Bring player targeted by hint arrow to front (while not in combat)
This commit is contained in:
@@ -1196,6 +1196,18 @@ public abstract class RSClientMixin implements RSClient
|
||||
client.getCallbacks().post(CanvasSizeChanged.class, CanvasSizeChanged.INSTANCE);
|
||||
}
|
||||
|
||||
@FieldHook("hintArrowPlayerIndex")
|
||||
@Inject
|
||||
public static void hintPlayerChanged(int ignored)
|
||||
{
|
||||
// Setting the localInteractingIndex (aka player target index, it only applies to players)
|
||||
// causes that player to get priority over others when rendering/menus are added
|
||||
if (client.getVar(VarPlayer.ATTACKING_PLAYER) == -1)
|
||||
{
|
||||
client.setLocalInteractingIndex(client.getHintArrowPlayerTargetIdx() & 2047);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public boolean hasHintArrow()
|
||||
@@ -1247,6 +1259,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
client.setHintArrowTargetType(HintArrowType.PLAYER.getValue());
|
||||
client.setHintArrowPlayerTargetIdx(((RSPlayer) player).getPlayerId());
|
||||
hintPlayerChanged(-1);
|
||||
}
|
||||
|
||||
@Inject
|
||||
|
||||
@@ -234,6 +234,9 @@ public interface RSClient extends RSGameShell, Client
|
||||
@Import("combatTargetPlayerIndex")
|
||||
int getLocalInteractingIndex();
|
||||
|
||||
@Import("combatTargetPlayerIndex")
|
||||
void setLocalInteractingIndex(int idx);
|
||||
|
||||
@Import("groundItems")
|
||||
RSNodeDeque[][][] getGroundItemDeque();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user