interfacestyles: add ability to always stack resizable stones

This commit is contained in:
Ron Young
2019-10-07 10:19:49 -05:00
parent a663770563
commit 88c2736e8b
3 changed files with 30 additions and 1 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)
{