menu entry swapper: add options for house portal
This commit is contained in:
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018, Snakk <http://github.com/SnakkSnokk>
|
||||||
|
* 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 HouseMode
|
||||||
|
{
|
||||||
|
ENTER("Enter"),
|
||||||
|
HOME("Home"),
|
||||||
|
BUILD_MODE("Build mode"),
|
||||||
|
FRIENDS_HOUSE("Friend's House");
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -147,13 +147,13 @@ public interface MenuEntrySwapperConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 10,
|
position = 10,
|
||||||
keyName = "swapHome",
|
keyName = "swapHomePortal",
|
||||||
name = "Home",
|
name = "Home",
|
||||||
description = "Swap Enter with Home on Portal"
|
description = "Swap Enter with Home or Build or Friend's house on Portal"
|
||||||
)
|
)
|
||||||
default boolean swapHome()
|
default HouseMode swapHomePortal()
|
||||||
{
|
{
|
||||||
return true;
|
return HouseMode.HOME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
|
|||||||
@@ -400,9 +400,20 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
swap("harpoon", option, target, true);
|
swap("harpoon", option, target, true);
|
||||||
}
|
}
|
||||||
else if (config.swapHome() && option.equals("enter"))
|
else if (config.swapHomePortal() != HouseMode.ENTER && option.equals("enter"))
|
||||||
{
|
{
|
||||||
swap("home", option, target, true);
|
switch (config.swapHomePortal())
|
||||||
|
{
|
||||||
|
case HOME:
|
||||||
|
swap("home", option, target, true);
|
||||||
|
break;
|
||||||
|
case BUILD_MODE:
|
||||||
|
swap("build mode", option, target, true);
|
||||||
|
break;
|
||||||
|
case FRIENDS_HOUSE:
|
||||||
|
swap("friend's house", option, target, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (config.swapFairyRing() != FairyRingMode.ZANARIS && (option.equals("zanaris") || option.equals("tree")))
|
else if (config.swapFairyRing() != FairyRingMode.ZANARIS && (option.equals("zanaris") || option.equals("tree")))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user