Merge pull request #5454 from Abextm/varcint-setter

runelite-mixins: Add setter for varcint
This commit is contained in:
Abex
2018-09-11 22:19:52 -06:00
committed by GitHub
2 changed files with 14 additions and 4 deletions

View File

@@ -648,13 +648,15 @@ public interface Client extends GameEngine
String getVar(VarClientStr varClientStr);
/**
* Sets the given variable
*
* @param varClientStr
* @param value
* Sets a VarClientString to the passed 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.
*

View File

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