Merge pull request #10004 from raiyni/stack-stones

Add ability to always stack resizable stones
This commit is contained in:
Adam
2020-02-08 17:17:58 -05:00
committed by GitHub
4 changed files with 272 additions and 0 deletions

View File

@@ -72,4 +72,14 @@ public interface InterfaceStylesConfig extends Config
{
return false;
}
@ConfigItem(
keyName = "alwaysStack",
name = "Always stack bottom bar",
description = "Always stack the bottom bar in resizable"
)
default boolean alwaysStack()
{
return false;
}
}

View File

@@ -40,6 +40,7 @@ import net.runelite.api.events.ClientTick;
import net.runelite.client.events.ConfigChanged;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.PostHealthBar;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.callback.ClientThread;
@@ -106,6 +107,17 @@ public class InterfaceStylesPlugin extends Plugin
}
}
@Subscribe
public void onScriptCallbackEvent(ScriptCallbackEvent event)
{
if ("forceStackStones".equals(event.getEventName()) && config.alwaysStack())
{
int[] intStack = client.getIntStack();
int intStackSize = client.getIntStackSize();
intStack[intStackSize - 1] = 1;
}
}
@Subscribe
public void onClientTick(ClientTick event)
{

View File

@@ -0,0 +1 @@
A358C6B0EC9AF746487EA8A20507B8C03073A5C2DE16EA2FC94751957A49DA09

View File

@@ -0,0 +1,249 @@
.id 920
.int_stack_count 2
.string_stack_count 0
.int_var_count 5
.string_var_count 0
; callback "forceStackStones"
; Used by the InterfaceStylesPlugin to enable it's Always stack bottom bar option
; Toggle the option when you have the bottom line top level interface on and your screen is large enough for the stones to be in a single line
iconst 0
istore 2
iconst 0
istore 3
iconst -1
istore 4
iload 1
switch
1745: LABEL129
1129: LABEL109
1130: LABEL87
1131: LABEL9
jump LABEL201
LABEL9:
iconst 10747937
if_getwidth
iconst 33
sub
iconst 10747937
if_getheight
istore 3
istore 2
iload 0
if_getwidth
iconst 73
iconst 73
iload 1
iconst 10551326
enum
if_getwidth
sub
iconst 429
if_icmplt LABEL29
iconst 0 ; should resizable stones be forced to stack
sconst "forceStackStones" ; push event name
runelite_callback ; invoke callback
iconst 0 ; if 0 is returned, continue normal layout
if_icmpeq LABEL49
LABEL29:
iconst 0
iload 3
iconst 10747952
if_getheight
add
iconst 2
iconst 2
iconst 73
iconst 73
iload 1
iconst 10747969
enum
if_setposition
iconst 0
iload 3
iconst 2
iconst 2
iconst 10747952
if_setposition
jump LABEL65
LABEL49:
iconst 0
iload 3
iconst 2
iconst 2
iconst 73
iconst 73
iload 1
iconst 10747969
enum
if_setposition
iload 2
iconst 0
iconst 2
iconst 2
iconst 10747952
if_setposition
LABEL65:
get_varbit 4084
iconst 1
if_icmpeq LABEL69
jump LABEL77
LABEL69:
iconst 1178
iconst 73
iconst 73
iload 1
iconst 10551322
enum
2122
jump LABEL84
LABEL77:
iconst 2154
iconst 73
iconst 73
iload 1
iconst 10551322
enum
2122
LABEL84:
clientclock
set_varc_int 384
jump LABEL201
LABEL87:
get_varbit 4084
iconst 1
if_icmpeq LABEL91
jump LABEL99
LABEL91:
iconst 1178
iconst 73
iconst 73
iload 1
iconst 10551322
enum
2122
jump LABEL106
LABEL99:
iconst 2154
iconst 73
iconst 73
iload 1
iconst 10551322
enum
2122
LABEL106:
clientclock
set_varc_int 384
jump LABEL201
LABEL109:
invoke 3297
iconst 1
if_icmpeq LABEL113
jump LABEL121
LABEL113:
iconst 2422
iconst 73
iconst 73
iload 1
iconst 10551322
enum
2122
jump LABEL128
LABEL121:
iconst 1200
iconst 73
iconst 73
iload 1
iconst 10551322
enum
2122
LABEL128:
jump LABEL201
LABEL129:
get_varbit 6257
iconst 1
if_icmpeq LABEL133
jump LABEL137
LABEL133:
iconst 1
iconst 39387167
if_sethide
jump LABEL192
LABEL137:
iconst 0
iconst 39387167
if_sethide
iconst 1
iconst 39387167
2308
get_varbit 6255
switch
1: LABEL154
2: LABEL146
3: LABEL162
jump LABEL170
LABEL146:
iconst 1718
iconst 39387169
if_setgraphic
iconst 1
sconst "Toggle single-tap mode"
iconst 39387167
if_setop
jump LABEL177
LABEL154:
iconst 1717
iconst 39387169
if_setgraphic
iconst 1
sconst "Toggle tap-to-drop mode"
iconst 39387167
if_setop
jump LABEL177
LABEL162:
iconst 1716
iconst 39387169
if_setgraphic
iconst 1
sconst "Show Keyboard"
iconst 39387167
if_setop
jump LABEL177
LABEL170:
iconst 1715
iconst 39387169
if_setgraphic
iconst 1
sconst ""
iconst 39387167
if_setop
LABEL177:
get_varbit 6255
iconst 3
if_icmpne LABEL181
jump LABEL189
LABEL181:
get_varbit 6256
iconst 0
if_icmpeq LABEL185
jump LABEL189
LABEL185:
iconst 155
iconst 39387169
if_settrans
jump LABEL192
LABEL189:
iconst 0
iconst 39387169
if_settrans
LABEL192:
invoke 2581
get_varbit 6254
invoke 633
iconst 39387158
if_sethide
invoke 2526
pop_int
clientclock
set_varc_int 384
LABEL201:
return