runelite-client: add tick counter
This commit is contained in:
@@ -447,4 +447,8 @@ public interface Client extends GameEngine
|
|||||||
|
|
||||||
@VisibleForDevtools
|
@VisibleForDevtools
|
||||||
void setChangedSkillsCount(int i);
|
void setChangedSkillsCount(int i);
|
||||||
|
|
||||||
|
int getTickCount();
|
||||||
|
|
||||||
|
void setTickCount(int tickCount);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,6 +119,9 @@ public class Hooks
|
|||||||
_deferredEventBus.replay();
|
_deferredEventBus.replay();
|
||||||
|
|
||||||
eventBus.post(tick);
|
eventBus.post(tick);
|
||||||
|
|
||||||
|
int tick = client.getTickCount();
|
||||||
|
client.setTickCount(tick + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
clientThread.invoke();
|
clientThread.invoke();
|
||||||
|
|||||||
@@ -105,6 +105,9 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
@Shadow("clientInstance")
|
@Shadow("clientInstance")
|
||||||
private static RSClient client;
|
private static RSClient client;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private static int tickCount;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private static boolean interpolatePlayerAnimations;
|
private static boolean interpolatePlayerAnimations;
|
||||||
|
|
||||||
@@ -883,4 +886,16 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
{
|
{
|
||||||
eventBus.post(new UsernameChanged());
|
eventBus.post(new UsernameChanged());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTickCount()
|
||||||
|
{
|
||||||
|
return tickCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTickCount(int tick)
|
||||||
|
{
|
||||||
|
tickCount = tick;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user