Skip to content

Commit 112964b

Browse files
committed
refactor: renaming for hinticon positioning
1 parent 3f9f2d0 commit 112964b

File tree

8 files changed

+33
-18
lines changed

8 files changed

+33
-18
lines changed

src/main/java/org/runejs/client/Class35.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
import org.runejs.client.io.Buffer;
66

77
public class Class35 implements Interface3 {
8-
public static int anInt1730 = 0;
8+
/**
9+
* Position of the hint icon within the specific tile.
10+
*/
11+
public static int hintIconInnerPosY = 0;
912
public static boolean aBoolean1734 = false;
1013
public static boolean aBoolean1735 = true;
1114
/**

src/main/java/org/runejs/client/Class37.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.runejs.client;
22

33
import org.runejs.client.cache.def.ActorDefinition;
4-
import org.runejs.client.cache.def.OverlayDefinition;
54
import org.runejs.client.cache.media.AnimationSequence;
65
import org.runejs.client.cache.media.ImageRGB;
76
import org.runejs.client.frame.ScreenController;
@@ -137,8 +136,8 @@ else if(isTeammate)
137136
}
138137
}
139138
if(Player.headIconDrawType == 2) {
140-
int hintX = -(Player.localPlayer.worldY / 32) + 2 + 4 * (-Class26.baseY + MovedStatics.anInt175);
141-
int hintY = 4 * (ProducingGraphicsBuffer.anInt1637 - MovedStatics.baseX) - (-2 + Player.localPlayer.worldX / 32);
139+
int hintX = -(Player.localPlayer.worldY / 32) + 2 + 4 * (-Class26.baseY + MovedStatics.hintIconPosY);
140+
int hintY = 4 * (ProducingGraphicsBuffer.hintIconPosX - MovedStatics.baseX) - (-2 + Player.localPlayer.worldX / 32);
142141
MovedStatics.drawMinimapMark(Class40_Sub3.aClass40_Sub5_Sub14_Sub4Array2019[1], hintY, hintX);
143142
}
144143
if(Player.headIconDrawType == 10 && ProducingGraphicsBuffer.anInt1623 >= 0 && Player.trackedPlayers.length > ProducingGraphicsBuffer.anInt1623) {

src/main/java/org/runejs/client/Landscape.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ public class Landscape {
3030
public static int mouseY = 0;
3131
public static CollisionMap[] currentCollisionMap = new CollisionMap[4];
3232
public static int[] anIntArray1168;
33-
public static int anInt1170 = 0;
33+
/**
34+
* Position of the hint icon within the specific tile.
35+
*/
36+
public static int hintIconInnerPosX = 0;
3437
public static int anInt1171 = 0;
3538
public static String[] menuActionTexts = new String[500];
3639
public static ProducingGraphicsBuffer framePieceRight;

src/main/java/org/runejs/client/MovedStatics.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ public class MovedStatics {
9393
public static int anInt573 = -1;
9494
public static boolean menuOpen = false;
9595
public static volatile long aLong174 = 0L;
96-
public static int anInt175 = 0;
96+
97+
/**
98+
* Position of the hint icon in world coordinates (e.g. 3222,3222).
99+
*/
100+
public static int hintIconPosY = 0;
97101
public static int[] anIntArray178;
98102
public static int[] chatboxLineOffsets;
99103
public static int anInt199 = 0;
@@ -1949,7 +1953,7 @@ public static void method311(Component arg1) {
19491953

19501954
public static void method450() {
19511955
if (Player.headIconDrawType == 2) {
1952-
MovedStatics.getProjectedScreenPosition(2 * ActorDefinition.anInt2404, Class35.anInt1730 + (-Class26.baseY + anInt175 << 7), (ProducingGraphicsBuffer.anInt1637 + -baseX << 7) + Landscape.anInt1170);
1956+
MovedStatics.getProjectedScreenPosition(2 * ActorDefinition.hintIconPosZ, Class35.hintIconInnerPosY + (-Class26.baseY + hintIconPosY << 7), (ProducingGraphicsBuffer.hintIconPosX + -baseX << 7) + Landscape.hintIconInnerPosX);
19531957
if (ISAAC.anInt522 > -1 && pulseCycle % 20 < 10)
19541958
hintIconSprites[0].drawImage(ISAAC.anInt522 + -12, -28 + Class44.anInt1048);
19551959
}

src/main/java/org/runejs/client/ProducingGraphicsBuffer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ public abstract class ProducingGraphicsBuffer {
1313
public static ProducingGraphicsBuffer aProducingGraphicsBuffer_1631;
1414
public static SignlinkNode updateServerSignlinkNode;
1515
public static int anInt1634 = 0;
16-
public static int anInt1637 = 0;
16+
17+
/**
18+
* Position of the hint icon in world coordinates (e.g. 3222,3222)
19+
*/
20+
public static int hintIconPosX = 0;
1721
public static ProducingGraphicsBuffer muteButton;
1822

1923
public int height;

src/main/java/org/runejs/client/cache/def/ActorDefinition.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ public class ActorDefinition extends CachedNode implements EntityDefinition {
2323

2424
public static int[] sidebarOffsets;
2525
public static int menuActionRow = 0;
26-
public static int anInt2404 = 0;
26+
27+
/**
28+
* Draw height of the icon in 3d positions.
29+
*/
30+
public static int hintIconPosZ = 0;
2731
public static int count;
2832

2933
public boolean isClickable = true;

src/main/java/org/runejs/client/frame/Minimap.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import org.runejs.client.media.renderable.actor.Actor;
1313
import org.runejs.client.media.renderable.actor.Npc;
1414
import org.runejs.client.media.renderable.actor.Player;
15-
import org.runejs.client.scene.GroundItemTile;
16-
import org.runejs.client.scene.SceneCamera;
1715
import org.runejs.client.scene.tile.Wall;
1816
import org.runejs.client.*;
1917

@@ -181,8 +179,8 @@ else if(isTeammate)
181179
}
182180
}
183181
if(Player.headIconDrawType == 2) {
184-
int hintY = -(Player.localPlayer.worldY / 32) + 2 + 4 * (-Class26.baseY + MovedStatics.anInt175);
185-
int hintX = 4 * (ProducingGraphicsBuffer.anInt1637 - MovedStatics.baseX) - (-2 + Player.localPlayer.worldX / 32);
182+
int hintY = -(Player.localPlayer.worldY / 32) + 2 + 4 * (-Class26.baseY + MovedStatics.hintIconPosY);
183+
int hintX = 4 * (ProducingGraphicsBuffer.hintIconPosX - MovedStatics.baseX) - (-2 + Player.localPlayer.worldX / 32);
186184
drawMinimapMark(Class40_Sub3.aClass40_Sub5_Sub14_Sub4Array2019[1], hintX, hintY);
187185
}
188186
if(Player.headIconDrawType == 10 && ProducingGraphicsBuffer.anInt1623 >= 0 && Player.trackedPlayers.length > ProducingGraphicsBuffer.anInt1623) {

src/main/java/org/runejs/client/message/handler/rs435/misc/SetHintIconMessageHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ private void handleNoneType(SetHintIconInboundMessage message) {
3333

3434
private void handlePositionType(SetHintIconInboundMessage message) {
3535
Player.headIconDrawType = 2;
36-
ProducingGraphicsBuffer.anInt1637 = message.positionInfo.x;
37-
MovedStatics.anInt175 = message.positionInfo.y;
38-
ActorDefinition.anInt2404 = message.positionInfo.drawHeight;
39-
Landscape.anInt1170 = message.positionInfo.drawOffsetX;
40-
Class35.anInt1730 = message.positionInfo.drawOffsetY;
36+
ProducingGraphicsBuffer.hintIconPosX = message.positionInfo.x;
37+
MovedStatics.hintIconPosY = message.positionInfo.y;
38+
ActorDefinition.hintIconPosZ = message.positionInfo.drawHeight;
39+
Landscape.hintIconInnerPosX = message.positionInfo.drawOffsetX;
40+
Class35.hintIconInnerPosY = message.positionInfo.drawOffsetY;
4141
}
4242

4343
private void handleNPCType(SetHintIconInboundMessage message) {

0 commit comments

Comments
 (0)