Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -2084,6 +2084,13 @@ public interface Client extends OAuthApi, GameEngine
|
|||||||
*/
|
*/
|
||||||
int getSelectedItemIndex();
|
int getSelectedItemIndex();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the selected widget, such as a selected spell or selected item (eg. "Use")
|
||||||
|
* @return the selected widget
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
Widget getSelectedWidget();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns client item composition cache
|
* Returns client item composition cache
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ public enum MenuAction
|
|||||||
*/
|
*/
|
||||||
ITEM_USE_ON_GAME_OBJECT(1),
|
ITEM_USE_ON_GAME_OBJECT(1),
|
||||||
/**
|
/**
|
||||||
* Menu action for casting a spell on a tile object (GameObject or GroundObject).
|
* Menu action for using a widget on a tile object (GameObject or GroundObject).
|
||||||
*/
|
*/
|
||||||
SPELL_CAST_ON_GAME_OBJECT(2),
|
WIDGET_TARGET_ON_GAME_OBJECT(2),
|
||||||
/**
|
/**
|
||||||
* First menu action for a game object.
|
* First menu action for a game object.
|
||||||
*/
|
*/
|
||||||
@@ -66,9 +66,9 @@ public enum MenuAction
|
|||||||
*/
|
*/
|
||||||
ITEM_USE_ON_NPC(7),
|
ITEM_USE_ON_NPC(7),
|
||||||
/**
|
/**
|
||||||
* Menu action for casting a spell on an NPC.
|
* Menu action for using a widget on an NPC.
|
||||||
*/
|
*/
|
||||||
SPELL_CAST_ON_NPC(8),
|
WIDGET_TARGET_ON_NPC(8),
|
||||||
/**
|
/**
|
||||||
* First menu action for an NPC.
|
* First menu action for an NPC.
|
||||||
*/
|
*/
|
||||||
@@ -95,18 +95,18 @@ public enum MenuAction
|
|||||||
*/
|
*/
|
||||||
ITEM_USE_ON_PLAYER(14),
|
ITEM_USE_ON_PLAYER(14),
|
||||||
/**
|
/**
|
||||||
* Menu action for casting a spell on a player.
|
* Menu action for using a widget on a player.
|
||||||
*/
|
*/
|
||||||
SPELL_CAST_ON_PLAYER(15),
|
WIDGET_TARGET_ON_PLAYER(15),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu action for using an item on an item on the ground.
|
* Menu action for using an item on an item on the ground.
|
||||||
*/
|
*/
|
||||||
ITEM_USE_ON_GROUND_ITEM(16),
|
ITEM_USE_ON_GROUND_ITEM(16),
|
||||||
/**
|
/**
|
||||||
* Menu action for casting a spell on an item on the ground.
|
* Menu action for using a widget on an item on the ground.
|
||||||
*/
|
*/
|
||||||
SPELL_CAST_ON_GROUND_ITEM(17),
|
WIDGET_TARGET_ON_GROUND_ITEM(17),
|
||||||
/**
|
/**
|
||||||
* First menu action for an item on the ground.
|
* First menu action for an item on the ground.
|
||||||
*/
|
*/
|
||||||
@@ -138,13 +138,14 @@ public enum MenuAction
|
|||||||
*/
|
*/
|
||||||
WIDGET_TYPE_1(24),
|
WIDGET_TYPE_1(24),
|
||||||
/**
|
/**
|
||||||
* Interaction with widget (type 2).
|
* Select the widget for targeting other widgets/entites etc.
|
||||||
|
* @see Client#getSelectedWidget()
|
||||||
*/
|
*/
|
||||||
WIDGET_TYPE_2(25),
|
WIDGET_TARGET(25),
|
||||||
/**
|
/**
|
||||||
* Interaction with widget (type 3).
|
* Performs an ifclose.
|
||||||
*/
|
*/
|
||||||
WIDGET_TYPE_3(26),
|
WIDGET_CLOSE(26),
|
||||||
/**
|
/**
|
||||||
* Interaction with widget (type 4).
|
* Interaction with widget (type 4).
|
||||||
*/
|
*/
|
||||||
@@ -154,19 +155,17 @@ public enum MenuAction
|
|||||||
*/
|
*/
|
||||||
WIDGET_TYPE_5(29),
|
WIDGET_TYPE_5(29),
|
||||||
/**
|
/**
|
||||||
* Interaction with widget (type 6).
|
* Performs a Continue
|
||||||
*
|
|
||||||
* This is the continue button on message boxes
|
|
||||||
*/
|
*/
|
||||||
WIDGET_TYPE_6(30),
|
WIDGET_CONTINUE(30),
|
||||||
/**
|
/**
|
||||||
* Menu action when using an item on another item inside a widget (inventory).
|
* Menu action when using an item on another item
|
||||||
*/
|
*/
|
||||||
ITEM_USE_ON_WIDGET_ITEM(31),
|
ITEM_USE_ON_ITEM(31),
|
||||||
/**
|
/**
|
||||||
* Menu action when using an item on a widget.
|
* Menu action when using a component on an item
|
||||||
*/
|
*/
|
||||||
ITEM_USE_ON_WIDGET(32),
|
WIDGET_USE_ON_ITEM(32),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* First menu action for an item.
|
* First menu action for an item.
|
||||||
@@ -229,20 +228,15 @@ public enum MenuAction
|
|||||||
CC_OP(57),
|
CC_OP(57),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Casting a spell / op target on a widget
|
* Using a widget on another widget
|
||||||
*/
|
*/
|
||||||
SPELL_CAST_ON_WIDGET(58),
|
WIDGET_TARGET_ON_WIDGET(58),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu action for high priority runelite options
|
* Menu action for high priority runelite options
|
||||||
*/
|
*/
|
||||||
RUNELITE_HIGH_PRIORITY(999),
|
RUNELITE_HIGH_PRIORITY(999),
|
||||||
|
|
||||||
/**
|
|
||||||
* Sub 1000 so it doesn't get sorted down in the list
|
|
||||||
*/
|
|
||||||
PRIO_RUNELITE(666),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu action triggered by examining an object.
|
* Menu action triggered by examining an object.
|
||||||
*/
|
*/
|
||||||
@@ -290,9 +284,6 @@ public enum MenuAction
|
|||||||
*/
|
*/
|
||||||
RUNELITE_INFOBOX(1504),
|
RUNELITE_INFOBOX(1504),
|
||||||
|
|
||||||
FOLLOW(2046),
|
|
||||||
TRADE(2047),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu action triggered when the id is not defined in this class.
|
* Menu action triggered when the id is not defined in this class.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
package net.runelite.api;
|
package net.runelite.api;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import net.runelite.api.widgets.Widget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A menu entry in a right-click menu.
|
* A menu entry in a right-click menu.
|
||||||
@@ -93,21 +95,31 @@ public interface MenuEntry
|
|||||||
*/
|
*/
|
||||||
MenuEntry onClick(Consumer<MenuEntry> callback);
|
MenuEntry onClick(Consumer<MenuEntry> callback);
|
||||||
|
|
||||||
@Deprecated
|
/**
|
||||||
int getOpcode();
|
* Test if this menu entry is an item op. "Use" and "Examine" are not considered item ops.
|
||||||
@Deprecated
|
* @return
|
||||||
void setOpcode(int opcode);
|
*/
|
||||||
|
boolean isItemOp();
|
||||||
|
|
||||||
@Deprecated
|
/**
|
||||||
int getActionParam0();
|
* If this menu entry is an item op, get the item op id
|
||||||
@Deprecated
|
* @return 1-5
|
||||||
void setActionParam0(int param0);
|
*/
|
||||||
|
int getItemOp();
|
||||||
|
|
||||||
@Deprecated
|
/**
|
||||||
int getActionParam1();
|
* If this menu entry is an item op, get the item id
|
||||||
@Deprecated
|
* @return
|
||||||
void setActionParam1(int param0);
|
* @see ItemID
|
||||||
|
* @see NullItemID
|
||||||
|
*/
|
||||||
|
int getItemId();
|
||||||
|
|
||||||
@Deprecated
|
/**
|
||||||
MenuAction getMenuAction();
|
* Get the widget this menu entry is on, if this is a menu entry
|
||||||
|
* with an associated widget. Such as eg, CC_OP.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
Widget getWidget();
|
||||||
}
|
}
|
||||||
@@ -24,9 +24,11 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import net.runelite.api.MenuAction;
|
import net.runelite.api.MenuAction;
|
||||||
import net.runelite.api.MenuEntry;
|
import net.runelite.api.MenuEntry;
|
||||||
|
import net.runelite.api.widgets.Widget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a menu option has been clicked.
|
* An event where a menu option has been clicked.
|
||||||
@@ -39,42 +41,106 @@ import net.runelite.api.MenuEntry;
|
|||||||
* By default, when there is no action performed when left-clicking,
|
* By default, when there is no action performed when left-clicking,
|
||||||
* it seems that this event still triggers with the "Cancel" action.
|
* it seems that this event still triggers with the "Cancel" action.
|
||||||
*/
|
*/
|
||||||
@Data
|
@RequiredArgsConstructor
|
||||||
public class MenuOptionClicked
|
public class MenuOptionClicked
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Action parameter 0. Its value depends on the menuAction.
|
* The clicked menu entry
|
||||||
*/
|
*/
|
||||||
private int param0;
|
private final MenuEntry menuEntry;
|
||||||
/**
|
|
||||||
* Action parameter 1. Its value depends on the menuAction.
|
|
||||||
*/
|
|
||||||
private int param1;
|
|
||||||
/**
|
|
||||||
* The option text added to the menu.
|
|
||||||
*/
|
|
||||||
private String menuOption;
|
|
||||||
/**
|
|
||||||
* The target of the action.
|
|
||||||
*/
|
|
||||||
private String menuTarget;
|
|
||||||
/**
|
|
||||||
* The action performed.
|
|
||||||
*/
|
|
||||||
private MenuAction menuAction;
|
|
||||||
/**
|
|
||||||
* The ID of the object, actor, or item that the interaction targets.
|
|
||||||
*/
|
|
||||||
private int id;
|
|
||||||
/**
|
|
||||||
* The selected item index at the time of the option click.
|
|
||||||
*/
|
|
||||||
private int selectedItemIndex;
|
|
||||||
/**
|
/**
|
||||||
* Whether or not the event has been consumed by a subscriber.
|
* Whether or not the event has been consumed by a subscriber.
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
private boolean consumed;
|
private boolean consumed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Action parameter 0. Its value depends on the menuAction.
|
||||||
|
*/
|
||||||
|
public int getParam0()
|
||||||
|
{
|
||||||
|
return menuEntry.getParam0();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Action parameter 1. Its value depends on the menuAction.
|
||||||
|
*/
|
||||||
|
public int getParam1()
|
||||||
|
{
|
||||||
|
return menuEntry.getParam1();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The option text added to the menu.
|
||||||
|
*/
|
||||||
|
public String getMenuOption()
|
||||||
|
{
|
||||||
|
return menuEntry.getOption();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The target of the action.
|
||||||
|
*/
|
||||||
|
public String getMenuTarget()
|
||||||
|
{
|
||||||
|
return menuEntry.getTarget();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The action performed.
|
||||||
|
*/
|
||||||
|
public MenuAction getMenuAction()
|
||||||
|
{
|
||||||
|
return menuEntry.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ID of the object, actor, or item that the interaction targets.
|
||||||
|
*/
|
||||||
|
public int getId()
|
||||||
|
{
|
||||||
|
return menuEntry.getIdentifier();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test if this menu entry is an item op. "Use" and "Examine" are not considered item ops.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isItemOp()
|
||||||
|
{
|
||||||
|
return menuEntry.isItemOp();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If this menu entry is an item op, get the item op id
|
||||||
|
* @return 1-5
|
||||||
|
*/
|
||||||
|
public int getItemOp()
|
||||||
|
{
|
||||||
|
return menuEntry.getItemOp();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If this menu entry is an item op, get the item id
|
||||||
|
* @return
|
||||||
|
* @see net.runelite.api.ItemID
|
||||||
|
* @see net.runelite.api.NullItemID
|
||||||
|
*/
|
||||||
|
public int getItemId()
|
||||||
|
{
|
||||||
|
return menuEntry.getItemId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the widget this menu entry is on, if this is a menu entry
|
||||||
|
* with an associated widget. Such as eg, CC_OP.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Widget getWidget()
|
||||||
|
{
|
||||||
|
return menuEntry.getWidget();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks the event as having been consumed.
|
* Marks the event as having been consumed.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -87,37 +153,15 @@ public class MenuOptionClicked
|
|||||||
this.consumed = true;
|
this.consumed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMenuEntry(MenuEntry entry)
|
|
||||||
{
|
|
||||||
this.setMenuOption(entry.getOption());
|
|
||||||
this.setMenuTarget(entry.getTarget());
|
|
||||||
this.setId(entry.getIdentifier());
|
|
||||||
this.setMenuAction(entry.getType());
|
|
||||||
this.setParam0(entry.getParam0());
|
|
||||||
this.setParam1(entry.getParam1());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int getActionParam()
|
public int getActionParam()
|
||||||
{
|
{
|
||||||
return param0;
|
return menuEntry.getParam0();
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void setActionParam(int i)
|
|
||||||
{
|
|
||||||
param0 = i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int getWidgetId()
|
public int getWidgetId()
|
||||||
{
|
{
|
||||||
return param1;
|
return menuEntry.getParam1();
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void setWidgetId(int i)
|
|
||||||
{
|
|
||||||
param1 = i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ public class RuneLiteProperties
|
|||||||
public static HttpUrl getPluginHubBase()
|
public static HttpUrl getPluginHubBase()
|
||||||
{
|
{
|
||||||
String version = System.getProperty(PLUGINHUB_VERSION, properties.getProperty(PLUGINHUB_VERSION));
|
String version = System.getProperty(PLUGINHUB_VERSION, properties.getProperty(PLUGINHUB_VERSION));
|
||||||
return HttpUrl.parse(properties.get(PLUGINHUB_BASE) + "/" + version);
|
return HttpUrl.get(properties.get(PLUGINHUB_BASE) + "/" + version);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getApiBase()
|
public static String getApiBase()
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ import okhttp3.Response;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class ConfigClient
|
public class ConfigClient
|
||||||
{
|
{
|
||||||
private static final MediaType TEXT_PLAIN = MediaType.parse("text/plain");
|
private static final MediaType TEXT_PLAIN = MediaType.get("text/plain");
|
||||||
private static final Gson GSON = RuneLiteAPI.GSON;
|
private static final Gson GSON = RuneLiteAPI.GSON;
|
||||||
|
|
||||||
private final OkHttpClient client;
|
private final OkHttpClient client;
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class ExternalPluginClient
|
|||||||
}
|
}
|
||||||
catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e)
|
catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e)
|
||||||
{
|
{
|
||||||
throw new RuntimeException(e);
|
throw new VerificationException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.AnimationID;
|
import net.runelite.api.AnimationID;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -58,6 +59,8 @@ import net.runelite.api.events.GameTick;
|
|||||||
import net.runelite.api.events.ItemContainerChanged;
|
import net.runelite.api.events.ItemContainerChanged;
|
||||||
import net.runelite.api.events.MenuOptionClicked;
|
import net.runelite.api.events.MenuOptionClicked;
|
||||||
import net.runelite.api.events.ProjectileMoved;
|
import net.runelite.api.events.ProjectileMoved;
|
||||||
|
import net.runelite.api.widgets.Widget;
|
||||||
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.Notifier;
|
import net.runelite.client.Notifier;
|
||||||
import net.runelite.client.callback.ClientThread;
|
import net.runelite.client.callback.ClientThread;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
@@ -74,6 +77,7 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
|||||||
description = "Show information about cannon placement and/or amount of cannonballs",
|
description = "Show information about cannon placement and/or amount of cannonballs",
|
||||||
tags = {"combat", "notifications", "ranged", "overlay"}
|
tags = {"combat", "notifications", "ranged", "overlay"}
|
||||||
)
|
)
|
||||||
|
@Slf4j
|
||||||
public class CannonPlugin extends Plugin
|
public class CannonPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final Pattern NUMBER_PATTERN = Pattern.compile("([0-9]+)");
|
private static final Pattern NUMBER_PATTERN = Pattern.compile("([0-9]+)");
|
||||||
@@ -284,16 +288,11 @@ public class CannonPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if cannonballs are being used on the cannon
|
// Check if cannonballs are being used on the cannon
|
||||||
if (event.getMenuAction() == MenuAction.ITEM_USE_ON_GAME_OBJECT)
|
if (event.getMenuAction() == MenuAction.WIDGET_TARGET_ON_GAME_OBJECT && client.getSelectedWidget().getId() == WidgetInfo.INVENTORY.getId())
|
||||||
{
|
{
|
||||||
final int idx = event.getSelectedItemIndex();
|
final Widget selected = client.getSelectedWidget();
|
||||||
final ItemContainer items = client.getItemContainer(InventoryID.INVENTORY);
|
final int itemId = selected.getItemId();
|
||||||
if (items == null)
|
if (itemId != ItemID.CANNONBALL && itemId != ItemID.GRANITE_CANNONBALL)
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final Item item = items.getItem(idx);
|
|
||||||
if (item == null || (item.getId() != ItemID.CANNONBALL && item.getId() != ItemID.GRANITE_CANNONBALL))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -306,6 +305,7 @@ public class CannonPlugin extends Plugin
|
|||||||
|
|
||||||
// Store the click location as a WorldPoint to avoid issues with scene loads
|
// Store the click location as a WorldPoint to avoid issues with scene loads
|
||||||
clickedCannonLocation = WorldPoint.fromScene(client, event.getParam0(), event.getParam1(), client.getPlane());
|
clickedCannonLocation = WorldPoint.fromScene(client, event.getParam0(), event.getParam1(), client.getPlane());
|
||||||
|
log.debug("Updated cannon location: {}", clickedCannonLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|||||||
@@ -325,14 +325,8 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean itemClicked = event.getMenuAction() == MenuAction.ITEM_FIRST_OPTION
|
final boolean isXMarksTheSpotOrb = event.getItemId() == ItemID.MYSTERIOUS_ORB_23069;
|
||||||
|| event.getMenuAction() == MenuAction.ITEM_SECOND_OPTION
|
if (isXMarksTheSpotOrb || event.getMenuOption().equals("Read"))
|
||||||
|| event.getMenuAction() == MenuAction.ITEM_THIRD_OPTION
|
|
||||||
|| event.getMenuAction() == MenuAction.ITEM_FOURTH_OPTION
|
|
||||||
|| event.getMenuAction() == MenuAction.ITEM_FIFTH_OPTION;
|
|
||||||
final boolean isXMarksTheSpotOrb = event.getId() == ItemID.MYSTERIOUS_ORB_23069;
|
|
||||||
|
|
||||||
if (itemClicked && (isXMarksTheSpotOrb || event.getMenuOption().equals("Read")))
|
|
||||||
{
|
{
|
||||||
final ItemComposition itemComposition = itemManager.getItemComposition(event.getId());
|
final ItemComposition itemComposition = itemManager.getItemComposition(event.getId());
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import okhttp3.Response;
|
|||||||
public class CrowdsourcingManager
|
public class CrowdsourcingManager
|
||||||
{
|
{
|
||||||
private static final String CROWDSOURCING_BASE = "https://crowdsource.runescape.wiki/runelite";
|
private static final String CROWDSOURCING_BASE = "https://crowdsource.runescape.wiki/runelite";
|
||||||
private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
private static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private OkHttpClient okHttpClient;
|
private OkHttpClient okHttpClient;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import net.runelite.api.Skill;
|
|||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
import net.runelite.api.events.MenuOptionClicked;
|
import net.runelite.api.events.MenuOptionClicked;
|
||||||
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.plugins.crowdsourcing.CrowdsourcingManager;
|
import net.runelite.client.plugins.crowdsourcing.CrowdsourcingManager;
|
||||||
|
|
||||||
@@ -114,7 +115,8 @@ public class CrowdsourcingCooking
|
|||||||
|| action == MenuAction.GAME_OBJECT_SECOND_OPTION
|
|| action == MenuAction.GAME_OBJECT_SECOND_OPTION
|
||||||
|| action == MenuAction.GAME_OBJECT_THIRD_OPTION
|
|| action == MenuAction.GAME_OBJECT_THIRD_OPTION
|
||||||
|| action == MenuAction.GAME_OBJECT_FOURTH_OPTION
|
|| action == MenuAction.GAME_OBJECT_FOURTH_OPTION
|
||||||
|| action == MenuAction.GAME_OBJECT_FIFTH_OPTION)
|
|| action == MenuAction.GAME_OBJECT_FIFTH_OPTION
|
||||||
|
|| action == MenuAction.WIDGET_TARGET_ON_GAME_OBJECT && client.getSelectedWidget().getId() == WidgetInfo.INVENTORY.getId())
|
||||||
{
|
{
|
||||||
lastGameObjectClicked = menuOptionClicked.getId();
|
lastGameObjectClicked = menuOptionClicked.getId();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,11 @@ public class CrowdsourcingZMI
|
|||||||
public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked)
|
public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked)
|
||||||
{
|
{
|
||||||
MenuAction action = menuOptionClicked.getMenuAction();
|
MenuAction action = menuOptionClicked.getMenuAction();
|
||||||
|
if (menuOptionClicked.isItemOp())
|
||||||
|
{
|
||||||
|
illegalActionTick = client.getTickCount();
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case ITEM_FIRST_OPTION:
|
case ITEM_FIRST_OPTION:
|
||||||
|
|||||||
@@ -516,8 +516,8 @@ class WidgetInspector extends DevToolsFrame
|
|||||||
for (int i = 0; i < menuEntries.length; i++)
|
for (int i = 0; i < menuEntries.length; i++)
|
||||||
{
|
{
|
||||||
MenuEntry entry = menuEntries[i];
|
MenuEntry entry = menuEntries[i];
|
||||||
if (entry.getType() != MenuAction.ITEM_USE_ON_WIDGET
|
if (entry.getType() != MenuAction.WIDGET_USE_ON_ITEM
|
||||||
&& entry.getType() != MenuAction.SPELL_CAST_ON_WIDGET)
|
&& entry.getType() != MenuAction.WIDGET_TARGET_ON_WIDGET)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -543,7 +543,7 @@ class WidgetInspector extends DevToolsFrame
|
|||||||
|
|
||||||
Object getWidgetOrWidgetItemForMenuOption(MenuAction type, int param0, int param1)
|
Object getWidgetOrWidgetItemForMenuOption(MenuAction type, int param0, int param1)
|
||||||
{
|
{
|
||||||
if (type == MenuAction.SPELL_CAST_ON_WIDGET)
|
if (type == MenuAction.WIDGET_TARGET_ON_WIDGET)
|
||||||
{
|
{
|
||||||
Widget w = client.getWidget(param1);
|
Widget w = client.getWidget(param1);
|
||||||
if (param0 != -1)
|
if (param0 != -1)
|
||||||
@@ -553,7 +553,7 @@ class WidgetInspector extends DevToolsFrame
|
|||||||
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
else if (type == MenuAction.ITEM_USE_ON_WIDGET)
|
else if (type == MenuAction.WIDGET_USE_ON_ITEM)
|
||||||
{
|
{
|
||||||
Widget w = client.getWidget(param1);
|
Widget w = client.getWidget(param1);
|
||||||
return w.getWidgetItem(param0);
|
return w.getWidgetItem(param0);
|
||||||
|
|||||||
@@ -54,10 +54,7 @@ import lombok.Setter;
|
|||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.InventoryID;
|
|
||||||
import net.runelite.api.Item;
|
|
||||||
import net.runelite.api.ItemComposition;
|
import net.runelite.api.ItemComposition;
|
||||||
import net.runelite.api.ItemContainer;
|
|
||||||
import net.runelite.api.ItemID;
|
import net.runelite.api.ItemID;
|
||||||
import net.runelite.api.MenuAction;
|
import net.runelite.api.MenuAction;
|
||||||
import net.runelite.api.MenuEntry;
|
import net.runelite.api.MenuEntry;
|
||||||
@@ -72,6 +69,7 @@ import net.runelite.api.events.ItemQuantityChanged;
|
|||||||
import net.runelite.api.events.ItemSpawned;
|
import net.runelite.api.events.ItemSpawned;
|
||||||
import net.runelite.api.events.MenuEntryAdded;
|
import net.runelite.api.events.MenuEntryAdded;
|
||||||
import net.runelite.api.events.MenuOptionClicked;
|
import net.runelite.api.events.MenuOptionClicked;
|
||||||
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.Notifier;
|
import net.runelite.client.Notifier;
|
||||||
import net.runelite.client.callback.ClientThread;
|
import net.runelite.client.callback.ClientThread;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
@@ -485,7 +483,7 @@ public class GroundItemsPlugin extends Plugin
|
|||||||
MenuAction type = MenuAction.of(event.getType());
|
MenuAction type = MenuAction.of(event.getType());
|
||||||
if (type == MenuAction.GROUND_ITEM_FIRST_OPTION || type == MenuAction.GROUND_ITEM_SECOND_OPTION ||
|
if (type == MenuAction.GROUND_ITEM_FIRST_OPTION || type == MenuAction.GROUND_ITEM_SECOND_OPTION ||
|
||||||
type == MenuAction.GROUND_ITEM_THIRD_OPTION || type == MenuAction.GROUND_ITEM_FOURTH_OPTION ||
|
type == MenuAction.GROUND_ITEM_THIRD_OPTION || type == MenuAction.GROUND_ITEM_FOURTH_OPTION ||
|
||||||
type == MenuAction.GROUND_ITEM_FIFTH_OPTION || type == MenuAction.SPELL_CAST_ON_GROUND_ITEM)
|
type == MenuAction.GROUND_ITEM_FIFTH_OPTION || type == MenuAction.WIDGET_TARGET_ON_GROUND_ITEM)
|
||||||
{
|
{
|
||||||
final int itemId = event.getIdentifier();
|
final int itemId = event.getIdentifier();
|
||||||
final int sceneX = event.getActionParam0();
|
final int sceneX = event.getActionParam0();
|
||||||
@@ -688,28 +686,16 @@ public class GroundItemsPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked)
|
public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked)
|
||||||
{
|
{
|
||||||
if (menuOptionClicked.getMenuAction() == MenuAction.ITEM_FIFTH_OPTION)
|
if (menuOptionClicked.isItemOp() && menuOptionClicked.getMenuOption().equals("Drop"))
|
||||||
{
|
{
|
||||||
int itemId = menuOptionClicked.getId();
|
int itemId = menuOptionClicked.getItemId();
|
||||||
// Keep a queue of recently dropped items to better detect
|
// Keep a queue of recently dropped items to better detect
|
||||||
// item spawns that are drops
|
// item spawns that are drops
|
||||||
droppedItemQueue.add(itemId);
|
droppedItemQueue.add(itemId);
|
||||||
}
|
}
|
||||||
else if (menuOptionClicked.getMenuAction() == MenuAction.ITEM_USE_ON_GAME_OBJECT)
|
else if (menuOptionClicked.getMenuAction() == MenuAction.WIDGET_TARGET_ON_GAME_OBJECT && client.getSelectedWidget().getId() == WidgetInfo.INVENTORY.getId())
|
||||||
{
|
{
|
||||||
final ItemContainer inventory = client.getItemContainer(InventoryID.INVENTORY);
|
lastUsedItem = client.getSelectedWidget().getItemId();
|
||||||
if (inventory == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Item clickedItem = inventory.getItem(menuOptionClicked.getSelectedItemIndex());
|
|
||||||
if (clickedItem == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
lastUsedItem = clickedItem.getId();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class InteractHighlightOverlay extends Overlay
|
|||||||
switch (menuAction)
|
switch (menuAction)
|
||||||
{
|
{
|
||||||
case ITEM_USE_ON_GAME_OBJECT:
|
case ITEM_USE_ON_GAME_OBJECT:
|
||||||
case SPELL_CAST_ON_GAME_OBJECT:
|
case WIDGET_TARGET_ON_GAME_OBJECT:
|
||||||
case GAME_OBJECT_FIRST_OPTION:
|
case GAME_OBJECT_FIRST_OPTION:
|
||||||
case GAME_OBJECT_SECOND_OPTION:
|
case GAME_OBJECT_SECOND_OPTION:
|
||||||
case GAME_OBJECT_THIRD_OPTION:
|
case GAME_OBJECT_THIRD_OPTION:
|
||||||
@@ -104,7 +104,7 @@ class InteractHighlightOverlay extends Overlay
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM_USE_ON_NPC:
|
case ITEM_USE_ON_NPC:
|
||||||
case SPELL_CAST_ON_NPC:
|
case WIDGET_TARGET_ON_NPC:
|
||||||
case NPC_FIRST_OPTION:
|
case NPC_FIRST_OPTION:
|
||||||
case NPC_SECOND_OPTION:
|
case NPC_SECOND_OPTION:
|
||||||
case NPC_THIRD_OPTION:
|
case NPC_THIRD_OPTION:
|
||||||
@@ -116,7 +116,7 @@ class InteractHighlightOverlay extends Overlay
|
|||||||
NPC npc = plugin.findNpc(id);
|
NPC npc = plugin.findNpc(id);
|
||||||
if (npc != null && config.npcShowHover() && (npc != plugin.getInteractedTarget() || !config.npcShowInteract()))
|
if (npc != null && config.npcShowHover() && (npc != plugin.getInteractedTarget() || !config.npcShowInteract()))
|
||||||
{
|
{
|
||||||
Color highlightColor = menuAction == MenuAction.NPC_SECOND_OPTION || menuAction == MenuAction.SPELL_CAST_ON_NPC
|
Color highlightColor = menuAction == MenuAction.NPC_SECOND_OPTION || menuAction == MenuAction.WIDGET_TARGET_ON_NPC
|
||||||
? config.npcAttackHoverHighlightColor() : config.npcHoverHighlightColor();
|
? config.npcAttackHoverHighlightColor() : config.npcHoverHighlightColor();
|
||||||
modelOutlineRenderer.drawOutline(npc, config.borderWidth(), highlightColor, config.outlineFeather());
|
modelOutlineRenderer.drawOutline(npc, config.borderWidth(), highlightColor, config.outlineFeather());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public class InteractHighlightPlugin extends Plugin
|
|||||||
switch (menuOptionClicked.getMenuAction())
|
switch (menuOptionClicked.getMenuAction())
|
||||||
{
|
{
|
||||||
case ITEM_USE_ON_GAME_OBJECT:
|
case ITEM_USE_ON_GAME_OBJECT:
|
||||||
case SPELL_CAST_ON_GAME_OBJECT:
|
case WIDGET_TARGET_ON_GAME_OBJECT:
|
||||||
case GAME_OBJECT_FIRST_OPTION:
|
case GAME_OBJECT_FIRST_OPTION:
|
||||||
case GAME_OBJECT_SECOND_OPTION:
|
case GAME_OBJECT_SECOND_OPTION:
|
||||||
case GAME_OBJECT_THIRD_OPTION:
|
case GAME_OBJECT_THIRD_OPTION:
|
||||||
@@ -158,7 +158,7 @@ public class InteractHighlightPlugin extends Plugin
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ITEM_USE_ON_NPC:
|
case ITEM_USE_ON_NPC:
|
||||||
case SPELL_CAST_ON_NPC:
|
case WIDGET_TARGET_ON_NPC:
|
||||||
case NPC_FIRST_OPTION:
|
case NPC_FIRST_OPTION:
|
||||||
case NPC_SECOND_OPTION:
|
case NPC_SECOND_OPTION:
|
||||||
case NPC_THIRD_OPTION:
|
case NPC_THIRD_OPTION:
|
||||||
@@ -168,7 +168,7 @@ public class InteractHighlightPlugin extends Plugin
|
|||||||
int id = menuOptionClicked.getId();
|
int id = menuOptionClicked.getId();
|
||||||
interactedObject = null;
|
interactedObject = null;
|
||||||
interactedNpc = findNpc(id);
|
interactedNpc = findNpc(id);
|
||||||
attacked = menuOptionClicked.getMenuAction() == MenuAction.NPC_SECOND_OPTION || menuOptionClicked.getMenuAction() == MenuAction.SPELL_CAST_ON_NPC;
|
attacked = menuOptionClicked.getMenuAction() == MenuAction.NPC_SECOND_OPTION || menuOptionClicked.getMenuAction() == MenuAction.WIDGET_TARGET_ON_NPC;
|
||||||
clickTick = client.getTickCount();
|
clickTick = client.getTickCount();
|
||||||
gameCycle = client.getGameCycle();
|
gameCycle = client.getGameCycle();
|
||||||
break;
|
break;
|
||||||
@@ -176,8 +176,11 @@ public class InteractHighlightPlugin extends Plugin
|
|||||||
// Any menu click which clears an interaction
|
// Any menu click which clears an interaction
|
||||||
case WALK:
|
case WALK:
|
||||||
case ITEM_USE:
|
case ITEM_USE:
|
||||||
|
case WIDGET_TARGET_ON_WIDGET:
|
||||||
case ITEM_USE_ON_GROUND_ITEM:
|
case ITEM_USE_ON_GROUND_ITEM:
|
||||||
|
case WIDGET_TARGET_ON_GROUND_ITEM:
|
||||||
case ITEM_USE_ON_PLAYER:
|
case ITEM_USE_ON_PLAYER:
|
||||||
|
case WIDGET_TARGET_ON_PLAYER:
|
||||||
case ITEM_FIRST_OPTION:
|
case ITEM_FIRST_OPTION:
|
||||||
case ITEM_SECOND_OPTION:
|
case ITEM_SECOND_OPTION:
|
||||||
case ITEM_THIRD_OPTION:
|
case ITEM_THIRD_OPTION:
|
||||||
@@ -190,6 +193,13 @@ public class InteractHighlightPlugin extends Plugin
|
|||||||
case GROUND_ITEM_FIFTH_OPTION:
|
case GROUND_ITEM_FIFTH_OPTION:
|
||||||
interactedObject = null;
|
interactedObject = null;
|
||||||
interactedNpc = null;
|
interactedNpc = null;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (menuOptionClicked.isItemOp())
|
||||||
|
{
|
||||||
|
interactedObject = null;
|
||||||
|
interactedNpc = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -164,42 +164,43 @@ public class InventoryTagsPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int widgetId = firstEntry.getParam1();
|
final int itemId;
|
||||||
|
if (firstEntry.getType() == MenuAction.WIDGET_TARGET && firstEntry.getWidget().getId() == WidgetInfo.INVENTORY.getId())
|
||||||
// Inventory item menu
|
|
||||||
if (widgetId == WidgetInfo.INVENTORY.getId())
|
|
||||||
{
|
{
|
||||||
int itemId = firstEntry.getIdentifier();
|
itemId = firstEntry.getWidget().getItemId();
|
||||||
|
}
|
||||||
|
else if (firstEntry.isItemOp())
|
||||||
|
{
|
||||||
|
itemId = firstEntry.getItemId();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (itemId == -1)
|
// Set menu to only be Cancel
|
||||||
{
|
client.setMenuEntries(Arrays.copyOf(client.getMenuEntries(), 1));
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set menu to only be Cancel
|
for (final String groupName : GROUPS)
|
||||||
client.setMenuEntries(Arrays.copyOf(client.getMenuEntries(), 1));
|
{
|
||||||
|
final String group = getTag(itemId);
|
||||||
|
final Color color = getGroupNameColor(groupName);
|
||||||
|
|
||||||
for (final String groupName : GROUPS)
|
client.createMenuEntry(-1)
|
||||||
{
|
.setOption(groupName.equals(group) ? MENU_REMOVE : MENU_SET)
|
||||||
final String group = getTag(itemId);
|
.setTarget(ColorUtil.prependColorTag(groupName, MoreObjects.firstNonNull(color, Color.WHITE)))
|
||||||
final Color color = getGroupNameColor(groupName);
|
.setType(MenuAction.RUNELITE)
|
||||||
|
.onClick(e ->
|
||||||
client.createMenuEntry(-1)
|
{
|
||||||
.setOption(groupName.equals(group) ? MENU_REMOVE : MENU_SET)
|
if (e.getOption().equals(MENU_SET))
|
||||||
.setTarget(ColorUtil.prependColorTag(groupName, MoreObjects.firstNonNull(color, Color.WHITE)))
|
|
||||||
.setType(MenuAction.RUNELITE)
|
|
||||||
.onClick(e ->
|
|
||||||
{
|
{
|
||||||
if (e.getOption().equals(MENU_SET))
|
setTag(itemId, groupName);
|
||||||
{
|
}
|
||||||
setTag(itemId, groupName);
|
else
|
||||||
}
|
{
|
||||||
else
|
unsetTag(itemId);
|
||||||
{
|
}
|
||||||
unsetTag(itemId);
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,11 +98,20 @@ class ItemPricesOverlay extends Overlay
|
|||||||
// Tooltip action type handling
|
// Tooltip action type handling
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case ITEM_USE_ON_WIDGET:
|
case WIDGET_TARGET_ON_WIDGET:
|
||||||
|
// Check target widget is the inventory
|
||||||
|
if (menuEntry.getWidget().getId() != WidgetInfo.INVENTORY.getId())
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// FALLTHROUGH
|
||||||
|
case WIDGET_USE_ON_ITEM:
|
||||||
|
// Require showWhileAlching and Cast High Level Alchemy
|
||||||
if (!config.showWhileAlching() || !isAlching)
|
if (!config.showWhileAlching() || !isAlching)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// FALLTHROUGH
|
||||||
case CC_OP:
|
case CC_OP:
|
||||||
case ITEM_USE:
|
case ITEM_USE:
|
||||||
case ITEM_FIRST_OPTION:
|
case ITEM_FIRST_OPTION:
|
||||||
@@ -110,38 +119,49 @@ class ItemPricesOverlay extends Overlay
|
|||||||
case ITEM_THIRD_OPTION:
|
case ITEM_THIRD_OPTION:
|
||||||
case ITEM_FOURTH_OPTION:
|
case ITEM_FOURTH_OPTION:
|
||||||
case ITEM_FIFTH_OPTION:
|
case ITEM_FIFTH_OPTION:
|
||||||
// Item tooltip values
|
addTooltip(menuEntry, isAlching, groupId);
|
||||||
switch (groupId)
|
|
||||||
{
|
|
||||||
case WidgetID.EXPLORERS_RING_ALCH_GROUP_ID:
|
|
||||||
if (!config.showWhileAlching())
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
case WidgetID.INVENTORY_GROUP_ID:
|
|
||||||
case WidgetID.POH_TREASURE_CHEST_INVENTORY_GROUP_ID:
|
|
||||||
if (config.hideInventory() && !(config.showWhileAlching() && isAlching))
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// intentional fallthrough
|
|
||||||
case WidgetID.BANK_GROUP_ID:
|
|
||||||
case WidgetID.BANK_INVENTORY_GROUP_ID:
|
|
||||||
case WidgetID.SEED_VAULT_GROUP_ID:
|
|
||||||
case WidgetID.SEED_VAULT_INVENTORY_GROUP_ID:
|
|
||||||
// Make tooltip
|
|
||||||
final String text = makeValueTooltip(menuEntry);
|
|
||||||
if (text != null)
|
|
||||||
{
|
|
||||||
tooltipManager.add(new Tooltip(ColorUtil.prependColorTag(text, new Color(238, 238, 238))));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
case WIDGET_TARGET:
|
||||||
|
// Check that this is the inventory
|
||||||
|
if (menuEntry.getWidget().getId() == WidgetInfo.INVENTORY.getId())
|
||||||
|
{
|
||||||
|
addTooltip(menuEntry, isAlching, groupId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addTooltip(MenuEntry menuEntry, boolean isAlching, int groupId)
|
||||||
|
{
|
||||||
|
// Item tooltip values
|
||||||
|
switch (groupId)
|
||||||
|
{
|
||||||
|
case WidgetID.EXPLORERS_RING_ALCH_GROUP_ID:
|
||||||
|
if (!config.showWhileAlching())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case WidgetID.INVENTORY_GROUP_ID:
|
||||||
|
case WidgetID.POH_TREASURE_CHEST_INVENTORY_GROUP_ID:
|
||||||
|
if (config.hideInventory() && (!config.showWhileAlching() || !isAlching))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// FALLTHROUGH
|
||||||
|
case WidgetID.BANK_GROUP_ID:
|
||||||
|
case WidgetID.BANK_INVENTORY_GROUP_ID:
|
||||||
|
case WidgetID.SEED_VAULT_GROUP_ID:
|
||||||
|
case WidgetID.SEED_VAULT_INVENTORY_GROUP_ID:
|
||||||
|
// Make tooltip
|
||||||
|
final String text = makeValueTooltip(menuEntry);
|
||||||
|
if (text != null)
|
||||||
|
{
|
||||||
|
tooltipManager.add(new Tooltip(ColorUtil.prependColorTag(text, new Color(238, 238, 238))));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private String makeValueTooltip(MenuEntry menuEntry)
|
private String makeValueTooltip(MenuEntry menuEntry)
|
||||||
{
|
{
|
||||||
// Disabling both disables all value tooltips
|
// Disabling both disables all value tooltips
|
||||||
|
|||||||
@@ -971,19 +971,19 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
onInvChange(collectInvAndGroundItems(LootRecordType.EVENT, SHADE_CHEST_OBJECTS.get(event.getId())));
|
onInvChange(collectInvAndGroundItems(LootRecordType.EVENT, SHADE_CHEST_OBJECTS.get(event.getId())));
|
||||||
}
|
}
|
||||||
else if (isItemOp(event.getMenuAction()))
|
else if (event.isItemOp())
|
||||||
{
|
{
|
||||||
if (event.getMenuOption().equals("Take") && event.getId() == ItemID.SEED_PACK)
|
if (event.getMenuOption().equals("Take") && event.getItemId() == ItemID.SEED_PACK)
|
||||||
{
|
{
|
||||||
onInvChange(collectInvItems(LootRecordType.EVENT, SEEDPACK_EVENT));
|
onInvChange(collectInvItems(LootRecordType.EVENT, SEEDPACK_EVENT));
|
||||||
}
|
}
|
||||||
else if (event.getMenuOption().equals("Search") && BIRDNEST_IDS.contains(event.getId()))
|
else if (event.getMenuOption().equals("Search") && BIRDNEST_IDS.contains(event.getItemId()))
|
||||||
{
|
{
|
||||||
onInvChange(collectInvItems(LootRecordType.EVENT, BIRDNEST_EVENT));
|
onInvChange(collectInvItems(LootRecordType.EVENT, BIRDNEST_EVENT));
|
||||||
}
|
}
|
||||||
else if (event.getMenuOption().equals("Open"))
|
else if (event.getMenuOption().equals("Open"))
|
||||||
{
|
{
|
||||||
switch (event.getId())
|
switch (event.getItemId())
|
||||||
{
|
{
|
||||||
case ItemID.CASKET:
|
case ItemID.CASKET:
|
||||||
onInvChange(collectInvItems(LootRecordType.EVENT, CASKET_EVENT));
|
onInvChange(collectInvItems(LootRecordType.EVENT, CASKET_EVENT));
|
||||||
@@ -1004,7 +1004,7 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
case ItemID.SIMPLE_LOCKBOX_25647:
|
case ItemID.SIMPLE_LOCKBOX_25647:
|
||||||
case ItemID.ELABORATE_LOCKBOX_25649:
|
case ItemID.ELABORATE_LOCKBOX_25649:
|
||||||
case ItemID.ORNATE_LOCKBOX_25651:
|
case ItemID.ORNATE_LOCKBOX_25651:
|
||||||
onInvChange(collectInvAndGroundItems(LootRecordType.EVENT, itemManager.getItemComposition(event.getId()).getName()));
|
onInvChange(collectInvAndGroundItems(LootRecordType.EVENT, itemManager.getItemComposition(event.getItemId()).getName()));
|
||||||
break;
|
break;
|
||||||
case ItemID.SUPPLY_CRATE_24884:
|
case ItemID.SUPPLY_CRATE_24884:
|
||||||
onInvChange(collectInvItems(LootRecordType.EVENT, MAHOGANY_CRATE_EVENT, client.getBoostedSkillLevel(Skill.CONSTRUCTION)));
|
onInvChange(collectInvItems(LootRecordType.EVENT, MAHOGANY_CRATE_EVENT, client.getBoostedSkillLevel(Skill.CONSTRUCTION)));
|
||||||
@@ -1014,14 +1014,14 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event.getMenuOption().equals("Loot") && IMPLING_JARS.contains(event.getId()))
|
else if (event.getMenuOption().equals("Loot") && IMPLING_JARS.contains(event.getItemId()))
|
||||||
{
|
{
|
||||||
onInvChange(((invItems, groundItems, removedItems) ->
|
onInvChange(((invItems, groundItems, removedItems) ->
|
||||||
{
|
{
|
||||||
int cnt = removedItems.count(event.getId());
|
int cnt = removedItems.count(event.getItemId());
|
||||||
if (cnt > 0)
|
if (cnt > 0)
|
||||||
{
|
{
|
||||||
String name = itemManager.getItemComposition(event.getId()).getName();
|
String name = itemManager.getItemComposition(event.getItemId()).getName();
|
||||||
addLoot(name, -1, LootRecordType.EVENT, null, invItems, cnt);
|
addLoot(name, -1, LootRecordType.EVENT, null, invItems, cnt);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@@ -1038,12 +1038,6 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isItemOp(MenuAction menuAction)
|
|
||||||
{
|
|
||||||
final int id = menuAction.getId();
|
|
||||||
return id >= MenuAction.ITEM_FIRST_OPTION.getId() && id <= MenuAction.ITEM_FIFTH_OPTION.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isNPCOp(MenuAction menuAction)
|
private static boolean isNPCOp(MenuAction menuAction)
|
||||||
{
|
{
|
||||||
final int id = menuAction.getId();
|
final int id = menuAction.getId();
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ import net.runelite.api.NPC;
|
|||||||
import net.runelite.api.NPCComposition;
|
import net.runelite.api.NPCComposition;
|
||||||
import net.runelite.api.ObjectComposition;
|
import net.runelite.api.ObjectComposition;
|
||||||
import net.runelite.api.events.ClientTick;
|
import net.runelite.api.events.ClientTick;
|
||||||
import net.runelite.api.events.MenuEntryAdded;
|
|
||||||
import net.runelite.api.events.MenuOpened;
|
import net.runelite.api.events.MenuOpened;
|
||||||
import net.runelite.api.events.PostItemComposition;
|
import net.runelite.api.events.PostItemComposition;
|
||||||
import net.runelite.api.widgets.WidgetID;
|
import net.runelite.api.widgets.WidgetID;
|
||||||
@@ -134,15 +133,6 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
private static final WidgetMenuOption RESIZABLE_BOTTOM_LINE_INVENTORY_TAB_SAVE_LC = new WidgetMenuOption(SAVE,
|
private static final WidgetMenuOption RESIZABLE_BOTTOM_LINE_INVENTORY_TAB_SAVE_LC = new WidgetMenuOption(SAVE,
|
||||||
LEFT_CLICK_MENU_TARGET, WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE_INVENTORY_TAB);
|
LEFT_CLICK_MENU_TARGET, WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE_INVENTORY_TAB);
|
||||||
|
|
||||||
private static final Set<MenuAction> ITEM_MENU_TYPES = ImmutableSet.of(
|
|
||||||
MenuAction.ITEM_FIRST_OPTION,
|
|
||||||
MenuAction.ITEM_SECOND_OPTION,
|
|
||||||
MenuAction.ITEM_THIRD_OPTION,
|
|
||||||
MenuAction.ITEM_FOURTH_OPTION,
|
|
||||||
MenuAction.ITEM_FIFTH_OPTION,
|
|
||||||
MenuAction.ITEM_USE
|
|
||||||
);
|
|
||||||
|
|
||||||
private static final List<MenuAction> NPC_MENU_TYPES = ImmutableList.of(
|
private static final List<MenuAction> NPC_MENU_TYPES = ImmutableList.of(
|
||||||
MenuAction.NPC_FIRST_OPTION,
|
MenuAction.NPC_FIRST_OPTION,
|
||||||
MenuAction.NPC_SECOND_OPTION,
|
MenuAction.NPC_SECOND_OPTION,
|
||||||
@@ -547,25 +537,27 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuEntry firstEntry = event.getFirstEntry();
|
final MenuEntry firstEntry = event.getFirstEntry();
|
||||||
if (firstEntry == null)
|
if (firstEntry == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int widgetId = firstEntry.getParam1();
|
final int itemId;
|
||||||
if (widgetId != WidgetInfo.INVENTORY.getId())
|
if (firstEntry.getType() == MenuAction.WIDGET_TARGET && firstEntry.getWidget().getId() == WidgetInfo.INVENTORY.getId())
|
||||||
|
{
|
||||||
|
itemId = firstEntry.getWidget().getItemId();
|
||||||
|
}
|
||||||
|
else if (firstEntry.isItemOp())
|
||||||
|
{
|
||||||
|
itemId = firstEntry.getItemId();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int itemId = firstEntry.getIdentifier();
|
int activeOp = 0;
|
||||||
if (itemId == -1)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuAction activeAction = null;
|
|
||||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||||
|
|
||||||
if (configuringShiftClick)
|
if (configuringShiftClick)
|
||||||
@@ -576,7 +568,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
|
|
||||||
if (shiftClickActionIndex >= 0)
|
if (shiftClickActionIndex >= 0)
|
||||||
{
|
{
|
||||||
activeAction = MenuAction.of(MenuAction.ITEM_FIRST_OPTION.getId() + shiftClickActionIndex);
|
activeOp = 1 + shiftClickActionIndex;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -584,7 +576,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
Integer config = getItemSwapConfig(true, itemId);
|
Integer config = getItemSwapConfig(true, itemId);
|
||||||
if (config != null && config == -1)
|
if (config != null && config == -1)
|
||||||
{
|
{
|
||||||
activeAction = MenuAction.ITEM_USE;
|
activeOp = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -594,9 +586,9 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
Integer config = getItemSwapConfig(false, itemId);
|
Integer config = getItemSwapConfig(false, itemId);
|
||||||
if (config != null)
|
if (config != null)
|
||||||
{
|
{
|
||||||
activeAction = config >= 0
|
activeOp = config >= 0
|
||||||
? MenuAction.of(MenuAction.ITEM_FIRST_OPTION.getId() + config)
|
? 1 + config
|
||||||
: MenuAction.ITEM_USE;
|
: -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -604,20 +596,31 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
|
|
||||||
for (MenuEntry entry : entries)
|
for (MenuEntry entry : entries)
|
||||||
{
|
{
|
||||||
final MenuAction menuAction = entry.getType();
|
if (entry.getType() == MenuAction.WIDGET_TARGET && entry.getWidget().getId() == WidgetInfo.INVENTORY.getId() && entry.getWidget().getItemId() == itemId)
|
||||||
|
|
||||||
if (ITEM_MENU_TYPES.contains(menuAction) && entry.getIdentifier() == itemId)
|
|
||||||
{
|
{
|
||||||
entry.setType(MenuAction.RUNELITE);
|
entry.setType(MenuAction.RUNELITE);
|
||||||
entry.onClick(e ->
|
entry.onClick(e ->
|
||||||
{
|
{
|
||||||
int index = menuAction == MenuAction.ITEM_USE
|
log.debug("Set {} item swap for {} to USE", configuringShiftClick ? "shift" : "left", itemId);
|
||||||
? -1
|
setItemSwapConfig(configuringShiftClick, itemId, -1);
|
||||||
: menuAction.getId() - MenuAction.ITEM_FIRST_OPTION.getId();
|
|
||||||
setItemSwapConfig(configuringShiftClick, itemId, index);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (activeAction == menuAction)
|
if (activeOp == -1)
|
||||||
|
{
|
||||||
|
entry.setOption("* " + entry.getOption());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (entry.isItemOp() && entry.getItemId() == itemId)
|
||||||
|
{
|
||||||
|
final int itemOp = entry.getItemOp();
|
||||||
|
entry.setType(MenuAction.RUNELITE);
|
||||||
|
entry.onClick(e ->
|
||||||
|
{
|
||||||
|
log.debug("Set {} item swap config for {} to {}", configuringShiftClick ? "shift" : "left", itemId, itemOp - 1);
|
||||||
|
setItemSwapConfig(configuringShiftClick, itemId, itemOp - 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (itemOp == activeOp)
|
||||||
{
|
{
|
||||||
entry.setOption("* " + entry.getOption());
|
entry.setOption("* " + entry.getOption());
|
||||||
}
|
}
|
||||||
@@ -803,15 +806,14 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
private boolean swapBank(MenuEntry menuEntry, MenuAction type)
|
||||||
public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded)
|
|
||||||
{
|
{
|
||||||
// This swap needs to happen prior to drag start on click, which happens during
|
if (type != MenuAction.CC_OP && type != MenuAction.CC_OP_LOW_PRIORITY)
|
||||||
// widget ticking and prior to our client tick event. This is because drag start
|
{
|
||||||
// is what builds the context menu row which is what the eventual click will use
|
return false;
|
||||||
|
}
|
||||||
final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntryAdded.getActionParam1());
|
|
||||||
|
|
||||||
|
final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntry.getParam1());
|
||||||
final boolean isDepositBoxPlayerInventory = widgetGroupId == WidgetID.DEPOSIT_BOX_GROUP_ID;
|
final boolean isDepositBoxPlayerInventory = widgetGroupId == WidgetID.DEPOSIT_BOX_GROUP_ID;
|
||||||
final boolean isChambersOfXericStorageUnitPlayerInventory = widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_INVENTORY_GROUP_ID;
|
final boolean isChambersOfXericStorageUnitPlayerInventory = widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_INVENTORY_GROUP_ID;
|
||||||
final boolean isGroupStoragePlayerInventory = widgetGroupId == WidgetID.GROUP_STORAGE_INVENTORY_GROUP_ID;
|
final boolean isGroupStoragePlayerInventory = widgetGroupId == WidgetID.GROUP_STORAGE_INVENTORY_GROUP_ID;
|
||||||
@@ -819,9 +821,9 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
// Deposit- op 1 is the current withdraw amount 1/5/10/x for deposit box interface and chambers of xeric storage unit.
|
// Deposit- op 1 is the current withdraw amount 1/5/10/x for deposit box interface and chambers of xeric storage unit.
|
||||||
// Deposit- op 2 is the current withdraw amount 1/5/10/x for bank interface
|
// Deposit- op 2 is the current withdraw amount 1/5/10/x for bank interface
|
||||||
if (shiftModifier() && config.bankDepositShiftClick() != ShiftDepositMode.OFF
|
if (shiftModifier() && config.bankDepositShiftClick() != ShiftDepositMode.OFF
|
||||||
&& menuEntryAdded.getType() == MenuAction.CC_OP.getId()
|
&& type == MenuAction.CC_OP
|
||||||
&& menuEntryAdded.getIdentifier() == (isDepositBoxPlayerInventory || isGroupStoragePlayerInventory || isChambersOfXericStorageUnitPlayerInventory ? 1 : 2)
|
&& menuEntry.getIdentifier() == (isDepositBoxPlayerInventory || isGroupStoragePlayerInventory || isChambersOfXericStorageUnitPlayerInventory ? 1 : 2)
|
||||||
&& (menuEntryAdded.getOption().startsWith("Deposit-") || menuEntryAdded.getOption().startsWith("Store") || menuEntryAdded.getOption().startsWith("Donate")))
|
&& (menuEntry.getOption().startsWith("Deposit-") || menuEntry.getOption().startsWith("Store") || menuEntry.getOption().startsWith("Donate")))
|
||||||
{
|
{
|
||||||
ShiftDepositMode shiftDepositMode = config.bankDepositShiftClick();
|
ShiftDepositMode shiftDepositMode = config.bankDepositShiftClick();
|
||||||
final int opId = isDepositBoxPlayerInventory ? shiftDepositMode.getIdentifierDepositBox()
|
final int opId = isDepositBoxPlayerInventory ? shiftDepositMode.getIdentifierDepositBox()
|
||||||
@@ -830,13 +832,14 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
: shiftDepositMode.getIdentifier();
|
: shiftDepositMode.getIdentifier();
|
||||||
final MenuAction action = opId >= 6 ? MenuAction.CC_OP_LOW_PRIORITY : MenuAction.CC_OP;
|
final MenuAction action = opId >= 6 ? MenuAction.CC_OP_LOW_PRIORITY : MenuAction.CC_OP;
|
||||||
bankModeSwap(action, opId);
|
bankModeSwap(action, opId);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Swap to shift-click withdraw behavior
|
// Swap to shift-click withdraw behavior
|
||||||
// Deposit- op 1 is the current withdraw amount 1/5/10/x
|
// Deposit- op 1 is the current withdraw amount 1/5/10/x
|
||||||
if (shiftModifier() && config.bankWithdrawShiftClick() != ShiftWithdrawMode.OFF
|
if (shiftModifier() && config.bankWithdrawShiftClick() != ShiftWithdrawMode.OFF
|
||||||
&& menuEntryAdded.getType() == MenuAction.CC_OP.getId() && menuEntryAdded.getIdentifier() == 1
|
&& type == MenuAction.CC_OP && menuEntry.getIdentifier() == 1
|
||||||
&& menuEntryAdded.getOption().startsWith("Withdraw"))
|
&& menuEntry.getOption().startsWith("Withdraw"))
|
||||||
{
|
{
|
||||||
ShiftWithdrawMode shiftWithdrawMode = config.bankWithdrawShiftClick();
|
ShiftWithdrawMode shiftWithdrawMode = config.bankWithdrawShiftClick();
|
||||||
final MenuAction action;
|
final MenuAction action;
|
||||||
@@ -852,7 +855,10 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
opId = shiftWithdrawMode.getIdentifier();
|
opId = shiftWithdrawMode.getIdentifier();
|
||||||
}
|
}
|
||||||
bankModeSwap(action, opId);
|
bankModeSwap(action, opId);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bankModeSwap(MenuAction entryType, int entryIdentifier)
|
private void bankModeSwap(MenuAction entryType, int entryIdentifier)
|
||||||
@@ -893,19 +899,15 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean itemOp = menuAction == MenuAction.ITEM_FIRST_OPTION
|
final boolean itemOp = menuEntry.isItemOp();
|
||||||
|| menuAction == MenuAction.ITEM_SECOND_OPTION
|
// Custom shift-click item swap
|
||||||
|| menuAction == MenuAction.ITEM_THIRD_OPTION
|
|
||||||
|| menuAction == MenuAction.ITEM_FOURTH_OPTION
|
|
||||||
|| menuAction == MenuAction.ITEM_FIFTH_OPTION
|
|
||||||
|| menuAction == MenuAction.ITEM_USE;
|
|
||||||
if (shiftModifier() && itemOp)
|
if (shiftModifier() && itemOp)
|
||||||
{
|
{
|
||||||
// Special case use shift click due to items not actually containing a "Use" option, making
|
// Special case use shift click due to items not actually containing a "Use" option, making
|
||||||
// the client unable to perform the swap itself.
|
// the client unable to perform the swap itself.
|
||||||
if (config.shiftClickCustomization() && !option.equals("use"))
|
if (config.shiftClickCustomization() && !option.equals("use"))
|
||||||
{
|
{
|
||||||
Integer customOption = getItemSwapConfig(true, eventId);
|
Integer customOption = getItemSwapConfig(true, menuEntry.getItemId());
|
||||||
|
|
||||||
if (customOption != null && customOption == -1)
|
if (customOption != null && customOption == -1)
|
||||||
{
|
{
|
||||||
@@ -921,14 +923,18 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
// Custom left-click item swap
|
// Custom left-click item swap
|
||||||
if (itemOp)
|
if (itemOp)
|
||||||
{
|
{
|
||||||
Integer swapIndex = getItemSwapConfig(false, eventId);
|
Integer swapIndex = getItemSwapConfig(false, menuEntry.getItemId());
|
||||||
if (swapIndex != null)
|
if (swapIndex != null)
|
||||||
{
|
{
|
||||||
MenuAction swapAction = swapIndex >= 0
|
final int swapAction = swapIndex >= 0
|
||||||
? MenuAction.of(MenuAction.ITEM_FIRST_OPTION.getId() + swapIndex)
|
? 1 + swapIndex
|
||||||
: MenuAction.ITEM_USE;
|
: -1;
|
||||||
|
|
||||||
if (menuAction == swapAction)
|
if (swapAction == -1)
|
||||||
|
{
|
||||||
|
swap(menuEntries, "use", target, index, true);
|
||||||
|
}
|
||||||
|
else if (swapAction == menuEntry.getItemOp())
|
||||||
{
|
{
|
||||||
swap(optionIndexes, menuEntries, index, menuEntries.length - 1);
|
swap(optionIndexes, menuEntries, index, menuEntries.length - 1);
|
||||||
}
|
}
|
||||||
@@ -986,6 +992,11 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (swapBank(menuEntry, menuAction))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Built-in swaps
|
// Built-in swaps
|
||||||
Collection<Swap> swaps = this.swaps.get(option);
|
Collection<Swap> swaps = this.swaps.get(option);
|
||||||
for (Swap swap : swaps)
|
for (Swap swap : swaps)
|
||||||
|
|||||||
@@ -49,13 +49,13 @@ class MouseHighlightOverlay extends Overlay
|
|||||||
*/
|
*/
|
||||||
private static final Set<MenuAction> WIDGET_MENU_ACTIONS = ImmutableSet.of(
|
private static final Set<MenuAction> WIDGET_MENU_ACTIONS = ImmutableSet.of(
|
||||||
MenuAction.WIDGET_TYPE_1,
|
MenuAction.WIDGET_TYPE_1,
|
||||||
MenuAction.WIDGET_TYPE_2,
|
MenuAction.WIDGET_TARGET,
|
||||||
MenuAction.WIDGET_TYPE_3,
|
MenuAction.WIDGET_CLOSE,
|
||||||
MenuAction.WIDGET_TYPE_4,
|
MenuAction.WIDGET_TYPE_4,
|
||||||
MenuAction.WIDGET_TYPE_5,
|
MenuAction.WIDGET_TYPE_5,
|
||||||
MenuAction.WIDGET_TYPE_6,
|
MenuAction.WIDGET_CONTINUE,
|
||||||
MenuAction.ITEM_USE_ON_WIDGET_ITEM,
|
MenuAction.ITEM_USE_ON_ITEM,
|
||||||
MenuAction.ITEM_USE_ON_WIDGET,
|
MenuAction.WIDGET_USE_ON_ITEM,
|
||||||
MenuAction.ITEM_FIRST_OPTION,
|
MenuAction.ITEM_FIRST_OPTION,
|
||||||
MenuAction.ITEM_SECOND_OPTION,
|
MenuAction.ITEM_SECOND_OPTION,
|
||||||
MenuAction.ITEM_THIRD_OPTION,
|
MenuAction.ITEM_THIRD_OPTION,
|
||||||
@@ -68,7 +68,7 @@ class MouseHighlightOverlay extends Overlay
|
|||||||
MenuAction.WIDGET_FOURTH_OPTION,
|
MenuAction.WIDGET_FOURTH_OPTION,
|
||||||
MenuAction.WIDGET_FIFTH_OPTION,
|
MenuAction.WIDGET_FIFTH_OPTION,
|
||||||
MenuAction.EXAMINE_ITEM,
|
MenuAction.EXAMINE_ITEM,
|
||||||
MenuAction.SPELL_CAST_ON_WIDGET,
|
MenuAction.WIDGET_TARGET_ON_WIDGET,
|
||||||
MenuAction.CC_OP_LOW_PRIORITY,
|
MenuAction.CC_OP_LOW_PRIORITY,
|
||||||
MenuAction.CC_OP
|
MenuAction.CC_OP
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class NpcIndicatorsPlugin extends Plugin
|
|||||||
private static final String UNTAG_ALL = "Un-tag-All";
|
private static final String UNTAG_ALL = "Un-tag-All";
|
||||||
|
|
||||||
private static final Set<MenuAction> NPC_MENU_ACTIONS = ImmutableSet.of(MenuAction.NPC_FIRST_OPTION, MenuAction.NPC_SECOND_OPTION,
|
private static final Set<MenuAction> NPC_MENU_ACTIONS = ImmutableSet.of(MenuAction.NPC_FIRST_OPTION, MenuAction.NPC_SECOND_OPTION,
|
||||||
MenuAction.NPC_THIRD_OPTION, MenuAction.NPC_FOURTH_OPTION, MenuAction.NPC_FIFTH_OPTION, MenuAction.SPELL_CAST_ON_NPC,
|
MenuAction.NPC_THIRD_OPTION, MenuAction.NPC_FOURTH_OPTION, MenuAction.NPC_FIFTH_OPTION, MenuAction.WIDGET_TARGET_ON_NPC,
|
||||||
MenuAction.ITEM_USE_ON_NPC);
|
MenuAction.ITEM_USE_ON_NPC);
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import static net.runelite.api.MenuAction.PLAYER_SEVENTH_OPTION;
|
|||||||
import static net.runelite.api.MenuAction.PLAYER_SIXTH_OPTION;
|
import static net.runelite.api.MenuAction.PLAYER_SIXTH_OPTION;
|
||||||
import static net.runelite.api.MenuAction.PLAYER_THIRD_OPTION;
|
import static net.runelite.api.MenuAction.PLAYER_THIRD_OPTION;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_PLAYER;
|
import static net.runelite.api.MenuAction.RUNELITE_PLAYER;
|
||||||
import static net.runelite.api.MenuAction.SPELL_CAST_ON_PLAYER;
|
import static net.runelite.api.MenuAction.WIDGET_TARGET_ON_PLAYER;
|
||||||
import static net.runelite.api.MenuAction.WALK;
|
import static net.runelite.api.MenuAction.WALK;
|
||||||
import net.runelite.api.MenuEntry;
|
import net.runelite.api.MenuEntry;
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
@@ -124,7 +124,7 @@ public class PlayerIndicatorsPlugin extends Plugin
|
|||||||
MenuAction type = entry.getType();
|
MenuAction type = entry.getType();
|
||||||
|
|
||||||
if (type == WALK
|
if (type == WALK
|
||||||
|| type == SPELL_CAST_ON_PLAYER
|
|| type == WIDGET_TARGET_ON_PLAYER
|
||||||
|| type == ITEM_USE_ON_PLAYER
|
|| type == ITEM_USE_ON_PLAYER
|
||||||
|| type == PLAYER_FIRST_OPTION
|
|| type == PLAYER_FIRST_OPTION
|
||||||
|| type == PLAYER_SECOND_OPTION
|
|| type == PLAYER_SECOND_OPTION
|
||||||
|
|||||||
@@ -266,8 +266,8 @@ public class WikiPlugin extends Plugin
|
|||||||
break optarget;
|
break optarget;
|
||||||
case CANCEL:
|
case CANCEL:
|
||||||
return;
|
return;
|
||||||
case ITEM_USE_ON_WIDGET:
|
case WIDGET_USE_ON_ITEM:
|
||||||
case SPELL_CAST_ON_GROUND_ITEM:
|
case WIDGET_TARGET_ON_GROUND_ITEM:
|
||||||
{
|
{
|
||||||
type = "item";
|
type = "item";
|
||||||
id = itemManager.canonicalize(ev.getId());
|
id = itemManager.canonicalize(ev.getId());
|
||||||
@@ -275,7 +275,7 @@ public class WikiPlugin extends Plugin
|
|||||||
location = null;
|
location = null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SPELL_CAST_ON_NPC:
|
case WIDGET_TARGET_ON_NPC:
|
||||||
{
|
{
|
||||||
type = "npc";
|
type = "npc";
|
||||||
NPC npc = client.getCachedNPCs()[ev.getId()];
|
NPC npc = client.getCachedNPCs()[ev.getId()];
|
||||||
@@ -285,7 +285,7 @@ public class WikiPlugin extends Plugin
|
|||||||
location = npc.getWorldLocation();
|
location = npc.getWorldLocation();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SPELL_CAST_ON_GAME_OBJECT:
|
case WIDGET_TARGET_ON_GAME_OBJECT:
|
||||||
{
|
{
|
||||||
type = "object";
|
type = "object";
|
||||||
ObjectComposition lc = client.getObjectDefinition(ev.getId());
|
ObjectComposition lc = client.getObjectDefinition(ev.getId());
|
||||||
@@ -298,7 +298,7 @@ public class WikiPlugin extends Plugin
|
|||||||
location = WorldPoint.fromScene(client, ev.getParam0(), ev.getParam1(), client.getPlane());
|
location = WorldPoint.fromScene(client, ev.getParam0(), ev.getParam1(), client.getPlane());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SPELL_CAST_ON_WIDGET:
|
case WIDGET_TARGET_ON_WIDGET:
|
||||||
Widget w = getWidget(ev.getParam1(), ev.getParam0());
|
Widget w = getWidget(ev.getParam1(), ev.getParam0());
|
||||||
|
|
||||||
if (w.getType() == WidgetType.GRAPHIC && w.getItemId() != -1)
|
if (w.getType() == WidgetType.GRAPHIC && w.getItemId() != -1)
|
||||||
@@ -359,7 +359,7 @@ public class WikiPlugin extends Plugin
|
|||||||
int widgetIndex = event.getActionParam0();
|
int widgetIndex = event.getActionParam0();
|
||||||
int widgetID = event.getActionParam1();
|
int widgetID = event.getActionParam1();
|
||||||
|
|
||||||
if (wikiSelected && event.getType() == MenuAction.SPELL_CAST_ON_WIDGET.getId())
|
if (wikiSelected && event.getType() == MenuAction.WIDGET_TARGET_ON_WIDGET.getId())
|
||||||
{
|
{
|
||||||
MenuEntry[] menuEntries = client.getMenuEntries();
|
MenuEntry[] menuEntries = client.getMenuEntries();
|
||||||
Widget w = getWidget(widgetID, widgetIndex);
|
Widget w = getWidget(widgetID, widgetIndex);
|
||||||
@@ -368,7 +368,7 @@ public class WikiPlugin extends Plugin
|
|||||||
for (int ourEntry = menuEntries.length - 1;ourEntry >= 0; ourEntry--)
|
for (int ourEntry = menuEntries.length - 1;ourEntry >= 0; ourEntry--)
|
||||||
{
|
{
|
||||||
MenuEntry entry = menuEntries[ourEntry];
|
MenuEntry entry = menuEntries[ourEntry];
|
||||||
if (entry.getType() == MenuAction.SPELL_CAST_ON_WIDGET)
|
if (entry.getType() == MenuAction.WIDGET_TARGET_ON_WIDGET)
|
||||||
{
|
{
|
||||||
int id = itemManager.canonicalize(w.getItemId());
|
int id = itemManager.canonicalize(w.getItemId());
|
||||||
String name = itemManager.getItemComposition(id).getName();
|
String name = itemManager.getItemComposition(id).getName();
|
||||||
@@ -385,7 +385,7 @@ public class WikiPlugin extends Plugin
|
|||||||
MenuEntry[] oldEntries = menuEntries;
|
MenuEntry[] oldEntries = menuEntries;
|
||||||
menuEntries = Arrays.copyOf(menuEntries, menuEntries.length - 1);
|
menuEntries = Arrays.copyOf(menuEntries, menuEntries.length - 1);
|
||||||
for (int ourEntry = oldEntries.length - 1;
|
for (int ourEntry = oldEntries.length - 1;
|
||||||
ourEntry >= 2 && oldEntries[oldEntries.length - 1].getType() != MenuAction.SPELL_CAST_ON_WIDGET;
|
ourEntry >= 2 && oldEntries[oldEntries.length - 1].getType() != MenuAction.WIDGET_TARGET_ON_WIDGET;
|
||||||
ourEntry--)
|
ourEntry--)
|
||||||
{
|
{
|
||||||
menuEntries[ourEntry - 1] = oldEntries[ourEntry];
|
menuEntries[ourEntry - 1] = oldEntries[ourEntry];
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ public class ClientLoader implements Supplier<Applet>
|
|||||||
|
|
||||||
private RSConfig downloadConfig() throws IOException
|
private RSConfig downloadConfig() throws IOException
|
||||||
{
|
{
|
||||||
HttpUrl url = HttpUrl.parse(javConfigUrl);
|
HttpUrl url = HttpUrl.get(javConfigUrl);
|
||||||
IOException err = null;
|
IOException err = null;
|
||||||
for (int attempt = 0; attempt < NUM_ATTEMPTS; attempt++)
|
for (int attempt = 0; attempt < NUM_ATTEMPTS; attempt++)
|
||||||
{
|
{
|
||||||
@@ -256,7 +256,7 @@ public class ClientLoader implements Supplier<Applet>
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
private RSConfig downloadFallbackConfig() throws IOException
|
private RSConfig downloadFallbackConfig() throws IOException
|
||||||
{
|
{
|
||||||
RSConfig backupConfig = clientConfigLoader.fetch(HttpUrl.parse(RuneLiteProperties.getJavConfigBackup()));
|
RSConfig backupConfig = clientConfigLoader.fetch(HttpUrl.get(RuneLiteProperties.getJavConfigBackup()));
|
||||||
|
|
||||||
if (Strings.isNullOrEmpty(backupConfig.getCodeBase()) || Strings.isNullOrEmpty(backupConfig.getInitialJar()) || Strings.isNullOrEmpty(backupConfig.getInitialClass()))
|
if (Strings.isNullOrEmpty(backupConfig.getCodeBase()) || Strings.isNullOrEmpty(backupConfig.getInitialJar()) || Strings.isNullOrEmpty(backupConfig.getInitialClass()))
|
||||||
{
|
{
|
||||||
@@ -326,13 +326,13 @@ public class ClientLoader implements Supplier<Applet>
|
|||||||
if (config.isFallback())
|
if (config.isFallback())
|
||||||
{
|
{
|
||||||
// If we are using the backup config, use our own gamepack and ignore the codebase
|
// If we are using the backup config, use our own gamepack and ignore the codebase
|
||||||
url = HttpUrl.parse(config.getRuneLiteGamepack());
|
url = HttpUrl.get(config.getRuneLiteGamepack());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
String codebase = config.getCodeBase();
|
String codebase = config.getCodeBase();
|
||||||
String initialJar = config.getInitialJar();
|
String initialJar = config.getInitialJar();
|
||||||
url = HttpUrl.parse(codebase + initialJar);
|
url = HttpUrl.get(codebase + initialJar);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int attempt = 0; ; attempt++)
|
for (int attempt = 0; ; attempt++)
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ package net.runelite.client.ui;
|
|||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Container;
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
@@ -45,7 +44,6 @@ import javax.swing.JDialog;
|
|||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.UIManager;
|
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.RuneLite;
|
import net.runelite.client.RuneLite;
|
||||||
@@ -53,6 +51,7 @@ import net.runelite.client.RuneLiteProperties;
|
|||||||
import net.runelite.client.util.ImageUtil;
|
import net.runelite.client.util.ImageUtil;
|
||||||
import net.runelite.client.util.LinkBrowser;
|
import net.runelite.client.util.LinkBrowser;
|
||||||
import net.runelite.client.util.VerificationException;
|
import net.runelite.client.util.VerificationException;
|
||||||
|
import org.pushingpixels.substance.internal.SubstanceSynapse;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class FatalErrorDialog extends JDialog
|
public class FatalErrorDialog extends JDialog
|
||||||
@@ -70,16 +69,6 @@ public class FatalErrorDialog extends JDialog
|
|||||||
throw new IllegalStateException("Fatal error during fatal error: " + message);
|
throw new IllegalStateException("Fatal error during fatal error: " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
UIManager.put("Button.select", ColorScheme.DARKER_GRAY_COLOR);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BufferedImage logo = ImageUtil.loadImageResource(FatalErrorDialog.class, "openosrs_transparent.png");
|
BufferedImage logo = ImageUtil.loadImageResource(FatalErrorDialog.class, "openosrs_transparent.png");
|
||||||
@@ -108,8 +97,9 @@ public class FatalErrorDialog extends JDialog
|
|||||||
setTitle("Fatal error starting OpenOSRS");
|
setTitle("Fatal error starting OpenOSRS");
|
||||||
setLayout(new BorderLayout());
|
setLayout(new BorderLayout());
|
||||||
|
|
||||||
Container pane = getContentPane();
|
JPanel pane = (JPanel) getContentPane();
|
||||||
pane.setBackground(ColorScheme.DARKER_GRAY_COLOR);
|
pane.setBackground(ColorScheme.DARKER_GRAY_COLOR);
|
||||||
|
pane.putClientProperty(SubstanceSynapse.COLORIZATION_FACTOR, 1.0);
|
||||||
|
|
||||||
JPanel leftPane = new JPanel();
|
JPanel leftPane = new JPanel();
|
||||||
leftPane.setBackground(ColorScheme.DARKER_GRAY_COLOR);
|
leftPane.setBackground(ColorScheme.DARKER_GRAY_COLOR);
|
||||||
@@ -130,6 +120,7 @@ public class FatalErrorDialog extends JDialog
|
|||||||
textArea.setWrapStyleWord(true);
|
textArea.setWrapStyleWord(true);
|
||||||
textArea.setBorder(new EmptyBorder(10, 10, 10, 10));
|
textArea.setBorder(new EmptyBorder(10, 10, 10, 10));
|
||||||
textArea.setEditable(false);
|
textArea.setEditable(false);
|
||||||
|
textArea.setOpaque(false);
|
||||||
leftPane.add(textArea, BorderLayout.CENTER);
|
leftPane.add(textArea, BorderLayout.CENTER);
|
||||||
|
|
||||||
pane.add(leftPane, BorderLayout.CENTER);
|
pane.add(leftPane, BorderLayout.CENTER);
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ import okhttp3.Response;
|
|||||||
public class ImageCapture
|
public class ImageCapture
|
||||||
{
|
{
|
||||||
private static final DateFormat TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
|
private static final DateFormat TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
|
||||||
private static final HttpUrl IMGUR_IMAGE_UPLOAD_URL = HttpUrl.parse("https://api.imgur.com/3/image");
|
private static final HttpUrl IMGUR_IMAGE_UPLOAD_URL = HttpUrl.get("https://api.imgur.com/3/image");
|
||||||
private static final MediaType JSON = MediaType.parse("application/json");
|
private static final MediaType JSON = MediaType.get("application/json");
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final Notifier notifier;
|
private final Notifier notifier;
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ public class VerificationException extends Exception
|
|||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public VerificationException(Throwable cause)
|
||||||
|
{
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
|
||||||
public VerificationException(String message, Throwable cause)
|
public VerificationException(String message, Throwable cause)
|
||||||
{
|
{
|
||||||
super(message, cause);
|
super(message, cause);
|
||||||
|
|||||||
@@ -1,19 +1,30 @@
|
|||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIDDDCCAfSgAwIBAgIJAK8uBanmNQZaMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
|
MIIFFTCCAv2gAwIBAgIUHZQhtTfY+I19Gz+JKYfvT6IM55QwDQYJKoZIhvcNAQEL
|
||||||
BAMMEHJ1bmVsaXRlLXBsdWdpbnMwHhcNMTkxMjEyMjEwNzUxWhcNMjUxMjEwMjEw
|
BQAwGjEYMBYGA1UEAwwPcnVuZWxpdGUtcGx1Z2luMB4XDTIyMDQxOTAxMjIzNFoX
|
||||||
NzUxWjAbMRkwFwYDVQQDDBBydW5lbGl0ZS1wbHVnaW5zMIIBIjANBgkqhkiG9w0B
|
DTMyMDQxNjAxMjIzNFowGjEYMBYGA1UEAwwPcnVuZWxpdGUtcGx1Z2luMIICIjAN
|
||||||
AQEFAAOCAQ8AMIIBCgKCAQEApu11OVANSU+pHaXRxB7fIZapucJ6BT46neicEixs
|
BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAw4Dkg5UBgD3X8UtChrnxCYaoe68J
|
||||||
NVPuK/QRVjO/G8F++MXFD/tlZUOEDllDN8uaHBIVwxilqEVYL7oX65Esl7qqC1TZ
|
uuY+lESNROWb27EAEcLHo/DBbW0q0n6zL4vKjHs4Acsq+Z9kblyXN572851b8hur
|
||||||
WGdjiMyYoK3CXWEWB4w+CdB31T7JG2HqH45ZsVs+U9OVWBkNkL5nNQNPOmZFd+3A
|
5CbHq0Uc4r1dUiMCYHjSJ/BkvGKMPs6Yo1CmzXqc9IPV/zoHC+yJH7R6hmIkLWu4
|
||||||
yCb9nGlO7SxduiHpwh3CV19jY47y8tevyo5qpaBuQeWtu3vbpeer0kbDarwD3xoF
|
CytXvmkIGEvOJoJ+LZyWcifBzX7Aua6IuWHHhTAxEcAxkrBFImfC9wgWD8sL/r2F
|
||||||
yUMPRK518gxRUSmOpsSG5viQ731mKVCUUfIXz91d3s+kJYAjORHS4zJe9s+1dljp
|
Xyzo3jkv1LognWFbuMGQYgG+PvO8Ia+p8cko9YZnH3+SQmtr+VPbLD+VOAyDxhH1
|
||||||
oLYNLkaP6m3CmNtC84OxkmognvZTNMbiQ3GQm/BK4sdjPQIDAQABo1MwUTAdBgNV
|
jX46SsSoB2sIIfCB3oNTERM1Wmy0xL5GYBj8PWOanWQY+rKku07SS8DBirkWRTVB
|
||||||
HQ4EFgQUxrkiRXNd0OHPMkqgl9UgV1//OuQwHwYDVR0jBBgwFoAUxrkiRXNd0OHP
|
lboNt60Di6FhrPnxTGA8DcxdYAJVZEQOS6ed540Bl40JMEdeMG66PGRDJJlIMyrc
|
||||||
Mkqgl9UgV1//OuQwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEA
|
3xa8Z6XoKMV0QCv5ETBQwnED3lXsViFDoeC6wCww1ZjOFMwHfk5O6N5CsyJOEoGC
|
||||||
StPyblz3aqOM5z2KqHX1B7Z3Q8B58g55YSefpcfwWEc6LT4HCztszcZDteWpV3W2
|
Y9LiUwzLkf2po6LGLRrUsiDf/a+nsMUam5Zhmdt6a77wii+cH7oaAAieLk11u1qr
|
||||||
ERfemkGKgsDhQ0qkzIt7tS5eNN3PPj7RZZm7vl5HquQ1vC/33ri/Z3CEKzbW7knt
|
Gc43gJtrzBY0thF5QiGtWlGHo7VY32Zlf9GnHkFSTTMdQX66VkWan6y080gr+HVn
|
||||||
i1iEpx8E9DKb9J9DjdKwNxSomOyCOFUt9YoQJs80xc1mwPDd6aWR3xwvnEUimkm+
|
aP1oN9cxBrfWc0XMBGp+uZf60p7D9gbPQG0bJUF7GDtgcZt+b8NK9u8hnJZVi8oX
|
||||||
Dbj7HMOXLeyN810wkeWcT8nC5GhxH3ZAmVExBHsaIOB876RntzshBehjY8s8JQhw
|
AmLfUvCZ4Uv/sjMCAwEAAaNTMFEwHQYDVR0OBBYEFEFHyDZIF4aE3o+ChP3/Y6eO
|
||||||
R+fT1e8EhYMM9ylYDk1KIWFWrAujjU04lS9tXZ5C2e7fr9R953XN6Y0PNM/taNTU
|
VsOQMB8GA1UdIwQYMBaAFEFHyDZIF4aE3o+ChP3/Y6eOVsOQMA8GA1UdEwEB/wQF
|
||||||
GzwGroJZI02V+1ADO14rRA==
|
MAMBAf8wDQYJKoZIhvcNAQELBQADggIBAH3Wm63s7ifC7cIeBLgM4LJxU9Qx1YA4
|
||||||
|
7U2WEoChoeDj4iBs5cAKCBXU9hbw2/Ij8JqYG1sjZGNZjdqzYtjh36K4j+vgTmK5
|
||||||
|
vufXlzC+MUwWt853QIrgWs4c2HO4HnQgsss7UJm3aofVeqEVH9MeHcmKiL/3uQFT
|
||||||
|
DiR31+MxLaQZw0JcmVMGR0WU6eXyi4lkZL82BGwponjaOgB4oxrHRqqrV7I93Y/v
|
||||||
|
GRiRwfcgP0QXORdfDmhtzaY6ay4TX1qzcXH/a78EGk3Bzgg20kh+6r8YRoBpbtM4
|
||||||
|
O4hZKhKtwGDDRHrVHy5gVh3hjAUdb2kdlxjxPocnkIiOWCrX2P5GA5NF6+deRE+B
|
||||||
|
NZO+3VAD40meNlaoVqSnXW2hmeqShWEclNkdyTieSLFTLpsPGIlC7+NYAgc6j9Jc
|
||||||
|
oFdcmdChavHv7UVbgg8Kp1ypfQLThNG9gWf+PByqRrEcCSKG3J1JrKwh8tqOXkNh
|
||||||
|
N5o3ON56H1WFPwkXji3amhkNCVHq13qgCXtPXTRSVcFTtPVrCKB5DSFqHErb73/5
|
||||||
|
WDkj4GYAVeL0+znFYktj/cxD0J8QRgNCVZeFCmxWpuN1WekHzy3C2TjO4We/x1yP
|
||||||
|
9HGVWLvJL8U8tgEO3c3g1OH9Z5SwHhgjNFw1VMfpKngFWp96o/OAJTX9K++5gKwm
|
||||||
|
Y5Hm2HkwTow+
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
@@ -1 +1 @@
|
|||||||
9B38CB6BF195C49B10D856C5F571AFDEC7BBEF96A4E3532F5B23E9341066144C
|
3218E18002C110E4D44C9CB0C006BD5C052AC1CA8D07B32F2C67CBD866570F06
|
||||||
@@ -90,13 +90,13 @@ LABEL60:
|
|||||||
iload 0
|
iload 0
|
||||||
iconst 84
|
iconst 84
|
||||||
if_icmpeq LABEL76
|
if_icmpeq LABEL76
|
||||||
jump LABEL822
|
jump LABEL809
|
||||||
LABEL76:
|
LABEL76:
|
||||||
invoke 1984
|
invoke 1984
|
||||||
iload 2
|
iload 2
|
||||||
iconst 0
|
iconst 0
|
||||||
if_icmpgt LABEL81
|
if_icmpgt LABEL81
|
||||||
jump LABEL821
|
jump LABEL808
|
||||||
LABEL81:
|
LABEL81:
|
||||||
iload 3
|
iload 3
|
||||||
iconst 1
|
iconst 1
|
||||||
@@ -699,7 +699,7 @@ LABEL587:
|
|||||||
sconst "You are not chatting as a guest in a clan channel at the moment."
|
sconst "You are not chatting as a guest in a clan channel at the moment."
|
||||||
mes
|
mes
|
||||||
LABEL589:
|
LABEL589:
|
||||||
jump LABEL817
|
jump LABEL804
|
||||||
LABEL590:
|
LABEL590:
|
||||||
iload 5
|
iload 5
|
||||||
iconst 41
|
iconst 41
|
||||||
@@ -782,7 +782,7 @@ LABEL655:
|
|||||||
sconst "You are not chatting in the channel of your Clan at the moment."
|
sconst "You are not chatting in the channel of your Clan at the moment."
|
||||||
mes
|
mes
|
||||||
LABEL657:
|
LABEL657:
|
||||||
jump LABEL817
|
jump LABEL804
|
||||||
LABEL658:
|
LABEL658:
|
||||||
iload 5
|
iload 5
|
||||||
iconst 9
|
iconst 9
|
||||||
@@ -842,7 +842,7 @@ LABEL699:
|
|||||||
iconst -1
|
iconst -1
|
||||||
invoke 5517
|
invoke 5517
|
||||||
LABEL705:
|
LABEL705:
|
||||||
jump LABEL817
|
jump LABEL804
|
||||||
LABEL706:
|
LABEL706:
|
||||||
iload 5
|
iload 5
|
||||||
iconst 2
|
iconst 2
|
||||||
@@ -858,17 +858,17 @@ LABEL710:
|
|||||||
iconst 0
|
iconst 0
|
||||||
iload 9
|
iload 9
|
||||||
invoke 5517
|
invoke 5517
|
||||||
jump LABEL817
|
jump LABEL804
|
||||||
LABEL720:
|
LABEL720:
|
||||||
iload 4
|
iload 4
|
||||||
iconst 1
|
iconst 1
|
||||||
if_icmpeq LABEL724
|
if_icmpeq LABEL724
|
||||||
jump LABEL811
|
jump LABEL798
|
||||||
LABEL724:
|
LABEL724:
|
||||||
iload 2
|
iload 2
|
||||||
iconst 2
|
iconst 2
|
||||||
if_icmpgt LABEL728
|
if_icmpgt LABEL728
|
||||||
jump LABEL804
|
jump LABEL791
|
||||||
LABEL728:
|
LABEL728:
|
||||||
get_varc_string 335
|
get_varc_string 335
|
||||||
sconst "::toggleroof"
|
sconst "::toggleroof"
|
||||||
@@ -876,80 +876,62 @@ LABEL728:
|
|||||||
string_indexof_string
|
string_indexof_string
|
||||||
iconst 0
|
iconst 0
|
||||||
if_icmpeq LABEL735
|
if_icmpeq LABEL735
|
||||||
jump LABEL763
|
|
||||||
LABEL735:
|
|
||||||
getremoveroofs
|
|
||||||
iconst 1
|
|
||||||
if_icmpeq LABEL739
|
|
||||||
jump LABEL751
|
|
||||||
LABEL739:
|
|
||||||
iconst 0
|
|
||||||
setremoveroofs
|
|
||||||
get_varbit 12378
|
|
||||||
iconst 0
|
|
||||||
if_icmpeq LABEL745
|
|
||||||
jump LABEL748
|
|
||||||
LABEL745:
|
|
||||||
sconst "Roofs will only be removed selectively."
|
|
||||||
mes
|
|
||||||
jump LABEL750
|
jump LABEL750
|
||||||
LABEL748:
|
LABEL735:
|
||||||
|
iconst 1
|
||||||
|
3215
|
||||||
|
iconst 1
|
||||||
|
if_icmpeq LABEL740
|
||||||
|
jump LABEL745
|
||||||
|
LABEL740:
|
||||||
|
iconst 0
|
||||||
|
invoke 4583
|
||||||
sconst "Roofs will only be removed selectively. This setting will not be saved."
|
sconst "Roofs will only be removed selectively. This setting will not be saved."
|
||||||
mes
|
mes
|
||||||
LABEL750:
|
jump LABEL749
|
||||||
jump LABEL762
|
LABEL745:
|
||||||
LABEL751:
|
|
||||||
iconst 1
|
iconst 1
|
||||||
setremoveroofs
|
invoke 4583
|
||||||
get_varbit 12378
|
|
||||||
iconst 1
|
|
||||||
if_icmpeq LABEL757
|
|
||||||
jump LABEL760
|
|
||||||
LABEL757:
|
|
||||||
sconst "Roofs are now all hidden."
|
|
||||||
mes
|
|
||||||
jump LABEL762
|
|
||||||
LABEL760:
|
|
||||||
sconst "Roofs are now all hidden. This setting will not be saved."
|
sconst "Roofs are now all hidden. This setting will not be saved."
|
||||||
mes
|
mes
|
||||||
LABEL762:
|
LABEL749:
|
||||||
jump LABEL803
|
jump LABEL790
|
||||||
LABEL763:
|
LABEL750:
|
||||||
get_varc_string 335
|
get_varc_string 335
|
||||||
sconst "::wiki "
|
sconst "::wiki "
|
||||||
iconst 0
|
iconst 0
|
||||||
string_indexof_string
|
string_indexof_string
|
||||||
iconst 0
|
iconst 0
|
||||||
if_icmpeq LABEL775
|
if_icmpeq LABEL762
|
||||||
get_varc_string 335
|
get_varc_string 335
|
||||||
sconst "::wiki"
|
sconst "::wiki"
|
||||||
compare
|
compare
|
||||||
iconst 0
|
iconst 0
|
||||||
if_icmpeq LABEL775
|
if_icmpeq LABEL762
|
||||||
sconst "runeliteCommand" ; load callback name
|
sconst "runeliteCommand" ; load callback name
|
||||||
runelite_callback ; invoke callback
|
runelite_callback ; invoke callback
|
||||||
jump LABEL778
|
jump LABEL765
|
||||||
LABEL775:
|
LABEL762:
|
||||||
get_varc_string 335
|
get_varc_string 335
|
||||||
invoke 3299
|
invoke 3299
|
||||||
jump LABEL803
|
jump LABEL790
|
||||||
LABEL778:
|
LABEL765:
|
||||||
get_varc_string 335
|
get_varc_string 335
|
||||||
sconst "::bank"
|
sconst "::bank"
|
||||||
iconst 0
|
iconst 0
|
||||||
string_indexof_string
|
string_indexof_string
|
||||||
iconst 0
|
iconst 0
|
||||||
if_icmpeq LABEL785
|
if_icmpeq LABEL772
|
||||||
jump LABEL792
|
jump LABEL779
|
||||||
LABEL785:
|
LABEL772:
|
||||||
sconst "Hey, everyone, I just tried to do something very silly!"
|
sconst "Hey, everyone, I just tried to do something very silly!"
|
||||||
iconst 0
|
iconst 0
|
||||||
iconst -1
|
iconst -1
|
||||||
iconst 0
|
iconst 0
|
||||||
iconst -1
|
iconst -1
|
||||||
invoke 5517
|
invoke 5517
|
||||||
jump LABEL803
|
jump LABEL790
|
||||||
LABEL792:
|
LABEL779:
|
||||||
get_varc_string 335
|
get_varc_string 335
|
||||||
invoke 224
|
invoke 224
|
||||||
set_varc_string 335
|
set_varc_string 335
|
||||||
@@ -961,97 +943,97 @@ LABEL792:
|
|||||||
iload 2
|
iload 2
|
||||||
substring
|
substring
|
||||||
docheat
|
docheat
|
||||||
LABEL803:
|
LABEL790:
|
||||||
jump LABEL810
|
jump LABEL797
|
||||||
LABEL804:
|
LABEL791:
|
||||||
get_varc_string 335
|
get_varc_string 335
|
||||||
iconst 0
|
iconst 0
|
||||||
iconst -1
|
iconst -1
|
||||||
iconst 0
|
iconst 0
|
||||||
iconst -1
|
iconst -1
|
||||||
invoke 5517
|
invoke 5517
|
||||||
LABEL810:
|
LABEL797:
|
||||||
jump LABEL817
|
jump LABEL804
|
||||||
LABEL811:
|
LABEL798:
|
||||||
get_varc_string 335
|
get_varc_string 335
|
||||||
iconst 0
|
iconst 0
|
||||||
iconst -1
|
iconst -1
|
||||||
iconst 1
|
iconst 1
|
||||||
iload 9
|
iload 9
|
||||||
invoke 5517
|
invoke 5517
|
||||||
LABEL817:
|
LABEL804:
|
||||||
get_varc_string 335
|
get_varc_string 335
|
||||||
invoke 77
|
invoke 77
|
||||||
sconst ""
|
sconst ""
|
||||||
set_varc_string 335
|
set_varc_string 335
|
||||||
LABEL821:
|
LABEL808:
|
||||||
jump LABEL897
|
jump LABEL884
|
||||||
LABEL822:
|
LABEL809:
|
||||||
iload 0
|
iload 0
|
||||||
iconst 104
|
iconst 104
|
||||||
if_icmpeq LABEL826
|
if_icmpeq LABEL813
|
||||||
jump LABEL832
|
jump LABEL819
|
||||||
LABEL826:
|
LABEL813:
|
||||||
iload 3
|
iload 3
|
||||||
iconst 1
|
iconst 1
|
||||||
if_icmpeq LABEL830
|
if_icmpeq LABEL817
|
||||||
jump LABEL831
|
jump LABEL818
|
||||||
LABEL830:
|
LABEL817:
|
||||||
invoke 75
|
invoke 75
|
||||||
LABEL831:
|
LABEL818:
|
||||||
jump LABEL897
|
jump LABEL884
|
||||||
LABEL832:
|
LABEL819:
|
||||||
iload 0
|
iload 0
|
||||||
iconst 105
|
iconst 105
|
||||||
if_icmpeq LABEL836
|
if_icmpeq LABEL823
|
||||||
jump LABEL842
|
jump LABEL829
|
||||||
LABEL836:
|
LABEL823:
|
||||||
iload 3
|
iload 3
|
||||||
iconst 1
|
iconst 1
|
||||||
if_icmpeq LABEL840
|
if_icmpeq LABEL827
|
||||||
jump LABEL841
|
jump LABEL828
|
||||||
LABEL840:
|
LABEL827:
|
||||||
invoke 76
|
invoke 76
|
||||||
LABEL841:
|
LABEL828:
|
||||||
jump LABEL897
|
jump LABEL884
|
||||||
LABEL842:
|
LABEL829:
|
||||||
iload 0
|
iload 0
|
||||||
iconst 80
|
iconst 80
|
||||||
if_icmpeq LABEL846
|
if_icmpeq LABEL833
|
||||||
jump LABEL891
|
jump LABEL878
|
||||||
LABEL846:
|
LABEL833:
|
||||||
iconst 40697936
|
iconst 40697936
|
||||||
iconst 1
|
iconst 1
|
||||||
cc_find
|
cc_find
|
||||||
iconst 1
|
iconst 1
|
||||||
if_icmpeq LABEL852
|
if_icmpeq LABEL839
|
||||||
jump LABEL853
|
jump LABEL840
|
||||||
LABEL852:
|
LABEL839:
|
||||||
return
|
return
|
||||||
LABEL853:
|
LABEL840:
|
||||||
get_varc_string 356
|
get_varc_string 356
|
||||||
string_length
|
string_length
|
||||||
iconst 0
|
iconst 0
|
||||||
if_icmpgt LABEL858
|
if_icmpgt LABEL845
|
||||||
jump LABEL878
|
jump LABEL865
|
||||||
LABEL858:
|
LABEL845:
|
||||||
get_varc_string 356
|
get_varc_string 356
|
||||||
friend_test
|
friend_test
|
||||||
iconst 1
|
iconst 1
|
||||||
if_icmpeq LABEL863
|
if_icmpeq LABEL850
|
||||||
jump LABEL866
|
jump LABEL853
|
||||||
LABEL863:
|
LABEL850:
|
||||||
get_varc_string 356
|
get_varc_string 356
|
||||||
invoke 107
|
invoke 107
|
||||||
return
|
return
|
||||||
LABEL866:
|
LABEL853:
|
||||||
get_varc_int 60
|
get_varc_int 60
|
||||||
clientclock
|
clientclock
|
||||||
if_icmpgt LABEL870
|
if_icmpgt LABEL857
|
||||||
jump LABEL871
|
jump LABEL858
|
||||||
LABEL870:
|
LABEL857:
|
||||||
return
|
return
|
||||||
LABEL871:
|
LABEL858:
|
||||||
clientclock
|
clientclock
|
||||||
iconst 50
|
iconst 50
|
||||||
add
|
add
|
||||||
@@ -1059,14 +1041,14 @@ LABEL871:
|
|||||||
sconst "That player was not found on your Friends list."
|
sconst "That player was not found on your Friends list."
|
||||||
mes
|
mes
|
||||||
return
|
return
|
||||||
LABEL878:
|
LABEL865:
|
||||||
get_varc_int 60
|
get_varc_int 60
|
||||||
clientclock
|
clientclock
|
||||||
if_icmpgt LABEL882
|
if_icmpgt LABEL869
|
||||||
jump LABEL883
|
jump LABEL870
|
||||||
LABEL882:
|
LABEL869:
|
||||||
return
|
return
|
||||||
LABEL883:
|
LABEL870:
|
||||||
clientclock
|
clientclock
|
||||||
iconst 50
|
iconst 50
|
||||||
add
|
add
|
||||||
@@ -1074,8 +1056,8 @@ LABEL883:
|
|||||||
sconst "You haven't received any messages to which you can reply."
|
sconst "You haven't received any messages to which you can reply."
|
||||||
mes
|
mes
|
||||||
return
|
return
|
||||||
jump LABEL897
|
jump LABEL884
|
||||||
LABEL891:
|
LABEL878:
|
||||||
get_varc_string 335
|
get_varc_string 335
|
||||||
iconst 0
|
iconst 0
|
||||||
iload 0
|
iload 0
|
||||||
@@ -1087,9 +1069,9 @@ LABEL891:
|
|||||||
runelite_callback ;
|
runelite_callback ;
|
||||||
if_icmpeq SKIPSETVARC ; skip setting varc with input
|
if_icmpeq SKIPSETVARC ; skip setting varc with input
|
||||||
set_varc_string 335
|
set_varc_string 335
|
||||||
jump LABEL897 ; jump over SKIPSETVARC
|
jump LABEL884 ; jump over SKIPSETVARC
|
||||||
SKIPSETVARC:
|
SKIPSETVARC:
|
||||||
pop_string ; pop message
|
pop_string ; pop message
|
||||||
LABEL897:
|
LABEL884:
|
||||||
invoke 223
|
invoke 223
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -25,9 +25,12 @@
|
|||||||
package net.runelite.client.menus;
|
package net.runelite.client.menus;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Setter;
|
||||||
import net.runelite.api.MenuAction;
|
import net.runelite.api.MenuAction;
|
||||||
import net.runelite.api.MenuEntry;
|
import net.runelite.api.MenuEntry;
|
||||||
|
import net.runelite.api.widgets.Widget;
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class TestMenuEntry implements MenuEntry
|
public class TestMenuEntry implements MenuEntry
|
||||||
@@ -39,6 +42,12 @@ public class TestMenuEntry implements MenuEntry
|
|||||||
private int param0;
|
private int param0;
|
||||||
private int param1;
|
private int param1;
|
||||||
private boolean forceLeftClick;
|
private boolean forceLeftClick;
|
||||||
|
@Setter
|
||||||
|
private int itemOp = -1;
|
||||||
|
@Setter
|
||||||
|
private int itemId = -1;
|
||||||
|
@Setter
|
||||||
|
private Widget widget;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOption()
|
public String getOption()
|
||||||
@@ -205,4 +214,29 @@ public class TestMenuEntry implements MenuEntry
|
|||||||
{
|
{
|
||||||
return MenuAction.of(this.type);
|
return MenuAction.of(this.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemOp()
|
||||||
|
{
|
||||||
|
return itemOp != -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemOp()
|
||||||
|
{
|
||||||
|
return itemOp;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemId()
|
||||||
|
{
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Widget getWidget()
|
||||||
|
{
|
||||||
|
return widget;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ import org.junit.Test;
|
|||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
|
import static org.mockito.Mockito.lenient;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
@@ -164,10 +165,10 @@ public class ClueScrollPluginTest
|
|||||||
plugin.onGameTick(new GameTick());
|
plugin.onGameTick(new GameTick());
|
||||||
|
|
||||||
// Simulate clicking on the STASH
|
// Simulate clicking on the STASH
|
||||||
MenuOptionClicked menuOptionClicked = new MenuOptionClicked();
|
MenuOptionClicked menuOptionClicked = mock(MenuOptionClicked.class);
|
||||||
menuOptionClicked.setMenuOption("Search");
|
when(menuOptionClicked.getMenuOption()).thenReturn("Search");
|
||||||
menuOptionClicked.setMenuTarget("<col=ffff>STASH unit (easy)");
|
lenient().when(menuOptionClicked.getMenuTarget()).thenReturn("<col=ffff>STASH unit (easy)");
|
||||||
menuOptionClicked.setId(NullObjectID.NULL_28983);
|
when(menuOptionClicked.getId()).thenReturn(NullObjectID.NULL_28983);
|
||||||
plugin.onMenuOptionClicked(menuOptionClicked);
|
plugin.onMenuOptionClicked(menuOptionClicked);
|
||||||
|
|
||||||
// Check that the STASH is stored after withdrawing
|
// Check that the STASH is stored after withdrawing
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ import net.runelite.api.NPC;
|
|||||||
import net.runelite.api.NPCComposition;
|
import net.runelite.api.NPCComposition;
|
||||||
import net.runelite.api.ObjectComposition;
|
import net.runelite.api.ObjectComposition;
|
||||||
import net.runelite.api.events.ClientTick;
|
import net.runelite.api.events.ClientTick;
|
||||||
import net.runelite.api.events.MenuEntryAdded;
|
|
||||||
import net.runelite.client.chat.ChatMessageManager;
|
import net.runelite.client.chat.ChatMessageManager;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.game.ItemManager;
|
import net.runelite.client.game.ItemManager;
|
||||||
@@ -332,14 +331,7 @@ public class MenuEntrySwapperPluginTest
|
|||||||
menu("Deposit-1", "Abyssal whip", MenuAction.CC_OP, 2),
|
menu("Deposit-1", "Abyssal whip", MenuAction.CC_OP, 2),
|
||||||
};
|
};
|
||||||
|
|
||||||
menuEntrySwapperPlugin.onMenuEntryAdded(new MenuEntryAdded(
|
menuEntrySwapperPlugin.onClientTick(new ClientTick());
|
||||||
"Deposit-1",
|
|
||||||
"Abyssal whip",
|
|
||||||
MenuAction.CC_OP.getId(),
|
|
||||||
2,
|
|
||||||
-1,
|
|
||||||
-1
|
|
||||||
));
|
|
||||||
|
|
||||||
ArgumentCaptor<MenuEntry[]> argumentCaptor = ArgumentCaptor.forClass(MenuEntry[].class);
|
ArgumentCaptor<MenuEntry[]> argumentCaptor = ArgumentCaptor.forClass(MenuEntry[].class);
|
||||||
verify(client).setMenuEntries(argumentCaptor.capture());
|
verify(client).setMenuEntries(argumentCaptor.capture());
|
||||||
@@ -364,14 +356,7 @@ public class MenuEntrySwapperPluginTest
|
|||||||
menu("Deposit-1", "Rune arrow", MenuAction.CC_OP, 2),
|
menu("Deposit-1", "Rune arrow", MenuAction.CC_OP, 2),
|
||||||
};
|
};
|
||||||
|
|
||||||
menuEntrySwapperPlugin.onMenuEntryAdded(new MenuEntryAdded(
|
menuEntrySwapperPlugin.onClientTick(new ClientTick());
|
||||||
"Deposit-1",
|
|
||||||
"Rune arrow",
|
|
||||||
MenuAction.CC_OP.getId(),
|
|
||||||
2,
|
|
||||||
-1,
|
|
||||||
-1
|
|
||||||
));
|
|
||||||
|
|
||||||
ArgumentCaptor<MenuEntry[]> argumentCaptor = ArgumentCaptor.forClass(MenuEntry[].class);
|
ArgumentCaptor<MenuEntry[]> argumentCaptor = ArgumentCaptor.forClass(MenuEntry[].class);
|
||||||
verify(client).setMenuEntries(argumentCaptor.capture());
|
verify(client).setMenuEntries(argumentCaptor.capture());
|
||||||
|
|||||||
Reference in New Issue
Block a user