|
1 | 1 | package org.runejs.client;
|
2 | 2 |
|
3 | 3 | import org.runejs.client.cache.def.IdentityKit;
|
4 |
| -import org.runejs.client.cache.media.gameInterface.GameInterface; |
5 |
| -import org.runejs.client.cache.media.gameInterface.GameInterfaceType; |
6 | 4 | import org.runejs.client.frame.ScreenController;
|
7 | 5 | import org.runejs.client.frame.ScreenMode;
|
8 | 6 | import org.runejs.client.input.MouseHandler;
|
9 |
| -import org.runejs.client.media.Rasterizer3D; |
10 | 7 | import org.runejs.client.media.renderable.actor.Actor;
|
11 |
| -import org.runejs.client.media.renderable.actor.Player; |
12 | 8 | import org.runejs.client.media.renderable.actor.PlayerAppearance;
|
13 |
| -import org.runejs.client.message.outbound.chat.ModifySocialListOutboundMessage; |
14 |
| -import org.runejs.client.net.OutgoingPackets; |
15 | 9 | import org.runejs.client.net.PacketBuffer;
|
16 | 10 | import org.runejs.client.scene.SceneCluster;
|
17 | 11 | import org.runejs.client.scene.tile.GenericTile;
|
18 |
| -import org.runejs.client.scene.tile.Wall; |
19 | 12 | import org.runejs.client.util.Signlink;
|
20 | 13 | import org.runejs.client.util.Timer;
|
21 | 14 |
|
22 |
| -import org.runejs.client.cache.media.AnimationSequence; |
23 |
| -import org.runejs.client.cache.media.IndexedImage; |
24 | 15 | import org.runejs.Configuration;
|
25 | 16 |
|
26 | 17 | import java.awt.*;
|
|
31 | 22 | import java.net.URL;
|
32 | 23 |
|
33 | 24 | public abstract class GameShell extends Canvas implements Runnable, FocusListener, WindowListener {
|
34 |
| - /** |
35 |
| - * The image used for the highlighted (selected) tab button, |
36 |
| - * for one of the tabs on the left-hand side of the top, |
37 |
| - * but not the furthest-left (see `tabHighlightImageTopLeftEdge` for that). |
38 |
| - */ |
39 |
| - public static IndexedImage tabHighlightImageTopLeft; |
40 | 25 | public static long[] tickSamples = new long[32];
|
41 |
| - public static int anInt31; |
42 | 26 |
|
43 | 27 | public static long exitTimeInMillis = 0L;
|
44 | 28 | public static Frame clientFrame;
|
45 | 29 | public static GameShell currentGameShell = null;
|
46 |
| - public static int millisPerTick = 20; |
| 30 | + private final int millisPerTick = 20; |
47 | 31 | public boolean gameShellError = false;
|
48 | 32 |
|
49 | 33 |
|
50 |
| - public static void runClientScriptsForInterface(int minY, int arg1, int scrollWidth, int arg3, int minX, int parentId, GameInterface[] interfaceCollection, int arg8, int scrollHeight) { |
51 |
| - for (int i = 0; i < interfaceCollection.length; i++) { |
52 |
| - GameInterface gameInterface = interfaceCollection[i]; |
53 |
| - if (gameInterface != null && (gameInterface.type == GameInterfaceType.LAYER || gameInterface.hasListeners) && parentId == gameInterface.parentId && (!gameInterface.isHidden || PacketBuffer.hiddenButtonTest)) { |
54 |
| - int absoluteX = minX + gameInterface.currentX; |
55 |
| - int absoluteY = minY + gameInterface.currentY; |
56 |
| - if (!gameInterface.lockScroll) |
57 |
| - absoluteY -= scrollHeight; |
58 |
| - int bottomLeftY = absoluteY + gameInterface.originalHeight; |
59 |
| - int i_4_ = Math.max(minY, absoluteY); |
60 |
| - if (!gameInterface.lockScroll) |
61 |
| - absoluteX -= scrollWidth; |
62 |
| - int topRightX = absoluteX + gameInterface.originalWidth; |
63 |
| - int i_6_ = Math.max(minX, absoluteX); |
64 |
| - int i_7_ = Math.min(arg1, bottomLeftY); |
65 |
| - int i_8_ = Math.min(topRightX, arg8); |
66 |
| - if (gameInterface.type == GameInterfaceType.LAYER) { |
67 |
| - runClientScriptsForInterface(i_4_, i_7_, gameInterface.scrollWidth, arg3, i_6_, i, interfaceCollection, i_8_, gameInterface.scrollPosition); |
68 |
| - if (gameInterface.children != null) |
69 |
| - runClientScriptsForInterface(i_4_, i_7_, gameInterface.scrollWidth, arg3, i_6_, gameInterface.id, gameInterface.children, i_8_, gameInterface.scrollPosition); |
70 |
| - } |
71 |
| - if (gameInterface.hasListeners) { |
72 |
| - boolean bool; |
73 |
| - bool = Class13.mouseX >= i_6_ && i_4_ <= Landscape.mouseY && i_8_ > Class13.mouseX && i_7_ > Landscape.mouseY; |
74 |
| - boolean bool_9_ = false; |
75 |
| - if (MouseHandler.currentMouseButtonPressed == 1 && bool) |
76 |
| - bool_9_ = true; |
77 |
| - boolean bool_10_ = false; |
78 |
| - if (gameInterface.anInt2738 != -1 && bool_9_ && Wall.aGameInterface_353 == null) { |
79 |
| - MovedStatics.anInt1996 = Class13.mouseX; |
80 |
| - Wall.aGameInterface_353 = gameInterface; |
81 |
| - MovedStatics.anInt2621 = Landscape.mouseY; |
82 |
| - } |
83 |
| - if (MouseHandler.clickType == 1 && i_6_ <= Class57.clickX && RSString.clickY >= i_4_ && Class57.clickX < i_8_ && RSString.clickY < i_7_) |
84 |
| - bool_10_ = true; |
85 |
| - if (Wall.aGameInterface_353 != null) { |
86 |
| - bool_9_ = false; |
87 |
| - bool = false; |
88 |
| - bool_10_ = false; |
89 |
| - } |
90 |
| - if (!gameInterface.aBoolean2730 && bool_10_ && (0x1 & arg3) != 0) { |
91 |
| - gameInterface.aBoolean2730 = true; |
92 |
| - if (gameInterface.anObjectArray2681 != null) |
93 |
| - ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2681, 0, RSString.clickY + -absoluteY, gameInterface, Class57.clickX - absoluteX); |
94 |
| - } |
95 |
| - if (gameInterface.aBoolean2730 && bool_9_ && (arg3 & 0x4) != 0 && gameInterface.anObjectArray2747 != null) |
96 |
| - ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2747, 0, -absoluteY + Landscape.mouseY, gameInterface, -absoluteX + Class13.mouseX); |
97 |
| - if (gameInterface.aBoolean2730 && !bool_9_ && (0x2 & arg3) != 0) { |
98 |
| - gameInterface.aBoolean2730 = false; |
99 |
| - if (gameInterface.anObjectArray2707 != null) |
100 |
| - ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2707, 0, Landscape.mouseY - absoluteY, gameInterface, Class13.mouseX - absoluteX); |
101 |
| - } |
102 |
| - if (bool_9_ && (arg3 & 0x8) != 0 && gameInterface.anObjectArray2644 != null) |
103 |
| - ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2644, 0, -absoluteY + Landscape.mouseY, gameInterface, -absoluteX + Class13.mouseX); |
104 |
| - if (!gameInterface.aBoolean2682 && bool && (0x10 & arg3) != 0) { |
105 |
| - gameInterface.aBoolean2682 = true; |
106 |
| - if (gameInterface.anObjectArray2658 != null) |
107 |
| - ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2658, 0, Landscape.mouseY - absoluteY, gameInterface, Class13.mouseX - absoluteX); |
108 |
| - } |
109 |
| - if (gameInterface.aBoolean2682 && bool && (0x40 & arg3) != 0 && gameInterface.anObjectArray2680 != null) |
110 |
| - ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2680, 0, -absoluteY + Landscape.mouseY, gameInterface, -absoluteX + Class13.mouseX); |
111 |
| - if (gameInterface.aBoolean2682 && !bool && (arg3 & 0x20) != 0) { |
112 |
| - gameInterface.aBoolean2682 = false; |
113 |
| - if (gameInterface.anObjectArray2672 != null) |
114 |
| - ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2672, 0, -absoluteY + Landscape.mouseY, gameInterface, -absoluteX + Class13.mouseX); |
115 |
| - } |
116 |
| - if (gameInterface.anObjectArray2712 != null && (arg3 & 0x80) != 0) |
117 |
| - ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2712, 0, 0, gameInterface, 0); |
118 |
| - if (AnimationSequence.anInt2480 == MovedStatics.pulseCycle && gameInterface.anObjectArray2650 != null && (arg3 & 0x100) != 0) |
119 |
| - ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2650, 0, 0, gameInterface, 0); |
120 |
| - } |
121 |
| - } |
122 |
| - } |
123 |
| - |
124 |
| - } |
125 |
| - |
126 |
| - public static void providesignlink(Signlink signlink) { |
127 |
| - Actor.signlink = Main.signlink = signlink; |
128 |
| - } |
129 |
| - |
130 |
| - public static void method28(long arg0) { |
131 |
| - if (arg0 != 0) { |
132 |
| - int i = 0; |
133 |
| - for (/**/; Player.friendsCount > i; i++) { |
134 |
| - if (Class59.friends[i] == arg0) { |
135 |
| - Player.friendsCount--; |
136 |
| - GameInterface.redrawTabArea = true; |
137 |
| - for (int i_13_ = i; i_13_ < Player.friendsCount; i_13_++) { |
138 |
| - Player.friendUsernames[i_13_] = Player.friendUsernames[1 + i_13_]; |
139 |
| - Player.friendWorlds[i_13_] = Player.friendWorlds[i_13_ + 1]; |
140 |
| - Class59.friends[i_13_] = Class59.friends[1 + i_13_]; |
141 |
| - } |
142 |
| - |
143 |
| - OutgoingPackets.sendMessage( |
144 |
| - new ModifySocialListOutboundMessage(arg0, ModifySocialListOutboundMessage.SocialList.FRIEND, ModifySocialListOutboundMessage.SocialListAction.REMOVE)); |
145 |
| - break; |
146 |
| - } |
147 |
| - } |
148 |
| - } |
149 |
| - } |
150 |
| - |
151 |
| - public static int interpolate(int arg0, int arg1, int arg2, boolean arg3, int arg4) { |
152 |
| - if (!arg3) |
153 |
| - return -109; |
154 |
| - int i = 65536 + -Rasterizer3D.cosinetable[1024 * arg4 / arg1] >> 1; |
155 |
| - return ((65536 + -i) * arg0 >> 16) + (arg2 * i >> 16); |
156 |
| - } |
157 |
| - |
158 | 34 | public void run() {
|
159 | 35 | if (Signlink.javaVendor != null) {
|
160 | 36 | String string = Signlink.javaVendor.toLowerCase();
|
|
0 commit comments