Skip to content

Commit 3080081

Browse files
committed
move statics out of VarPlayerConfig
1 parent c482c62 commit 3080081

File tree

16 files changed

+41
-42
lines changed

16 files changed

+41
-42
lines changed

src/main/java/com/jagex/runescape/Class22.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public static void method309(int varPlayerIndex) {
142142
((Class35) Rasterizer3D.anInterface3_2939).method424(0.6);
143143
}
144144
GameObject.clearImageCache();
145-
VarPlayerConfig.clearScreen = true;
145+
MovedStatics.clearScreen = true;
146146
}
147147
if(varPlayerType == 3) {
148148
int i_22_ = 0;

src/main/java/com/jagex/runescape/Class33.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ else if(i < Player.localPlayerCount)
165165
if(PlayerAppearance.anIntArray712[i] < 6)
166166
i_8_ = MovedStatics.anIntArray2106[PlayerAppearance.anIntArray712[i]];
167167
if(PlayerAppearance.anIntArray712[i] == 6)
168-
i_8_ = VarPlayerConfig.anInt2628 % 20 >= 10 ? 16776960 : 16711680;
168+
i_8_ = MovedStatics.anInt2628 % 20 >= 10 ? 16776960 : 16711680;
169169
if(PlayerAppearance.anIntArray712[i] == 7)
170-
i_8_ = VarPlayerConfig.anInt2628 % 20 < 10 ? 255 : 65535;
170+
i_8_ = MovedStatics.anInt2628 % 20 < 10 ? 255 : 65535;
171171
if(PlayerAppearance.anIntArray712[i] == 8)
172-
i_8_ = VarPlayerConfig.anInt2628 % 20 >= 10 ? 8454016 : 45056;
172+
i_8_ = MovedStatics.anInt2628 % 20 >= 10 ? 8454016 : 45056;
173173
if(PlayerAppearance.anIntArray712[i] == 9) {
174174
int i_9_ = 150 - PlayerAppearance.anIntArray684[i];
175175
if(i_9_ >= 50) {
@@ -206,16 +206,16 @@ else if(i_11_ < 150)
206206
TypeFace.fontBold.drawStringLeft(class1, ISAAC.anInt522, Class44.anInt1048, i_8_);
207207
}
208208
if(PlayerAppearance.anIntArray695[i] == 1) {
209-
TypeFace.fontBold.drawCenteredStringWaveY(class1, ISAAC.anInt522, Class44.anInt1048 + 1, 0, VarPlayerConfig.anInt2628);
210-
TypeFace.fontBold.drawCenteredStringWaveY(class1, ISAAC.anInt522, Class44.anInt1048, i_8_, VarPlayerConfig.anInt2628);
209+
TypeFace.fontBold.drawCenteredStringWaveY(class1, ISAAC.anInt522, Class44.anInt1048 + 1, 0, MovedStatics.anInt2628);
210+
TypeFace.fontBold.drawCenteredStringWaveY(class1, ISAAC.anInt522, Class44.anInt1048, i_8_, MovedStatics.anInt2628);
211211
}
212212
if(PlayerAppearance.anIntArray695[i] == 2) {
213-
TypeFace.fontBold.drawCenteredStringWaveXY(class1, ISAAC.anInt522, 1 + Class44.anInt1048, 0, VarPlayerConfig.anInt2628);
214-
TypeFace.fontBold.drawCenteredStringWaveXY(class1, ISAAC.anInt522, Class44.anInt1048, i_8_, VarPlayerConfig.anInt2628);
213+
TypeFace.fontBold.drawCenteredStringWaveXY(class1, ISAAC.anInt522, 1 + Class44.anInt1048, 0, MovedStatics.anInt2628);
214+
TypeFace.fontBold.drawCenteredStringWaveXY(class1, ISAAC.anInt522, Class44.anInt1048, i_8_, MovedStatics.anInt2628);
215215
}
216216
if(PlayerAppearance.anIntArray695[i] == 3) {
217-
TypeFace.fontBold.drawCenteredStringWaveXYMove(class1, ISAAC.anInt522, Class44.anInt1048 + 1, 0, VarPlayerConfig.anInt2628, -PlayerAppearance.anIntArray684[i] + 150);
218-
TypeFace.fontBold.drawCenteredStringWaveXYMove(class1, ISAAC.anInt522, Class44.anInt1048, i_8_, VarPlayerConfig.anInt2628, -PlayerAppearance.anIntArray684[i] + 150);
217+
TypeFace.fontBold.drawCenteredStringWaveXYMove(class1, ISAAC.anInt522, Class44.anInt1048 + 1, 0, MovedStatics.anInt2628, -PlayerAppearance.anIntArray684[i] + 150);
218+
TypeFace.fontBold.drawCenteredStringWaveXYMove(class1, ISAAC.anInt522, Class44.anInt1048, i_8_, MovedStatics.anInt2628, -PlayerAppearance.anIntArray684[i] + 150);
219219
}
220220
if(PlayerAppearance.anIntArray695[i] == 4) {
221221
int i_12_ = TypeFace.fontBold.getStringWidth(class1);

src/main/java/com/jagex/runescape/Class40_Sub5_Sub17_Sub6.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ public static void method833(int arg0, boolean arg1) {
8989
Npc.currentScene.method112(Player.worldLevel, player.worldX, player.worldY, player.anInt3276, 60, player, player.anInt3118, i_1_, player.anInt3258, player.anInt3281, player.anInt3262, player.anInt3289);
9090
} else {
9191
if((0x7f & player.worldX) == 64 && (player.worldY & 0x7f) == 64) {
92-
if(VarPlayerConfig.anInt2628 == MovedStatics.anIntArrayArray1435[i_2_][i_3_])
92+
if(MovedStatics.anInt2628 == MovedStatics.anIntArrayArray1435[i_2_][i_3_])
9393
continue;
94-
MovedStatics.anIntArrayArray1435[i_2_][i_3_] = VarPlayerConfig.anInt2628;
94+
MovedStatics.anIntArrayArray1435[i_2_][i_3_] = MovedStatics.anInt2628;
9595
}
9696
player.anInt3276 = Class37.getFloorDrawHeight(Player.worldLevel, player.worldX, player.worldY);
9797
Npc.currentScene.method134(Player.worldLevel, player.worldX, player.worldY, player.anInt3276, 60, player, player.anInt3118, i_1_, player.aBoolean3105);

src/main/java/com/jagex/runescape/Class51.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public static int getKeyChar(KeyEvent arg1) {
3535

3636

3737
public static void method940(int arg0, String arg1, boolean arg2, String arg3) {
38-
if(VarPlayerConfig.clearScreen) {
39-
VarPlayerConfig.clearScreen = false;
38+
if(MovedStatics.clearScreen) {
39+
MovedStatics.clearScreen = false;
4040
ItemDefinition.drawWelcomeScreenGraphics();
4141
LinkedList.drawChatBoxGraphics();
4242
Class55.drawTabGraphics();

src/main/java/com/jagex/runescape/Class64.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public static void method1015() {
211211
Landscape.mouseY = MovedStatics.eventMouseY;
212212
MouseHandler.clickType = Actor.eventMouseButtonPressed;
213213
Class57.clickX = Class55.eventClickX;
214-
RSString.clickY = VarPlayerConfig.eventClickY;
214+
RSString.clickY = MovedStatics.eventClickY;
215215
GameObjectDefinition.aLong2561 = OverlayDefinition.lastClick;
216216
Actor.eventMouseButtonPressed = 0;
217217
}

src/main/java/com/jagex/runescape/GameShell.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static void method20(int arg0, int arg1, int arg2, int arg3, int arg4, in
9898
if (gameInterface.anInt2738 != -1 && bool_9_ && Wall.aGameInterface_353 == null) {
9999
MovedStatics.anInt1996 = Class13.mouseX;
100100
Wall.aGameInterface_353 = gameInterface;
101-
VarPlayerConfig.anInt2621 = Landscape.mouseY;
101+
MovedStatics.anInt2621 = Landscape.mouseY;
102102
}
103103
if (MouseHandler.clickType == 1 && i_6_ <= Class57.clickX && RSString.clickY >= i_4_ && Class57.clickX < i_8_ && RSString.clickY < i_7_)
104104
bool_10_ = true;
@@ -306,7 +306,7 @@ public void focusLost(FocusEvent arg0) {
306306

307307
public synchronized void paint(Graphics arg0) {
308308
if (this == MovedStatics.anApplet_Sub1_179 && !PacketBuffer.aBoolean2255) {
309-
VarPlayerConfig.clearScreen = true;
309+
MovedStatics.clearScreen = true;
310310
if (Signlink.aString739 == null || !Signlink.aString739.startsWith("1.5") || -MovedStatics.aLong174 + System.currentTimeMillis() <= 1000L)
311311
return;
312312
Rectangle rectangle = arg0.getClipBounds();
@@ -326,7 +326,7 @@ public void destroy() {
326326

327327
public void focusGained(FocusEvent arg0) {
328328
GenericTile.aBoolean1215 = true;
329-
VarPlayerConfig.clearScreen = true;
329+
MovedStatics.clearScreen = true;
330330
}
331331

332332
public URL getDocumentBase() {
@@ -376,7 +376,7 @@ public void method26(byte arg0) {
376376
PlayerAppearance.anInt681 = PlayerAppearance.anInt681 + 1 & 0x1f;
377377
if (MovedStatics.anInt938++ > 50) {
378378
MovedStatics.anInt938 -= 50;
379-
VarPlayerConfig.clearScreen = true;
379+
MovedStatics.clearScreen = true;
380380
MouseHandler.gameCanvas.setSize(Class12.width, IdentityKit.height);
381381
MouseHandler.gameCanvas.setVisible(true);
382382
MouseHandler.gameCanvas.setBackground(Color.BLACK);
@@ -490,7 +490,7 @@ public synchronized void setCanvas(byte arg0) {
490490
if (arg0 < 85)
491491
run();
492492
MouseHandler.gameCanvas.requestFocus();
493-
VarPlayerConfig.clearScreen = true;
493+
MovedStatics.clearScreen = true;
494494
MovedStatics.aBoolean1575 = false;
495495
MovedStatics.aLong174 = System.currentTimeMillis();
496496
}

src/main/java/com/jagex/runescape/Main.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static boolean drawInterface(int areaId, int minX, int minY, int maxX, in
117117
GameInterface gameInterface_3_ = FramemapDefinition.method878(gameInterface);
118118
int[] is = Class13.method247(gameInterface_3_, (byte) 117);
119119
int[] is_4_ = Class13.method247(gameInterface, (byte) 97);
120-
int i_5_ = Landscape.mouseY + -VarPlayerConfig.anInt2621 + is_4_[1] - is[1];
120+
int i_5_ = Landscape.mouseY + -MovedStatics.anInt2621 + is_4_[1] - is[1];
121121
if (i_5_ < 0)
122122
i_5_ = 0;
123123
if (i_5_ + gameInterface.originalHeight > gameInterface_3_.originalHeight)
@@ -771,7 +771,7 @@ public static void method44() {
771771
}
772772

773773
public static void method353(byte arg0) {
774-
VarPlayerConfig.anInt2628++;
774+
MovedStatics.anInt2628++;
775775
Class40_Sub5_Sub17_Sub6.method833(0, true);
776776
ItemDefinition.method749(true);
777777
Class40_Sub5_Sub17_Sub6.method833(0, false);
@@ -915,8 +915,8 @@ public static void method364(byte arg0, boolean arg1) {
915915
}
916916

917917
public static void drawGameScreen() {
918-
if(VarPlayerConfig.clearScreen) {
919-
VarPlayerConfig.clearScreen = false;
918+
if(MovedStatics.clearScreen) {
919+
MovedStatics.clearScreen = false;
920920
ItemDefinition.drawWelcomeScreenGraphics();
921921
GameInterface.drawTabIcons = true;
922922
ChatBox.redrawChatbox = true;

src/main/java/com/jagex/runescape/MovedStatics.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ public class MovedStatics {
126126
public static long aLong853;
127127
public static int anInt854 = -1;
128128
public static IndexedImage minimapBackgroundImage;
129+
public static int anInt2621 = 0;
130+
public static volatile int eventClickY = 0;
131+
public static int anInt2628 = 0;
132+
public static volatile boolean clearScreen = true;
129133

130134
public static void method440(byte arg0) {
131135
if (ISAAC.aBoolean512) {

src/main/java/com/jagex/runescape/VarPlayerConfig.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,14 @@
44
import com.jagex.runescape.node.CachedNode;
55

66
public class VarPlayerConfig extends CachedNode {
7-
public static int anInt2621 = 0;
8-
public static volatile int eventClickY = 0;
9-
public static int anInt2628 = 0;
10-
public static volatile boolean clearScreen = true;
11-
127
public int type = 0;
138

149
public void decodeVarPlayerConfig(Buffer buffer) {
1510
for(; ; ) {
16-
int i = buffer.getUnsignedByte();
17-
if(i == 0)
11+
int opcode = buffer.getUnsignedByte();
12+
if(opcode == 0)
1813
break;
19-
if(i == 5)
14+
if(opcode == 5)
2015
type = buffer.getUnsignedShortBE();
2116
}
2217
}

src/main/java/com/jagex/runescape/cache/def/ItemDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ public static void method749(boolean arg0) {
179179
int i_17_ = npc.worldY >> 7;
180180
if(i_16_ >= 0 && i_16_ < 104 && i_17_ >= 0 && i_17_ < 104) {
181181
if(npc.anInt3096 == 1 && (npc.worldX & 0x7f) == 64 && (npc.worldY & 0x7f) == 64) {
182-
if(MovedStatics.anIntArrayArray1435[i_16_][i_17_] == VarPlayerConfig.anInt2628) {
182+
if(MovedStatics.anIntArrayArray1435[i_16_][i_17_] == MovedStatics.anInt2628) {
183183
continue;
184184
}
185-
MovedStatics.anIntArrayArray1435[i_16_][i_17_] = VarPlayerConfig.anInt2628;
185+
MovedStatics.anIntArrayArray1435[i_16_][i_17_] = MovedStatics.anInt2628;
186186
}
187187
if(!npc.actorDefinition.isClickable) {
188188
i_15_ += -2147483648;

0 commit comments

Comments
 (0)