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);
|
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
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public boolean hasHintArrow()
|
public boolean hasHintArrow()
|
||||||
@@ -1247,6 +1259,7 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
{
|
{
|
||||||
client.setHintArrowTargetType(HintArrowType.PLAYER.getValue());
|
client.setHintArrowTargetType(HintArrowType.PLAYER.getValue());
|
||||||
client.setHintArrowPlayerTargetIdx(((RSPlayer) player).getPlayerId());
|
client.setHintArrowPlayerTargetIdx(((RSPlayer) player).getPlayerId());
|
||||||
|
hintPlayerChanged(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -234,6 +234,9 @@ public interface RSClient extends RSGameShell, Client
|
|||||||
@Import("combatTargetPlayerIndex")
|
@Import("combatTargetPlayerIndex")
|
||||||
int getLocalInteractingIndex();
|
int getLocalInteractingIndex();
|
||||||
|
|
||||||
|
@Import("combatTargetPlayerIndex")
|
||||||
|
void setLocalInteractingIndex(int idx);
|
||||||
|
|
||||||
@Import("groundItems")
|
@Import("groundItems")
|
||||||
RSNodeDeque[][][] getGroundItemDeque();
|
RSNodeDeque[][][] getGroundItemDeque();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user