devtools: allow pgup/down to cycle through previous commands

Co-authored-by: Max Weber <mii7303@gmail.com>
This commit is contained in:
Adam
2022-05-16 18:05:53 -04:00
parent cbb0730a38
commit 573a66abf1
2 changed files with 20 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ import net.runelite.api.VarbitComposition;
import net.runelite.api.coords.WorldPoint; import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.CommandExecuted; import net.runelite.api.events.CommandExecuted;
import net.runelite.api.events.MenuEntryAdded; import net.runelite.api.events.MenuEntryAdded;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.api.events.StatChanged; import net.runelite.api.events.StatChanged;
import net.runelite.api.events.VarbitChanged; import net.runelite.api.events.VarbitChanged;
import net.runelite.api.kit.KitType; import net.runelite.api.kit.KitType;
@@ -488,4 +489,13 @@ public class DevToolsPlugin extends Plugin
entry.setTarget(entry.getTarget() + " " + ColorUtil.prependColorTag("(" + info + ")", JagexColors.MENU_TARGET)); entry.setTarget(entry.getTarget() + " " + ColorUtil.prependColorTag("(" + info + ")", JagexColors.MENU_TARGET));
} }
} }
@Subscribe
public void onScriptCallbackEvent(ScriptCallbackEvent ev)
{
if ("devtoolsEnabled".equals(ev.getEventName()))
{
client.getIntStack()[client.getIntStackSize() - 1] = 1;
}
}
} }

View File

@@ -870,6 +870,9 @@ LABEL724:
if_icmpgt LABEL728 if_icmpgt LABEL728
jump LABEL791 jump LABEL791
LABEL728: LABEL728:
; move chatout_add under if ($length2 > 2) to only add for :: commands
get_varc_string 335
invoke 77 ; chatout_add
get_varc_string 335 get_varc_string 335
sconst "::toggleroof" sconst "::toggleroof"
iconst 0 iconst 0
@@ -962,8 +965,11 @@ LABEL798:
iload 9 iload 9
invoke 5517 invoke 5517
LABEL804: LABEL804:
; see comment above
jump AFTER_CHATOUT_ADD
get_varc_string 335 get_varc_string 335
invoke 77 invoke 77
AFTER_CHATOUT_ADD:
sconst "" sconst ""
set_varc_string 335 set_varc_string 335
LABEL808: LABEL808:
@@ -975,6 +981,8 @@ LABEL809:
jump LABEL819 jump LABEL819
LABEL813: LABEL813:
iload 3 iload 3
sconst "devtoolsEnabled"
runelite_callback
iconst 1 iconst 1
if_icmpeq LABEL817 if_icmpeq LABEL817
jump LABEL818 jump LABEL818
@@ -989,6 +997,8 @@ LABEL819:
jump LABEL829 jump LABEL829
LABEL823: LABEL823:
iload 3 iload 3
sconst "devtoolsEnabled"
runelite_callback
iconst 1 iconst 1
if_icmpeq LABEL827 if_icmpeq LABEL827
jump LABEL828 jump LABEL828