@@ -64,8 +64,8 @@ public class ComparableEntry
|
|||||||
|
|
||||||
public ComparableEntry(String option, String target, int id, int type, boolean strictOption, boolean strictTarget)
|
public ComparableEntry(String option, String target, int id, int type, boolean strictOption, boolean strictTarget)
|
||||||
{
|
{
|
||||||
this.option = option;
|
this.option = Text.standardize(option);
|
||||||
this.target = target;
|
this.target = Text.standardize(target);
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.strictOption = strictOption;
|
this.strictOption = strictOption;
|
||||||
@@ -76,7 +76,7 @@ public class ComparableEntry
|
|||||||
// target sometimes changes to option.
|
// target sometimes changes to option.
|
||||||
public ComparableEntry(MenuEntry e)
|
public ComparableEntry(MenuEntry e)
|
||||||
{
|
{
|
||||||
this.option = e.getOption();
|
this.option = Text.standardize(e.getOption());
|
||||||
this.id = e.getIdentifier();
|
this.id = e.getIdentifier();
|
||||||
this.type = e.getType();
|
this.type = e.getType();
|
||||||
this.strictOption = true;
|
this.strictOption = true;
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public class MenuManager
|
|||||||
{
|
{
|
||||||
MenuEntry original = MenuEntry.copy(e);
|
MenuEntry original = MenuEntry.copy(e);
|
||||||
e.setType(newType);
|
e.setType(newType);
|
||||||
originalType = new EntryTypeMapping(new ComparableEntry(e), original);
|
originalType = new EntryTypeMapping(new ComparableEntry(leftClickEntry), original);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -750,7 +750,7 @@ public class MenuManager
|
|||||||
{
|
{
|
||||||
MenuEntry entry = event.getMenuEntry();
|
MenuEntry entry = event.getMenuEntry();
|
||||||
|
|
||||||
if (!entry.getTarget().equals(entry.getOption()) && !comparable.matches(entry))
|
if (event.getTarget().equals("do not edit") || !comparable.matches(entry))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import net.runelite.api.Actor;
|
import net.runelite.api.Actor;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
|
||||||
import net.runelite.api.ItemID;
|
import net.runelite.api.ItemID;
|
||||||
import net.runelite.api.MenuEntry;
|
import net.runelite.api.MenuEntry;
|
||||||
import net.runelite.api.MessageNode;
|
import net.runelite.api.MessageNode;
|
||||||
@@ -262,10 +261,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
overlayManager.add(widgetsOverlay);
|
overlayManager.add(widgetsOverlay);
|
||||||
overlayManager.add(sceneOverlay);
|
overlayManager.add(sceneOverlay);
|
||||||
keyManager.registerKeyListener(this);
|
keyManager.registerKeyListener(this);
|
||||||
if (client.getGameState() == GameState.LOGGED_IN)
|
clientThread.invoke(this::validateGame);
|
||||||
{
|
|
||||||
clientThread.invoke(this::validateGame);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -885,55 +885,29 @@ default CharterOption charterOption()
|
|||||||
// Skilling
|
// Skilling
|
||||||
//------------------------------------------------------------//
|
//------------------------------------------------------------//
|
||||||
|
|
||||||
/* @ConfigItem(
|
|
||||||
keyName = "easyConstruction",
|
|
||||||
name = "Easy Construction",
|
|
||||||
description = "Makes 'Remove'/'Build' the default option for listed item ID's in build mode.<br>Tip: Use dev tools \"'Game Objects\" to find out the ID!",
|
|
||||||
position = 59,
|
|
||||||
group = "Skilling"
|
|
||||||
)
|
|
||||||
default boolean getEasyConstruction()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "constructionItems",
|
keyName = "getEasyConstruction",
|
||||||
name = "Construction Items",
|
|
||||||
description = "Makes 'Remove'/'Build' the default option for listed item ID's in build mode.<br>Tip: Use dev tools \"Game Objects\" to find out the ID, and separate values with a ','",
|
|
||||||
position = 60,
|
|
||||||
group = "Skilling",
|
|
||||||
hidden = true,
|
|
||||||
unhide = "easyConstruction"
|
|
||||||
)
|
|
||||||
default String getConstructionItems()
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "getTempConstruction",
|
|
||||||
name = "Easy Construction",
|
name = "Easy Construction",
|
||||||
description = "Makes 'Remove'/'Build' the default option for listed items.",
|
description = "Makes 'Remove'/'Build' the default option for listed items.",
|
||||||
position = 0,
|
position = 0,
|
||||||
group = "Skilling"
|
group = "Skilling"
|
||||||
)
|
)
|
||||||
|
|
||||||
default boolean getTempConstruction()
|
default boolean getEasyConstruction()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "getTempConstructionItems",
|
keyName = "getEasyConstructionItems",
|
||||||
name = "Build Items",
|
name = "Build Items",
|
||||||
description = "",
|
description = "",
|
||||||
position = 1,
|
position = 1,
|
||||||
group = "Skilling",
|
group = "Skilling",
|
||||||
hidden = true,
|
hidden = true,
|
||||||
unhide = "getTempConstruction"
|
unhide = "getEasyConstruction"
|
||||||
)
|
)
|
||||||
default String getTempConstructionItems()
|
default String getEasyConstructionItems()
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
private MenuEntry[] entries;
|
private MenuEntry[] entries;
|
||||||
private final Set<Integer> leftClickConstructionIDs = new HashSet<>();
|
private final Set<String> leftClickConstructionItems = new HashSet<>();
|
||||||
private boolean buildingMode;
|
private boolean buildingMode;
|
||||||
|
|
||||||
private static final WidgetMenuOption FIXED_INVENTORY_TAB_CONFIGURE = new WidgetMenuOption(CONFIGURE,
|
private static final WidgetMenuOption FIXED_INVENTORY_TAB_CONFIGURE = new WidgetMenuOption(CONFIGURE,
|
||||||
@@ -192,8 +192,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
public void startUp()
|
public void startUp()
|
||||||
{
|
{
|
||||||
addSwaps();
|
addSwaps();
|
||||||
//todo re-enable when fixed.
|
loadConstructionItems(config.getEasyConstructionItems());
|
||||||
/*loadConstructionIDs(config.getConstructionItems());*/
|
|
||||||
|
|
||||||
if (config.shiftClickCustomization())
|
if (config.shiftClickCustomization())
|
||||||
{
|
{
|
||||||
@@ -207,8 +206,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
public void shutDown()
|
public void shutDown()
|
||||||
{
|
{
|
||||||
disableCustomization();
|
disableCustomization();
|
||||||
//todo re-enable when fixed.
|
loadConstructionItems("");
|
||||||
/*loadConstructionIDs("");*/
|
|
||||||
loadCustomSwaps(""); // Removes all custom swaps
|
loadCustomSwaps(""); // Removes all custom swaps
|
||||||
removeSwaps();
|
removeSwaps();
|
||||||
}
|
}
|
||||||
@@ -220,9 +218,8 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//todo re-enable when fixed.
|
|
||||||
|
|
||||||
/*loadConstructionIDs(config.getConstructionItems());*/
|
loadConstructionItems(config.getEasyConstructionItems());
|
||||||
removeSwaps();
|
removeSwaps();
|
||||||
addSwaps();
|
addSwaps();
|
||||||
|
|
||||||
@@ -317,9 +314,8 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//todo re-enable when fixed.
|
|
||||||
|
|
||||||
/*loadConstructionIDs(config.getConstructionItems());*/
|
loadConstructionItems(config.getEasyConstructionItems());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -1246,37 +1242,6 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
swap(client, "teleport menu", option, target, true);
|
swap(client, "teleport menu", option, target, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.getTempConstruction() && buildingMode && !Strings.isNullOrEmpty(config.getTempConstructionItems()))
|
|
||||||
{
|
|
||||||
if (event.getType() == WALK.getId())
|
|
||||||
{
|
|
||||||
MenuEntry[] menuEntries = client.getMenuEntries();
|
|
||||||
MenuEntry menuEntry = menuEntries[menuEntries.length - 1];
|
|
||||||
menuEntry.setType(MenuAction.WALK.getId() + MENU_ACTION_DEPRIORITIZE_OFFSET);
|
|
||||||
client.setMenuEntries(menuEntries);
|
|
||||||
}
|
|
||||||
|
|
||||||
swap(client, "Build", option, target);
|
|
||||||
|
|
||||||
MenuEntry[] entries = client.getMenuEntries();
|
|
||||||
for (int i = entries.length - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
for (String temp : config.getTempConstructionItems().split(","))
|
|
||||||
{
|
|
||||||
if (temp.equalsIgnoreCase(Text.removeTags(entries[i].getTarget())))
|
|
||||||
{
|
|
||||||
if (!entries[i].getOption().equalsIgnoreCase("remove"))
|
|
||||||
{
|
|
||||||
entries = ArrayUtils.remove(entries, i);
|
|
||||||
i--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
client.setMenuEntries(entries);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -1520,25 +1485,24 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
return location.getRegionID() == PURO_PURO_REGION_ID;
|
return location.getRegionID() == PURO_PURO_REGION_ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//todo re-enable when fixed.
|
|
||||||
|
|
||||||
/* private void loadConstructionIDs(String from)
|
private void loadConstructionItems(String from)
|
||||||
{
|
{
|
||||||
if (client.getGameState() != GameState.LOGGED_IN
|
if (client.getGameState() != GameState.LOGGED_IN
|
||||||
|| Strings.isNullOrEmpty(from) && leftClickConstructionIDs.isEmpty())
|
|| Strings.isNullOrEmpty(from) && leftClickConstructionItems.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!leftClickConstructionIDs.isEmpty())
|
if (!leftClickConstructionItems.isEmpty())
|
||||||
{
|
{
|
||||||
for (int i : leftClickConstructionIDs)
|
for (String s : leftClickConstructionItems)
|
||||||
{
|
{
|
||||||
menuManager.toggleLeftClick("build", i, true);
|
menuManager.removePriorityEntry("build", s);
|
||||||
menuManager.toggleLeftClick("remove", i, true);
|
menuManager.removePriorityEntry("remove", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
leftClickConstructionIDs.clear();
|
leftClickConstructionItems.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.getEasyConstruction() &&
|
if (config.getEasyConstruction() &&
|
||||||
@@ -1547,21 +1511,18 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
for (String s : Text.fromCSV(from))
|
for (String s : Text.fromCSV(from))
|
||||||
{
|
{
|
||||||
int id = Integer.parseInt(s.replaceAll("[^0-9]", ""));
|
if (leftClickConstructionItems.contains(s))
|
||||||
|
|
||||||
if (leftClickConstructionIDs.contains(id))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menuManager.toggleLeftClick("build", id, false)
|
menuManager.addPriorityEntry("build", s);
|
||||||
|| menuManager.toggleLeftClick("remove", id, false))
|
menuManager.addPriorityEntry("remove", s);
|
||||||
{
|
|
||||||
leftClickConstructionIDs.add(id);
|
leftClickConstructionItems.add(s);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
void startShift()
|
void startShift()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user