Merge pull request #9869 from eric-weaver/menu-entry-swapper-add-house-advertisement
menu entry swapper: add house advertisement board
This commit is contained in:
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019, Adam <Adam@sigterm.info>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package net.runelite.client.plugins.menuentryswapper;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum HouseAdvertisementMode
|
||||||
|
{
|
||||||
|
VIEW("View"),
|
||||||
|
ADD_HOUSE("Add-House"),
|
||||||
|
VISIT_LAST("Visit-Last");
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -99,7 +99,7 @@ public interface MenuEntrySwapperConfig extends Config
|
|||||||
)
|
)
|
||||||
default boolean swapContract()
|
default boolean swapContract()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
@@ -122,7 +122,7 @@ public interface MenuEntrySwapperConfig extends Config
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "swapDarkMage",
|
keyName = "swapDarkMage",
|
||||||
name = "Repairs",
|
name = "Repairs",
|
||||||
description = "Swap Talk-to with Repairs for Dark Mage"
|
description = "Swap Talk-to with Repairs for Dark Mage"
|
||||||
@@ -192,6 +192,16 @@ public interface MenuEntrySwapperConfig extends Config
|
|||||||
return HouseMode.HOME;
|
return HouseMode.HOME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "swapHouseAdvertisement",
|
||||||
|
name = "House Advertisement",
|
||||||
|
description = "Swap View with Add-House or Visit-Last on House Advertisement board"
|
||||||
|
)
|
||||||
|
default HouseAdvertisementMode swapHouseAdvertisement()
|
||||||
|
{
|
||||||
|
return HouseAdvertisementMode.VIEW;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "swapPickpocket",
|
keyName = "swapPickpocket",
|
||||||
name = "Pickpocket",
|
name = "Pickpocket",
|
||||||
|
|||||||
@@ -498,6 +498,18 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (config.swapHouseAdvertisement() != HouseAdvertisementMode.VIEW && option.equals("view"))
|
||||||
|
{
|
||||||
|
switch (config.swapHouseAdvertisement())
|
||||||
|
{
|
||||||
|
case ADD_HOUSE:
|
||||||
|
swap("add-house", option, target, index);
|
||||||
|
break;
|
||||||
|
case VISIT_LAST:
|
||||||
|
swap("visit-last", option, target, index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (config.swapFairyRing() != FairyRingMode.OFF && config.swapFairyRing() != FairyRingMode.ZANARIS
|
else if (config.swapFairyRing() != FairyRingMode.OFF && config.swapFairyRing() != FairyRingMode.ZANARIS
|
||||||
&& (option.equals("zanaris") || option.equals("configure") || option.equals("tree")))
|
&& (option.equals("zanaris") || option.equals("configure") || option.equals("tree")))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user