Merge remote-tracking branch 'runelite/master'

This commit is contained in:
Owain van Brakel
2021-08-05 00:10:59 +02:00
55 changed files with 997 additions and 336 deletions

View File

@@ -25,9 +25,9 @@
object ProjectVersions { object ProjectVersions {
const val launcherVersion = "2.2.0" const val launcherVersion = "2.2.0"
const val rlVersion = "1.7.18" const val rlVersion = "1.7.19"
const val openosrsVersion = "4.9.9" const val openosrsVersion = "4.9.10"
const val rsversion = 198 const val rsversion = 198
const val cacheversion = 165 const val cacheversion = 165

View File

@@ -672,6 +672,34 @@ public interface Client extends GameEngine
*/ */
boolean isMenuOpen(); boolean isMenuOpen();
/**
* Get the menu x location. Only valid if the menu is open.
*
* @return the menu x location
*/
int getMenuX();
/**
* Get the menu y location. Only valid if the menu is open.
*
* @return the menu y location
*/
int getMenuY();
/**
* Get the menu height. Only valid if the menu is open.
*
* @return the menu height
*/
int getMenuHeight();
/**
* Get the menu width. Only valid if the menu is open.
*
* @return the menu width
*/
int getMenuWidth();
/** /**
* Gets the angle of the map, or target camera yaw. * Gets the angle of the map, or target camera yaw.
* *

View File

@@ -57,11 +57,11 @@ public class MenuEntry implements Cloneable
/** /**
* An additional parameter for the action. * An additional parameter for the action.
*/ */
private int actionParam; private int param0;
/** /**
* A second additional parameter for the action. * A second additional parameter for the action.
*/ */
private int actionParam1; private int param1;
/** /**
* If this field is true and you have single mouse button on and this entry is * If this field is true and you have single mouse button on and this entry is
* the top entry the right click menu will not be opened when you left click * the top entry the right click menu will not be opened when you left click
@@ -70,14 +70,14 @@ public class MenuEntry implements Cloneable
*/ */
private boolean forceLeftClick; private boolean forceLeftClick;
public MenuEntry(String option, String target, int type, int opcode, int actionParam, int actionParam1, boolean forceLeftClick) public MenuEntry(String option, String target, int type, int opcode, int param0, int param1, boolean forceLeftClick)
{ {
this.option = option; this.option = option;
this.target = target; this.target = target;
this.identifier = type; this.identifier = type;
this.opcode = opcode; this.opcode = opcode;
this.actionParam = actionParam; this.param0 = param0;
this.actionParam1 = actionParam1; this.param1 = param1;
this.forceLeftClick = forceLeftClick; this.forceLeftClick = forceLeftClick;
} }
@@ -96,32 +96,42 @@ public class MenuEntry implements Cloneable
public void setActionParam0(int i) public void setActionParam0(int i)
{ {
this.actionParam = i; this.param0 = i;
} }
public int getActionParam0() public int getActionParam0()
{ {
return this.actionParam; return this.param0;
} }
public int getParam0() public int getParam0()
{ {
return this.actionParam; return this.param0;
} }
public void setParam0(int i) public void setParam0(int i)
{ {
this.actionParam = i; this.param0 = i;
} }
public void setParam1(int i) public void setParam1(int i)
{ {
this.actionParam1 = i; this.param1 = i;
} }
public int getParam1() public int getParam1()
{ {
return this.actionParam1; return this.param1;
}
public void setActionParam1(int i)
{
this.param1 = i;
}
public int getActionParam1()
{
return this.param1;
} }
public void setType(int i) public void setType(int i)

View File

@@ -43,9 +43,13 @@ import net.runelite.api.MenuEntry;
public class MenuOptionClicked public class MenuOptionClicked
{ {
/** /**
* The action parameter used in the click. * Action parameter 0. Its value depends on the menuAction.
*/ */
private int actionParam; private int param0;
/**
* Action parameter 1. Its value depends on the menuAction.
*/
private int param1;
/** /**
* The option text added to the menu. * The option text added to the menu.
*/ */
@@ -62,12 +66,6 @@ public class MenuOptionClicked
* The ID of the object, actor, or item that the interaction targets. * The ID of the object, actor, or item that the interaction targets.
*/ */
private int id; private int id;
/**
* The ID of the widget where the menu was clicked.
*
* @see net.runelite.api.widgets.WidgetID
*/
private int widgetId;
/** /**
* The selected item index at the time of the option click. * The selected item index at the time of the option click.
*/ */
@@ -95,7 +93,31 @@ public class MenuOptionClicked
this.setMenuTarget(entry.getTarget()); this.setMenuTarget(entry.getTarget());
this.setId(entry.getId()); this.setId(entry.getId());
this.setMenuAction(MenuAction.of(entry.getOpcode())); this.setMenuAction(MenuAction.of(entry.getOpcode()));
this.setActionParam(entry.getActionParam()); this.setParam0(entry.getParam0());
this.setWidgetId(entry.getActionParam1()); this.setParam1(entry.getParam1());
}
@Deprecated
public int getActionParam()
{
return param0;
}
@Deprecated
public void setActionParam(int i)
{
param0 = i;
}
@Deprecated
public int getWidgetId()
{
return param1;
}
@Deprecated
public void setWidgetId(int i)
{
param1 = i;
} }
} }

View File

@@ -484,65 +484,65 @@ public class WidgetID
static final int RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX = 19; static final int RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX = 19;
static final int MULTICOMBAT_INDICATOR = 23; static final int MULTICOMBAT_INDICATOR = 23;
static final int MINIMAP = 25; static final int MINIMAP = 25;
static final int MINIMAP_DRAW_AREA = 33; static final int MINIMAP_DRAW_AREA = 34;
static final int MINIMAP_ORB_HOLDER = 36; static final int MINIMAP_ORB_HOLDER = 37;
static final int FRIENDS_CHAT_TAB = 45; static final int FRIENDS_CHAT_TAB = 46;
static final int IGNORES_TAB = 46; static final int IGNORES_TAB = 47;
static final int FRIENDS_TAB = 47; static final int FRIENDS_TAB = 48;
static final int LOGOUT_TAB = 48; static final int LOGOUT_TAB = 49;
static final int OPTIONS_TAB = 49; static final int OPTIONS_TAB = 50;
static final int EMOTES_TAB = 50; static final int EMOTES_TAB = 51;
static final int MUSIC_TAB = 51; static final int MUSIC_TAB = 52;
static final int FRIENDS_CHAT_ICON = 52; static final int FRIENDS_CHAT_ICON = 53;
static final int FRIENDS_ICON = 54; static final int FRIENDS_ICON = 55;
static final int IGNORES_ICON = 53; static final int IGNORES_ICON = 54;
static final int LOGOUT_ICON = 55; static final int LOGOUT_ICON = 56;
static final int OPTIONS_ICON = 56; static final int OPTIONS_ICON = 57;
static final int EMOTES_ICON = 57; static final int EMOTES_ICON = 58;
static final int MUSIC_ICON = 58; static final int MUSIC_ICON = 59;
static final int COMBAT_TAB = 61; static final int COMBAT_TAB = 62;
static final int STATS_TAB = 62; static final int STATS_TAB = 63;
static final int QUESTS_TAB = 63; static final int QUESTS_TAB = 64;
static final int INVENTORY_TAB = 64; static final int INVENTORY_TAB = 65;
static final int EQUIPMENT_TAB = 65; static final int EQUIPMENT_TAB = 66;
static final int PRAYER_TAB = 66; static final int PRAYER_TAB = 67;
static final int MAGIC_TAB = 67; static final int MAGIC_TAB = 68;
static final int COMBAT_ICON = 68; static final int COMBAT_ICON = 69;
static final int STATS_ICON = 69; static final int STATS_ICON = 70;
static final int QUESTS_ICON = 70; static final int QUESTS_ICON = 71;
static final int INVENTORY_ICON = 71; static final int INVENTORY_ICON = 72;
static final int EQUIPMENT_ICON = 72; static final int EQUIPMENT_ICON = 73;
static final int PRAYER_ICON = 73; static final int PRAYER_ICON = 74;
static final int MAGIC_ICON = 74; static final int MAGIC_ICON = 75;
static final int INTERFACE_CONTAINER = 75; static final int INTERFACE_CONTAINER = 76;
static final int INVENTORY_CONTAINER = 81; static final int INVENTORY_CONTAINER = 82;
} }
static class ResizableViewportBottomLine static class ResizableViewportBottomLine
{ {
static final int RESIZABLE_VIEWPORT_BOTTOM_LINE = 19; static final int RESIZABLE_VIEWPORT_BOTTOM_LINE = 19;
static final int MINIMAP = 25; static final int MINIMAP = 25;
static final int MINIMAP_DRAW_AREA = 33; static final int MINIMAP_DRAW_AREA = 34;
static final int MINIMAP_ORB_HOLDER = 36; static final int MINIMAP_ORB_HOLDER = 37;
static final int LOGOUT_BUTTON_OVERLAY = 37; static final int LOGOUT_BUTTON_OVERLAY = 38;
static final int MINIMAP_LOGOUT_BUTTON = 38; static final int MINIMAP_LOGOUT_BUTTON = 39;
static final int FC_ICON = 49; static final int FC_ICON = 50;
static final int FRIEND_ICON = 51; static final int FRIEND_ICON = 52;
static final int SETTINGS_ICON = 52; static final int SETTINGS_ICON = 53;
static final int EMOTE_ICON = 53; static final int EMOTE_ICON = 54;
static final int MUSIC_ICON = 54; static final int MUSIC_ICON = 55;
static final int INVENTORY_TAB = 61; static final int INVENTORY_TAB = 62;
static final int PRAYER_TAB = 63; static final int PRAYER_TAB = 64;
static final int MAGIC_TAB = 64; static final int MAGIC_TAB = 65;
static final int CMB_ICON = 65; static final int CMB_ICON = 66;
static final int SKILLS_ICON = 66; static final int SKILLS_ICON = 67;
static final int QUESTS_ICON = 67; static final int QUESTS_ICON = 68;
static final int INVENTORY_ICON = 68; static final int INVENTORY_ICON = 69;
static final int EQUIP_ICON = 69; static final int EQUIP_ICON = 70;
static final int PRAYER_ICON = 70; static final int PRAYER_ICON = 71;
static final int MAGIC_ICON = 71; static final int MAGIC_ICON = 72;
static final int INTERFACE_CONTAINER = 74; static final int INTERFACE_CONTAINER = 75;
static final int INVENTORY_CONTAINER = 80; static final int INVENTORY_CONTAINER = 81;
} }
static class Chatbox static class Chatbox

View File

@@ -113,7 +113,7 @@ public class MenuManager
return; return;
} }
int widgetId = event.getActionParam1(); int widgetId = event.getParam1();
Collection<WidgetMenuOption> options = managedMenuOptions.get(widgetId); Collection<WidgetMenuOption> options = managedMenuOptions.get(widgetId);
if (options.isEmpty()) if (options.isEmpty())
{ {
@@ -206,7 +206,7 @@ public class MenuManager
return; return;
} }
int widgetId = event.getWidgetId(); int widgetId = event.getParam1();
Collection<WidgetMenuOption> options = managedMenuOptions.get(widgetId); Collection<WidgetMenuOption> options = managedMenuOptions.get(widgetId);
for (WidgetMenuOption curMenuOption : options) for (WidgetMenuOption curMenuOption : options)

View File

@@ -46,7 +46,7 @@ public interface AntiDragConfig extends Config
@ConfigItem( @ConfigItem(
keyName = "onShiftOnly", keyName = "onShiftOnly",
name = "On Shift Only", name = "On Shift Only",
description = "Configures whether to only adjust the delay while holding shift in non-PvP scenarios. Shift is required in PvP regardless of this config setting", description = "Configures whether to only adjust the delay while holding shift.",
position = 2 position = 2
) )
default boolean onShiftOnly() default boolean onShiftOnly()

View File

@@ -29,9 +29,7 @@ import java.awt.event.KeyEvent;
import javax.inject.Inject; import javax.inject.Inject;
import net.runelite.api.Client; import net.runelite.api.Client;
import net.runelite.api.GameState; import net.runelite.api.GameState;
import net.runelite.api.Varbits;
import net.runelite.api.events.FocusChanged; import net.runelite.api.events.FocusChanged;
import net.runelite.api.events.VarbitChanged;
import net.runelite.api.events.WidgetLoaded; import net.runelite.api.events.WidgetLoaded;
import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetID; import net.runelite.api.widgets.WidgetID;
@@ -69,7 +67,6 @@ public class AntiDragPlugin extends Plugin implements KeyListener
@Inject @Inject
private KeyManager keyManager; private KeyManager keyManager;
private boolean inPvp;
private boolean shiftHeld; private boolean shiftHeld;
private boolean ctrlHeld; private boolean ctrlHeld;
@@ -86,8 +83,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener
{ {
clientThread.invokeLater(() -> clientThread.invokeLater(() ->
{ {
inPvp = client.getVar(Varbits.PVP_SPEC_ORB) == 1; if (!config.onShiftOnly())
if (!config.onShiftOnly() && !inPvp)
{ {
setDragDelay(); setDragDelay();
} }
@@ -113,12 +109,12 @@ public class AntiDragPlugin extends Plugin implements KeyListener
@Override @Override
public void keyPressed(KeyEvent e) public void keyPressed(KeyEvent e)
{ {
if (e.getKeyCode() == KeyEvent.VK_CONTROL && config.disableOnCtrl() && !(inPvp || config.onShiftOnly())) if (e.getKeyCode() == KeyEvent.VK_CONTROL && config.disableOnCtrl() && !config.onShiftOnly())
{ {
resetDragDelay(); resetDragDelay();
ctrlHeld = true; ctrlHeld = true;
} }
else if (e.getKeyCode() == KeyEvent.VK_SHIFT && (inPvp || config.onShiftOnly())) else if (e.getKeyCode() == KeyEvent.VK_SHIFT && config.onShiftOnly())
{ {
setDragDelay(); setDragDelay();
shiftHeld = true; shiftHeld = true;
@@ -128,12 +124,12 @@ public class AntiDragPlugin extends Plugin implements KeyListener
@Override @Override
public void keyReleased(KeyEvent e) public void keyReleased(KeyEvent e)
{ {
if (e.getKeyCode() == KeyEvent.VK_CONTROL && config.disableOnCtrl() && !(inPvp || config.onShiftOnly())) if (e.getKeyCode() == KeyEvent.VK_CONTROL && config.disableOnCtrl() && !config.onShiftOnly())
{ {
setDragDelay(); setDragDelay();
ctrlHeld = false; ctrlHeld = false;
} }
else if (e.getKeyCode() == KeyEvent.VK_SHIFT && (inPvp || config.onShiftOnly())) else if (e.getKeyCode() == KeyEvent.VK_SHIFT && config.onShiftOnly())
{ {
resetDragDelay(); resetDragDelay();
shiftHeld = false; shiftHeld = false;
@@ -150,7 +146,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener
ctrlHeld = false; ctrlHeld = false;
} }
if (config.onShiftOnly() || inPvp) if (config.onShiftOnly())
{ {
shiftHeld = false; shiftHeld = false;
clientThread.invoke(this::resetDragDelay); clientThread.invoke(this::resetDragDelay);
@@ -162,27 +158,6 @@ public class AntiDragPlugin extends Plugin implements KeyListener
} }
} }
@Subscribe
public void onVarbitChanged(VarbitChanged varbitChanged)
{
boolean currentStatus = client.getVar(Varbits.PVP_SPEC_ORB) == 1;
if (currentStatus != inPvp)
{
inPvp = currentStatus;
if (!inPvp && !config.onShiftOnly())
{
setDragDelay();
}
else
{
resetDragDelay();
}
}
}
@Subscribe @Subscribe
public void onFocusChanged(FocusChanged focusChanged) public void onFocusChanged(FocusChanged focusChanged)
{ {
@@ -192,7 +167,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener
ctrlHeld = false; ctrlHeld = false;
clientThread.invoke(this::resetDragDelay); clientThread.invoke(this::resetDragDelay);
} }
else if (!inPvp && !config.onShiftOnly()) else if (!config.onShiftOnly())
{ {
clientThread.invoke(this::setDragDelay); clientThread.invoke(this::setDragDelay);
} }

View File

@@ -339,7 +339,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
{ {
MenuEntry[] entries = client.getMenuEntries(); MenuEntry[] entries = client.getMenuEntries();
if (event.getActionParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() if (event.getParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId()
&& event.getOption().equals("Examine")) && event.getOption().equals("Examine"))
{ {
Widget container = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER); Widget container = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER);
@@ -355,7 +355,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
MenuEntry editTags = new MenuEntry(); MenuEntry editTags = new MenuEntry();
editTags.setParam0(event.getActionParam0()); editTags.setParam0(event.getActionParam0());
editTags.setParam1(event.getActionParam1()); editTags.setParam1(event.getParam1());
editTags.setTarget(event.getTarget()); editTags.setTarget(event.getTarget());
editTags.setOption(text); editTags.setOption(text);
editTags.setType(MenuAction.RUNELITE.getId()); editTags.setType(MenuAction.RUNELITE.getId());
@@ -371,12 +371,12 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
@Subscribe @Subscribe
public void onMenuOptionClicked(MenuOptionClicked event) public void onMenuOptionClicked(MenuOptionClicked event)
{ {
if (event.getWidgetId() == WidgetInfo.BANK_ITEM_CONTAINER.getId() if (event.getParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId()
&& event.getMenuAction() == MenuAction.RUNELITE && event.getMenuAction() == MenuAction.RUNELITE
&& event.getMenuOption().startsWith(EDIT_TAGS_MENU_OPTION)) && event.getMenuOption().startsWith(EDIT_TAGS_MENU_OPTION))
{ {
event.consume(); event.consume();
int inventoryIndex = event.getActionParam(); int inventoryIndex = event.getParam0();
ItemContainer bankContainer = client.getItemContainer(InventoryID.BANK); ItemContainer bankContainer = client.getItemContainer(InventoryID.BANK);
if (bankContainer == null) if (bankContainer == null)
{ {

View File

@@ -608,13 +608,13 @@ public class TabInterface
MenuEntry[] entries = client.getMenuEntries(); MenuEntry[] entries = client.getMenuEntries();
if (activeTab != null if (activeTab != null
&& event.getActionParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() && event.getParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId()
&& event.getOption().equals("Examine")) && event.getOption().equals("Examine"))
{ {
entries = createMenuEntry(event, REMOVE_TAG + " (" + activeTab.getTag() + ")", event.getTarget(), entries); entries = createMenuEntry(event, REMOVE_TAG + " (" + activeTab.getTag() + ")", event.getTarget(), entries);
client.setMenuEntries(entries); client.setMenuEntries(entries);
} }
else if (event.getActionParam1() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId() else if (event.getParam1() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId()
&& event.getOption().equals("Deposit inventory")) && event.getOption().equals("Deposit inventory"))
{ {
entries = createMenuEntry(event, TAG_INVENTORY, event.getTarget(), entries); entries = createMenuEntry(event, TAG_INVENTORY, event.getTarget(), entries);
@@ -626,7 +626,7 @@ public class TabInterface
client.setMenuEntries(entries); client.setMenuEntries(entries);
} }
else if (event.getActionParam1() == WidgetInfo.BANK_DEPOSIT_EQUIPMENT.getId() else if (event.getParam1() == WidgetInfo.BANK_DEPOSIT_EQUIPMENT.getId()
&& event.getOption().equals("Deposit worn items")) && event.getOption().equals("Deposit worn items"))
{ {
entries = createMenuEntry(event, TAG_GEAR, event.getTarget(), entries); entries = createMenuEntry(event, TAG_GEAR, event.getTarget(), entries);
@@ -661,26 +661,26 @@ public class TabInterface
activateTab(null); activateTab(null);
} }
else if (activeTab != null else if (activeTab != null
&& event.getWidgetId() == WidgetInfo.BANK_ITEM_CONTAINER.getId() && event.getParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId()
&& event.getMenuAction() == MenuAction.RUNELITE && event.getMenuAction() == MenuAction.RUNELITE
&& event.getMenuOption().startsWith(REMOVE_TAG)) && event.getMenuOption().startsWith(REMOVE_TAG))
{ {
// Add "remove" menu entry to all items in bank while tab is selected // Add "remove" menu entry to all items in bank while tab is selected
event.consume(); event.consume();
final ItemComposition item = getItem(event.getActionParam()); final ItemComposition item = getItem(event.getParam0());
final int itemId = item.getId(); final int itemId = item.getId();
tagManager.removeTag(itemId, activeTab.getTag()); tagManager.removeTag(itemId, activeTab.getTag());
bankSearch.layoutBank(); // re-layout to filter the removed item out bankSearch.layoutBank(); // re-layout to filter the removed item out
} }
else if (event.getMenuAction() == MenuAction.RUNELITE else if (event.getMenuAction() == MenuAction.RUNELITE
&& ((event.getWidgetId() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId() && event.getMenuOption().equals(TAG_INVENTORY)) && ((event.getParam1() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId() && event.getMenuOption().equals(TAG_INVENTORY))
|| (event.getWidgetId() == WidgetInfo.BANK_DEPOSIT_EQUIPMENT.getId() && event.getMenuOption().equals(TAG_GEAR)))) || (event.getParam1() == WidgetInfo.BANK_DEPOSIT_EQUIPMENT.getId() && event.getMenuOption().equals(TAG_GEAR))))
{ {
handleDeposit(event, event.getWidgetId() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId()); handleDeposit(event, event.getParam1() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId());
} }
else if (activeTab != null && ((event.getWidgetId() == WidgetInfo.BANK_EQUIPMENT_BUTTON.getId() && event.getMenuOption().equals(SHOW_WORN)) else if (activeTab != null && ((event.getParam1() == WidgetInfo.BANK_EQUIPMENT_BUTTON.getId() && event.getMenuOption().equals(SHOW_WORN))
|| (event.getWidgetId() == WidgetInfo.BANK_SETTINGS_BUTTON.getId() && event.getMenuOption().equals(SHOW_SETTINGS)) || (event.getParam1() == WidgetInfo.BANK_SETTINGS_BUTTON.getId() && event.getMenuOption().equals(SHOW_SETTINGS))
|| (event.getWidgetId() == WidgetInfo.BANK_TUTORIAL_BUTTON.getId() && event.getMenuOption().equals(SHOW_TUTORIAL)))) || (event.getParam1() == WidgetInfo.BANK_TUTORIAL_BUTTON.getId() && event.getMenuOption().equals(SHOW_TUTORIAL))))
{ {
saveTab(); saveTab();
} }
@@ -1186,7 +1186,7 @@ public class TabInterface
{ {
final MenuEntry entry = new MenuEntry(); final MenuEntry entry = new MenuEntry();
entry.setParam0(event.getActionParam0()); entry.setParam0(event.getActionParam0());
entry.setParam1(event.getActionParam1()); entry.setParam1(event.getParam1());
entry.setTarget(target); entry.setTarget(target);
entry.setOption(option); entry.setOption(option);
entry.setType(MenuAction.RUNELITE.getId()); entry.setType(MenuAction.RUNELITE.getId());

View File

@@ -56,7 +56,7 @@ enum Boss
THERMONUCLEAR_SMOKE_DEVIL(NpcID.THERMONUCLEAR_SMOKE_DEVIL, 8400, ChronoUnit.MILLIS, ItemID.PET_SMOKE_DEVIL), THERMONUCLEAR_SMOKE_DEVIL(NpcID.THERMONUCLEAR_SMOKE_DEVIL, 8400, ChronoUnit.MILLIS, ItemID.PET_SMOKE_DEVIL),
KRAKEN(NpcID.KRAKEN, 8400, ChronoUnit.MILLIS, ItemID.PET_KRAKEN), KRAKEN(NpcID.KRAKEN, 8400, ChronoUnit.MILLIS, ItemID.PET_KRAKEN),
KALPHITE_QUEEN(NpcID.KALPHITE_QUEEN_965, 30, ChronoUnit.SECONDS, ItemID.KALPHITE_PRINCESS), KALPHITE_QUEEN(NpcID.KALPHITE_QUEEN_965, 30, ChronoUnit.SECONDS, ItemID.KALPHITE_PRINCESS),
DUSK(NpcID.DUSK_7889, 2, ChronoUnit.MINUTES, ItemID.NOON), DUSK(NpcID.DUSK_7889, 5, ChronoUnit.MINUTES, ItemID.NOON),
ALCHEMICAL_HYDRA(NpcID.ALCHEMICAL_HYDRA_8622, 25200, ChronoUnit.MILLIS, ItemID.IKKLE_HYDRA), ALCHEMICAL_HYDRA(NpcID.ALCHEMICAL_HYDRA_8622, 25200, ChronoUnit.MILLIS, ItemID.IKKLE_HYDRA),
SARACHNIS(NpcID.SARACHNIS, 10, ChronoUnit.SECONDS, ItemID.SRARACHA), SARACHNIS(NpcID.SARACHNIS, 10, ChronoUnit.SECONDS, ItemID.SRARACHA),
ZALCANO(NpcID.ZALCANO_9050, 21600, ChronoUnit.MILLIS, ItemID.SMOLCANO); ZALCANO(NpcID.ZALCANO_9050, 21600, ChronoUnit.MILLIS, ItemID.SMOLCANO);

View File

@@ -209,7 +209,7 @@ public class CameraPlugin extends Plugin implements KeyListener, MouseListener
m.setIdentifier(identifier); m.setIdentifier(identifier);
m.setType(MenuAction.CC_OP.getId()); m.setType(MenuAction.CC_OP.getId());
m.setParam0(lookNorth.getActionParam0()); m.setParam0(lookNorth.getActionParam0());
m.setParam1(lookNorth.getActionParam1()); m.setParam1(lookNorth.getParam1());
return m; return m;
} }

View File

@@ -114,7 +114,7 @@ public class ChatCommandsPlugin extends Plugin
private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("<col=ef20ff>Congratulations - your raid is complete!</col><br>Team size: <col=ff0000>" + COX_TEAM_SIZES + "</col> Duration:</col> <col=ff0000>[0-9:.]+</col> Personal best: </col><col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col>"); private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("<col=ef20ff>Congratulations - your raid is complete!</col><br>Team size: <col=ff0000>" + COX_TEAM_SIZES + "</col> Duration:</col> <col=ff0000>[0-9:.]+</col> Personal best: </col><col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col>");
private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("Theatre of Blood wave completion time: <col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(new personal best\\)"); private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("Theatre of Blood wave completion time: <col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(new personal best\\)");
private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("Theatre of Blood wave completion time: <col=ff0000>[0-9:.]+</col>\\. Personal best: (?<pb>[0-9:]+(?:\\.[0-9]+)?)"); private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("Theatre of Blood wave completion time: <col=ff0000>[0-9:.]+</col>\\. Personal best: (?<pb>[0-9:]+(?:\\.[0-9]+)?)");
private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:(?:Fight |Lap |Challenge |Corrupted challenge )?duration:|Subdued in) <col=[0-9a-f]{6}>[0-9:.]+</col>\\. Personal best: (?:<col=ff0000>)?(?<pb>[0-9:]+(?:\\.[0-9]+)?)"); private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)(?:(?:Fight |Lap |Challenge |Corrupted challenge )?duration:|Subdued in) <col=[0-9a-f]{6}>[0-9:.]+</col>\\. Personal best: (?:<col=ff0000>)?(?<pb>[0-9:]+(?:\\.[0-9]+)?)");
private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)(?:(?:Fight |Lap |Challenge |Corrupted challenge )?duration:|Subdued in) <col=[0-9a-f]{6}>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(new personal best\\)"); private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)(?:(?:Fight |Lap |Challenge |Corrupted challenge )?duration:|Subdued in) <col=[0-9a-f]{6}>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(new personal best\\)");
private static final Pattern DUEL_ARENA_WINS_PATTERN = Pattern.compile("You (were defeated|won)! You have(?: now)? won (\\d+) duels?"); private static final Pattern DUEL_ARENA_WINS_PATTERN = Pattern.compile("You (were defeated|won)! You have(?: now)? won (\\d+) duels?");
private static final Pattern DUEL_ARENA_LOSSES_PATTERN = Pattern.compile("You have(?: now)? lost (\\d+) duels?"); private static final Pattern DUEL_ARENA_LOSSES_PATTERN = Pattern.compile("You have(?: now)? lost (\\d+) duels?");
@@ -1238,7 +1238,10 @@ public class ChatCommandsPlugin extends Plugin
try try
{ {
List<Integer> petList = getPetList().stream().map(Pet::getIconID).collect(Collectors.toList()); List<Integer> petList = getPetList().stream().map(Pet::getIconID).collect(Collectors.toList());
chatClient.submitPetList(playerName, petList); if (!petList.isEmpty())
{
chatClient.submitPetList(playerName, petList);
}
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -254,7 +254,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
// The menu option for clear history is "<col=ffff00>Public:</col> Clear history" // The menu option for clear history is "<col=ffff00>Public:</col> Clear history"
if (menuOption.endsWith(CLEAR_HISTORY)) if (menuOption.endsWith(CLEAR_HISTORY))
{ {
clearChatboxHistory(ChatboxTab.of(event.getWidgetId())); clearChatboxHistory(ChatboxTab.of(event.getParam1()));
} }
else if (COPY_TO_CLIPBOARD.equals(menuOption) && !Strings.isNullOrEmpty(currentMessage)) else if (COPY_TO_CLIPBOARD.equals(menuOption) && !Strings.isNullOrEmpty(currentMessage))
{ {
@@ -266,7 +266,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
@Subscribe @Subscribe
public void onMenuEntryAdded(MenuEntryAdded entry) public void onMenuEntryAdded(MenuEntryAdded entry)
{ {
final ChatboxTab tab = ChatboxTab.of(entry.getActionParam1()); final ChatboxTab tab = ChatboxTab.of(entry.getParam1());
if (tab == null || tab.getAfter() == null || !config.clearHistory() || !Text.removeTags(entry.getOption()).equals(tab.getAfter())) if (tab == null || tab.getAfter() == null || !config.clearHistory() || !Text.removeTags(entry.getOption()).equals(tab.getAfter()))
{ {
@@ -277,7 +277,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
clearEntry.setTarget(""); clearEntry.setTarget("");
clearEntry.setType(MenuAction.RUNELITE.getId()); clearEntry.setType(MenuAction.RUNELITE.getId());
clearEntry.setParam0(entry.getActionParam0()); clearEntry.setParam0(entry.getActionParam0());
clearEntry.setParam1(entry.getActionParam1()); clearEntry.setParam1(entry.getParam1());
if (tab == ChatboxTab.GAME) if (tab == ChatboxTab.GAME)
{ {

View File

@@ -61,7 +61,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("Search the bucket in the Port Sarim jail.", BUCKET_9568, new WorldPoint(3013, 3179, 0), "Talk to Shantay & identify yourself as an outlaw, refuse to pay the 5gp fine twice and you will be sent to the Port Sarim jail."), new CrypticClue("Search the bucket in the Port Sarim jail.", BUCKET_9568, new WorldPoint(3013, 3179, 0), "Talk to Shantay & identify yourself as an outlaw, refuse to pay the 5gp fine twice and you will be sent to the Port Sarim jail."),
new CrypticClue("Search the crates in a bank in Varrock.", CRATE_5107, new WorldPoint(3187, 9825, 0), "Search in the basement of the West Varrock bank."), new CrypticClue("Search the crates in a bank in Varrock.", CRATE_5107, new WorldPoint(3187, 9825, 0), "Search in the basement of the West Varrock bank."),
new CrypticClue("Falo the bard wants to see you.", "Falo the Bard", new WorldPoint(2689, 3550, 0), "Speak to Falo the Bard located between Seers' Village and Rellekka. Southwest of fairy ring CJR."), new CrypticClue("Falo the bard wants to see you.", "Falo the Bard", new WorldPoint(2689, 3550, 0), "Speak to Falo the Bard located between Seers' Village and Rellekka. Southwest of fairy ring CJR."),
new CrypticClue("Search a bookcase in the Wizards tower.", BOOKCASE_12539, new WorldPoint(3113, 3159, 0), "The bookcase located on the ground floor of the Wizards' Tower."), new CrypticClue("Search a bookcase in the Wizards tower.", BOOKCASE_12539, new WorldPoint(3113, 3159, 0), "The bookcase located on the ground floor of the Wizards' Tower. Fairy ring DIS."),
new CrypticClue("Come have a cip with this great soot covered denizen.", "Miner Magnus", new WorldPoint(2527, 3891, 0), "Talk to Miner Magnus on Miscellania, east of the fairy ring CIP. Answer: 8", "How many coal rocks are around here?"), new CrypticClue("Come have a cip with this great soot covered denizen.", "Miner Magnus", new WorldPoint(2527, 3891, 0), "Talk to Miner Magnus on Miscellania, east of the fairy ring CIP. Answer: 8", "How many coal rocks are around here?"),
new CrypticClue("Citric cellar.", "Heckel Funch", new WorldPoint(2490, 3488, 0), "Speak to Heckel Funch on the first floor in the Grand Tree."), new CrypticClue("Citric cellar.", "Heckel Funch", new WorldPoint(2490, 3488, 0), "Speak to Heckel Funch on the first floor in the Grand Tree."),
new CrypticClue("I burn between heroes and legends.", "Candle maker", new WorldPoint(2799, 3438, 0), "Speak to the Candle maker in Catherby."), new CrypticClue("I burn between heroes and legends.", "Candle maker", new WorldPoint(2799, 3438, 0), "Speak to the Candle maker in Catherby."),

View File

@@ -276,7 +276,7 @@ public class CrowdsourcingWoodcutting
state = SkillingState.CLICKED; state = SkillingState.CLICKED;
lastExperimentEnd = client.getTickCount(); lastExperimentEnd = client.getTickCount();
treeId = id; treeId = id;
treeLocation = WorldPoint.fromScene(client, menuOptionClicked.getActionParam(), menuOptionClicked.getWidgetId(), client.getPlane()); treeLocation = WorldPoint.fromScene(client, menuOptionClicked.getParam0(), menuOptionClicked.getParam1(), client.getPlane());
} }
else else
{ {

View File

@@ -487,7 +487,7 @@ class WidgetInspector extends DevToolsFrame
client.setSpellSelected(false); client.setSpellSelected(false);
ev.consume(); ev.consume();
Object target = getWidgetOrWidgetItemForMenuOption(ev.getMenuAction().getId(), ev.getActionParam(), ev.getWidgetId()); Object target = getWidgetOrWidgetItemForMenuOption(ev.getMenuAction().getId(), ev.getParam0(), ev.getParam1());
if (target == null) if (target == null)
{ {
return; return;

View File

@@ -97,11 +97,11 @@ public class ExaminePlugin extends Plugin
type = ExamineType.ITEM; type = ExamineType.ITEM;
id = event.getId(); id = event.getId();
int widgetId = event.getWidgetId(); int widgetId = event.getParam1();
int widgetGroup = TO_GROUP(widgetId); int widgetGroup = TO_GROUP(widgetId);
int widgetChild = TO_CHILD(widgetId); int widgetChild = TO_CHILD(widgetId);
Widget widget = client.getWidget(widgetGroup, widgetChild); Widget widget = client.getWidget(widgetGroup, widgetChild);
WidgetItem widgetItem = widget.getWidgetItem(event.getActionParam()); WidgetItem widgetItem = widget.getWidgetItem(event.getParam0());
quantity = widgetItem != null && widgetItem.getId() >= 0 ? widgetItem.getQuantity() : 1; quantity = widgetItem != null && widgetItem.getId() >= 0 ? widgetItem.getQuantity() : 1;
// Examine on inventory items with more than 100000 quantity is handled locally and shows the item stack // Examine on inventory items with more than 100000 quantity is handled locally and shows the item stack
@@ -127,7 +127,7 @@ public class ExaminePlugin extends Plugin
case CC_OP_LOW_PRIORITY: case CC_OP_LOW_PRIORITY:
{ {
type = ExamineType.ITEM_BANK_EQ; type = ExamineType.ITEM_BANK_EQ;
int[] qi = findItemFromWidget(event.getWidgetId(), event.getActionParam()); int[] qi = findItemFromWidget(event.getParam1(), event.getParam0());
if (qi == null) if (qi == null)
{ {
log.debug("Examine for item with unknown widget: {}", event); log.debug("Examine for item with unknown widget: {}", event);

View File

@@ -235,7 +235,7 @@ public class FriendNotesPlugin extends Plugin
@Subscribe @Subscribe
public void onMenuEntryAdded(MenuEntryAdded event) public void onMenuEntryAdded(MenuEntryAdded event)
{ {
final int groupId = WidgetInfo.TO_GROUP(event.getActionParam1()); final int groupId = WidgetInfo.TO_GROUP(event.getParam1());
// Look for "Message" on friends list // Look for "Message" on friends list
if ((groupId == WidgetInfo.FRIENDS_LIST.getGroupId() && event.getOption().equals("Message")) || if ((groupId == WidgetInfo.FRIENDS_LIST.getGroupId() && event.getOption().equals("Message")) ||
@@ -250,7 +250,7 @@ public class FriendNotesPlugin extends Plugin
addNote.setType(MenuAction.RUNELITE.getId()); addNote.setType(MenuAction.RUNELITE.getId());
addNote.setTarget(event.getTarget()); //Preserve color codes here addNote.setTarget(event.getTarget()); //Preserve color codes here
addNote.setParam0(event.getActionParam0()); addNote.setParam0(event.getActionParam0());
addNote.setParam1(event.getActionParam1()); addNote.setParam1(event.getParam1());
// Add menu entry // Add menu entry
final MenuEntry[] menuEntries = ObjectArrays.concat(client.getMenuEntries(), addNote); final MenuEntry[] menuEntries = ObjectArrays.concat(client.getMenuEntries(), addNote);
@@ -265,7 +265,7 @@ public class FriendNotesPlugin extends Plugin
@Subscribe @Subscribe
public void onMenuOptionClicked(MenuOptionClicked event) public void onMenuOptionClicked(MenuOptionClicked event)
{ {
final int groupId = WidgetInfo.TO_GROUP(event.getWidgetId()); final int groupId = WidgetInfo.TO_GROUP(event.getParam1());
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.IGNORE_LIST.getGroupId()) if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.IGNORE_LIST.getGroupId())
{ {

View File

@@ -498,7 +498,7 @@ public class GroundItemsPlugin extends Plugin
final int itemId = event.getIdentifier(); final int itemId = event.getIdentifier();
final int sceneX = event.getActionParam0(); final int sceneX = event.getActionParam0();
final int sceneY = event.getActionParam1(); final int sceneY = event.getParam1();
MenuEntry[] menuEntries = client.getMenuEntries(); MenuEntry[] menuEntries = client.getMenuEntries();
MenuEntry lastEntry = menuEntries[menuEntries.length - 1]; MenuEntry lastEntry = menuEntries[menuEntries.length - 1];

View File

@@ -255,7 +255,7 @@ public class HerbiboarPlugin extends Plugin
case "Rock": case "Rock":
case "Mushroom": case "Mushroom":
case "Driftwood": case "Driftwood":
startPoint = WorldPoint.fromScene(client, menuOpt.getActionParam(), menuOpt.getWidgetId(), client.getPlane()); startPoint = WorldPoint.fromScene(client, menuOpt.getParam0(), menuOpt.getParam1(), client.getPlane());
} }
} }

View File

@@ -114,7 +114,7 @@ public class HiscorePanel extends PluginPanel
); );
private static final HiscoreEndpoint[] ENDPOINTS = { private static final HiscoreEndpoint[] ENDPOINTS = {
HiscoreEndpoint.NORMAL, HiscoreEndpoint.IRONMAN, HiscoreEndpoint.HARDCORE_IRONMAN, HiscoreEndpoint.ULTIMATE_IRONMAN, HiscoreEndpoint.DEADMAN, HiscoreEndpoint.LEAGUE HiscoreEndpoint.NORMAL, HiscoreEndpoint.IRONMAN, HiscoreEndpoint.HARDCORE_IRONMAN, HiscoreEndpoint.ULTIMATE_IRONMAN, HiscoreEndpoint.DEADMAN, HiscoreEndpoint.TOURNAMENT
}; };
private final HiscorePlugin plugin; private final HiscorePlugin plugin;

View File

@@ -158,7 +158,7 @@ public class HiscorePlugin extends Plugin
return; return;
} }
final int componentId = event.getActionParam1(); final int componentId = event.getParam1();
int groupId = WidgetInfo.TO_GROUP(componentId); int groupId = WidgetInfo.TO_GROUP(componentId);
String option = event.getOption(); String option = event.getOption();
@@ -178,7 +178,7 @@ public class HiscorePlugin extends Plugin
lookup.setTarget(event.getTarget()); lookup.setTarget(event.getTarget());
lookup.setType(MenuAction.RUNELITE.getId()); lookup.setType(MenuAction.RUNELITE.getId());
lookup.setParam0(event.getActionParam0()); lookup.setParam0(event.getActionParam0());
lookup.setParam1(event.getActionParam1()); lookup.setParam1(event.getParam1());
lookup.setIdentifier(event.getIdentifier()); lookup.setIdentifier(event.getIdentifier());
insertMenuEntry(lookup, client.getMenuEntries()); insertMenuEntry(lookup, client.getMenuEntries());

View File

@@ -0,0 +1,202 @@
/*
* Copyright (c) 2021, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.interacthighlight;
import java.awt.Color;
import net.runelite.client.config.Alpha;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigSection;
import net.runelite.client.config.Range;
@ConfigGroup("interacthighlight")
public interface InteractHighlightConfig extends Config
{
@ConfigSection(
name = "NPCs",
description = "Settings for NPC highlight",
position = 0
)
String npcSection = "npcSection";
@ConfigSection(
name = "Objects",
description = "Settings for object highlight",
position = 1
)
String objectSection = "objectSection";
@ConfigItem(
keyName = "npcShowHover",
name = "Show on hover",
description = "Outline NPCs when hovered",
position = 1,
section = npcSection
)
default boolean npcShowHover()
{
return true;
}
@ConfigItem(
keyName = "npcShowInteract",
name = "Show on interact",
description = "Outline NPCs when interacted",
position = 2,
section = npcSection
)
default boolean npcShowInteract()
{
return true;
}
@Alpha
@ConfigItem(
keyName = "npcHoverHighlightColor",
name = "NPC hover",
description = "The color of the hover outline for NPCs",
position = 3,
section = npcSection
)
default Color npcHoverHighlightColor()
{
return new Color(0x90FFFF00, true);
}
@Alpha
@ConfigItem(
keyName = "npcAttackHoverHighlightColor",
name = "NPC attack hover",
description = "The color of the attack hover outline for NPCs",
position = 4,
section = npcSection
)
default Color npcAttackHoverHighlightColor()
{
return new Color(0x90FFFF00, true);
}
@Alpha
@ConfigItem(
keyName = "npcInteractHighlightColor",
name = "NPC interact",
description = "The color of the target outline for NPCs",
position = 5,
section = npcSection
)
default Color npcInteractHighlightColor()
{
return new Color(0x90FF0000, true);
}
@Alpha
@ConfigItem(
keyName = "npcAttackHighlightColor",
name = "NPC attack",
description = "The color of the outline on attacked NPCs",
position = 6,
section = npcSection
)
default Color npcAttackHighlightColor()
{
return new Color(0x90FF0000, true);
}
@ConfigItem(
keyName = "objectShowHover",
name = "Show on hover",
description = "Outline objects when hovered",
position = 1,
section = objectSection
)
default boolean objectShowHover()
{
return true;
}
@ConfigItem(
keyName = "objectShowInteract",
name = "Show on interact",
description = "Outline objects when interacted",
position = 2,
section = objectSection
)
default boolean objectShowInteract()
{
return true;
}
@Alpha
@ConfigItem(
keyName = "objectHoverHighlightColor",
name = "Object hover",
description = "The color of the hover outline for objects",
position = 4,
section = objectSection
)
default Color objectHoverHighlightColor()
{
return new Color(0x9000FFFF, true);
}
@Alpha
@ConfigItem(
keyName = "objectInteractHighlightColor",
name = "Object interact",
description = "The color of the target outline for objects",
position = 6,
section = objectSection
)
default Color objectInteractHighlightColor()
{
return new Color(0x90FF0000, true);
}
@ConfigItem(
keyName = "borderWidth",
name = "Border Width",
description = "Width of the outlined border",
position = 7
)
default int borderWidth()
{
return 4;
}
@ConfigItem(
keyName = "outlineFeather",
name = "Outline feather",
description = "Specify between 0-4 how much of the model outline should be faded",
position = 8
)
@Range(
max = 4
)
default int outlineFeather()
{
return 4;
}
}

View File

@@ -0,0 +1,158 @@
/*
* Copyright (c) 2021, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.interacthighlight;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import javax.inject.Inject;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.MenuAction;
import net.runelite.api.MenuEntry;
import net.runelite.api.NPC;
import net.runelite.api.TileObject;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.outline.ModelOutlineRenderer;
import net.runelite.client.util.ColorUtil;
class InteractHighlightOverlay extends Overlay
{
private static final Color INTERACT_CLICK_COLOR = new Color(0x90ffffff);
private final Client client;
private final InteractHighlightPlugin plugin;
private final InteractHighlightConfig config;
private final ModelOutlineRenderer modelOutlineRenderer;
@Inject
private InteractHighlightOverlay(Client client, InteractHighlightPlugin plugin, InteractHighlightConfig config, ModelOutlineRenderer modelOutlineRenderer)
{
this.client = client;
this.plugin = plugin;
this.config = config;
this.modelOutlineRenderer = modelOutlineRenderer;
setPosition(OverlayPosition.DYNAMIC);
setLayer(OverlayLayer.ABOVE_SCENE);
setPriority(OverlayPriority.LOW);
}
@Override
public Dimension render(Graphics2D graphics)
{
renderMouseover();
renderTarget();
return null;
}
private void renderMouseover()
{
MenuEntry[] menuEntries = client.getMenuEntries();
if (menuEntries.length == 0)
{
return;
}
MenuEntry top = menuEntries[menuEntries.length - 1];
MenuAction menuAction = MenuAction.of(top.getType());
switch (menuAction)
{
case ITEM_USE_ON_GAME_OBJECT:
case SPELL_CAST_ON_GAME_OBJECT:
case GAME_OBJECT_FIRST_OPTION:
case GAME_OBJECT_SECOND_OPTION:
case GAME_OBJECT_THIRD_OPTION:
case GAME_OBJECT_FOURTH_OPTION:
case GAME_OBJECT_FIFTH_OPTION:
{
int x = top.getParam0();
int y = top.getParam1();
int id = top.getIdentifier();
TileObject tileObject = plugin.findTileObject(x, y, id);
if (tileObject != null && config.objectShowHover() && (tileObject != plugin.getInteractedObject() || !config.objectShowInteract()))
{
modelOutlineRenderer.drawOutline(tileObject, config.borderWidth(), config.objectHoverHighlightColor(), config.outlineFeather());
}
break;
}
case ITEM_USE_ON_NPC:
case SPELL_CAST_ON_NPC:
case NPC_FIRST_OPTION:
case NPC_SECOND_OPTION:
case NPC_THIRD_OPTION:
case NPC_FOURTH_OPTION:
case NPC_FIFTH_OPTION:
{
int id = top.getIdentifier();
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
? config.npcAttackHoverHighlightColor() : config.npcHoverHighlightColor();
modelOutlineRenderer.drawOutline(npc, config.borderWidth(), highlightColor, config.outlineFeather());
}
break;
}
}
}
private void renderTarget()
{
TileObject interactedObject = plugin.getInteractedObject();
if (interactedObject != null && config.objectShowInteract())
{
Color clickColor = getClickColor(config.objectHoverHighlightColor(), config.objectInteractHighlightColor(),
client.getGameCycle() - plugin.getGameCycle());
modelOutlineRenderer.drawOutline(interactedObject, config.borderWidth(), clickColor, config.outlineFeather());
}
Actor target = plugin.getInteractedTarget();
if (target instanceof NPC && config.npcShowInteract())
{
Color startColor = plugin.isAttacked() ? config.npcAttackHoverHighlightColor() : config.npcHoverHighlightColor();
Color endColor = plugin.isAttacked() ? config.npcAttackHighlightColor() : config.npcInteractHighlightColor();
Color clickColor = getClickColor(startColor, endColor,
client.getGameCycle() - plugin.getGameCycle());
modelOutlineRenderer.drawOutline((NPC) target, config.borderWidth(), clickColor, config.outlineFeather());
}
}
private Color getClickColor(Color start, Color end, long time)
{
if (time < 5)
{
return ColorUtil.colorLerp(start, INTERACT_CLICK_COLOR, time / 5f);
}
else if (time < 10)
{
return ColorUtil.colorLerp(INTERACT_CLICK_COLOR, end, (time - 5) / 5f);
}
return end;
}
}

View File

@@ -0,0 +1,242 @@
/*
* Copyright (c) 2021, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.interacthighlight;
import com.google.inject.Provides;
import javax.annotation.Nullable;
import javax.inject.Inject;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.DecorativeObject;
import net.runelite.api.GameObject;
import net.runelite.api.GameState;
import net.runelite.api.GroundObject;
import net.runelite.api.MenuAction;
import net.runelite.api.NPC;
import net.runelite.api.Scene;
import net.runelite.api.Tile;
import net.runelite.api.TileObject;
import net.runelite.api.WallObject;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.MenuOptionClicked;
import net.runelite.api.events.NpcDespawned;
import net.runelite.api.events.InteractingChanged;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.overlay.OverlayManager;
@PluginDescriptor(
name = "Interact Highlight",
description = "Outlines npcs and objects you interact with or hover over",
enabledByDefault = false
)
public class InteractHighlightPlugin extends Plugin
{
@Inject
private OverlayManager overlayManager;
@Inject
private InteractHighlightOverlay interactHighlightOverlay;
@Inject
private Client client;
@Getter(AccessLevel.PACKAGE)
private TileObject interactedObject;
private NPC interactedNpc;
@Getter(AccessLevel.PACKAGE)
boolean attacked;
private int clickTick;
@Getter(AccessLevel.PACKAGE)
private int gameCycle;
@Provides
InteractHighlightConfig provideConfig(ConfigManager configManager)
{
return configManager.getConfig(InteractHighlightConfig.class);
}
@Override
protected void startUp()
{
overlayManager.add(interactHighlightOverlay);
}
@Override
protected void shutDown()
{
overlayManager.remove(interactHighlightOverlay);
}
@Subscribe
public void onGameStateChanged(GameStateChanged gameStateChanged)
{
if (gameStateChanged.getGameState() == GameState.LOADING)
{
interactedObject = null;
}
}
@Subscribe
public void onNpcDespawned(NpcDespawned npcDespawned)
{
if (npcDespawned.getNpc() == interactedNpc)
{
interactedNpc = null;
}
}
@Subscribe
public void onGameTick(GameTick gameTick)
{
if (client.getTickCount() > clickTick && client.getLocalDestinationLocation() == null)
{
// when the destination is reached, clear the interacting object
interactedObject = null;
interactedNpc = null;
}
}
@Subscribe
public void onInteractingChanged(InteractingChanged interactingChanged)
{
if (interactingChanged.getSource() == client.getLocalPlayer()
&& client.getTickCount() > clickTick && interactingChanged.getTarget() != interactedNpc)
{
interactedNpc = null;
attacked = interactingChanged.getTarget() != null && interactingChanged.getTarget().getCombatLevel() > 0;
}
}
@Subscribe
public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked)
{
switch (menuOptionClicked.getMenuAction())
{
case ITEM_USE_ON_GAME_OBJECT:
case SPELL_CAST_ON_GAME_OBJECT:
case GAME_OBJECT_FIRST_OPTION:
case GAME_OBJECT_SECOND_OPTION:
case GAME_OBJECT_THIRD_OPTION:
case GAME_OBJECT_FOURTH_OPTION:
case GAME_OBJECT_FIFTH_OPTION:
{
int x = menuOptionClicked.getParam0();
int y = menuOptionClicked.getParam1();
int id = menuOptionClicked.getId();
interactedObject = findTileObject(x, y, id);
interactedNpc = null;
clickTick = client.getTickCount();
gameCycle = client.getGameCycle();
break;
}
case ITEM_USE_ON_NPC:
case SPELL_CAST_ON_NPC:
case NPC_FIRST_OPTION:
case NPC_SECOND_OPTION:
case NPC_THIRD_OPTION:
case NPC_FOURTH_OPTION:
case NPC_FIFTH_OPTION:
{
int id = menuOptionClicked.getId();
interactedObject = null;
interactedNpc = findNpc(id);
attacked = menuOptionClicked.getMenuAction() == MenuAction.NPC_SECOND_OPTION || menuOptionClicked.getMenuAction() == MenuAction.SPELL_CAST_ON_NPC;
clickTick = client.getTickCount();
gameCycle = client.getGameCycle();
break;
}
// Any menu click which clears an interaction
case WALK:
case ITEM_USE:
case ITEM_USE_ON_GROUND_ITEM:
case ITEM_USE_ON_PLAYER:
case ITEM_FIRST_OPTION:
case ITEM_SECOND_OPTION:
case ITEM_THIRD_OPTION:
case ITEM_FOURTH_OPTION:
case ITEM_FIFTH_OPTION:
case GROUND_ITEM_FIRST_OPTION:
case GROUND_ITEM_SECOND_OPTION:
case GROUND_ITEM_THIRD_OPTION:
case GROUND_ITEM_FOURTH_OPTION:
case GROUND_ITEM_FIFTH_OPTION:
interactedObject = null;
interactedNpc = null;
}
}
TileObject findTileObject(int x, int y, int id)
{
Scene scene = client.getScene();
Tile[][][] tiles = scene.getTiles();
Tile tile = tiles[client.getPlane()][x][y];
if (tile != null)
{
for (GameObject gameObject : tile.getGameObjects())
{
if (gameObject != null && gameObject.getId() == id)
{
return gameObject;
}
}
WallObject wallObject = tile.getWallObject();
if (wallObject != null && wallObject.getId() == id)
{
return wallObject;
}
DecorativeObject decorativeObject = tile.getDecorativeObject();
if (decorativeObject != null && decorativeObject.getId() == id)
{
return decorativeObject;
}
GroundObject groundObject = tile.getGroundObject();
if (groundObject != null && groundObject.getId() == id)
{
return groundObject;
}
}
return null;
}
NPC findNpc(int id)
{
return client.getCachedNPCs()[id];
}
@Nullable
Actor getInteractedTarget()
{
return interactedNpc != null ? interactedNpc : client.getLocalPlayer().getInteracting();
}
}

View File

@@ -212,6 +212,7 @@ public class ItemStatChanges
add(combo(boost(ATTACK, 2), boost(STRENGTH, 1), heal(DEFENCE, -1)), JANGERBERRIES); add(combo(boost(ATTACK, 2), boost(STRENGTH, 1), heal(DEFENCE, -1)), JANGERBERRIES);
// Gauntlet items // Gauntlet items
add(heal(HITPOINTS, 16), CRYSTAL_PADDLEFISH);
add(heal(HITPOINTS, 20), PADDLEFISH); add(heal(HITPOINTS, 20), PADDLEFISH);
add(new GauntletPotion(), EGNIOL_POTION_1, EGNIOL_POTION_2, EGNIOL_POTION_3, EGNIOL_POTION_4); add(new GauntletPotion(), EGNIOL_POTION_1, EGNIOL_POTION_2, EGNIOL_POTION_3, EGNIOL_POTION_4);

View File

@@ -218,7 +218,7 @@ public class KourendLibraryPlugin extends Plugin
{ {
if (MenuAction.GAME_OBJECT_FIRST_OPTION == menuOpt.getMenuAction() && menuOpt.getMenuTarget().contains("Bookshelf")) if (MenuAction.GAME_OBJECT_FIRST_OPTION == menuOpt.getMenuAction() && menuOpt.getMenuTarget().contains("Bookshelf"))
{ {
lastBookcaseClick = WorldPoint.fromScene(client, menuOpt.getActionParam(), menuOpt.getWidgetId(), client.getPlane()); lastBookcaseClick = WorldPoint.fromScene(client, menuOpt.getParam0(), menuOpt.getParam1(), client.getPlane());
} }
} }

View File

@@ -792,7 +792,8 @@ public class LootTrackerPlugin extends Plugin
|| WINTERTODT_SUPPLY_CRATE_EVENT.equals(eventType) || WINTERTODT_SUPPLY_CRATE_EVENT.equals(eventType)
|| eventType.endsWith("Bird House") || eventType.endsWith("Bird House")
|| eventType.startsWith("H.A.M. chest") || eventType.startsWith("H.A.M. chest")
|| lootRecordType == LootRecordType.PICKPOCKET) || lootRecordType == LootRecordType.PICKPOCKET
|| eventType.endsWith("lockbox"))
{ {
WorldPoint playerLocation = client.getLocalPlayer().getWorldLocation(); WorldPoint playerLocation = client.getLocalPlayer().getWorldLocation();
Collection<ItemStack> groundItems = lootManager.getItemSpawns(playerLocation); Collection<ItemStack> groundItems = lootManager.getItemSpawns(playerLocation);
@@ -860,6 +861,12 @@ public class LootTrackerPlugin extends Plugin
setEvent(LootRecordType.EVENT, TEMPOROSS_CASKET_EVENT); setEvent(LootRecordType.EVENT, TEMPOROSS_CASKET_EVENT);
takeInventorySnapshot(); takeInventorySnapshot();
break; break;
case ItemID.SIMPLE_LOCKBOX_25647:
case ItemID.ELABORATE_LOCKBOX_25649:
case ItemID.ORNATE_LOCKBOX_25651:
setEvent(LootRecordType.EVENT, itemManager.getItemComposition(event.getId()).getName());
takeInventorySnapshot();
break;
} }
} }
} }

View File

@@ -600,7 +600,7 @@ public class MenuEntrySwapperPlugin extends Plugin
&& (menuEntryAdded.getOption().startsWith("Deposit-") || menuEntryAdded.getOption().startsWith("Store") || menuEntryAdded.getOption().startsWith("Donate"))) && (menuEntryAdded.getOption().startsWith("Deposit-") || menuEntryAdded.getOption().startsWith("Store") || menuEntryAdded.getOption().startsWith("Donate")))
{ {
ShiftDepositMode shiftDepositMode = config.bankDepositShiftClick(); ShiftDepositMode shiftDepositMode = config.bankDepositShiftClick();
final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntryAdded.getActionParam1()); final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntryAdded.getParam1());
final int opId = widgetGroupId == WidgetID.DEPOSIT_BOX_GROUP_ID ? shiftDepositMode.getIdentifierDepositBox() final int opId = widgetGroupId == WidgetID.DEPOSIT_BOX_GROUP_ID ? shiftDepositMode.getIdentifierDepositBox()
: widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_INVENTORY_GROUP_ID ? shiftDepositMode.getIdentifierChambersStorageUnit() : widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_INVENTORY_GROUP_ID ? shiftDepositMode.getIdentifierChambersStorageUnit()
: shiftDepositMode.getIdentifier(); : shiftDepositMode.getIdentifier();
@@ -615,7 +615,7 @@ public class MenuEntrySwapperPlugin extends Plugin
&& menuEntryAdded.getOption().startsWith("Withdraw")) && menuEntryAdded.getOption().startsWith("Withdraw"))
{ {
ShiftWithdrawMode shiftWithdrawMode = config.bankWithdrawShiftClick(); ShiftWithdrawMode shiftWithdrawMode = config.bankWithdrawShiftClick();
final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntryAdded.getActionParam1()); final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntryAdded.getParam1());
final int actionId, opId; final int actionId, opId;
if (widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_PRIVATE_GROUP_ID || widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_SHARED_GROUP_ID) if (widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_PRIVATE_GROUP_ID || widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_SHARED_GROUP_ID)
{ {
@@ -656,7 +656,7 @@ public class MenuEntrySwapperPlugin extends Plugin
@Subscribe @Subscribe
public void onMenuOptionClicked(MenuOptionClicked event) public void onMenuOptionClicked(MenuOptionClicked event)
{ {
if (event.getMenuAction() != MenuAction.RUNELITE || event.getWidgetId() != WidgetInfo.INVENTORY.getId()) if (event.getMenuAction() != MenuAction.RUNELITE || event.getParam1() != WidgetInfo.INVENTORY.getId())
{ {
return; return;
} }

View File

@@ -37,9 +37,10 @@ public enum ShiftWithdrawMode
WITHDRAW_10("Withdraw-10", MenuAction.CC_OP, 4, 3), WITHDRAW_10("Withdraw-10", MenuAction.CC_OP, 4, 3),
WITHDRAW_X("Withdraw-X", MenuAction.CC_OP, 5, 5), WITHDRAW_X("Withdraw-X", MenuAction.CC_OP, 5, 5),
WITHDRAW_ALL("Withdraw-All", MenuAction.CC_OP_LOW_PRIORITY, 7, 4), WITHDRAW_ALL("Withdraw-All", MenuAction.CC_OP_LOW_PRIORITY, 7, 4),
// chambers of xeric storage units do not have an "all-but-1" option, so this option will choose "Withdraw-all" // chambers of xeric storage units do not have an "all-but-1" option or a "placeholder" option, so these options will choose "Withdraw-all"
// instead when using the storage unit. // choose "Withdraw-all" instead when using the storage unit.
WITHDRAW_ALL_BUT_1("Withdraw-All-But-1", MenuAction.CC_OP_LOW_PRIORITY, 8, 4), WITHDRAW_ALL_BUT_1("Withdraw-All-But-1", MenuAction.CC_OP_LOW_PRIORITY, 8, 4),
WITHDRAW_PLACEHOLDER("Placeholder", MenuAction.CC_OP_LOW_PRIORITY, 9, 4),
OFF("Off", MenuAction.UNKNOWN, 0, 0); OFF("Off", MenuAction.UNKNOWN, 0, 0);
private final String name; private final String name;

View File

@@ -296,7 +296,7 @@ public class NpcIndicatorsPlugin extends Plugin
tagAllEntry.setOption(highlights.stream().anyMatch(npcName::equalsIgnoreCase) ? UNTAG_ALL : TAG_ALL); tagAllEntry.setOption(highlights.stream().anyMatch(npcName::equalsIgnoreCase) ? UNTAG_ALL : TAG_ALL);
tagAllEntry.setTarget(event.getTarget()); tagAllEntry.setTarget(event.getTarget());
tagAllEntry.setParam0(event.getActionParam0()); tagAllEntry.setParam0(event.getActionParam0());
tagAllEntry.setParam1(event.getActionParam1()); tagAllEntry.setParam1(event.getParam1());
tagAllEntry.setIdentifier(event.getIdentifier()); tagAllEntry.setIdentifier(event.getIdentifier());
tagAllEntry.setType(MenuAction.RUNELITE.getId()); tagAllEntry.setType(MenuAction.RUNELITE.getId());
} }
@@ -309,7 +309,7 @@ public class NpcIndicatorsPlugin extends Plugin
tagEntry.setOption(npcTags.contains(npc.getIndex()) ? UNTAG : TAG); tagEntry.setOption(npcTags.contains(npc.getIndex()) ? UNTAG : TAG);
tagEntry.setTarget(event.getTarget()); tagEntry.setTarget(event.getTarget());
tagEntry.setParam0(event.getActionParam0()); tagEntry.setParam0(event.getActionParam0());
tagEntry.setParam1(event.getActionParam1()); tagEntry.setParam1(event.getParam1());
tagEntry.setIdentifier(event.getIdentifier()); tagEntry.setIdentifier(event.getIdentifier());
tagEntry.setType(MenuAction.RUNELITE.getId()); tagEntry.setType(MenuAction.RUNELITE.getId());

View File

@@ -222,7 +222,7 @@ public class ObjectIndicatorsPlugin extends Plugin
return; return;
} }
final Tile tile = client.getScene().getTiles()[client.getPlane()][event.getActionParam0()][event.getActionParam1()]; final Tile tile = client.getScene().getTiles()[client.getPlane()][event.getActionParam0()][event.getParam1()];
final TileObject tileObject = findTileObject(tile, event.getIdentifier()); final TileObject tileObject = findTileObject(tile, event.getIdentifier());
if (tileObject == null) if (tileObject == null)
@@ -236,7 +236,7 @@ public class ObjectIndicatorsPlugin extends Plugin
menuEntry.setOption(objects.stream().anyMatch(o -> o.getTileObject() == tileObject) ? UNMARK : MARK); menuEntry.setOption(objects.stream().anyMatch(o -> o.getTileObject() == tileObject) ? UNMARK : MARK);
menuEntry.setTarget(event.getTarget()); menuEntry.setTarget(event.getTarget());
menuEntry.setParam0(event.getActionParam0()); menuEntry.setParam0(event.getActionParam0());
menuEntry.setParam1(event.getActionParam1()); menuEntry.setParam1(event.getParam1());
menuEntry.setIdentifier(event.getIdentifier()); menuEntry.setIdentifier(event.getIdentifier());
menuEntry.setType(MenuAction.RUNELITE.getId()); menuEntry.setType(MenuAction.RUNELITE.getId());
client.setMenuEntries(menuEntries); client.setMenuEntries(menuEntries);
@@ -253,8 +253,8 @@ public class ObjectIndicatorsPlugin extends Plugin
Scene scene = client.getScene(); Scene scene = client.getScene();
Tile[][][] tiles = scene.getTiles(); Tile[][][] tiles = scene.getTiles();
final int x = event.getActionParam(); final int x = event.getParam0();
final int y = event.getWidgetId(); final int y = event.getParam1();
final int z = client.getPlane(); final int z = client.getPlane();
final Tile tile = tiles[z][x][y]; final Tile tile = tiles[z][x][y];

View File

@@ -64,12 +64,7 @@ class BurnerOverlay extends Overlay
plugin.getIncenseBurners().forEach((tile, burner) -> plugin.getIncenseBurners().forEach((tile, burner) ->
{ {
if (tile.getPlane() != client.getPlane()) if (tile.getPlane() != client.getPlane() || !burner.isLit())
{
return;
}
if (!PohPlugin.BURNER_LIT.contains(burner.getId()))
{ {
return; return;
} }

View File

@@ -25,20 +25,22 @@
package net.runelite.client.plugins.poh; package net.runelite.client.plugins.poh;
import java.time.Instant; import java.time.Instant;
import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
@RequiredArgsConstructor
@AllArgsConstructor
class IncenseBurner class IncenseBurner
{ {
private final Instant start = Instant.now(); private Instant start;
private final int id; private boolean lit;
private double countdownTimer; private double countdownTimer;
private double randomTimer; private double randomTimer;
private Instant end; private Instant end;
void reset()
{
countdownTimer = 0;
randomTimer = 0;
}
} }

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.poh;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.inject.Provides; import com.google.inject.Provides;
import java.io.IOException; import java.io.IOException;
import java.time.Instant;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@@ -49,7 +50,6 @@ import net.runelite.api.Tile;
import net.runelite.api.TileObject; import net.runelite.api.TileObject;
import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.LocalPoint;
import net.runelite.api.events.AnimationChanged; import net.runelite.api.events.AnimationChanged;
import net.runelite.client.events.ConfigChanged;
import net.runelite.api.events.DecorativeObjectDespawned; import net.runelite.api.events.DecorativeObjectDespawned;
import net.runelite.api.events.DecorativeObjectSpawned; import net.runelite.api.events.DecorativeObjectSpawned;
import net.runelite.api.events.GameObjectDespawned; import net.runelite.api.events.GameObjectDespawned;
@@ -57,6 +57,7 @@ import net.runelite.api.events.GameObjectSpawned;
import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameStateChanged;
import net.runelite.client.config.ConfigManager; import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe; import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.game.HiscoreManager; import net.runelite.client.game.HiscoreManager;
import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginDescriptor;
@@ -144,9 +145,11 @@ public class PohPlugin extends Plugin
return; return;
} }
final double countdownTimer = 130.0; // Minimum amount of seconds a burner will light IncenseBurner incenseBurner = incenseBurners.computeIfAbsent(event.getTile(), k -> new IncenseBurner());
final double randomTimer = 30.0; // Minimum amount of seconds a burner will light incenseBurner.setStart(Instant.now());
incenseBurners.put(event.getTile(), new IncenseBurner(gameObject.getId(), countdownTimer, randomTimer, null)); incenseBurner.setLit(BURNER_LIT.contains(gameObject.getId()));
incenseBurner.setEnd(null);
// The burner timers are set when observing a player light the burner
} }
@Subscribe @Subscribe
@@ -203,6 +206,7 @@ public class PohPlugin extends Plugin
.ifPresent(tile -> .ifPresent(tile ->
{ {
final IncenseBurner incenseBurner = incenseBurners.get(tile); final IncenseBurner incenseBurner = incenseBurners.get(tile);
incenseBurner.reset();
if (actor == client.getLocalPlayer()) if (actor == client.getLocalPlayer())
{ {
@@ -245,6 +249,7 @@ public class PohPlugin extends Plugin
{ {
final double tickLengthSeconds = Constants.GAME_TICK_LENGTH / 1000.0; final double tickLengthSeconds = Constants.GAME_TICK_LENGTH / 1000.0;
incenseBurner.setCountdownTimer((200 + fmLevel) * tickLengthSeconds); incenseBurner.setCountdownTimer((200 + fmLevel) * tickLengthSeconds);
incenseBurner.setRandomTimer(fmLevel * tickLengthSeconds); incenseBurner.setRandomTimer((fmLevel - 1) * tickLengthSeconds);
log.debug("Set burner timer for firemaking level {}", fmLevel);
} }
} }

View File

@@ -138,7 +138,7 @@ public class PuzzleSolverPlugin extends Plugin
@Subscribe @Subscribe
public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked) public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked)
{ {
int widgetId = menuOptionClicked.getWidgetId(); int widgetId = menuOptionClicked.getParam1();
if (TO_GROUP(widgetId) != WidgetID.LIGHT_BOX_GROUP_ID) if (TO_GROUP(widgetId) != WidgetID.LIGHT_BOX_GROUP_ID)
{ {
return; return;

View File

@@ -137,7 +137,7 @@ enum Task
MOGRES("Mogres", ItemID.MOGRE), MOGRES("Mogres", ItemID.MOGRE),
MOLANISKS("Molanisks", ItemID.MOLANISK), MOLANISKS("Molanisks", ItemID.MOLANISK),
MONKEYS("Monkeys", ItemID.ENSOULED_MONKEY_HEAD, "Tortured gorilla"), MONKEYS("Monkeys", ItemID.ENSOULED_MONKEY_HEAD, "Tortured gorilla"),
MOSS_GIANTS("Moss giants", ItemID.HILL_GIANT_CLUB), MOSS_GIANTS("Moss giants", ItemID.MOSSY_KEY),
MUTATED_ZYGOMITES("Mutated zygomites", ItemID.MUTATED_ZYGOMITE, 7, ItemID.FUNGICIDE_SPRAY_0, "Zygomite", "Fungi"), MUTATED_ZYGOMITES("Mutated zygomites", ItemID.MUTATED_ZYGOMITE, 7, ItemID.FUNGICIDE_SPRAY_0, "Zygomite", "Fungi"),
NECHRYAEL("Nechryael", ItemID.NECHRYAEL, "Nechryarch"), NECHRYAEL("Nechryael", ItemID.NECHRYAEL, "Nechryarch"),
OGRES("Ogres", ItemID.ENSOULED_OGRE_HEAD), OGRES("Ogres", ItemID.ENSOULED_OGRE_HEAD),

View File

@@ -487,7 +487,7 @@ public class TimersPlugin extends Plugin
imbuedHeartClickTick = client.getTickCount(); imbuedHeartClickTick = client.getTickCount();
} }
TeleportWidget teleportWidget = TeleportWidget.of(event.getWidgetId()); TeleportWidget teleportWidget = TeleportWidget.of(event.getParam1());
if (teleportWidget != null) if (teleportWidget != null)
{ {
lastTeleportClicked = teleportWidget; lastTeleportClicked = teleportWidget;

View File

@@ -284,11 +284,11 @@ public class WikiPlugin extends Plugin
} }
id = lc.getId(); id = lc.getId();
name = lc.getName(); name = lc.getName();
location = WorldPoint.fromScene(client, ev.getActionParam(), ev.getWidgetId(), client.getPlane()); location = WorldPoint.fromScene(client, ev.getParam0(), ev.getParam1(), client.getPlane());
break; break;
} }
case SPELL_CAST_ON_WIDGET: case SPELL_CAST_ON_WIDGET:
Widget w = getWidget(ev.getWidgetId(), ev.getActionParam()); Widget w = getWidget(ev.getParam1(), ev.getParam0());
if (w.getType() == WidgetType.GRAPHIC && w.getItemId() != -1) if (w.getType() == WidgetType.GRAPHIC && w.getItemId() != -1)
{ {
@@ -360,7 +360,7 @@ public class WikiPlugin extends Plugin
public void onMenuEntryAdded(MenuEntryAdded event) public void onMenuEntryAdded(MenuEntryAdded event)
{ {
int widgetIndex = event.getActionParam0(); int widgetIndex = event.getActionParam0();
int widgetID = event.getActionParam1(); int widgetID = event.getParam1();
MenuEntry[] menuEntries = client.getMenuEntries(); MenuEntry[] menuEntries = client.getMenuEntries();
if (wikiSelected && event.getType() == MenuAction.SPELL_CAST_ON_WIDGET.getId()) if (wikiSelected && event.getType() == MenuAction.SPELL_CAST_ON_WIDGET.getId())

View File

@@ -355,7 +355,7 @@ public class WorldHopperPlugin extends Plugin
return; return;
} }
final int componentId = event.getActionParam1(); final int componentId = event.getParam1();
int groupId = WidgetInfo.TO_GROUP(componentId); int groupId = WidgetInfo.TO_GROUP(componentId);
String option = event.getOption(); String option = event.getOption();
@@ -401,7 +401,7 @@ public class WorldHopperPlugin extends Plugin
hopTo.setTarget(event.getTarget()); hopTo.setTarget(event.getTarget());
hopTo.setType(MenuAction.RUNELITE.getId()); hopTo.setType(MenuAction.RUNELITE.getId());
hopTo.setParam0(event.getActionParam0()); hopTo.setParam0(event.getActionParam0());
hopTo.setParam1(event.getActionParam1()); hopTo.setParam1(event.getParam1());
insertMenuEntry(hopTo, client.getMenuEntries(), after); insertMenuEntry(hopTo, client.getMenuEntries(), after);
} }

View File

@@ -29,32 +29,32 @@ import lombok.Getter;
import net.runelite.api.Quest; import net.runelite.api.Quest;
import net.runelite.api.coords.WorldPoint; import net.runelite.api.coords.WorldPoint;
// Some quests are in the same spot, but they are done in order. If multiple
// quests start in the same location, an array of quests is expected.
enum QuestStartLocation enum QuestStartLocation
{ {
//Free Quests //Free Quests
BELOW_ICE_MOUNTAIN(Quest.BELOW_ICE_MOUNTAIN, new WorldPoint(3001, 3436, 0)), BELOW_ICE_MOUNTAIN(Quest.BELOW_ICE_MOUNTAIN, new WorldPoint(3001, 3436, 0)),
COOKS_ASSISTANT_RFD(Quest.COOKS_ASSISTANT, new WorldPoint(3211, 3216, 0)), BLACK_KNIGHTS_FORTRESS(Quest.BLACK_KNIGHTS_FORTRESS, new WorldPoint(2959, 3336, 0)),
COOKS_ASSISTANT(Quest.COOKS_ASSISTANT, new WorldPoint(3209, 3215, 0)),
THE_CORSAIR_CURSE(Quest.THE_CORSAIR_CURSE, new WorldPoint(3029, 3273, 0)), THE_CORSAIR_CURSE(Quest.THE_CORSAIR_CURSE, new WorldPoint(3029, 3273, 0)),
DEMON_SLAYER(Quest.DEMON_SLAYER, new WorldPoint(3204, 3424, 0)), DEMON_SLAYER(Quest.DEMON_SLAYER, new WorldPoint(3204, 3424, 0)),
DORICS_QUEST(Quest.DORICS_QUEST, new WorldPoint(2952, 3450, 0)), DORICS_QUEST(Quest.DORICS_QUEST, new WorldPoint(2952, 3450, 0)),
DRAGON_SLAYER_I(Quest.DRAGON_SLAYER_I, new WorldPoint(3190, 3362, 0)), DRAGON_SLAYER_I(Quest.DRAGON_SLAYER_I, new WorldPoint(3190, 3362, 0)),
ERNEST_THE_CHICKEN(Quest.ERNEST_THE_CHICKEN, new WorldPoint(3109, 3330, 0)), ERNEST_THE_CHICKEN(Quest.ERNEST_THE_CHICKEN, new WorldPoint(3109, 3330, 0)),
GOBLIN_DIPLOMACY(Quest.GOBLIN_DIPLOMACY, new WorldPoint(2957, 3509, 0)), GOBLIN_DIPLOMACY(Quest.GOBLIN_DIPLOMACY, new WorldPoint(2957, 3509, 0)),
IMP_CATCHER(Quest.IMP_CATCHER, new WorldPoint(3108, 3160, 0)), IMP_CATCHER(Quest.IMP_CATCHER, new WorldPoint(3102, 3164, 0)),
THE_KNIGHTS_SWORD(Quest.THE_KNIGHTS_SWORD, new WorldPoint(2976, 3342, 0)), THE_KNIGHTS_SWORD(Quest.THE_KNIGHTS_SWORD, new WorldPoint(2976, 3342, 0)),
MISTHALIN_MYSTERY(Quest.MISTHALIN_MYSTERY, new WorldPoint(3235, 3155, 0)), MISTHALIN_MYSTERY(Quest.MISTHALIN_MYSTERY, new WorldPoint(3235, 3155, 0)),
PIRATES_TREASURE(Quest.PIRATES_TREASURE, new WorldPoint(3051, 3252, 0)), PIRATES_TREASURE(Quest.PIRATES_TREASURE, new WorldPoint(3051, 3252, 0)),
PRINCE_ALI_RESCUE(Quest.PRINCE_ALI_RESCUE, new WorldPoint(3301, 3163, 0)), PRINCE_ALI_RESCUE(Quest.PRINCE_ALI_RESCUE, new WorldPoint(3301, 3163, 0)),
THE_RESTLESS_GHOST(Quest.THE_RESTLESS_GHOST, new WorldPoint(3240, 3210, 0)), THE_RESTLESS_GHOST(Quest.THE_RESTLESS_GHOST, new WorldPoint(3240, 3210, 0)),
RUNE_MYSTERIES(Quest.RUNE_MYSTERIES, new WorldPoint(3210, 3220, 0)), ROMEO__JULIET(Quest.ROMEO__JULIET, new WorldPoint(3210, 3423, 0)),
SHEEP_SHEARER(Quest.SHEEP_SHEARER, new WorldPoint(3190, 3272, 0)), RUNE_MYSTERIES(Quest.RUNE_MYSTERIES, new WorldPoint(3211, 3224, 0)),
SHEEP_SHEARER(Quest.SHEEP_SHEARER, new WorldPoint(3187, 3272, 0)),
SHIELD_OF_ARRAV_PHOENIX_GANG(Quest.SHIELD_OF_ARRAV, new WorldPoint(3208, 3495, 0)), SHIELD_OF_ARRAV_PHOENIX_GANG(Quest.SHIELD_OF_ARRAV, new WorldPoint(3208, 3495, 0)),
SHIELD_OF_ARRAV_BLACK_ARM_GANG(Quest.SHIELD_OF_ARRAV, new WorldPoint(3208, 3392, 0)), SHIELD_OF_ARRAV_BLACK_ARM_GANG(Quest.SHIELD_OF_ARRAV, new WorldPoint(3208, 3392, 0)),
VAMPYRE_SLAYER(Quest.VAMPYRE_SLAYER, new WorldPoint(3096, 3266, 0)), VAMPYRE_SLAYER(Quest.VAMPYRE_SLAYER, new WorldPoint(3096, 3266, 0)),
WITCHS_POTION(Quest.WITCHS_POTION, new WorldPoint(2967, 3203, 0)), WITCHS_POTION(Quest.WITCHS_POTION, new WorldPoint(2968, 3204, 0)),
X_MARKS_THE_SPOT(Quest.X_MARKS_THE_SPOT, new WorldPoint(3227, 3242, 0)), X_MARKS_THE_SPOT(Quest.X_MARKS_THE_SPOT, new WorldPoint(3226, 3242, 0)),
//Members' Quests //Members' Quests
ANIMAL_MAGNETISM(Quest.ANIMAL_MAGNETISM, new WorldPoint(3094, 3360, 0)), ANIMAL_MAGNETISM(Quest.ANIMAL_MAGNETISM, new WorldPoint(3094, 3360, 0)),
@@ -65,29 +65,31 @@ enum QuestStartLocation
BIOHAZARD(Quest.BIOHAZARD, new WorldPoint(2591, 3335, 0)), BIOHAZARD(Quest.BIOHAZARD, new WorldPoint(2591, 3335, 0)),
BONE_VOYAGE(Quest.BONE_VOYAGE, new WorldPoint(3259, 3450, 0)), BONE_VOYAGE(Quest.BONE_VOYAGE, new WorldPoint(3259, 3450, 0)),
CABIN_FEVER(Quest.CABIN_FEVER, new WorldPoint(3674, 3496, 0)), CABIN_FEVER(Quest.CABIN_FEVER, new WorldPoint(3674, 3496, 0)),
CLIENT_OF_KOUREND(Quest.CLIENT_OF_KOUREND, new WorldPoint(1823, 3690, 0)), CLIENT_OF_KOUREND(Quest.CLIENT_OF_KOUREND, new WorldPoint(1825, 3690, 0)),
CLOCK_TOWER(Quest.CLOCK_TOWER, new WorldPoint(2568, 3249, 0)), CLOCK_TOWER(Quest.CLOCK_TOWER, new WorldPoint(2568, 3249, 0)),
COLD_WAR(Quest.COLD_WAR, new WorldPoint(2593, 3265, 0)), COLD_WAR(Quest.COLD_WAR, new WorldPoint(2593, 3265, 0)),
CONTACT(Quest.CONTACT, new WorldPoint(3280, 2770, 0)), CONTACT(Quest.CONTACT, new WorldPoint(3280, 2770, 0)),
CREATURE_OF_FENKENSTRAIN(Quest.CREATURE_OF_FENKENSTRAIN, new WorldPoint(3487, 3485, 0)), CREATURE_OF_FENKENSTRAIN(Quest.CREATURE_OF_FENKENSTRAIN, new WorldPoint(3487, 3485, 0)),
DARKNESS_OF_HALLOWVALE(Quest.DARKNESS_OF_HALLOWVALE, new WorldPoint(3494, 9628, 0)), DARKNESS_OF_HALLOWVALE(Quest.DARKNESS_OF_HALLOWVALE, new WorldPoint(3493, 9588, 0)),
DEATH_PLATEAU_TROLL_STRONGHOLD(new Quest[]{Quest.DEATH_PLATEAU, Quest.TROLL_STRONGHOLD}, new WorldPoint(2895, 3528, 0)), DEATH_PLATEAU(Quest.DEATH_PLATEAU, new WorldPoint(2897, 3529, 0)),
DEATH_TO_THE_DORGESHUUN(Quest.DEATH_TO_THE_DORGESHUUN, new WorldPoint(3316, 9613, 0)), DEATH_TO_THE_DORGESHUUN(Quest.DEATH_TO_THE_DORGESHUUN, new WorldPoint(3316, 9613, 0)),
THE_DEPTHS_OF_DESPAIR(Quest.THE_DEPTHS_OF_DESPAIR, new WorldPoint(1781, 3570, 0)), THE_DEPTHS_OF_DESPAIR(Quest.THE_DEPTHS_OF_DESPAIR, new WorldPoint(1781, 3570, 0)),
DESERT_TREASURE(Quest.DESERT_TREASURE, new WorldPoint(3177, 3043, 0)), DESERT_TREASURE(Quest.DESERT_TREASURE, new WorldPoint(3177, 3043, 0)),
DEVIOUS_MINDS(Quest.DEVIOUS_MINDS, new WorldPoint(3405, 3492, 0)), DEVIOUS_MINDS(Quest.DEVIOUS_MINDS, new WorldPoint(3405, 3492, 0)),
THE_DIG_SITE(Quest.THE_DIG_SITE, new WorldPoint(3363, 3337, 0)), THE_DIG_SITE(Quest.THE_DIG_SITE, new WorldPoint(3363, 3341, 0)),
DRAGON_SLAYER_II(Quest.DRAGON_SLAYER_II, new WorldPoint(2456, 2868, 0)), DRAGON_SLAYER_II(Quest.DRAGON_SLAYER_II, new WorldPoint(2456, 2868, 0)),
DREAM_MENTOR(Quest.DREAM_MENTOR, new WorldPoint(2144, 10346, 0)), DREAM_MENTOR(Quest.DREAM_MENTOR, new WorldPoint(2144, 10346, 0)),
DRUIDIC_RITUAL(Quest.DRUIDIC_RITUAL, new WorldPoint(2916, 3484, 0)), DRUIDIC_RITUAL(Quest.DRUIDIC_RITUAL, new WorldPoint(2916, 3484, 0)),
DWARF_CANNON(Quest.DWARF_CANNON, new WorldPoint(2566, 3461, 0)), DWARF_CANNON(Quest.DWARF_CANNON, new WorldPoint(2566, 3461, 0)),
EADGARS_RUSE(Quest.EADGARS_RUSE, new WorldPoint(2896, 3426, 0)), EADGARS_RUSE(Quest.EADGARS_RUSE, new WorldPoint(2896, 3426, 0)),
EAGLES_PEAK(Quest.EAGLES_PEAK, new WorldPoint(2605, 3264, 0)), EAGLES_PEAK(Quest.EAGLES_PEAK, new WorldPoint(2605, 3264, 0)),
ELEMENTAL_WORKSHOP(new Quest[]{Quest.ELEMENTAL_WORKSHOP_I, Quest.ELEMENTAL_WORKSHOP_II}, new WorldPoint(2714, 3482, 0)), ELEMENTAL_WORKSHOP_I(Quest.ELEMENTAL_WORKSHOP_I, new WorldPoint(2714, 3482, 0)),
ELEMENTAL_WORKSHOP_II(Quest.ELEMENTAL_WORKSHOP_II, new WorldPoint(3364, 3335, 0)),
ENAKHRAS_LAMENT(Quest.ENAKHRAS_LAMENT, new WorldPoint(3190, 2926, 0)), ENAKHRAS_LAMENT(Quest.ENAKHRAS_LAMENT, new WorldPoint(3190, 2926, 0)),
ENLIGHTENED_JOURNEY(Quest.ENLIGHTENED_JOURNEY, new WorldPoint(2809, 3356, 0)), ENLIGHTENED_JOURNEY(Quest.ENLIGHTENED_JOURNEY, new WorldPoint(2809, 3356, 0)),
THE_EYES_OF_GLOUPHRIE(Quest.THE_EYES_OF_GLOUPHRIE, new WorldPoint(2400, 3419, 0)), THE_EYES_OF_GLOUPHRIE(Quest.THE_EYES_OF_GLOUPHRIE, new WorldPoint(2405, 9817, 0)),
FAIRYTALE(new Quest[]{Quest.FAIRYTALE_I__GROWING_PAINS, Quest.FAIRYTALE_II__CURE_A_QUEEN}, new WorldPoint(3077, 3258, 0)), FAIRYTALE_I(Quest.FAIRYTALE_I__GROWING_PAINS, new WorldPoint(3075, 3259, 0)),
FAIRYTALE_II(Quest.FAIRYTALE_II__CURE_A_QUEEN, new WorldPoint(3078, 3258, 0)),
FAMILY_CREST(Quest.FAMILY_CREST, new WorldPoint(3278, 3404, 0)), FAMILY_CREST(Quest.FAMILY_CREST, new WorldPoint(3278, 3404, 0)),
THE_FEUD(Quest.THE_FEUD, new WorldPoint(3301, 3211, 0)), THE_FEUD(Quest.THE_FEUD, new WorldPoint(3301, 3211, 0)),
FIGHT_ARENA(Quest.FIGHT_ARENA, new WorldPoint(2565, 3199, 0)), FIGHT_ARENA(Quest.FIGHT_ARENA, new WorldPoint(2565, 3199, 0)),
@@ -96,60 +98,71 @@ enum QuestStartLocation
FORGETTABLE_TALE(Quest.FORGETTABLE_TALE, new WorldPoint(2826, 10215, 0)), FORGETTABLE_TALE(Quest.FORGETTABLE_TALE, new WorldPoint(2826, 10215, 0)),
THE_FORSAKEN_TOWER(Quest.THE_FORSAKEN_TOWER, new WorldPoint(1482, 3748, 0)), THE_FORSAKEN_TOWER(Quest.THE_FORSAKEN_TOWER, new WorldPoint(1482, 3748, 0)),
THE_FREMENNIK_ISLES(Quest.THE_FREMENNIK_ISLES, new WorldPoint(2645, 3711, 0)), THE_FREMENNIK_ISLES(Quest.THE_FREMENNIK_ISLES, new WorldPoint(2645, 3711, 0)),
THE_FREMENNIK_TRIALS(Quest.THE_FREMENNIK_TRIALS, new WorldPoint(2657, 3669, 0)), THE_FREMENNIK_TRIALS(Quest.THE_FREMENNIK_TRIALS, new WorldPoint(2658, 3667, 0)),
THE_FREMENNIK_EXILES(Quest.THE_FREMENNIK_EXILES, new WorldPoint(2658, 3669, 0)), THE_FREMENNIK_EXILES(Quest.THE_FREMENNIK_EXILES, new WorldPoint(2656, 3669, 0)),
GARDEN_OF_TRANQUILLITY(Quest.GARDEN_OF_TRANQUILLITY, new WorldPoint(3227, 3477, 0)), GARDEN_OF_TRANQUILLITY(Quest.GARDEN_OF_TRANQUILLITY, new WorldPoint(3227, 3477, 0)),
GERTRUDES_CAT_RATCATCHERS(Quest.GERTRUDES_CAT, new WorldPoint(3150, 3411, 0)), GERTRUDES_CAT(Quest.GERTRUDES_CAT, new WorldPoint(3150, 3411, 0)),
GETTING_AHEAD(Quest.GETTING_AHEAD, new WorldPoint(1247, 3686, 0)), GETTING_AHEAD(Quest.GETTING_AHEAD, new WorldPoint(1247, 3686, 0)),
GHOSTS_AHOY(Quest.GHOSTS_AHOY, new WorldPoint(3677, 3510, 0)), GHOSTS_AHOY(Quest.GHOSTS_AHOY, new WorldPoint(3677, 3510, 0)),
THE_GIANT_DWARF(Quest.THE_GIANT_DWARF, new WorldPoint(2841, 10129, 0)), THE_GIANT_DWARF(Quest.THE_GIANT_DWARF, new WorldPoint(2841, 10129, 0)),
THE_GOLEM(Quest.THE_GOLEM, new WorldPoint(3487, 3089, 0)), THE_GOLEM(Quest.THE_GOLEM, new WorldPoint(3487, 3089, 0)),
THE_GRAND_TREE_MONKEY_MADNESS(new Quest[]{Quest.THE_GRAND_TREE, Quest.MONKEY_MADNESS_I, Quest.MONKEY_MADNESS_II}, new WorldPoint(2466, 3497, 0)), THE_GRAND_TREE(Quest.THE_GRAND_TREE, new WorldPoint(2464, 3494, 0)),
THE_GREAT_BRAIN_ROBBERY(Quest.THE_GREAT_BRAIN_ROBBERY, new WorldPoint(3681, 2963, 0)), THE_GREAT_BRAIN_ROBBERY(Quest.THE_GREAT_BRAIN_ROBBERY, new WorldPoint(3681, 2963, 0)),
GRIM_TALES(Quest.GRIM_TALES, new WorldPoint(2890, 3454, 0)), GRIM_TALES(Quest.GRIM_TALES, new WorldPoint(2890, 3454, 0)),
THE_HAND_IN_THE_SAND(Quest.THE_HAND_IN_THE_SAND, new WorldPoint(2552, 3101, 0)), THE_HAND_IN_THE_SAND(Quest.THE_HAND_IN_THE_SAND, new WorldPoint(2551, 3101, 0)),
HAUNTED_MINE(Quest.HAUNTED_MINE, new WorldPoint(3443, 3258, 0)), HAUNTED_MINE(Quest.HAUNTED_MINE, new WorldPoint(3443, 3258, 0)),
HAZEEL_CULT(Quest.HAZEEL_CULT, new WorldPoint(2565, 3271, 0)), HAZEEL_CULT(Quest.HAZEEL_CULT, new WorldPoint(2565, 3271, 0)),
HEROES_QUEST(Quest.HEROES_QUEST, new WorldPoint(2903, 3511, 0)), HEROES_QUEST(Quest.HEROES_QUEST, new WorldPoint(2903, 3511, 0)),
HOLY_GRAIL(new Quest[]{Quest.MERLINS_CRYSTAL, Quest.HOLY_GRAIL}, new WorldPoint(2763, 3515, 0)), HOLY_GRAIL(Quest.HOLY_GRAIL, new WorldPoint(2763, 3513, 0)),
HORROR_FROM_THE_DEEP(Quest.HORROR_FROM_THE_DEEP, new WorldPoint(2507, 3635, 0)), HORROR_FROM_THE_DEEP(Quest.HORROR_FROM_THE_DEEP, new WorldPoint(2507, 3635, 0)),
ICTHLARINS_LITTLE_HELPER(Quest.ICTHLARINS_LITTLE_HELPER, new WorldPoint(3314, 2849, 0)), ICTHLARINS_LITTLE_HELPER(Quest.ICTHLARINS_LITTLE_HELPER, new WorldPoint(3314, 2849, 0)),
IN_AID_OF_THE_MYREQUE(Quest.IN_AID_OF_THE_MYREQUE, new WorldPoint(3505, 9839, 0)),
IN_SEARCH_OF_THE_MYREQUE(Quest.IN_SEARCH_OF_THE_MYREQUE, new WorldPoint(3502, 3477, 0)), IN_SEARCH_OF_THE_MYREQUE(Quest.IN_SEARCH_OF_THE_MYREQUE, new WorldPoint(3502, 3477, 0)),
JUNGLE_POTION(Quest.JUNGLE_POTION, new WorldPoint(2809, 3086, 0)), JUNGLE_POTION(Quest.JUNGLE_POTION, new WorldPoint(2809, 3086, 0)),
A_KINGDOM_DIVIDED(Quest.A_KINGDOM_DIVIDED, new WorldPoint(1663, 3672, 0)), A_KINGDOM_DIVIDED(Quest.A_KINGDOM_DIVIDED, new WorldPoint(1663, 3672, 0)),
KINGS_RANSOM(Quest.KINGS_RANSOM, new WorldPoint(2741, 3554, 0)), KINGS_RANSOM(Quest.KINGS_RANSOM, new WorldPoint(2741, 3554, 0)),
LEGENDS_QUEST(Quest.LEGENDS_QUEST, new WorldPoint(2725, 3367, 0)), LEGENDS_QUEST(Quest.LEGENDS_QUEST, new WorldPoint(2725, 3367, 0)),
LOST_CITY(Quest.LOST_CITY, new WorldPoint(3149, 3205, 0)), LOST_CITY(Quest.LOST_CITY, new WorldPoint(3149, 3205, 0)),
THE_LOST_TRIBE(Quest.THE_LOST_TRIBE, new WorldPoint(3211, 3224, 0)), THE_LOST_TRIBE(Quest.THE_LOST_TRIBE, new WorldPoint(3210, 3220, 0)),
LUNAR_DIPLOMACY(Quest.LUNAR_DIPLOMACY, new WorldPoint(2618, 3691, 0)), LUNAR_DIPLOMACY(Quest.LUNAR_DIPLOMACY, new WorldPoint(2618, 3691, 0)),
MAKING_FRIENDS_WITH_MY_ARM(Quest.MAKING_FRIENDS_WITH_MY_ARM, new WorldPoint(2904, 10092, 0)), MAKING_FRIENDS_WITH_MY_ARM(Quest.MAKING_FRIENDS_WITH_MY_ARM, new WorldPoint(2904, 10092, 0)),
MAKING_HISTORY(Quest.MAKING_HISTORY, new WorldPoint(2435, 3346, 0)), MAKING_HISTORY(Quest.MAKING_HISTORY, new WorldPoint(2435, 3346, 0)),
MONKS_FRIEND(Quest.MONKS_FRIEND, new WorldPoint(2605, 3209, 0)), MERLINS_CRYSTAL(Quest.MERLINS_CRYSTAL, new WorldPoint(2761, 3516, 0)),
MONKEY_MADNESS_I(Quest.MONKEY_MADNESS_I, new WorldPoint(2465, 3498, 0)),
MONKEY_MADNESS_II(Quest.MONKEY_MADNESS_II, new WorldPoint(2466, 3496, 0)),
MONKS_FRIEND(Quest.MONKS_FRIEND, new WorldPoint(2605, 3211, 0)),
MOUNTAIN_DAUGHTER(Quest.MOUNTAIN_DAUGHTER, new WorldPoint(2810, 3672, 0)), MOUNTAIN_DAUGHTER(Quest.MOUNTAIN_DAUGHTER, new WorldPoint(2810, 3672, 0)),
MOURNINGS_ENDS_PART_I(Quest.MOURNINGS_END_PART_I, new WorldPoint(2289, 3149, 0)), MOURNINGS_ENDS_PART_I(Quest.MOURNINGS_END_PART_I, new WorldPoint(2288, 3147, 0)),
MOURNINGS_ENDS_PART_II(Quest.MOURNINGS_END_PART_II, new WorldPoint(2352, 3172, 0)), MOURNINGS_ENDS_PART_II(Quest.MOURNINGS_END_PART_II, new WorldPoint(2352, 3172, 0)),
MURDER_MYSTERY(Quest.MURDER_MYSTERY, new WorldPoint(2740, 3562, 0)), MURDER_MYSTERY(Quest.MURDER_MYSTERY, new WorldPoint(2740, 3562, 0)),
MY_ARMS_BIG_ADVENTURE(Quest.MY_ARMS_BIG_ADVENTURE, new WorldPoint(2908, 10088, 0)), MY_ARMS_BIG_ADVENTURE(Quest.MY_ARMS_BIG_ADVENTURE, new WorldPoint(2908, 10088, 0)),
NATURE_SPIRIT(Quest.NATURE_SPIRIT, new WorldPoint(3440, 9894, 0)), NATURE_SPIRIT(Quest.NATURE_SPIRIT, new WorldPoint(3423, 9886, 0)),
A_NIGHT_AT_THE_THEATRE(Quest.A_NIGHT_AT_THE_THEATRE, new WorldPoint(3672, 3224, 0)), A_NIGHT_AT_THE_THEATRE(Quest.A_NIGHT_AT_THE_THEATRE, new WorldPoint(3672, 3224, 0)),
OBSERVATORY_QUEST(Quest.OBSERVATORY_QUEST, new WorldPoint(2438, 3185, 0)), OBSERVATORY_QUEST(Quest.OBSERVATORY_QUEST, new WorldPoint(2438, 3185, 0)),
OLAFS_QUEST(Quest.OLAFS_QUEST, new WorldPoint(2723, 3729, 0)), OLAFS_QUEST(Quest.OLAFS_QUEST, new WorldPoint(2723, 3729, 0)),
ONE_SMALL_FAVOUR(Quest.ONE_SMALL_FAVOUR, new WorldPoint(2834, 2985, 0)), ONE_SMALL_FAVOUR(Quest.ONE_SMALL_FAVOUR, new WorldPoint(2834, 2985, 0)),
PLAGUE_CITY_SONG_OF_THE_ELVES(new Quest[]{Quest.PLAGUE_CITY, Quest.SONG_OF_THE_ELVES}, new WorldPoint(2567, 3334, 0)), PLAGUE_CITY(Quest.PLAGUE_CITY, new WorldPoint(2568, 3332, 0)),
A_PORCINE_OF_INTEREST(Quest.A_PORCINE_OF_INTEREST, new WorldPoint(3085, 3251, 0)), A_PORCINE_OF_INTEREST(Quest.A_PORCINE_OF_INTEREST, new WorldPoint(3085, 3251, 0)),
PRIEST_IN_PERIL(Quest.PRIEST_IN_PERIL, new WorldPoint(3219, 3473, 0)), PRIEST_IN_PERIL(Quest.PRIEST_IN_PERIL, new WorldPoint(3219, 3473, 0)),
THE_QUEEN_OF_THIEVES(Quest.THE_QUEEN_OF_THIEVES, new WorldPoint(1795, 3782, 0)), THE_QUEEN_OF_THIEVES(Quest.THE_QUEEN_OF_THIEVES, new WorldPoint(1795, 3782, 0)),
RAG_AND_BONE_MAN_I(new Quest[]{Quest.RAG_AND_BONE_MAN_I, Quest.RAG_AND_BONE_MAN_II}, new WorldPoint(3359, 3504, 0)), RAG_AND_BONE_MAN_I(Quest.RAG_AND_BONE_MAN_I, new WorldPoint(3359, 3504, 0)),
RECRUITMENT_DRIVE_BLACK_KNIGHTS_FORTRESS(new Quest[]{Quest.BLACK_KNIGHTS_FORTRESS, Quest.RECRUITMENT_DRIVE}, new WorldPoint(2959, 3336, 0)), RAG_AND_BONE_MAN_II(Quest.RAG_AND_BONE_MAN_II, new WorldPoint(3361, 3507, 0)),
ROVING_ELVES(Quest.ROVING_ELVES, new WorldPoint(2288, 3146, 0)), RATCATCHERS(Quest.RATCATCHERS, new WorldPoint(3243, 9867, 0)),
RUM_DEAL(Quest.RUM_DEAL, new WorldPoint(3679, 3535, 0)), RECIPE_FOR_DISASTER(Quest.RECIPE_FOR_DISASTER, new WorldPoint(3206, 3213, 0)),
SCORPION_CATCHER(Quest.SCORPION_CATCHER, new WorldPoint(2701, 3399, 0)), RECRUITMENT_DRIVE(Quest.RECRUITMENT_DRIVE, new WorldPoint(2962, 3338, 0)),
REGICIDE(Quest.REGICIDE, new WorldPoint(2575, 3293, 0)),
ROVING_ELVES(Quest.ROVING_ELVES, new WorldPoint(2287, 3144, 0)),
ROYAL_TROUBLE(Quest.ROYAL_TROUBLE, new WorldPoint(2497, 3857, 0)),
RUM_DEAL(Quest.RUM_DEAL, new WorldPoint(3677, 3535, 0)),
SCORPION_CATCHER(Quest.SCORPION_CATCHER, new WorldPoint(2700, 3404, 0)),
SEA_SLUG(Quest.SEA_SLUG, new WorldPoint(2715, 3302, 0)), SEA_SLUG(Quest.SEA_SLUG, new WorldPoint(2715, 3302, 0)),
SHADES_OF_MORTTON(Quest.SHADES_OF_MORTTON, new WorldPoint(3463, 3308, 0)), SHADES_OF_MORTTON(Quest.SHADES_OF_MORTTON, new WorldPoint(3463, 3308, 0)),
SHADOW_OF_THE_STORM(Quest.SHADOW_OF_THE_STORM, new WorldPoint(3270, 3159, 0)), SHADOW_OF_THE_STORM(Quest.SHADOW_OF_THE_STORM, new WorldPoint(3270, 3159, 0)),
SHEEP_HERDER(Quest.SHEEP_HERDER, new WorldPoint(2616, 3299, 0)), SHEEP_HERDER(Quest.SHEEP_HERDER, new WorldPoint(2616, 3299, 0)),
SHILO_VILLAGE(Quest.SHILO_VILLAGE, new WorldPoint(2882, 2951, 0)), SHILO_VILLAGE(Quest.SHILO_VILLAGE, new WorldPoint(2882, 2951, 0)),
SINS_OF_THE_FATHER(Quest.SINS_OF_THE_FATHER, new WorldPoint(3728, 3319, 0)), SINS_OF_THE_FATHER(Quest.SINS_OF_THE_FATHER, new WorldPoint(3728, 3319, 0)),
THE_SLUG_MENACE(Quest.THE_SLUG_MENACE, new WorldPoint(2994, 3374, 0)),
SONG_OF_THE_ELVES(Quest.SONG_OF_THE_ELVES, new WorldPoint(2567, 3335, 0)),
A_SOULS_BANE(Quest.A_SOULS_BANE, new WorldPoint(3307, 3454, 0)), A_SOULS_BANE(Quest.A_SOULS_BANE, new WorldPoint(3307, 3454, 0)),
SPIRITS_OF_THE_ELID(Quest.SPIRITS_OF_THE_ELID, new WorldPoint(3441, 2911, 0)), SPIRITS_OF_THE_ELID(Quest.SPIRITS_OF_THE_ELID, new WorldPoint(3441, 2911, 0)),
SWAN_SONG(Quest.SWAN_SONG, new WorldPoint(2345, 3652, 0)), SWAN_SONG(Quest.SWAN_SONG, new WorldPoint(2345, 3652, 0)),
@@ -158,15 +171,16 @@ enum QuestStartLocation
TALE_OF_THE_RIGHTEOUS(Quest.TALE_OF_THE_RIGHTEOUS, new WorldPoint(1541, 3570, 0)), TALE_OF_THE_RIGHTEOUS(Quest.TALE_OF_THE_RIGHTEOUS, new WorldPoint(1541, 3570, 0)),
A_TASTE_OF_HOPE(Quest.A_TASTE_OF_HOPE, new WorldPoint(3668, 3216, 0)), A_TASTE_OF_HOPE(Quest.A_TASTE_OF_HOPE, new WorldPoint(3668, 3216, 0)),
TEARS_OF_GUTHIX(Quest.TEARS_OF_GUTHIX, new WorldPoint(3251, 9517, 0)), TEARS_OF_GUTHIX(Quest.TEARS_OF_GUTHIX, new WorldPoint(3251, 9517, 0)),
TEMPLE_OF_IKOV(Quest.TEMPLE_OF_IKOV, new WorldPoint(2574, 3320, 0)), TEMPLE_OF_IKOV(Quest.TEMPLE_OF_IKOV, new WorldPoint(2571, 3320, 0)),
THRONE_OF_MISCELLANIA_ROYAL_TROUBLE(new Quest[]{Quest.THRONE_OF_MISCELLANIA, Quest.ROYAL_TROUBLE}, new WorldPoint(2497, 3859, 0)), THRONE_OF_MISCELLANIA(Quest.THRONE_OF_MISCELLANIA, new WorldPoint(2497, 3861, 0)),
THE_TOURIST_TRAP(Quest.THE_TOURIST_TRAP, new WorldPoint(3302, 3113, 0)), THE_TOURIST_TRAP(Quest.THE_TOURIST_TRAP, new WorldPoint(3302, 3113, 0)),
TOWER_OF_LIFE(Quest.TOWER_OF_LIFE, new WorldPoint(2640, 3218, 0)), TOWER_OF_LIFE(Quest.TOWER_OF_LIFE, new WorldPoint(2640, 3218, 0)),
TREE_GNOME_VILLAGE(Quest.TREE_GNOME_VILLAGE, new WorldPoint(2541, 3169, 0)), TREE_GNOME_VILLAGE(Quest.TREE_GNOME_VILLAGE, new WorldPoint(2541, 3169, 0)),
TRIBAL_TOTEM(Quest.TRIBAL_TOTEM, new WorldPoint(2790, 3182, 0)), TRIBAL_TOTEM(Quest.TRIBAL_TOTEM, new WorldPoint(2790, 3182, 0)),
TROLL_ROMANCE(Quest.TROLL_ROMANCE, new WorldPoint(2890, 10097, 0)), TROLL_ROMANCE(Quest.TROLL_ROMANCE, new WorldPoint(2890, 10097, 0)),
UNDERGROUND_PASS_REGICIDE(new Quest[]{Quest.REGICIDE, Quest.UNDERGROUND_PASS}, new WorldPoint(2575, 3293, 0)), TROLL_STRONGHOLD(Quest.TROLL_STRONGHOLD, new WorldPoint(2893, 3528, 0)),
WANTED_SLUG_MENACE(new Quest[]{Quest.WANTED, Quest.THE_SLUG_MENACE}, new WorldPoint(2996, 3373, 0)), UNDERGROUND_PASS(Quest.UNDERGROUND_PASS, new WorldPoint(2578, 3295, 0)),
WANTED(Quest.WANTED, new WorldPoint(2998, 3372, 0)),
WATCHTOWER(Quest.WATCHTOWER, new WorldPoint(2545, 3112, 0)), WATCHTOWER(Quest.WATCHTOWER, new WorldPoint(2545, 3112, 0)),
WATERFALL_QUEST(Quest.WATERFALL_QUEST, new WorldPoint(2521, 3498, 0)), WATERFALL_QUEST(Quest.WATERFALL_QUEST, new WorldPoint(2521, 3498, 0)),
WHAT_LIES_BELOW(Quest.WHAT_LIES_BELOW, new WorldPoint(3265, 3333, 0)), WHAT_LIES_BELOW(Quest.WHAT_LIES_BELOW, new WorldPoint(3265, 3333, 0)),
@@ -177,17 +191,11 @@ enum QuestStartLocation
private final WorldPoint location; private final WorldPoint location;
@Getter @Getter
private final Quest[] quests; private final Quest quest;
QuestStartLocation(Quest[] quests, WorldPoint location)
{
this.location = location;
this.quests = quests;
}
QuestStartLocation(Quest quest, WorldPoint location) QuestStartLocation(Quest quest, WorldPoint location)
{ {
this.location = location; this.location = location;
this.quests = new Quest[]{quest}; this.quest = quest;
} }
} }

View File

@@ -188,8 +188,8 @@ public interface WorldMapConfig extends Config
@ConfigItem( @ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_QUEST_START_TOOLTIPS, keyName = WorldMapPlugin.CONFIG_KEY_QUEST_START_TOOLTIPS,
name = "Quest names and status", name = "Quest status icons",
description = "Indicates the names of quests and shows completion status", description = "Shows completion status of quests on the quest's icon",
position = 15 position = 15
) )
default boolean questStartTooltips() default boolean questStartTooltips()

View File

@@ -33,7 +33,6 @@ import java.util.function.Predicate;
import net.runelite.api.Client; import net.runelite.api.Client;
import net.runelite.api.GameState; import net.runelite.api.GameState;
import net.runelite.api.Quest; import net.runelite.api.Quest;
import net.runelite.api.QuestState;
import net.runelite.api.Skill; import net.runelite.api.Skill;
import net.runelite.api.events.StatChanged; import net.runelite.api.events.StatChanged;
import net.runelite.api.events.WidgetLoaded; import net.runelite.api.events.WidgetLoaded;
@@ -505,41 +504,21 @@ public class WorldMapPlugin extends Plugin
private MapPoint createQuestStartPoint(QuestStartLocation data) private MapPoint createQuestStartPoint(QuestStartLocation data)
{ {
Quest[] quests = data.getQuests(); Quest quest = data.getQuest();
// Get first uncompleted quest. Else, return the last quest.
Quest quest = null;
for (Quest q : quests)
{
if (q.getState(client) != QuestState.FINISHED)
{
quest = q;
break;
}
}
if (quest == null)
{
quest = quests[quests.length - 1];
}
BufferedImage icon = BLANK_ICON; BufferedImage icon = BLANK_ICON;
String tooltip = "";
if (quest != null) if (quest != null)
{ {
tooltip = quest.getName();
switch (quest.getState(client)) switch (quest.getState(client))
{ {
case FINISHED: case FINISHED:
icon = FINISHED_ICON; icon = FINISHED_ICON;
tooltip += " - Finished";
break; break;
case IN_PROGRESS: case IN_PROGRESS:
icon = STARTED_ICON; icon = STARTED_ICON;
tooltip += " - Started";
break; break;
case NOT_STARTED: case NOT_STARTED:
icon = NOT_STARTED_ICON; icon = NOT_STARTED_ICON;
tooltip += " - Not Started";
break; break;
} }
} }
@@ -548,7 +527,6 @@ public class WorldMapPlugin extends Plugin
.type(MapPoint.Type.QUEST) .type(MapPoint.Type.QUEST)
.worldPoint(data.getLocation()) .worldPoint(data.getLocation())
.image(icon) .image(icon)
.tooltip(tooltip)
.build(); .build();
} }

View File

@@ -508,7 +508,7 @@ public class XpTrackerPlugin extends Plugin
@Subscribe @Subscribe
public void onMenuEntryAdded(final MenuEntryAdded event) public void onMenuEntryAdded(final MenuEntryAdded event)
{ {
int widgetID = event.getActionParam1(); int widgetID = event.getParam1();
if (TO_GROUP(widgetID) != WidgetID.SKILLS_GROUP_ID if (TO_GROUP(widgetID) != WidgetID.SKILLS_GROUP_ID
|| !event.getOption().startsWith("View") || !event.getOption().startsWith("View")
@@ -538,7 +538,7 @@ public class XpTrackerPlugin extends Plugin
public void onMenuOptionClicked(MenuOptionClicked event) public void onMenuOptionClicked(MenuOptionClicked event)
{ {
if (event.getMenuAction().getId() != MenuAction.RUNELITE.getId() if (event.getMenuAction().getId() != MenuAction.RUNELITE.getId()
|| TO_GROUP(event.getWidgetId()) != WidgetID.SKILLS_GROUP_ID) || TO_GROUP(event.getParam1()) != WidgetID.SKILLS_GROUP_ID)
{ {
return; return;
} }

View File

@@ -101,11 +101,14 @@ public class ColorUtil
final double g2 = b.getGreen(); final double g2 = b.getGreen();
final double b1 = a.getBlue(); final double b1 = a.getBlue();
final double b2 = b.getBlue(); final double b2 = b.getBlue();
final double a1 = a.getAlpha();
final double a2 = b.getAlpha();
return new Color( return new Color(
(int) Math.round(r1 + (t * (r2 - r1))), (int) Math.round(r1 + (t * (r2 - r1))),
(int) Math.round(g1 + (t * (g2 - g1))), (int) Math.round(g1 + (t * (g2 - g1))),
(int) Math.round(b1 + (t * (b2 - b1))) (int) Math.round(b1 + (t * (b2 - b1))),
(int) Math.round(a1 + (t * (a2 - a1)))
); );
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -1 +1 @@
BADE5769E553D84CF031C4D278466E46B74E12CF62A3351646CD1C504D7A426A F4D54D6A71A806F01FA6B823A3E75524B857E2F556E0AE55FEA0A4ABFEB603C9

View File

@@ -62,7 +62,7 @@ LABEL49:
iconst 73 iconst 73
iconst 73 iconst 73
iload 6 iload 6
iconst 10551333 iconst 10551334
enum enum
if_getheight if_getheight
add add

View File

@@ -1 +1 @@
C3095F0E7973E9EF0E8035AF4B4AC7CE28D692B71A63DE31B7820F1D2AB09F2E A9D5E42A864BFEEE2BB8CAF4A111A68426B7CE5DF5C982AF168F90A28CAE4423

View File

@@ -14,17 +14,17 @@
istore 4 istore 4
iload 1 iload 1
switch switch
1745: LABEL129 1745: LABEL145
1129: LABEL109 1129: LABEL125
1130: LABEL87 1130: LABEL95
1131: LABEL9 1131: LABEL9
jump LABEL204 jump LABEL220
LABEL9: LABEL9:
iconst 10747944 iconst 10747945
if_getwidth if_getwidth
iconst 33 iconst 33
sub sub
iconst 10747944 iconst 10747945
if_getheight if_getheight
istore 3 istore 3
istore 2 istore 2
@@ -33,7 +33,7 @@ LABEL9:
iconst 73 iconst 73
iconst 73 iconst 73
iload 1 iload 1
iconst 10551333 iconst 10551334
enum enum
if_getwidth if_getwidth
sub sub
@@ -48,7 +48,7 @@ LABEL9:
LABEL29: LABEL29:
iconst 0 iconst 0
iload 3 iload 3
iconst 10747959 iconst 10747960
if_getheight if_getheight
add add
iconst 2 iconst 2
@@ -56,14 +56,14 @@ LABEL29:
iconst 73 iconst 73
iconst 73 iconst 73
iload 1 iload 1
iconst 10747976 iconst 10747977
enum enum
if_setposition if_setposition
iconst 0 iconst 0
iload 3 iload 3
iconst 2 iconst 2
iconst 2 iconst 2
iconst 10747959 iconst 10747960
if_setposition if_setposition
jump LABEL65 jump LABEL65
LABEL49: LABEL49:
@@ -74,14 +74,14 @@ LABEL49:
iconst 73 iconst 73
iconst 73 iconst 73
iload 1 iload 1
iconst 10747976 iconst 10747977
enum enum
if_setposition if_setposition
iload 2 iload 2
iconst 0 iconst 0
iconst 2 iconst 2
iconst 2 iconst 2
iconst 10747959 iconst 10747960
if_setposition if_setposition
LABEL65: LABEL65:
get_varbit 4084 get_varbit 4084
@@ -93,7 +93,7 @@ LABEL69:
iconst 73 iconst 73
iconst 73 iconst 73
iload 1 iload 1
iconst 10551329 iconst 10551330
enum enum
2122 2122
jump LABEL84 jump LABEL84
@@ -102,77 +102,97 @@ LABEL77:
iconst 73 iconst 73
iconst 73 iconst 73
iload 1 iload 1
iconst 10551329 iconst 10551330
enum enum
2122 2122
LABEL84: LABEL84:
clientclock clientclock
set_varc_int 384 set_varc_int 384
jump LABEL204 invoke 2357
LABEL87: iconst 1
if_icmpeq LABEL90
jump LABEL94
LABEL90:
get_varbit 12986
invoke 633
iconst 10747930
if_sethide
LABEL94:
jump LABEL220
LABEL95:
get_varbit 4084 get_varbit 4084
iconst 1 iconst 1
if_icmpeq LABEL91 if_icmpeq LABEL99
jump LABEL99 jump LABEL107
LABEL91: LABEL99:
iconst 1178 iconst 1178
iconst 73 iconst 73
iconst 73 iconst 73
iload 1 iload 1
iconst 10551329 iconst 10551330
enum enum
2122 2122
jump LABEL106 jump LABEL114
LABEL99: LABEL107:
iconst 2154 iconst 2154
iconst 73 iconst 73
iconst 73 iconst 73
iload 1 iload 1
iconst 10551329 iconst 10551330
enum enum
2122 2122
LABEL106: LABEL114:
clientclock clientclock
set_varc_int 384 set_varc_int 384
jump LABEL204 invoke 2357
LABEL109: iconst 1
if_icmpeq LABEL120
jump LABEL124
LABEL120:
get_varbit 12986
invoke 633
iconst 10551322
if_sethide
LABEL124:
jump LABEL220
LABEL125:
invoke 3297 invoke 3297
iconst 1 iconst 1
if_icmpeq LABEL113 if_icmpeq LABEL129
jump LABEL121 jump LABEL137
LABEL113: LABEL129:
iconst 2422 iconst 2422
iconst 73 iconst 73
iconst 73 iconst 73
iload 1 iload 1
iconst 10551329 iconst 10551330
enum enum
2122 2122
jump LABEL128 jump LABEL144
LABEL121: LABEL137:
iconst 1200 iconst 1200
iconst 73 iconst 73
iconst 73 iconst 73
iload 1 iload 1
iconst 10551329 iconst 10551330
enum enum
2122 2122
LABEL128: LABEL144:
jump LABEL204 jump LABEL220
LABEL129: LABEL145:
get_varbit 6257 get_varbit 6257
iconst 1 iconst 1
if_icmpeq LABEL136 if_icmpeq LABEL152
get_varbit 542 get_varbit 542
iconst 1 iconst 1
if_icmpeq LABEL136 if_icmpeq LABEL152
jump LABEL140 jump LABEL156
LABEL136: LABEL152:
iconst 1 iconst 1
iconst 39387175 iconst 39387175
if_sethide if_sethide
jump LABEL195 jump LABEL211
LABEL140: LABEL156:
iconst 0 iconst 0
iconst 39387175 iconst 39387175
if_sethide if_sethide
@@ -181,11 +201,11 @@ LABEL140:
2308 2308
get_varbit 6255 get_varbit 6255
switch switch
1: LABEL157 1: LABEL173
2: LABEL149 2: LABEL165
3: LABEL165 3: LABEL181
jump LABEL173 jump LABEL189
LABEL149: LABEL165:
iconst 1718 iconst 1718
iconst 39387177 iconst 39387177
if_setgraphic if_setgraphic
@@ -193,8 +213,8 @@ LABEL149:
sconst "Toggle single-tap mode" sconst "Toggle single-tap mode"
iconst 39387175 iconst 39387175
if_setop if_setop
jump LABEL180 jump LABEL196
LABEL157: LABEL173:
iconst 1717 iconst 1717
iconst 39387177 iconst 39387177
if_setgraphic if_setgraphic
@@ -202,8 +222,8 @@ LABEL157:
sconst "Toggle tap-to-drop mode" sconst "Toggle tap-to-drop mode"
iconst 39387175 iconst 39387175
if_setop if_setop
jump LABEL180 jump LABEL196
LABEL165: LABEL181:
iconst 1716 iconst 1716
iconst 39387177 iconst 39387177
if_setgraphic if_setgraphic
@@ -211,8 +231,8 @@ LABEL165:
sconst "Show Keyboard" sconst "Show Keyboard"
iconst 39387175 iconst 39387175
if_setop if_setop
jump LABEL180 jump LABEL196
LABEL173: LABEL189:
iconst 1715 iconst 1715
iconst 39387177 iconst 39387177
if_setgraphic if_setgraphic
@@ -220,26 +240,26 @@ LABEL173:
sconst "" sconst ""
iconst 39387175 iconst 39387175
if_setop if_setop
LABEL180: LABEL196:
get_varbit 6255 get_varbit 6255
iconst 3 iconst 3
if_icmpne LABEL184 if_icmpne LABEL200
jump LABEL192 jump LABEL208
LABEL184: LABEL200:
get_varbit 6256 get_varbit 6256
iconst 0 iconst 0
if_icmpeq LABEL188 if_icmpeq LABEL204
jump LABEL192 jump LABEL208
LABEL188: LABEL204:
iconst 155 iconst 155
iconst 39387177 iconst 39387177
if_settrans if_settrans
jump LABEL195 jump LABEL211
LABEL192: LABEL208:
iconst 0 iconst 0
iconst 39387177 iconst 39387177
if_settrans if_settrans
LABEL195: LABEL211:
invoke 2581 invoke 2581
get_varbit 6254 get_varbit 6254
invoke 633 invoke 633
@@ -249,5 +269,5 @@ LABEL195:
pop_int pop_int
clientclock clientclock
set_varc_int 384 set_varc_int 384
LABEL204: LABEL220:
return return

View File

@@ -116,6 +116,7 @@ public class ColorUtilTest
assertEquals(new Color(128, 128, 128), ColorUtil.colorLerp(Color.BLACK, Color.WHITE, 0.5)); assertEquals(new Color(128, 128, 128), ColorUtil.colorLerp(Color.BLACK, Color.WHITE, 0.5));
assertEquals(Color.BLACK, ColorUtil.colorLerp(Color.BLACK, Color.CYAN, 0)); assertEquals(Color.BLACK, ColorUtil.colorLerp(Color.BLACK, Color.CYAN, 0));
assertEquals(Color.CYAN, ColorUtil.colorLerp(Color.BLACK, Color.CYAN, 1)); assertEquals(Color.CYAN, ColorUtil.colorLerp(Color.BLACK, Color.CYAN, 1));
assertEquals(new Color(0x80800080, true), ColorUtil.colorLerp(new Color(0xff0000ff, true), new Color(0x00ff0000, true), 0.5));
} }
@Test @Test

View File

@@ -188,8 +188,8 @@ public abstract class MenuMixin implements RSClient
getMenuTargets()[i] = entry.getTarget(); getMenuTargets()[i] = entry.getTarget();
getMenuIdentifiers()[i] = entry.getIdentifier(); getMenuIdentifiers()[i] = entry.getIdentifier();
getMenuOpcodes()[i] = entry.getOpcode(); getMenuOpcodes()[i] = entry.getOpcode();
getMenuArguments1()[i] = entry.getActionParam(); getMenuArguments1()[i] = entry.getParam0();
getMenuArguments2()[i] = entry.getActionParam1(); getMenuArguments2()[i] = entry.getParam1();
getMenuForceLeftClick()[i] = entry.isForceLeftClick(); getMenuForceLeftClick()[i] = entry.isForceLeftClick();
} }
@@ -215,7 +215,7 @@ public abstract class MenuMixin implements RSClient
tempMenuAction.setOption(entry.getOption()); tempMenuAction.setOption(entry.getOption());
tempMenuAction.setOpcode(entry.getOpcode()); tempMenuAction.setOpcode(entry.getOpcode());
tempMenuAction.setIdentifier(entry.getIdentifier()); tempMenuAction.setIdentifier(entry.getIdentifier());
tempMenuAction.setParam0(entry.getActionParam()); tempMenuAction.setParam0(entry.getParam0());
tempMenuAction.setParam1(entry.getActionParam1()); tempMenuAction.setParam1(entry.getParam1());
} }
} }

View File

@@ -777,8 +777,8 @@ public abstract class RSClientMixin implements RSClient
entry.setTarget(menuTargets[i]); entry.setTarget(menuTargets[i]);
entry.setIdentifier(menuIdentifiers[i]); entry.setIdentifier(menuIdentifiers[i]);
entry.setOpcode(menuTypes[i]); entry.setOpcode(menuTypes[i]);
entry.setActionParam(params0[i]); entry.setParam0(params0[i]);
entry.setActionParam1(params1[i]); entry.setParam1(params1[i]);
entry.setForceLeftClick(leftClick[i]); entry.setForceLeftClick(leftClick[i]);
} }
return entries; return entries;
@@ -808,8 +808,8 @@ public abstract class RSClientMixin implements RSClient
menuTargets[count] = entry.getTarget(); menuTargets[count] = entry.getTarget();
menuIdentifiers[count] = entry.getIdentifier(); menuIdentifiers[count] = entry.getIdentifier();
menuTypes[count] = entry.getOpcode(); menuTypes[count] = entry.getOpcode();
params0[count] = entry.getActionParam(); params0[count] = entry.getParam0();
params1[count] = entry.getActionParam1(); params1[count] = entry.getParam1();
leftClick[count] = entry.isForceLeftClick(); leftClick[count] = entry.isForceLeftClick();
++count; ++count;
} }
@@ -855,8 +855,8 @@ public abstract class RSClientMixin implements RSClient
targets[oldCount] = event.getTarget(); targets[oldCount] = event.getTarget();
identifiers[oldCount] = event.getIdentifier(); identifiers[oldCount] = event.getIdentifier();
opcodes[oldCount] = event.getOpcode(); opcodes[oldCount] = event.getOpcode();
arguments1[oldCount] = event.getActionParam(); arguments1[oldCount] = event.getParam0();
arguments2[oldCount] = event.getActionParam1(); arguments2[oldCount] = event.getParam1();
forceLeftClick[oldCount] = event.isForceLeftClick(); forceLeftClick[oldCount] = event.isForceLeftClick();
} }
} }
@@ -1430,12 +1430,12 @@ public abstract class RSClientMixin implements RSClient
} }
final MenuOptionClicked menuOptionClicked = new MenuOptionClicked(); final MenuOptionClicked menuOptionClicked = new MenuOptionClicked();
menuOptionClicked.setActionParam(param0); menuOptionClicked.setParam0(param0);
menuOptionClicked.setMenuOption(option); menuOptionClicked.setMenuOption(option);
menuOptionClicked.setMenuTarget(target); menuOptionClicked.setMenuTarget(target);
menuOptionClicked.setMenuAction(MenuAction.of(opcode)); menuOptionClicked.setMenuAction(MenuAction.of(opcode));
menuOptionClicked.setId(id); menuOptionClicked.setId(id);
menuOptionClicked.setWidgetId(param1); menuOptionClicked.setParam1(param1);
menuOptionClicked.setSelectedItemIndex(client.getSelectedItemSlot()); menuOptionClicked.setSelectedItemIndex(client.getSelectedItemSlot());
client.getCallbacks().post(menuOptionClicked); client.getCallbacks().post(menuOptionClicked);