runelite-mixins: Add setter for varcint

This commit is contained in:
Max Weber
2018-09-11 21:20:20 -06:00
parent 1a14aa295e
commit a03b34a2c3
2 changed files with 14 additions and 4 deletions

View File

@@ -648,13 +648,15 @@ public interface Client extends GameEngine
String getVar(VarClientStr varClientStr); String getVar(VarClientStr varClientStr);
/** /**
* Sets the given variable * Sets a VarClientString to the passed value
*
* @param varClientStr
* @param value
*/ */
void setVar(VarClientStr varClientStr, String value); void setVar(VarClientStr varClientStr, String value);
/**
* Sets a VarClientInt to the passed value
*/
void setVar(VarClientInt varClientStr, int value);
/** /**
* Sets the value of a given variable. * Sets the value of a given variable.
* *

View File

@@ -134,6 +134,14 @@ public abstract class VarbitMixin implements RSClient
vars[varClientStr.getIndex()] = value; vars[varClientStr.getIndex()] = value;
} }
@Inject
@Override
public void setVar(VarClientInt varClientInt, int value)
{
int[] vars = getIntVarcs();
vars[varClientInt.getIndex()] = value;
}
@Inject @Inject
@Override @Override
public int[] getIntVarcs() public int[] getIntVarcs()