Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -137,7 +137,7 @@ public class RuneLiteProperties
|
||||
public static HttpUrl getPluginHubBase()
|
||||
{
|
||||
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()
|
||||
|
||||
@@ -50,7 +50,7 @@ import okhttp3.Response;
|
||||
@Slf4j
|
||||
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 final OkHttpClient client;
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ExternalPluginClient
|
||||
}
|
||||
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 javax.inject.Inject;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.AnimationID;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
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.MenuOptionClicked;
|
||||
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.callback.ClientThread;
|
||||
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",
|
||||
tags = {"combat", "notifications", "ranged", "overlay"}
|
||||
)
|
||||
@Slf4j
|
||||
public class CannonPlugin extends Plugin
|
||||
{
|
||||
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
|
||||
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 ItemContainer items = client.getItemContainer(InventoryID.INVENTORY);
|
||||
if (items == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
final Item item = items.getItem(idx);
|
||||
if (item == null || (item.getId() != ItemID.CANNONBALL && item.getId() != ItemID.GRANITE_CANNONBALL))
|
||||
final Widget selected = client.getSelectedWidget();
|
||||
final int itemId = selected.getItemId();
|
||||
if (itemId != ItemID.CANNONBALL && itemId != ItemID.GRANITE_CANNONBALL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -306,6 +305,7 @@ public class CannonPlugin extends Plugin
|
||||
|
||||
// Store the click location as a WorldPoint to avoid issues with scene loads
|
||||
clickedCannonLocation = WorldPoint.fromScene(client, event.getParam0(), event.getParam1(), client.getPlane());
|
||||
log.debug("Updated cannon location: {}", clickedCannonLocation);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -325,14 +325,8 @@ public class ClueScrollPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean itemClicked = event.getMenuAction() == MenuAction.ITEM_FIRST_OPTION
|
||||
|| event.getMenuAction() == MenuAction.ITEM_SECOND_OPTION
|
||||
|| 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 boolean isXMarksTheSpotOrb = event.getItemId() == ItemID.MYSTERIOUS_ORB_23069;
|
||||
if (isXMarksTheSpotOrb || event.getMenuOption().equals("Read"))
|
||||
{
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(event.getId());
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ import okhttp3.Response;
|
||||
public class CrowdsourcingManager
|
||||
{
|
||||
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
|
||||
private OkHttpClient okHttpClient;
|
||||
|
||||
@@ -37,6 +37,7 @@ import net.runelite.api.Skill;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.plugins.crowdsourcing.CrowdsourcingManager;
|
||||
|
||||
@@ -114,7 +115,8 @@ public class CrowdsourcingCooking
|
||||
|| action == MenuAction.GAME_OBJECT_SECOND_OPTION
|
||||
|| action == MenuAction.GAME_OBJECT_THIRD_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();
|
||||
}
|
||||
|
||||
@@ -77,7 +77,11 @@ public class CrowdsourcingZMI
|
||||
public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked)
|
||||
{
|
||||
MenuAction action = menuOptionClicked.getMenuAction();
|
||||
|
||||
if (menuOptionClicked.isItemOp())
|
||||
{
|
||||
illegalActionTick = client.getTickCount();
|
||||
return;
|
||||
}
|
||||
switch (action)
|
||||
{
|
||||
case ITEM_FIRST_OPTION:
|
||||
|
||||
@@ -516,8 +516,8 @@ class WidgetInspector extends DevToolsFrame
|
||||
for (int i = 0; i < menuEntries.length; i++)
|
||||
{
|
||||
MenuEntry entry = menuEntries[i];
|
||||
if (entry.getType() != MenuAction.ITEM_USE_ON_WIDGET
|
||||
&& entry.getType() != MenuAction.SPELL_CAST_ON_WIDGET)
|
||||
if (entry.getType() != MenuAction.WIDGET_USE_ON_ITEM
|
||||
&& entry.getType() != MenuAction.WIDGET_TARGET_ON_WIDGET)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -543,7 +543,7 @@ class WidgetInspector extends DevToolsFrame
|
||||
|
||||
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);
|
||||
if (param0 != -1)
|
||||
@@ -553,7 +553,7 @@ class WidgetInspector extends DevToolsFrame
|
||||
|
||||
return w;
|
||||
}
|
||||
else if (type == MenuAction.ITEM_USE_ON_WIDGET)
|
||||
else if (type == MenuAction.WIDGET_USE_ON_ITEM)
|
||||
{
|
||||
Widget w = client.getWidget(param1);
|
||||
return w.getWidgetItem(param0);
|
||||
|
||||
@@ -54,10 +54,7 @@ import lombok.Setter;
|
||||
import lombok.Value;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.MenuAction;
|
||||
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.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
@@ -485,7 +483,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
MenuAction type = MenuAction.of(event.getType());
|
||||
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_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 sceneX = event.getActionParam0();
|
||||
@@ -688,28 +686,16 @@ public class GroundItemsPlugin extends Plugin
|
||||
@Subscribe
|
||||
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
|
||||
// item spawns that are drops
|
||||
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);
|
||||
if (inventory == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Item clickedItem = inventory.getItem(menuOptionClicked.getSelectedItemIndex());
|
||||
if (clickedItem == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lastUsedItem = clickedItem.getId();
|
||||
lastUsedItem = client.getSelectedWidget().getItemId();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ class InteractHighlightOverlay extends Overlay
|
||||
switch (menuAction)
|
||||
{
|
||||
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_SECOND_OPTION:
|
||||
case GAME_OBJECT_THIRD_OPTION:
|
||||
@@ -104,7 +104,7 @@ class InteractHighlightOverlay extends Overlay
|
||||
break;
|
||||
}
|
||||
case ITEM_USE_ON_NPC:
|
||||
case SPELL_CAST_ON_NPC:
|
||||
case WIDGET_TARGET_ON_NPC:
|
||||
case NPC_FIRST_OPTION:
|
||||
case NPC_SECOND_OPTION:
|
||||
case NPC_THIRD_OPTION:
|
||||
@@ -116,7 +116,7 @@ class InteractHighlightOverlay extends Overlay
|
||||
NPC npc = plugin.findNpc(id);
|
||||
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();
|
||||
modelOutlineRenderer.drawOutline(npc, config.borderWidth(), highlightColor, config.outlineFeather());
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class InteractHighlightPlugin extends Plugin
|
||||
switch (menuOptionClicked.getMenuAction())
|
||||
{
|
||||
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_SECOND_OPTION:
|
||||
case GAME_OBJECT_THIRD_OPTION:
|
||||
@@ -158,7 +158,7 @@ public class InteractHighlightPlugin extends Plugin
|
||||
break;
|
||||
}
|
||||
case ITEM_USE_ON_NPC:
|
||||
case SPELL_CAST_ON_NPC:
|
||||
case WIDGET_TARGET_ON_NPC:
|
||||
case NPC_FIRST_OPTION:
|
||||
case NPC_SECOND_OPTION:
|
||||
case NPC_THIRD_OPTION:
|
||||
@@ -168,7 +168,7 @@ public class InteractHighlightPlugin extends Plugin
|
||||
int id = menuOptionClicked.getId();
|
||||
interactedObject = null;
|
||||
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();
|
||||
gameCycle = client.getGameCycle();
|
||||
break;
|
||||
@@ -176,8 +176,11 @@ public class InteractHighlightPlugin extends Plugin
|
||||
// Any menu click which clears an interaction
|
||||
case WALK:
|
||||
case ITEM_USE:
|
||||
case WIDGET_TARGET_ON_WIDGET:
|
||||
case ITEM_USE_ON_GROUND_ITEM:
|
||||
case WIDGET_TARGET_ON_GROUND_ITEM:
|
||||
case ITEM_USE_ON_PLAYER:
|
||||
case WIDGET_TARGET_ON_PLAYER:
|
||||
case ITEM_FIRST_OPTION:
|
||||
case ITEM_SECOND_OPTION:
|
||||
case ITEM_THIRD_OPTION:
|
||||
@@ -190,6 +193,13 @@ public class InteractHighlightPlugin extends Plugin
|
||||
case GROUND_ITEM_FIFTH_OPTION:
|
||||
interactedObject = null;
|
||||
interactedNpc = null;
|
||||
break;
|
||||
default:
|
||||
if (menuOptionClicked.isItemOp())
|
||||
{
|
||||
interactedObject = null;
|
||||
interactedNpc = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -164,42 +164,43 @@ public class InventoryTagsPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
final int widgetId = firstEntry.getParam1();
|
||||
|
||||
// Inventory item menu
|
||||
if (widgetId == WidgetInfo.INVENTORY.getId())
|
||||
final int itemId;
|
||||
if (firstEntry.getType() == MenuAction.WIDGET_TARGET && firstEntry.getWidget().getId() == WidgetInfo.INVENTORY.getId())
|
||||
{
|
||||
int itemId = firstEntry.getIdentifier();
|
||||
itemId = firstEntry.getWidget().getItemId();
|
||||
}
|
||||
else if (firstEntry.isItemOp())
|
||||
{
|
||||
itemId = firstEntry.getItemId();
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (itemId == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Set menu to only be Cancel
|
||||
client.setMenuEntries(Arrays.copyOf(client.getMenuEntries(), 1));
|
||||
|
||||
// Set menu to only be Cancel
|
||||
client.setMenuEntries(Arrays.copyOf(client.getMenuEntries(), 1));
|
||||
for (final String groupName : GROUPS)
|
||||
{
|
||||
final String group = getTag(itemId);
|
||||
final Color color = getGroupNameColor(groupName);
|
||||
|
||||
for (final String groupName : GROUPS)
|
||||
{
|
||||
final String group = getTag(itemId);
|
||||
final Color color = getGroupNameColor(groupName);
|
||||
|
||||
client.createMenuEntry(-1)
|
||||
.setOption(groupName.equals(group) ? MENU_REMOVE : MENU_SET)
|
||||
.setTarget(ColorUtil.prependColorTag(groupName, MoreObjects.firstNonNull(color, Color.WHITE)))
|
||||
.setType(MenuAction.RUNELITE)
|
||||
.onClick(e ->
|
||||
client.createMenuEntry(-1)
|
||||
.setOption(groupName.equals(group) ? MENU_REMOVE : MENU_SET)
|
||||
.setTarget(ColorUtil.prependColorTag(groupName, MoreObjects.firstNonNull(color, Color.WHITE)))
|
||||
.setType(MenuAction.RUNELITE)
|
||||
.onClick(e ->
|
||||
{
|
||||
if (e.getOption().equals(MENU_SET))
|
||||
{
|
||||
if (e.getOption().equals(MENU_SET))
|
||||
{
|
||||
setTag(itemId, groupName);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsetTag(itemId);
|
||||
}
|
||||
});
|
||||
}
|
||||
setTag(itemId, groupName);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsetTag(itemId);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,11 +98,20 @@ class ItemPricesOverlay extends Overlay
|
||||
// Tooltip action type handling
|
||||
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)
|
||||
{
|
||||
break;
|
||||
}
|
||||
// FALLTHROUGH
|
||||
case CC_OP:
|
||||
case ITEM_USE:
|
||||
case ITEM_FIRST_OPTION:
|
||||
@@ -110,38 +119,49 @@ class ItemPricesOverlay extends Overlay
|
||||
case ITEM_THIRD_OPTION:
|
||||
case ITEM_FOURTH_OPTION:
|
||||
case ITEM_FIFTH_OPTION:
|
||||
// Item tooltip values
|
||||
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;
|
||||
}
|
||||
addTooltip(menuEntry, isAlching, groupId);
|
||||
break;
|
||||
case WIDGET_TARGET:
|
||||
// Check that this is the inventory
|
||||
if (menuEntry.getWidget().getId() == WidgetInfo.INVENTORY.getId())
|
||||
{
|
||||
addTooltip(menuEntry, isAlching, groupId);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
// 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())));
|
||||
}
|
||||
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));
|
||||
}
|
||||
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));
|
||||
}
|
||||
else if (event.getMenuOption().equals("Open"))
|
||||
{
|
||||
switch (event.getId())
|
||||
switch (event.getItemId())
|
||||
{
|
||||
case ItemID.CASKET:
|
||||
onInvChange(collectInvItems(LootRecordType.EVENT, CASKET_EVENT));
|
||||
@@ -1004,7 +1004,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
case ItemID.SIMPLE_LOCKBOX_25647:
|
||||
case ItemID.ELABORATE_LOCKBOX_25649:
|
||||
case ItemID.ORNATE_LOCKBOX_25651:
|
||||
onInvChange(collectInvAndGroundItems(LootRecordType.EVENT, itemManager.getItemComposition(event.getId()).getName()));
|
||||
onInvChange(collectInvAndGroundItems(LootRecordType.EVENT, itemManager.getItemComposition(event.getItemId()).getName()));
|
||||
break;
|
||||
case ItemID.SUPPLY_CRATE_24884:
|
||||
onInvChange(collectInvItems(LootRecordType.EVENT, MAHOGANY_CRATE_EVENT, client.getBoostedSkillLevel(Skill.CONSTRUCTION)));
|
||||
@@ -1014,14 +1014,14 @@ public class LootTrackerPlugin extends Plugin
|
||||
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) ->
|
||||
{
|
||||
int cnt = removedItems.count(event.getId());
|
||||
int cnt = removedItems.count(event.getItemId());
|
||||
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);
|
||||
}
|
||||
}));
|
||||
@@ -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)
|
||||
{
|
||||
final int id = menuAction.getId();
|
||||
|
||||
@@ -57,7 +57,6 @@ import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.events.ClientTick;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOpened;
|
||||
import net.runelite.api.events.PostItemComposition;
|
||||
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,
|
||||
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(
|
||||
MenuAction.NPC_FIRST_OPTION,
|
||||
MenuAction.NPC_SECOND_OPTION,
|
||||
@@ -547,25 +537,27 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
MenuEntry firstEntry = event.getFirstEntry();
|
||||
final MenuEntry firstEntry = event.getFirstEntry();
|
||||
if (firstEntry == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int widgetId = firstEntry.getParam1();
|
||||
if (widgetId != WidgetInfo.INVENTORY.getId())
|
||||
final int itemId;
|
||||
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;
|
||||
}
|
||||
|
||||
int itemId = firstEntry.getIdentifier();
|
||||
if (itemId == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MenuAction activeAction = null;
|
||||
int activeOp = 0;
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||
|
||||
if (configuringShiftClick)
|
||||
@@ -576,7 +568,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
|
||||
if (shiftClickActionIndex >= 0)
|
||||
{
|
||||
activeAction = MenuAction.of(MenuAction.ITEM_FIRST_OPTION.getId() + shiftClickActionIndex);
|
||||
activeOp = 1 + shiftClickActionIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -584,7 +576,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
Integer config = getItemSwapConfig(true, itemId);
|
||||
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);
|
||||
if (config != null)
|
||||
{
|
||||
activeAction = config >= 0
|
||||
? MenuAction.of(MenuAction.ITEM_FIRST_OPTION.getId() + config)
|
||||
: MenuAction.ITEM_USE;
|
||||
activeOp = config >= 0
|
||||
? 1 + config
|
||||
: -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -604,20 +596,31 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
|
||||
for (MenuEntry entry : entries)
|
||||
{
|
||||
final MenuAction menuAction = entry.getType();
|
||||
|
||||
if (ITEM_MENU_TYPES.contains(menuAction) && entry.getIdentifier() == itemId)
|
||||
if (entry.getType() == MenuAction.WIDGET_TARGET && entry.getWidget().getId() == WidgetInfo.INVENTORY.getId() && entry.getWidget().getItemId() == itemId)
|
||||
{
|
||||
entry.setType(MenuAction.RUNELITE);
|
||||
entry.onClick(e ->
|
||||
{
|
||||
int index = menuAction == MenuAction.ITEM_USE
|
||||
? -1
|
||||
: menuAction.getId() - MenuAction.ITEM_FIRST_OPTION.getId();
|
||||
setItemSwapConfig(configuringShiftClick, itemId, index);
|
||||
log.debug("Set {} item swap for {} to USE", configuringShiftClick ? "shift" : "left", itemId);
|
||||
setItemSwapConfig(configuringShiftClick, itemId, -1);
|
||||
});
|
||||
|
||||
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());
|
||||
}
|
||||
@@ -803,15 +806,14 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded)
|
||||
private boolean swapBank(MenuEntry menuEntry, MenuAction type)
|
||||
{
|
||||
// This swap needs to happen prior to drag start on click, which happens during
|
||||
// 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
|
||||
|
||||
final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntryAdded.getActionParam1());
|
||||
if (type != MenuAction.CC_OP && type != MenuAction.CC_OP_LOW_PRIORITY)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntry.getParam1());
|
||||
final boolean isDepositBoxPlayerInventory = widgetGroupId == WidgetID.DEPOSIT_BOX_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;
|
||||
@@ -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 2 is the current withdraw amount 1/5/10/x for bank interface
|
||||
if (shiftModifier() && config.bankDepositShiftClick() != ShiftDepositMode.OFF
|
||||
&& menuEntryAdded.getType() == MenuAction.CC_OP.getId()
|
||||
&& menuEntryAdded.getIdentifier() == (isDepositBoxPlayerInventory || isGroupStoragePlayerInventory || isChambersOfXericStorageUnitPlayerInventory ? 1 : 2)
|
||||
&& (menuEntryAdded.getOption().startsWith("Deposit-") || menuEntryAdded.getOption().startsWith("Store") || menuEntryAdded.getOption().startsWith("Donate")))
|
||||
&& type == MenuAction.CC_OP
|
||||
&& menuEntry.getIdentifier() == (isDepositBoxPlayerInventory || isGroupStoragePlayerInventory || isChambersOfXericStorageUnitPlayerInventory ? 1 : 2)
|
||||
&& (menuEntry.getOption().startsWith("Deposit-") || menuEntry.getOption().startsWith("Store") || menuEntry.getOption().startsWith("Donate")))
|
||||
{
|
||||
ShiftDepositMode shiftDepositMode = config.bankDepositShiftClick();
|
||||
final int opId = isDepositBoxPlayerInventory ? shiftDepositMode.getIdentifierDepositBox()
|
||||
@@ -830,13 +832,14 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
: shiftDepositMode.getIdentifier();
|
||||
final MenuAction action = opId >= 6 ? MenuAction.CC_OP_LOW_PRIORITY : MenuAction.CC_OP;
|
||||
bankModeSwap(action, opId);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Swap to shift-click withdraw behavior
|
||||
// Deposit- op 1 is the current withdraw amount 1/5/10/x
|
||||
if (shiftModifier() && config.bankWithdrawShiftClick() != ShiftWithdrawMode.OFF
|
||||
&& menuEntryAdded.getType() == MenuAction.CC_OP.getId() && menuEntryAdded.getIdentifier() == 1
|
||||
&& menuEntryAdded.getOption().startsWith("Withdraw"))
|
||||
&& type == MenuAction.CC_OP && menuEntry.getIdentifier() == 1
|
||||
&& menuEntry.getOption().startsWith("Withdraw"))
|
||||
{
|
||||
ShiftWithdrawMode shiftWithdrawMode = config.bankWithdrawShiftClick();
|
||||
final MenuAction action;
|
||||
@@ -852,7 +855,10 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
opId = shiftWithdrawMode.getIdentifier();
|
||||
}
|
||||
bankModeSwap(action, opId);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void bankModeSwap(MenuAction entryType, int entryIdentifier)
|
||||
@@ -893,19 +899,15 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean itemOp = menuAction == MenuAction.ITEM_FIRST_OPTION
|
||||
|| menuAction == MenuAction.ITEM_SECOND_OPTION
|
||||
|| menuAction == MenuAction.ITEM_THIRD_OPTION
|
||||
|| menuAction == MenuAction.ITEM_FOURTH_OPTION
|
||||
|| menuAction == MenuAction.ITEM_FIFTH_OPTION
|
||||
|| menuAction == MenuAction.ITEM_USE;
|
||||
final boolean itemOp = menuEntry.isItemOp();
|
||||
// Custom shift-click item swap
|
||||
if (shiftModifier() && itemOp)
|
||||
{
|
||||
// Special case use shift click due to items not actually containing a "Use" option, making
|
||||
// the client unable to perform the swap itself.
|
||||
if (config.shiftClickCustomization() && !option.equals("use"))
|
||||
{
|
||||
Integer customOption = getItemSwapConfig(true, eventId);
|
||||
Integer customOption = getItemSwapConfig(true, menuEntry.getItemId());
|
||||
|
||||
if (customOption != null && customOption == -1)
|
||||
{
|
||||
@@ -921,14 +923,18 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
// Custom left-click item swap
|
||||
if (itemOp)
|
||||
{
|
||||
Integer swapIndex = getItemSwapConfig(false, eventId);
|
||||
Integer swapIndex = getItemSwapConfig(false, menuEntry.getItemId());
|
||||
if (swapIndex != null)
|
||||
{
|
||||
MenuAction swapAction = swapIndex >= 0
|
||||
? MenuAction.of(MenuAction.ITEM_FIRST_OPTION.getId() + swapIndex)
|
||||
: MenuAction.ITEM_USE;
|
||||
final int swapAction = swapIndex >= 0
|
||||
? 1 + swapIndex
|
||||
: -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);
|
||||
}
|
||||
@@ -986,6 +992,11 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
if (swapBank(menuEntry, menuAction))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Built-in swaps
|
||||
Collection<Swap> swaps = this.swaps.get(option);
|
||||
for (Swap swap : swaps)
|
||||
|
||||
@@ -49,13 +49,13 @@ class MouseHighlightOverlay extends Overlay
|
||||
*/
|
||||
private static final Set<MenuAction> WIDGET_MENU_ACTIONS = ImmutableSet.of(
|
||||
MenuAction.WIDGET_TYPE_1,
|
||||
MenuAction.WIDGET_TYPE_2,
|
||||
MenuAction.WIDGET_TYPE_3,
|
||||
MenuAction.WIDGET_TARGET,
|
||||
MenuAction.WIDGET_CLOSE,
|
||||
MenuAction.WIDGET_TYPE_4,
|
||||
MenuAction.WIDGET_TYPE_5,
|
||||
MenuAction.WIDGET_TYPE_6,
|
||||
MenuAction.ITEM_USE_ON_WIDGET_ITEM,
|
||||
MenuAction.ITEM_USE_ON_WIDGET,
|
||||
MenuAction.WIDGET_CONTINUE,
|
||||
MenuAction.ITEM_USE_ON_ITEM,
|
||||
MenuAction.WIDGET_USE_ON_ITEM,
|
||||
MenuAction.ITEM_FIRST_OPTION,
|
||||
MenuAction.ITEM_SECOND_OPTION,
|
||||
MenuAction.ITEM_THIRD_OPTION,
|
||||
@@ -68,7 +68,7 @@ class MouseHighlightOverlay extends Overlay
|
||||
MenuAction.WIDGET_FOURTH_OPTION,
|
||||
MenuAction.WIDGET_FIFTH_OPTION,
|
||||
MenuAction.EXAMINE_ITEM,
|
||||
MenuAction.SPELL_CAST_ON_WIDGET,
|
||||
MenuAction.WIDGET_TARGET_ON_WIDGET,
|
||||
MenuAction.CC_OP_LOW_PRIORITY,
|
||||
MenuAction.CC_OP
|
||||
);
|
||||
|
||||
@@ -90,7 +90,7 @@ public class NpcIndicatorsPlugin extends Plugin
|
||||
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,
|
||||
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);
|
||||
|
||||
@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_THIRD_OPTION;
|
||||
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 net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.Player;
|
||||
@@ -124,7 +124,7 @@ public class PlayerIndicatorsPlugin extends Plugin
|
||||
MenuAction type = entry.getType();
|
||||
|
||||
if (type == WALK
|
||||
|| type == SPELL_CAST_ON_PLAYER
|
||||
|| type == WIDGET_TARGET_ON_PLAYER
|
||||
|| type == ITEM_USE_ON_PLAYER
|
||||
|| type == PLAYER_FIRST_OPTION
|
||||
|| type == PLAYER_SECOND_OPTION
|
||||
|
||||
@@ -266,8 +266,8 @@ public class WikiPlugin extends Plugin
|
||||
break optarget;
|
||||
case CANCEL:
|
||||
return;
|
||||
case ITEM_USE_ON_WIDGET:
|
||||
case SPELL_CAST_ON_GROUND_ITEM:
|
||||
case WIDGET_USE_ON_ITEM:
|
||||
case WIDGET_TARGET_ON_GROUND_ITEM:
|
||||
{
|
||||
type = "item";
|
||||
id = itemManager.canonicalize(ev.getId());
|
||||
@@ -275,7 +275,7 @@ public class WikiPlugin extends Plugin
|
||||
location = null;
|
||||
break;
|
||||
}
|
||||
case SPELL_CAST_ON_NPC:
|
||||
case WIDGET_TARGET_ON_NPC:
|
||||
{
|
||||
type = "npc";
|
||||
NPC npc = client.getCachedNPCs()[ev.getId()];
|
||||
@@ -285,7 +285,7 @@ public class WikiPlugin extends Plugin
|
||||
location = npc.getWorldLocation();
|
||||
break;
|
||||
}
|
||||
case SPELL_CAST_ON_GAME_OBJECT:
|
||||
case WIDGET_TARGET_ON_GAME_OBJECT:
|
||||
{
|
||||
type = "object";
|
||||
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());
|
||||
break;
|
||||
}
|
||||
case SPELL_CAST_ON_WIDGET:
|
||||
case WIDGET_TARGET_ON_WIDGET:
|
||||
Widget w = getWidget(ev.getParam1(), ev.getParam0());
|
||||
|
||||
if (w.getType() == WidgetType.GRAPHIC && w.getItemId() != -1)
|
||||
@@ -359,7 +359,7 @@ public class WikiPlugin extends Plugin
|
||||
int widgetIndex = event.getActionParam0();
|
||||
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();
|
||||
Widget w = getWidget(widgetID, widgetIndex);
|
||||
@@ -368,7 +368,7 @@ public class WikiPlugin extends Plugin
|
||||
for (int ourEntry = menuEntries.length - 1;ourEntry >= 0; 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());
|
||||
String name = itemManager.getItemComposition(id).getName();
|
||||
@@ -385,7 +385,7 @@ public class WikiPlugin extends Plugin
|
||||
MenuEntry[] oldEntries = menuEntries;
|
||||
menuEntries = Arrays.copyOf(menuEntries, menuEntries.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--)
|
||||
{
|
||||
menuEntries[ourEntry - 1] = oldEntries[ourEntry];
|
||||
|
||||
@@ -206,7 +206,7 @@ public class ClientLoader implements Supplier<Applet>
|
||||
|
||||
private RSConfig downloadConfig() throws IOException
|
||||
{
|
||||
HttpUrl url = HttpUrl.parse(javConfigUrl);
|
||||
HttpUrl url = HttpUrl.get(javConfigUrl);
|
||||
IOException err = null;
|
||||
for (int attempt = 0; attempt < NUM_ATTEMPTS; attempt++)
|
||||
{
|
||||
@@ -256,7 +256,7 @@ public class ClientLoader implements Supplier<Applet>
|
||||
@Nonnull
|
||||
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()))
|
||||
{
|
||||
@@ -326,13 +326,13 @@ public class ClientLoader implements Supplier<Applet>
|
||||
if (config.isFallback())
|
||||
{
|
||||
// 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
|
||||
{
|
||||
String codebase = config.getCodeBase();
|
||||
String initialJar = config.getInitialJar();
|
||||
url = HttpUrl.parse(codebase + initialJar);
|
||||
url = HttpUrl.get(codebase + initialJar);
|
||||
}
|
||||
|
||||
for (int attempt = 0; ; attempt++)
|
||||
|
||||
@@ -27,7 +27,6 @@ package net.runelite.client.ui;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.event.WindowAdapter;
|
||||
@@ -45,7 +44,6 @@ import javax.swing.JDialog;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.LinkBrowser;
|
||||
import net.runelite.client.util.VerificationException;
|
||||
import org.pushingpixels.substance.internal.SubstanceSynapse;
|
||||
|
||||
@Slf4j
|
||||
public class FatalErrorDialog extends JDialog
|
||||
@@ -70,16 +69,6 @@ public class FatalErrorDialog extends JDialog
|
||||
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
|
||||
{
|
||||
BufferedImage logo = ImageUtil.loadImageResource(FatalErrorDialog.class, "openosrs_transparent.png");
|
||||
@@ -108,8 +97,9 @@ public class FatalErrorDialog extends JDialog
|
||||
setTitle("Fatal error starting OpenOSRS");
|
||||
setLayout(new BorderLayout());
|
||||
|
||||
Container pane = getContentPane();
|
||||
JPanel pane = (JPanel) getContentPane();
|
||||
pane.setBackground(ColorScheme.DARKER_GRAY_COLOR);
|
||||
pane.putClientProperty(SubstanceSynapse.COLORIZATION_FACTOR, 1.0);
|
||||
|
||||
JPanel leftPane = new JPanel();
|
||||
leftPane.setBackground(ColorScheme.DARKER_GRAY_COLOR);
|
||||
@@ -130,6 +120,7 @@ public class FatalErrorDialog extends JDialog
|
||||
textArea.setWrapStyleWord(true);
|
||||
textArea.setBorder(new EmptyBorder(10, 10, 10, 10));
|
||||
textArea.setEditable(false);
|
||||
textArea.setOpaque(false);
|
||||
leftPane.add(textArea, BorderLayout.CENTER);
|
||||
|
||||
pane.add(leftPane, BorderLayout.CENTER);
|
||||
|
||||
@@ -68,8 +68,8 @@ import okhttp3.Response;
|
||||
public class ImageCapture
|
||||
{
|
||||
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 MediaType JSON = MediaType.parse("application/json");
|
||||
private static final HttpUrl IMGUR_IMAGE_UPLOAD_URL = HttpUrl.get("https://api.imgur.com/3/image");
|
||||
private static final MediaType JSON = MediaType.get("application/json");
|
||||
|
||||
private final Client client;
|
||||
private final Notifier notifier;
|
||||
|
||||
@@ -31,6 +31,11 @@ public class VerificationException extends Exception
|
||||
super(message);
|
||||
}
|
||||
|
||||
public VerificationException(Throwable cause)
|
||||
{
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public VerificationException(String message, Throwable cause)
|
||||
{
|
||||
super(message, cause);
|
||||
|
||||
@@ -1,19 +1,30 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDDDCCAfSgAwIBAgIJAK8uBanmNQZaMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
|
||||
BAMMEHJ1bmVsaXRlLXBsdWdpbnMwHhcNMTkxMjEyMjEwNzUxWhcNMjUxMjEwMjEw
|
||||
NzUxWjAbMRkwFwYDVQQDDBBydW5lbGl0ZS1wbHVnaW5zMIIBIjANBgkqhkiG9w0B
|
||||
AQEFAAOCAQ8AMIIBCgKCAQEApu11OVANSU+pHaXRxB7fIZapucJ6BT46neicEixs
|
||||
NVPuK/QRVjO/G8F++MXFD/tlZUOEDllDN8uaHBIVwxilqEVYL7oX65Esl7qqC1TZ
|
||||
WGdjiMyYoK3CXWEWB4w+CdB31T7JG2HqH45ZsVs+U9OVWBkNkL5nNQNPOmZFd+3A
|
||||
yCb9nGlO7SxduiHpwh3CV19jY47y8tevyo5qpaBuQeWtu3vbpeer0kbDarwD3xoF
|
||||
yUMPRK518gxRUSmOpsSG5viQ731mKVCUUfIXz91d3s+kJYAjORHS4zJe9s+1dljp
|
||||
oLYNLkaP6m3CmNtC84OxkmognvZTNMbiQ3GQm/BK4sdjPQIDAQABo1MwUTAdBgNV
|
||||
HQ4EFgQUxrkiRXNd0OHPMkqgl9UgV1//OuQwHwYDVR0jBBgwFoAUxrkiRXNd0OHP
|
||||
Mkqgl9UgV1//OuQwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEA
|
||||
StPyblz3aqOM5z2KqHX1B7Z3Q8B58g55YSefpcfwWEc6LT4HCztszcZDteWpV3W2
|
||||
ERfemkGKgsDhQ0qkzIt7tS5eNN3PPj7RZZm7vl5HquQ1vC/33ri/Z3CEKzbW7knt
|
||||
i1iEpx8E9DKb9J9DjdKwNxSomOyCOFUt9YoQJs80xc1mwPDd6aWR3xwvnEUimkm+
|
||||
Dbj7HMOXLeyN810wkeWcT8nC5GhxH3ZAmVExBHsaIOB876RntzshBehjY8s8JQhw
|
||||
R+fT1e8EhYMM9ylYDk1KIWFWrAujjU04lS9tXZ5C2e7fr9R953XN6Y0PNM/taNTU
|
||||
GzwGroJZI02V+1ADO14rRA==
|
||||
-----END CERTIFICATE-----
|
||||
MIIFFTCCAv2gAwIBAgIUHZQhtTfY+I19Gz+JKYfvT6IM55QwDQYJKoZIhvcNAQEL
|
||||
BQAwGjEYMBYGA1UEAwwPcnVuZWxpdGUtcGx1Z2luMB4XDTIyMDQxOTAxMjIzNFoX
|
||||
DTMyMDQxNjAxMjIzNFowGjEYMBYGA1UEAwwPcnVuZWxpdGUtcGx1Z2luMIICIjAN
|
||||
BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAw4Dkg5UBgD3X8UtChrnxCYaoe68J
|
||||
uuY+lESNROWb27EAEcLHo/DBbW0q0n6zL4vKjHs4Acsq+Z9kblyXN572851b8hur
|
||||
5CbHq0Uc4r1dUiMCYHjSJ/BkvGKMPs6Yo1CmzXqc9IPV/zoHC+yJH7R6hmIkLWu4
|
||||
CytXvmkIGEvOJoJ+LZyWcifBzX7Aua6IuWHHhTAxEcAxkrBFImfC9wgWD8sL/r2F
|
||||
Xyzo3jkv1LognWFbuMGQYgG+PvO8Ia+p8cko9YZnH3+SQmtr+VPbLD+VOAyDxhH1
|
||||
jX46SsSoB2sIIfCB3oNTERM1Wmy0xL5GYBj8PWOanWQY+rKku07SS8DBirkWRTVB
|
||||
lboNt60Di6FhrPnxTGA8DcxdYAJVZEQOS6ed540Bl40JMEdeMG66PGRDJJlIMyrc
|
||||
3xa8Z6XoKMV0QCv5ETBQwnED3lXsViFDoeC6wCww1ZjOFMwHfk5O6N5CsyJOEoGC
|
||||
Y9LiUwzLkf2po6LGLRrUsiDf/a+nsMUam5Zhmdt6a77wii+cH7oaAAieLk11u1qr
|
||||
Gc43gJtrzBY0thF5QiGtWlGHo7VY32Zlf9GnHkFSTTMdQX66VkWan6y080gr+HVn
|
||||
aP1oN9cxBrfWc0XMBGp+uZf60p7D9gbPQG0bJUF7GDtgcZt+b8NK9u8hnJZVi8oX
|
||||
AmLfUvCZ4Uv/sjMCAwEAAaNTMFEwHQYDVR0OBBYEFEFHyDZIF4aE3o+ChP3/Y6eO
|
||||
VsOQMB8GA1UdIwQYMBaAFEFHyDZIF4aE3o+ChP3/Y6eOVsOQMA8GA1UdEwEB/wQF
|
||||
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-----
|
||||
|
||||
@@ -1 +1 @@
|
||||
9B38CB6BF195C49B10D856C5F571AFDEC7BBEF96A4E3532F5B23E9341066144C
|
||||
3218E18002C110E4D44C9CB0C006BD5C052AC1CA8D07B32F2C67CBD866570F06
|
||||
@@ -90,13 +90,13 @@ LABEL60:
|
||||
iload 0
|
||||
iconst 84
|
||||
if_icmpeq LABEL76
|
||||
jump LABEL822
|
||||
jump LABEL809
|
||||
LABEL76:
|
||||
invoke 1984
|
||||
iload 2
|
||||
iconst 0
|
||||
if_icmpgt LABEL81
|
||||
jump LABEL821
|
||||
jump LABEL808
|
||||
LABEL81:
|
||||
iload 3
|
||||
iconst 1
|
||||
@@ -699,7 +699,7 @@ LABEL587:
|
||||
sconst "You are not chatting as a guest in a clan channel at the moment."
|
||||
mes
|
||||
LABEL589:
|
||||
jump LABEL817
|
||||
jump LABEL804
|
||||
LABEL590:
|
||||
iload 5
|
||||
iconst 41
|
||||
@@ -782,7 +782,7 @@ LABEL655:
|
||||
sconst "You are not chatting in the channel of your Clan at the moment."
|
||||
mes
|
||||
LABEL657:
|
||||
jump LABEL817
|
||||
jump LABEL804
|
||||
LABEL658:
|
||||
iload 5
|
||||
iconst 9
|
||||
@@ -842,7 +842,7 @@ LABEL699:
|
||||
iconst -1
|
||||
invoke 5517
|
||||
LABEL705:
|
||||
jump LABEL817
|
||||
jump LABEL804
|
||||
LABEL706:
|
||||
iload 5
|
||||
iconst 2
|
||||
@@ -858,17 +858,17 @@ LABEL710:
|
||||
iconst 0
|
||||
iload 9
|
||||
invoke 5517
|
||||
jump LABEL817
|
||||
jump LABEL804
|
||||
LABEL720:
|
||||
iload 4
|
||||
iconst 1
|
||||
if_icmpeq LABEL724
|
||||
jump LABEL811
|
||||
jump LABEL798
|
||||
LABEL724:
|
||||
iload 2
|
||||
iconst 2
|
||||
if_icmpgt LABEL728
|
||||
jump LABEL804
|
||||
jump LABEL791
|
||||
LABEL728:
|
||||
get_varc_string 335
|
||||
sconst "::toggleroof"
|
||||
@@ -876,80 +876,62 @@ LABEL728:
|
||||
string_indexof_string
|
||||
iconst 0
|
||||
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
|
||||
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."
|
||||
mes
|
||||
LABEL750:
|
||||
jump LABEL762
|
||||
LABEL751:
|
||||
jump LABEL749
|
||||
LABEL745:
|
||||
iconst 1
|
||||
setremoveroofs
|
||||
get_varbit 12378
|
||||
iconst 1
|
||||
if_icmpeq LABEL757
|
||||
jump LABEL760
|
||||
LABEL757:
|
||||
sconst "Roofs are now all hidden."
|
||||
mes
|
||||
jump LABEL762
|
||||
LABEL760:
|
||||
invoke 4583
|
||||
sconst "Roofs are now all hidden. This setting will not be saved."
|
||||
mes
|
||||
LABEL762:
|
||||
jump LABEL803
|
||||
LABEL763:
|
||||
LABEL749:
|
||||
jump LABEL790
|
||||
LABEL750:
|
||||
get_varc_string 335
|
||||
sconst "::wiki "
|
||||
iconst 0
|
||||
string_indexof_string
|
||||
iconst 0
|
||||
if_icmpeq LABEL775
|
||||
if_icmpeq LABEL762
|
||||
get_varc_string 335
|
||||
sconst "::wiki"
|
||||
compare
|
||||
iconst 0
|
||||
if_icmpeq LABEL775
|
||||
if_icmpeq LABEL762
|
||||
sconst "runeliteCommand" ; load callback name
|
||||
runelite_callback ; invoke callback
|
||||
jump LABEL778
|
||||
LABEL775:
|
||||
jump LABEL765
|
||||
LABEL762:
|
||||
get_varc_string 335
|
||||
invoke 3299
|
||||
jump LABEL803
|
||||
LABEL778:
|
||||
jump LABEL790
|
||||
LABEL765:
|
||||
get_varc_string 335
|
||||
sconst "::bank"
|
||||
iconst 0
|
||||
string_indexof_string
|
||||
iconst 0
|
||||
if_icmpeq LABEL785
|
||||
jump LABEL792
|
||||
LABEL785:
|
||||
if_icmpeq LABEL772
|
||||
jump LABEL779
|
||||
LABEL772:
|
||||
sconst "Hey, everyone, I just tried to do something very silly!"
|
||||
iconst 0
|
||||
iconst -1
|
||||
iconst 0
|
||||
iconst -1
|
||||
invoke 5517
|
||||
jump LABEL803
|
||||
LABEL792:
|
||||
jump LABEL790
|
||||
LABEL779:
|
||||
get_varc_string 335
|
||||
invoke 224
|
||||
set_varc_string 335
|
||||
@@ -961,97 +943,97 @@ LABEL792:
|
||||
iload 2
|
||||
substring
|
||||
docheat
|
||||
LABEL803:
|
||||
jump LABEL810
|
||||
LABEL804:
|
||||
LABEL790:
|
||||
jump LABEL797
|
||||
LABEL791:
|
||||
get_varc_string 335
|
||||
iconst 0
|
||||
iconst -1
|
||||
iconst 0
|
||||
iconst -1
|
||||
invoke 5517
|
||||
LABEL810:
|
||||
jump LABEL817
|
||||
LABEL811:
|
||||
LABEL797:
|
||||
jump LABEL804
|
||||
LABEL798:
|
||||
get_varc_string 335
|
||||
iconst 0
|
||||
iconst -1
|
||||
iconst 1
|
||||
iload 9
|
||||
invoke 5517
|
||||
LABEL817:
|
||||
LABEL804:
|
||||
get_varc_string 335
|
||||
invoke 77
|
||||
sconst ""
|
||||
set_varc_string 335
|
||||
LABEL821:
|
||||
jump LABEL897
|
||||
LABEL822:
|
||||
LABEL808:
|
||||
jump LABEL884
|
||||
LABEL809:
|
||||
iload 0
|
||||
iconst 104
|
||||
if_icmpeq LABEL826
|
||||
jump LABEL832
|
||||
LABEL826:
|
||||
if_icmpeq LABEL813
|
||||
jump LABEL819
|
||||
LABEL813:
|
||||
iload 3
|
||||
iconst 1
|
||||
if_icmpeq LABEL830
|
||||
jump LABEL831
|
||||
LABEL830:
|
||||
if_icmpeq LABEL817
|
||||
jump LABEL818
|
||||
LABEL817:
|
||||
invoke 75
|
||||
LABEL831:
|
||||
jump LABEL897
|
||||
LABEL832:
|
||||
LABEL818:
|
||||
jump LABEL884
|
||||
LABEL819:
|
||||
iload 0
|
||||
iconst 105
|
||||
if_icmpeq LABEL836
|
||||
jump LABEL842
|
||||
LABEL836:
|
||||
if_icmpeq LABEL823
|
||||
jump LABEL829
|
||||
LABEL823:
|
||||
iload 3
|
||||
iconst 1
|
||||
if_icmpeq LABEL840
|
||||
jump LABEL841
|
||||
LABEL840:
|
||||
if_icmpeq LABEL827
|
||||
jump LABEL828
|
||||
LABEL827:
|
||||
invoke 76
|
||||
LABEL841:
|
||||
jump LABEL897
|
||||
LABEL842:
|
||||
LABEL828:
|
||||
jump LABEL884
|
||||
LABEL829:
|
||||
iload 0
|
||||
iconst 80
|
||||
if_icmpeq LABEL846
|
||||
jump LABEL891
|
||||
LABEL846:
|
||||
if_icmpeq LABEL833
|
||||
jump LABEL878
|
||||
LABEL833:
|
||||
iconst 40697936
|
||||
iconst 1
|
||||
cc_find
|
||||
iconst 1
|
||||
if_icmpeq LABEL852
|
||||
jump LABEL853
|
||||
LABEL852:
|
||||
if_icmpeq LABEL839
|
||||
jump LABEL840
|
||||
LABEL839:
|
||||
return
|
||||
LABEL853:
|
||||
LABEL840:
|
||||
get_varc_string 356
|
||||
string_length
|
||||
iconst 0
|
||||
if_icmpgt LABEL858
|
||||
jump LABEL878
|
||||
LABEL858:
|
||||
if_icmpgt LABEL845
|
||||
jump LABEL865
|
||||
LABEL845:
|
||||
get_varc_string 356
|
||||
friend_test
|
||||
iconst 1
|
||||
if_icmpeq LABEL863
|
||||
jump LABEL866
|
||||
LABEL863:
|
||||
if_icmpeq LABEL850
|
||||
jump LABEL853
|
||||
LABEL850:
|
||||
get_varc_string 356
|
||||
invoke 107
|
||||
return
|
||||
LABEL866:
|
||||
LABEL853:
|
||||
get_varc_int 60
|
||||
clientclock
|
||||
if_icmpgt LABEL870
|
||||
jump LABEL871
|
||||
LABEL870:
|
||||
if_icmpgt LABEL857
|
||||
jump LABEL858
|
||||
LABEL857:
|
||||
return
|
||||
LABEL871:
|
||||
LABEL858:
|
||||
clientclock
|
||||
iconst 50
|
||||
add
|
||||
@@ -1059,14 +1041,14 @@ LABEL871:
|
||||
sconst "That player was not found on your Friends list."
|
||||
mes
|
||||
return
|
||||
LABEL878:
|
||||
LABEL865:
|
||||
get_varc_int 60
|
||||
clientclock
|
||||
if_icmpgt LABEL882
|
||||
jump LABEL883
|
||||
LABEL882:
|
||||
if_icmpgt LABEL869
|
||||
jump LABEL870
|
||||
LABEL869:
|
||||
return
|
||||
LABEL883:
|
||||
LABEL870:
|
||||
clientclock
|
||||
iconst 50
|
||||
add
|
||||
@@ -1074,8 +1056,8 @@ LABEL883:
|
||||
sconst "You haven't received any messages to which you can reply."
|
||||
mes
|
||||
return
|
||||
jump LABEL897
|
||||
LABEL891:
|
||||
jump LABEL884
|
||||
LABEL878:
|
||||
get_varc_string 335
|
||||
iconst 0
|
||||
iload 0
|
||||
@@ -1087,9 +1069,9 @@ LABEL891:
|
||||
runelite_callback ;
|
||||
if_icmpeq SKIPSETVARC ; skip setting varc with input
|
||||
set_varc_string 335
|
||||
jump LABEL897 ; jump over SKIPSETVARC
|
||||
jump LABEL884 ; jump over SKIPSETVARC
|
||||
SKIPSETVARC:
|
||||
pop_string ; pop message
|
||||
LABEL897:
|
||||
LABEL884:
|
||||
invoke 223
|
||||
return
|
||||
|
||||
@@ -25,9 +25,12 @@
|
||||
package net.runelite.client.menus;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class TestMenuEntry implements MenuEntry
|
||||
@@ -39,6 +42,12 @@ public class TestMenuEntry implements MenuEntry
|
||||
private int param0;
|
||||
private int param1;
|
||||
private boolean forceLeftClick;
|
||||
@Setter
|
||||
private int itemOp = -1;
|
||||
@Setter
|
||||
private int itemId = -1;
|
||||
@Setter
|
||||
private Widget widget;
|
||||
|
||||
@Override
|
||||
public String getOption()
|
||||
@@ -205,4 +214,29 @@ public class TestMenuEntry implements MenuEntry
|
||||
{
|
||||
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 static org.mockito.ArgumentMatchers.any;
|
||||
import org.mockito.Mock;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
@@ -164,10 +165,10 @@ public class ClueScrollPluginTest
|
||||
plugin.onGameTick(new GameTick());
|
||||
|
||||
// Simulate clicking on the STASH
|
||||
MenuOptionClicked menuOptionClicked = new MenuOptionClicked();
|
||||
menuOptionClicked.setMenuOption("Search");
|
||||
menuOptionClicked.setMenuTarget("<col=ffff>STASH unit (easy)");
|
||||
menuOptionClicked.setId(NullObjectID.NULL_28983);
|
||||
MenuOptionClicked menuOptionClicked = mock(MenuOptionClicked.class);
|
||||
when(menuOptionClicked.getMenuOption()).thenReturn("Search");
|
||||
lenient().when(menuOptionClicked.getMenuTarget()).thenReturn("<col=ffff>STASH unit (easy)");
|
||||
when(menuOptionClicked.getId()).thenReturn(NullObjectID.NULL_28983);
|
||||
plugin.onMenuOptionClicked(menuOptionClicked);
|
||||
|
||||
// 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.ObjectComposition;
|
||||
import net.runelite.api.events.ClientTick;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
@@ -332,14 +331,7 @@ public class MenuEntrySwapperPluginTest
|
||||
menu("Deposit-1", "Abyssal whip", MenuAction.CC_OP, 2),
|
||||
};
|
||||
|
||||
menuEntrySwapperPlugin.onMenuEntryAdded(new MenuEntryAdded(
|
||||
"Deposit-1",
|
||||
"Abyssal whip",
|
||||
MenuAction.CC_OP.getId(),
|
||||
2,
|
||||
-1,
|
||||
-1
|
||||
));
|
||||
menuEntrySwapperPlugin.onClientTick(new ClientTick());
|
||||
|
||||
ArgumentCaptor<MenuEntry[]> argumentCaptor = ArgumentCaptor.forClass(MenuEntry[].class);
|
||||
verify(client).setMenuEntries(argumentCaptor.capture());
|
||||
@@ -364,14 +356,7 @@ public class MenuEntrySwapperPluginTest
|
||||
menu("Deposit-1", "Rune arrow", MenuAction.CC_OP, 2),
|
||||
};
|
||||
|
||||
menuEntrySwapperPlugin.onMenuEntryAdded(new MenuEntryAdded(
|
||||
"Deposit-1",
|
||||
"Rune arrow",
|
||||
MenuAction.CC_OP.getId(),
|
||||
2,
|
||||
-1,
|
||||
-1
|
||||
));
|
||||
menuEntrySwapperPlugin.onClientTick(new ClientTick());
|
||||
|
||||
ArgumentCaptor<MenuEntry[]> argumentCaptor = ArgumentCaptor.forClass(MenuEntry[].class);
|
||||
verify(client).setMenuEntries(argumentCaptor.capture());
|
||||
|
||||
Reference in New Issue
Block a user