project: we are actually up to date now, thanks blue!
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
package net.runelite.mixins;
|
||||
|
||||
import net.runelite.api.ParamHolder;
|
||||
import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.api.mixins.Mixins;
|
||||
import net.runelite.api.mixins.Shadow;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSIntegerNode;
|
||||
import net.runelite.rs.api.RSItemComposition;
|
||||
import net.runelite.rs.api.RSNPCComposition;
|
||||
import net.runelite.rs.api.RSNode;
|
||||
import net.runelite.rs.api.RSObjectComposition;
|
||||
import net.runelite.rs.api.RSObjectNode;
|
||||
import net.runelite.rs.api.RSParamComposition;
|
||||
import net.runelite.rs.api.RSStructComposition;
|
||||
|
||||
@Mixins({
|
||||
@Mixin(RSStructComposition.class),
|
||||
@Mixin(RSObjectComposition.class),
|
||||
@Mixin(RSNPCComposition.class),
|
||||
@Mixin(RSItemComposition.class)
|
||||
})
|
||||
public abstract class ParamHolderMixin implements ParamHolder
|
||||
{
|
||||
@Shadow("client")
|
||||
private static RSClient client;
|
||||
|
||||
@Inject
|
||||
private RSNode getParam(int id)
|
||||
{
|
||||
return this.getParams() == null ? null : (RSNode) this.getParams().get(id);
|
||||
}
|
||||
|
||||
@Inject
|
||||
private void setParam(int id, RSNode node)
|
||||
{
|
||||
RSParamComposition comp = client.getRSParamComposition(id);
|
||||
if (comp.isString() != (node instanceof RSObjectNode))
|
||||
{
|
||||
if (comp.isString())
|
||||
{
|
||||
throw new IllegalArgumentException("trying to put int into string param");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("trying to put string into int param");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getParams() == null)
|
||||
{
|
||||
setParams(client.newIterableNodeHashTable(16));
|
||||
}
|
||||
|
||||
getParams().put(node, id);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public int getIntValue(int paramID)
|
||||
{
|
||||
RSNode param = getParam(paramID);
|
||||
if (param != null)
|
||||
{
|
||||
RSIntegerNode node = (RSIntegerNode) param;
|
||||
return node.getValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
RSParamComposition comp = client.getRSParamComposition(paramID);
|
||||
if (comp.isString())
|
||||
{
|
||||
throw new IllegalArgumentException("trying to get int from string param");
|
||||
}
|
||||
|
||||
return comp.getDefaultInt();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setValue(int id, int val)
|
||||
{
|
||||
setParam(id, client.newIntegerNode(val));
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public String getStringValue(int paramID)
|
||||
{
|
||||
RSNode param = getParam(paramID);
|
||||
if (param != null)
|
||||
{
|
||||
RSObjectNode node = (RSObjectNode) param;
|
||||
return (String) node.getValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
RSParamComposition comp = client.getRSParamComposition(paramID);
|
||||
if (!comp.isString())
|
||||
{
|
||||
throw new IllegalArgumentException("trying to get string from int param");
|
||||
}
|
||||
|
||||
return comp.getDefaultStr();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setValue(int id, String val)
|
||||
{
|
||||
setParam(id, client.newObjectNode(val));
|
||||
}
|
||||
}
|
||||
@@ -67,17 +67,19 @@ import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NameableContainer;
|
||||
import net.runelite.api.Node;
|
||||
import net.runelite.api.NodeCache;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import static net.runelite.api.Perspective.LOCAL_TILE_SIZE;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Prayer;
|
||||
import net.runelite.api.Projectile;
|
||||
import net.runelite.api.ScriptEvent;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.StructComposition;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.VarbitComposition;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.WidgetNode;
|
||||
import net.runelite.api.WorldType;
|
||||
@@ -101,11 +103,13 @@ import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.PlayerDespawned;
|
||||
import net.runelite.api.events.PlayerMenuOptionsChanged;
|
||||
import net.runelite.api.events.PlayerSpawned;
|
||||
import net.runelite.api.events.PostStructComposition;
|
||||
import net.runelite.api.events.ResizeableChanged;
|
||||
import net.runelite.api.events.StatChanged;
|
||||
import net.runelite.api.events.UsernameChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.events.VolumeChanged;
|
||||
import net.runelite.api.events.WidgetClosed;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.events.WorldChanged;
|
||||
import net.runelite.api.hooks.Callbacks;
|
||||
@@ -129,6 +133,7 @@ import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSEnumComposition;
|
||||
import net.runelite.rs.api.RSFriendSystem;
|
||||
import net.runelite.rs.api.RSIndexedSprite;
|
||||
import net.runelite.rs.api.RSInterfaceParent;
|
||||
import net.runelite.rs.api.RSItemContainer;
|
||||
import net.runelite.rs.api.RSNPC;
|
||||
import net.runelite.rs.api.RSNode;
|
||||
@@ -137,7 +142,9 @@ import net.runelite.rs.api.RSNodeHashTable;
|
||||
import net.runelite.rs.api.RSPacketBuffer;
|
||||
import net.runelite.rs.api.RSPlayer;
|
||||
import net.runelite.rs.api.RSScene;
|
||||
import net.runelite.rs.api.RSScriptEvent;
|
||||
import net.runelite.rs.api.RSSpritePixels;
|
||||
import net.runelite.rs.api.RSStructComposition;
|
||||
import net.runelite.rs.api.RSTile;
|
||||
import net.runelite.rs.api.RSTileItem;
|
||||
import net.runelite.rs.api.RSUsername;
|
||||
@@ -727,24 +734,6 @@ public abstract class RSClientMixin implements RSClient
|
||||
setChatCycle(getCycleCntr());
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public Widget getViewportWidget()
|
||||
{
|
||||
if (isResized())
|
||||
{
|
||||
if (getVar(Varbits.SIDE_PANELS) == 1)
|
||||
{
|
||||
return getWidget(WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return getWidget(WidgetInfo.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX);
|
||||
}
|
||||
}
|
||||
return getWidget(WidgetInfo.FIXED_VIEWPORT);
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public MenuEntry[] getMenuEntries()
|
||||
@@ -1565,24 +1554,23 @@ public abstract class RSClientMixin implements RSClient
|
||||
else if (widget.getContentType() == WidgetType.RECTANGLE)
|
||||
{
|
||||
if (renderX == client.getViewportXOffset() && renderY == client.getViewportYOffset()
|
||||
&& widget.getWidth() == client.getViewportWidth() && widget.getHeight() == client.getViewportHeight()
|
||||
&& widget.getWidth() == client.getViewportWidth() && widget.getHeight() == client.getViewportHeight()
|
||||
&& widget.getOpacity() > 0 && widget.isFilled() && client.isGpu())
|
||||
{
|
||||
int tc = widget.getTextColor();
|
||||
int alpha = widget.getOpacity() & 0xFF;
|
||||
int inverseAlpha = 256 - alpha;
|
||||
int vpc = viewportColor;
|
||||
int c1 = (alpha * (tc & 0xff00ff) >> 8 & 0xFF00FF) + (alpha * (tc & 0x00FF00) >> 8 & 0x00FF00);
|
||||
int c2 = (inverseAlpha * (vpc & 0xff00ff) >> 8 & 0xFF00FF) + (inverseAlpha * (vpc & 0x00FF00) >> 8 & 0x00FF00);
|
||||
int outAlpha = alpha + ((vpc >>> 24) * (255 - alpha) * 0x8081 >>> 23);
|
||||
viewportColor = outAlpha << 24 | c1 + c2;
|
||||
widget.setHidden(true);
|
||||
hiddenWidgets.add(widget);
|
||||
continue;
|
||||
int alpha = widget.getOpacity() & 0xFF;
|
||||
int inverseAlpha = 256 - alpha;
|
||||
int vpc = viewportColor;
|
||||
int c1 = (alpha * (tc & 0xff00ff) >> 8 & 0xFF00FF) + (alpha * (tc & 0x00FF00) >> 8 & 0x00FF00);
|
||||
int c2 = (inverseAlpha * (vpc & 0xff00ff) >> 8 & 0xFF00FF) + (inverseAlpha * (vpc & 0x00FF00) >> 8 & 0x00FF00);
|
||||
int outAlpha = alpha + ((vpc >>> 24) * (255 - alpha) * 0x8081 >>> 23);
|
||||
viewportColor = outAlpha << 24 | c1 + c2;
|
||||
widget.setHidden(true);
|
||||
hiddenWidgets.add(widget);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WidgetNode childNode = componentTable.get(widget.getId());
|
||||
if (childNode != null)
|
||||
{
|
||||
@@ -2108,16 +2096,85 @@ public abstract class RSClientMixin implements RSClient
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public VarbitComposition getVarbit(int id)
|
||||
public ScriptEvent createScriptEvent(Object... args)
|
||||
{
|
||||
return getVarbitDefinition(id);
|
||||
return createRSScriptEvent(args);
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public int getViewportColor()
|
||||
public RSScriptEvent createRSScriptEvent(Object... args)
|
||||
{
|
||||
return viewportColor;
|
||||
RSScriptEvent event = createScriptEvent();
|
||||
event.setArguments(args);
|
||||
return event;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public NodeCache getStructCompositionCache()
|
||||
{
|
||||
assert client.isClientThread() : "getStructCompositionCache must be called on client thread";
|
||||
|
||||
return getRSStructCompositionCache();
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public StructComposition getStructComposition(int structID)
|
||||
{
|
||||
assert client.isClientThread() : "getStructComposition must be called on client thread";
|
||||
|
||||
return getRSStructComposition(structID);
|
||||
}
|
||||
|
||||
@Copy("StructDefinition_getStructDefinition")
|
||||
@Replace("StructDefinition_getStructDefinition")
|
||||
@SuppressWarnings("InfiniteRecursion")
|
||||
static RSStructComposition copy$getStructComposition(int id)
|
||||
{
|
||||
RSStructComposition comp = copy$getStructComposition(id);
|
||||
|
||||
if (comp.getId() == -1)
|
||||
{
|
||||
comp.setId(id);
|
||||
PostStructComposition event = new PostStructComposition();
|
||||
event.setStructComposition(comp);
|
||||
client.getCallbacks().post(event);
|
||||
}
|
||||
|
||||
return comp;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public int getMusicVolume()
|
||||
{
|
||||
return client.getPreferences().getMusicVolume();
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setMusicVolume(int volume)
|
||||
{
|
||||
if (volume > 0 && client.getPreferences().getMusicVolume() <= 0 && client.getCurrentTrackGroupId() != -1)
|
||||
{
|
||||
client.playMusicTrack(1000, client.getMusicTracks(), client.getCurrentTrackGroupId(), 0, volume, false);
|
||||
}
|
||||
|
||||
client.getPreferences().setMusicVolume(volume);
|
||||
client.setMusicTrackVolume(volume);
|
||||
if (client.getMidiPcmStream() != null)
|
||||
{
|
||||
client.getMidiPcmStream().setPcmStreamVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
@MethodHook("closeInterface")
|
||||
public static void preCloseInterface(RSInterfaceParent iface, boolean willUnload)
|
||||
{
|
||||
client.getCallbacks().post(new WidgetClosed(iface.getId(), iface.getModalMode(), willUnload));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package net.runelite.mixins;
|
||||
|
||||
import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.api.mixins.Shadow;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSClientPreferences;
|
||||
|
||||
@Mixin(RSClientPreferences.class)
|
||||
public abstract class RSClientPreferencesMixin implements RSClientPreferences
|
||||
{
|
||||
@Shadow("client")
|
||||
private static RSClient client;
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setClientMusicVolume(int volume)
|
||||
{
|
||||
if (volume > 0 && client.getPreferences().getMusicVolume() <= 0 && client.getCurrentTrackGroupId() != -1)
|
||||
{
|
||||
client.playMusicTrack(1000, client.getMusicTracks(), client.getCurrentTrackGroupId(), 0, volume, false);
|
||||
}
|
||||
|
||||
client.getPreferences().setMusicVolume(volume);
|
||||
client.setMusicTrackVolume(volume);
|
||||
if (client.getMidiPcmStream() != null)
|
||||
{
|
||||
client.getMidiPcmStream().setPcmStreamVolume(volume);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,9 @@ public abstract class RSGameShellMixin implements RSGameShell
|
||||
@Shadow("client")
|
||||
private static RSClient client;
|
||||
|
||||
@Shadow("viewportColor")
|
||||
private static int viewportColor;
|
||||
|
||||
@Inject
|
||||
private Thread thread;
|
||||
|
||||
@@ -83,7 +86,7 @@ public abstract class RSGameShellMixin implements RSGameShell
|
||||
DrawCallbacks drawCallbacks = client.getDrawCallbacks();
|
||||
if (drawCallbacks != null)
|
||||
{
|
||||
drawCallbacks.draw(client.getViewportColor());
|
||||
drawCallbacks.draw(viewportColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.runelite.mixins;
|
||||
|
||||
import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.rs.api.RSParamComposition;
|
||||
|
||||
@Mixin(RSParamComposition.class)
|
||||
public abstract class RSParamCompositionMixin implements RSParamComposition
|
||||
{
|
||||
@Inject
|
||||
@Override
|
||||
public boolean isString()
|
||||
{
|
||||
return getType() == 's';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package net.runelite.mixins;
|
||||
|
||||
import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.api.mixins.Shadow;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSScriptEvent;
|
||||
|
||||
@Mixin(RSScriptEvent.class)
|
||||
public abstract class RSScriptEventMixin implements RSScriptEvent
|
||||
{
|
||||
@Shadow("client")
|
||||
private static RSClient client;
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
client.runScriptEvent(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package net.runelite.mixins;
|
||||
|
||||
import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.rs.api.RSStructComposition;
|
||||
|
||||
@Mixin(RSStructComposition.class)
|
||||
public abstract class RSStructCompositionMixin implements RSStructComposition
|
||||
{
|
||||
@Inject
|
||||
private int id = -1;
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setId(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@ import net.runelite.api.HashTable;
|
||||
import net.runelite.api.Node;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.WidgetNode;
|
||||
import net.runelite.api.events.WidgetHiddenChanged;
|
||||
import net.runelite.api.events.WidgetPositioned;
|
||||
import net.runelite.api.mixins.Copy;
|
||||
import net.runelite.api.mixins.FieldHook;
|
||||
@@ -410,78 +409,6 @@ public abstract class RSWidgetMixin implements RSWidget
|
||||
return bounds != null && bounds.contains(new java.awt.Point(point.getX(), point.getY()));
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void broadcastHidden(boolean hidden)
|
||||
{
|
||||
WidgetHiddenChanged event = new WidgetHiddenChanged();
|
||||
event.setWidget(this);
|
||||
event.setHidden(hidden);
|
||||
|
||||
client.getCallbacks().post(event);
|
||||
|
||||
RSWidget[] children = getChildren();
|
||||
|
||||
if (children != null)
|
||||
{
|
||||
// recursive through children
|
||||
for (RSWidget child : children)
|
||||
{
|
||||
// if the widget is hidden it will not magically unhide from its parent changing
|
||||
if (child == null || child.isSelfHidden())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
child.broadcastHidden(hidden);
|
||||
}
|
||||
}
|
||||
|
||||
// make sure we iterate nested children as well
|
||||
// cannot be null
|
||||
Widget[] nestedChildren = getNestedChildren();
|
||||
|
||||
for (Widget nestedChild : nestedChildren)
|
||||
{
|
||||
if (nestedChild == null || nestedChild.isSelfHidden())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
((RSWidget) nestedChild).broadcastHidden(hidden);
|
||||
}
|
||||
}
|
||||
|
||||
@FieldHook("isHidden")
|
||||
@Inject
|
||||
public void onHiddenChanged(int idx)
|
||||
{
|
||||
int id = getId();
|
||||
|
||||
if (id == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Widget parent = getParent();
|
||||
|
||||
// if the parent is hidden then changes in this widget don't have any visual effect
|
||||
// so ignore them
|
||||
if (parent != null)
|
||||
{
|
||||
if (parent.isHidden())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (TO_GROUP(id) != client.getWidgetRoot())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
broadcastHidden(isSelfHidden());
|
||||
}
|
||||
|
||||
@FieldHook("y")
|
||||
@Inject
|
||||
public void onPositionChanged(int idx)
|
||||
|
||||
@@ -27,7 +27,7 @@ package net.runelite.mixins;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.Opcodes.*;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.events.ScriptPostFired;
|
||||
import net.runelite.api.events.ScriptPreFired;
|
||||
@@ -40,13 +40,12 @@ import net.runelite.api.widgets.JavaScriptCallback;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSScript;
|
||||
import net.runelite.rs.api.RSScriptEvent;
|
||||
import static net.runelite.api.Opcodes.*;
|
||||
|
||||
@Mixin(RSClient.class)
|
||||
public abstract class ScriptVMMixin implements RSClient
|
||||
{
|
||||
@Shadow("client")
|
||||
private static Client client;
|
||||
private static RSClient client;
|
||||
|
||||
@Inject
|
||||
private static RSScript currentScript;
|
||||
@@ -172,11 +171,44 @@ public abstract class ScriptVMMixin implements RSClient
|
||||
@Override
|
||||
public void runScript(Object... args)
|
||||
{
|
||||
assert isClientThread();
|
||||
assert currentScript == null;
|
||||
assert args[0] instanceof Integer || args[0] instanceof JavaScriptCallback : "The first argument should always be a ScriptID!";
|
||||
RSScriptEvent se = createScriptEvent();
|
||||
se.setArguments(args);
|
||||
runScript(se, 5000000);
|
||||
runScriptEvent(createRSScriptEvent(args));
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void runScriptEvent(RSScriptEvent event)
|
||||
{
|
||||
assert isClientThread() : "runScriptEvent must be called on client thread";
|
||||
assert currentScript == null : "scripts are not reentrant";
|
||||
runScript(event, 5000000);
|
||||
boolean assertionsEnabled = false;
|
||||
assert assertionsEnabled = true;
|
||||
|
||||
Object[] args = event.getArguments();
|
||||
if (assertionsEnabled && args[0] instanceof Integer)
|
||||
{
|
||||
int scriptId = (int) args[0];
|
||||
RSScript script = (RSScript) client.getScriptCache().get(scriptId);
|
||||
|
||||
if (script != null)
|
||||
{
|
||||
int intCount = 0, stringCount = 0;
|
||||
for (int i = 1; i < args.length; i++)
|
||||
{
|
||||
if (args[i] instanceof Integer)
|
||||
{
|
||||
intCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
stringCount++;
|
||||
}
|
||||
}
|
||||
|
||||
assert script.getIntArgumentCount() == intCount && script.getStringArgumentCount() == stringCount :
|
||||
"Script " + scriptId + " was called with the incorrect number of arguments; takes "
|
||||
+ script.getIntArgumentCount() + "+" + script.getStringArgumentCount() + ", got " + intCount + "+" + stringCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package net.runelite.mixins;
|
||||
|
||||
import net.runelite.api.VarClientInt;
|
||||
import net.runelite.api.VarClientStr;
|
||||
import net.runelite.api.VarbitComposition;
|
||||
import net.runelite.api.Varbits;
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
@@ -55,7 +56,7 @@ public abstract class VarbitMixin implements RSClient
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public RSVarbitComposition getVarbitDefinition(int id)
|
||||
public RSVarbitComposition getVarbitComposition(int id)
|
||||
{
|
||||
assert client.isClientThread() : "getVarbitDefinition must be called on client thread";
|
||||
|
||||
@@ -78,7 +79,7 @@ public abstract class VarbitMixin implements RSClient
|
||||
{
|
||||
assert client.isClientThread();
|
||||
|
||||
RSVarbitComposition v = getVarbitDefinition(varbitId);
|
||||
RSVarbitComposition v = getVarbitComposition(varbitId);
|
||||
if (v == null)
|
||||
{
|
||||
throw new IndexOutOfBoundsException("Varbit " + varbitId + " does not exist!"); // oob for "backwards compatibility lol"
|
||||
@@ -95,7 +96,7 @@ public abstract class VarbitMixin implements RSClient
|
||||
@Override
|
||||
public void setVarbitValue(int[] varps, int varbitId, int value)
|
||||
{
|
||||
RSVarbitComposition v = getVarbitDefinition(varbitId);
|
||||
RSVarbitComposition v = getVarbitComposition(varbitId);
|
||||
if (v == null)
|
||||
{
|
||||
throw new IndexOutOfBoundsException(String.format("Varbit %d does not exist!", varbitId)); // oob for "backwards compatibility lol"
|
||||
@@ -161,4 +162,11 @@ public abstract class VarbitMixin implements RSClient
|
||||
{
|
||||
return getVarcs().getVarcMap();
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public VarbitComposition getVarbit(int id)
|
||||
{
|
||||
return getVarbitComposition(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user