mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-19 21:10:19 -07:00
Refactored OverheadChat
This commit is contained in:
parent
249781ed8b
commit
a59254cde7
6 changed files with 104 additions and 111 deletions
|
|
@ -4,31 +4,64 @@ import org.openrs2.deob.annotation.OriginalMember;
|
|||
import org.openrs2.deob.annotation.Pc;
|
||||
|
||||
public class OverheadChat {
|
||||
@OriginalMember(owner = "client!bf", name = "I", descriptor = "[I")
|
||||
public static final int[] COLORS = new int[]{16776960, 16711680, 65280, 65535, 16711935, 16777215};
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "fb", descriptor = "I")
|
||||
public static final int CAPACITY = 50;
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "cb", descriptor = "[I")
|
||||
public static final int[] anIntArray389 = new int[CAPACITY];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "Z", descriptor = "[I")
|
||||
public static final int[] anIntArray387 = new int[CAPACITY];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "kb", descriptor = "[I")
|
||||
public static final int[] effects = new int[CAPACITY];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "Q", descriptor = "[I")
|
||||
public static final int[] loops = new int[CAPACITY];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "eb", descriptor = "[I")
|
||||
public static final int[] colors = new int[CAPACITY];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "lb", descriptor = "[I")
|
||||
public static final int[] anIntArray392 = new int[CAPACITY];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "R", descriptor = "[I")
|
||||
public static final int[] anIntArray385 = new int[CAPACITY];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "P", descriptor = "[Lclient!na;")
|
||||
public static final JagString[] messages = new JagString[CAPACITY];
|
||||
|
||||
@OriginalMember(owner = "client!wi", name = "bb", descriptor = "I")
|
||||
public static int size = 0;
|
||||
|
||||
@OriginalMember(owner = "client!bi", name = "f", descriptor = "(B)V")
|
||||
public static void loop() {
|
||||
@Pc(11) int local11;
|
||||
for (local11 = -1; local11 < PlayerList.size; local11++) {
|
||||
@Pc(22) int local22;
|
||||
if (local11 == -1) {
|
||||
local22 = 2047;
|
||||
@Pc(11) int i;
|
||||
for (i = -1; i < PlayerList.size; i++) {
|
||||
@Pc(22) int id;
|
||||
if (i == -1) {
|
||||
id = 2047;
|
||||
} else {
|
||||
local22 = PlayerList.ids[local11];
|
||||
id = PlayerList.ids[i];
|
||||
}
|
||||
@Pc(30) Player local30 = PlayerList.players[local22];
|
||||
if (local30 != null && local30.chatLoops > 0) {
|
||||
local30.chatLoops--;
|
||||
if (local30.chatLoops == 0) {
|
||||
local30.chatMessage = null;
|
||||
@Pc(30) Player player = PlayerList.players[id];
|
||||
if (player != null && player.chatLoops > 0) {
|
||||
player.chatLoops--;
|
||||
if (player.chatLoops == 0) {
|
||||
player.chatMessage = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (local11 = 0; local11 < NpcList.size; local11++) {
|
||||
@Pc(68) int local68 = NpcList.ids[local11];
|
||||
@Pc(72) Npc local72 = NpcList.npcs[local68];
|
||||
if (local72 != null && local72.chatLoops > 0) {
|
||||
local72.chatLoops--;
|
||||
if (local72.chatLoops == 0) {
|
||||
local72.chatMessage = null;
|
||||
for (i = 0; i < NpcList.size; i++) {
|
||||
@Pc(68) int id = NpcList.ids[i];
|
||||
@Pc(72) Npc npc = NpcList.npcs[id];
|
||||
if (npc != null && npc.chatLoops > 0) {
|
||||
npc.chatLoops--;
|
||||
if (npc.chatLoops == 0) {
|
||||
npc.chatMessage = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ public class Protocol {
|
|||
public static final JagString aClass100_431 = JagString.parse("; Max)2Age=");
|
||||
@OriginalMember(owner = "client!ch", name = "z", descriptor = "[I")
|
||||
public static final int[] anIntArray76 = new int[5];
|
||||
@OriginalMember(owner = "client!pg", name = "db", descriptor = "Lclient!na;")
|
||||
public static final JagString ASSISTREQ = JagString.parse(":assistreq:");
|
||||
@OriginalMember(owner = "client!jk", name = "B", descriptor = "Lclient!ma;")
|
||||
public static BufferedSocket socket;
|
||||
@OriginalMember(owner = "client!fl", name = "C", descriptor = "Lsignlink!im;")
|
||||
|
|
@ -979,7 +981,7 @@ public class Protocol {
|
|||
JagString local506 = message.substring(message.length() - 9, message.indexOf(DateUtil.COLON) + 1);
|
||||
Chat.add(name, 8, local506);
|
||||
}
|
||||
} else if (message.endsWith(Static191.ASSISTREQ)) {
|
||||
} else if (message.endsWith(ASSISTREQ)) {
|
||||
JagString name = message.substring(message.indexOf(DateUtil.COLON), 0);
|
||||
long name37 = name.encode37();
|
||||
boolean ignored = false;
|
||||
|
|
@ -2846,7 +2848,7 @@ public class Protocol {
|
|||
InterfaceList.redraw(InterfaceList.aClass13_22);
|
||||
}
|
||||
}
|
||||
if (local1508 != aClass13_11 && Static191.anInt4504 == anInt5235) {
|
||||
if (local1508 != aClass13_11 && Static87.anInt4504 == anInt5235) {
|
||||
if (local1508 != null) {
|
||||
InterfaceList.redraw(local1508);
|
||||
}
|
||||
|
|
@ -2858,9 +2860,9 @@ public class Protocol {
|
|||
if (anInt5235 > 0) {
|
||||
anInt5235--;
|
||||
}
|
||||
} else if (anInt5235 < Static191.anInt4504) {
|
||||
} else if (anInt5235 < Static87.anInt4504) {
|
||||
anInt5235++;
|
||||
if (Static191.anInt4504 == anInt5235) {
|
||||
if (Static87.anInt4504 == anInt5235) {
|
||||
InterfaceList.redraw(aClass13_11);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ public class SceneGraph {
|
|||
public static final int[] anIntArray565 = new int[]{1, -1, -1, 1};
|
||||
@OriginalMember(owner = "client!vl", name = "e", descriptor = "[I")
|
||||
public static final int[] anIntArray517 = new int[]{1, 2, 4, 8};
|
||||
@OriginalMember(owner = "client!pg", name = "T", descriptor = "[I")
|
||||
public static final int[] anIntArray386 = new int[]{76, 8, 137, 4, 0, 1, 38, 2, 19};
|
||||
@OriginalMember(owner = "client!kc", name = "o", descriptor = "[[[Lclient!bj;")
|
||||
public static Tile[][][] tiles;
|
||||
|
||||
|
|
@ -1742,7 +1744,7 @@ public class SceneGraph {
|
|||
var10 += 6;
|
||||
}
|
||||
local65 = Static247.anIntArray324[var10];
|
||||
local8.anInt670 = Static191.anIntArray386[var10];
|
||||
local8.anInt670 = anIntArray386[var10];
|
||||
}
|
||||
if (local616 != null) {
|
||||
if ((local616.anInt3049 & Static247.anIntArray215[var10]) == 0) {
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ public final class ScriptRunner {
|
|||
public static final int[][] anIntArrayArray33 = new int[5][5000];
|
||||
@OriginalMember(owner = "client!rl", name = "eb", descriptor = "Lclient!na;")
|
||||
public static final JagString aClass100_928 = JagString.parse("(U0a )2 in: ");
|
||||
@OriginalMember(owner = "client!bf", name = "I", descriptor = "[I")
|
||||
public static final int[] anIntArray52 = new int[]{16776960, 16711680, 65280, 65535, 16711935, 16777215};
|
||||
@OriginalMember(owner = "client!fe", name = "I", descriptor = "Lclient!na;")
|
||||
public static final JagString aClass100_639 = JagString.parse(" ");
|
||||
@OriginalMember(owner = "client!dc", name = "M", descriptor = "Lclient!na;")
|
||||
|
|
@ -102,8 +100,6 @@ public final class ScriptRunner {
|
|||
public static int anInt3325 = 0;
|
||||
@OriginalMember(owner = "client!bi", name = "jb", descriptor = "Z")
|
||||
public static boolean aBoolean43 = true;
|
||||
@OriginalMember(owner = "client!wi", name = "bb", descriptor = "I")
|
||||
public static int anInt5854 = 0;
|
||||
@OriginalMember(owner = "client!wb", name = "c", descriptor = "I")
|
||||
public static int anInt5794 = -1;
|
||||
@OriginalMember(owner = "client!k", name = "m", descriptor = "Z")
|
||||
|
|
@ -353,7 +349,7 @@ public final class ScriptRunner {
|
|||
|
||||
@OriginalMember(owner = "client!lc", name = "a", descriptor = "(IIIIIII)V")
|
||||
public static void method2726(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5) {
|
||||
anInt5854 = 0;
|
||||
OverheadChat.size = 0;
|
||||
@Pc(5) int local5;
|
||||
@Pc(642) int local642;
|
||||
@Pc(74) int local74;
|
||||
|
|
@ -444,16 +440,16 @@ public final class ScriptRunner {
|
|||
}
|
||||
if (local17.chatMessage != null && (local5 >= PlayerList.size || Chat.publicFilter == 0 || Chat.publicFilter == 3 || Chat.publicFilter == 1 && FriendsList.contains(((Player) local17).username))) {
|
||||
method3326(arg4 >> 1, arg3, local17, arg5, local17.method2691(), arg1 >> 1);
|
||||
if (anInt1951 > -1 && anInt5854 < Static191.anInt4506) {
|
||||
Static191.anIntArray389[anInt5854] = Fonts.b12Full.getStringWidth(local17.chatMessage) / 2;
|
||||
Static191.anIntArray387[anInt5854] = Fonts.b12Full.lineHeight;
|
||||
Static191.anIntArray385[anInt5854] = anInt1951;
|
||||
Static191.anIntArray392[anInt5854] = anInt548;
|
||||
Static191.anIntArray390[anInt5854] = local17.chatColor;
|
||||
Static191.anIntArray391[anInt5854] = local17.chatEffect;
|
||||
Static191.anIntArray384[anInt5854] = local17.chatLoops;
|
||||
Static191.aClass100Array132[anInt5854] = local17.chatMessage;
|
||||
anInt5854++;
|
||||
if (anInt1951 > -1 && OverheadChat.size < OverheadChat.CAPACITY) {
|
||||
OverheadChat.anIntArray389[OverheadChat.size] = Fonts.b12Full.getStringWidth(local17.chatMessage) / 2;
|
||||
OverheadChat.anIntArray387[OverheadChat.size] = Fonts.b12Full.lineHeight;
|
||||
OverheadChat.anIntArray385[OverheadChat.size] = anInt1951;
|
||||
OverheadChat.anIntArray392[OverheadChat.size] = anInt548;
|
||||
OverheadChat.colors[OverheadChat.size] = local17.chatColor;
|
||||
OverheadChat.effects[OverheadChat.size] = local17.chatEffect;
|
||||
OverheadChat.loops[OverheadChat.size] = local17.chatLoops;
|
||||
OverheadChat.messages[OverheadChat.size] = local17.chatMessage;
|
||||
OverheadChat.size++;
|
||||
}
|
||||
}
|
||||
if (local17.hitpointsBarVisibleUntil > client.loop) {
|
||||
|
|
@ -534,40 +530,40 @@ public final class ScriptRunner {
|
|||
}
|
||||
}
|
||||
}
|
||||
for (local5 = 0; local5 < anInt5854; local5++) {
|
||||
local74 = Static191.anIntArray392[local5];
|
||||
@Pc(859) int local859 = Static191.anIntArray385[local5];
|
||||
local310 = Static191.anIntArray387[local5];
|
||||
local265 = Static191.anIntArray389[local5];
|
||||
for (local5 = 0; local5 < OverheadChat.size; local5++) {
|
||||
local74 = OverheadChat.anIntArray392[local5];
|
||||
@Pc(859) int local859 = OverheadChat.anIntArray385[local5];
|
||||
local310 = OverheadChat.anIntArray387[local5];
|
||||
local265 = OverheadChat.anIntArray389[local5];
|
||||
@Pc(869) boolean local869 = true;
|
||||
while (local869) {
|
||||
local869 = false;
|
||||
for (local359 = 0; local359 < local5; local359++) {
|
||||
if (Static191.anIntArray392[local359] - Static191.anIntArray387[local359] < local74 + 2 && local74 - local310 < Static191.anIntArray392[local359] - -2 && local859 - local265 < Static191.anIntArray385[local359] + Static191.anIntArray389[local359] && Static191.anIntArray385[local359] - Static191.anIntArray389[local359] < local265 + local859 && Static191.anIntArray392[local359] - Static191.anIntArray387[local359] < local74) {
|
||||
local74 = Static191.anIntArray392[local359] - Static191.anIntArray387[local359];
|
||||
if (OverheadChat.anIntArray392[local359] - OverheadChat.anIntArray387[local359] < local74 + 2 && local74 - local310 < OverheadChat.anIntArray392[local359] - -2 && local859 - local265 < OverheadChat.anIntArray385[local359] + OverheadChat.anIntArray389[local359] && OverheadChat.anIntArray385[local359] - OverheadChat.anIntArray389[local359] < local265 + local859 && OverheadChat.anIntArray392[local359] - OverheadChat.anIntArray387[local359] < local74) {
|
||||
local74 = OverheadChat.anIntArray392[local359] - OverheadChat.anIntArray387[local359];
|
||||
local869 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
anInt1951 = Static191.anIntArray385[local5];
|
||||
anInt548 = Static191.anIntArray392[local5] = local74;
|
||||
@Pc(962) JagString local962 = Static191.aClass100Array132[local5];
|
||||
anInt1951 = OverheadChat.anIntArray385[local5];
|
||||
anInt548 = OverheadChat.anIntArray392[local5] = local74;
|
||||
@Pc(962) JagString local962 = OverheadChat.messages[local5];
|
||||
if (VarpDomain.anInt2157 == 0) {
|
||||
local639 = 16776960;
|
||||
if (Static191.anIntArray390[local5] < 6) {
|
||||
local639 = anIntArray52[Static191.anIntArray390[local5]];
|
||||
if (OverheadChat.colors[local5] < 6) {
|
||||
local639 = OverheadChat.COLORS[OverheadChat.colors[local5]];
|
||||
}
|
||||
if (Static191.anIntArray390[local5] == 6) {
|
||||
if (OverheadChat.colors[local5] == 6) {
|
||||
local639 = anInt3325 % 20 >= 10 ? 16776960 : 16711680;
|
||||
}
|
||||
if (Static191.anIntArray390[local5] == 7) {
|
||||
if (OverheadChat.colors[local5] == 7) {
|
||||
local639 = anInt3325 % 20 < 10 ? 255 : 65535;
|
||||
}
|
||||
if (Static191.anIntArray390[local5] == 8) {
|
||||
if (OverheadChat.colors[local5] == 8) {
|
||||
local639 = anInt3325 % 20 >= 10 ? 8454016 : 45056;
|
||||
}
|
||||
if (Static191.anIntArray390[local5] == 9) {
|
||||
local642 = 150 - Static191.anIntArray384[local5];
|
||||
if (OverheadChat.colors[local5] == 9) {
|
||||
local642 = 150 - OverheadChat.loops[local5];
|
||||
if (local642 < 50) {
|
||||
local639 = local642 * 1280 + 16711680;
|
||||
} else if (local642 < 100) {
|
||||
|
|
@ -576,8 +572,8 @@ public final class ScriptRunner {
|
|||
local639 = local642 * 5 + 65280 - 500;
|
||||
}
|
||||
}
|
||||
if (Static191.anIntArray390[local5] == 10) {
|
||||
local642 = 150 - Static191.anIntArray384[local5];
|
||||
if (OverheadChat.colors[local5] == 10) {
|
||||
local642 = 150 - OverheadChat.loops[local5];
|
||||
if (local642 < 50) {
|
||||
local639 = local642 * 5 + 16711680;
|
||||
} else if (local642 < 100) {
|
||||
|
|
@ -586,8 +582,8 @@ public final class ScriptRunner {
|
|||
local639 = local642 * 327680 + 255 + 500 - local642 * 5 - 32768000;
|
||||
}
|
||||
}
|
||||
if (Static191.anIntArray390[local5] == 11) {
|
||||
local642 = 150 - Static191.anIntArray384[local5];
|
||||
if (OverheadChat.colors[local5] == 11) {
|
||||
local642 = 150 - OverheadChat.loops[local5];
|
||||
if (local642 < 50) {
|
||||
local639 = 16777215 - local642 * 327685;
|
||||
} else if (local642 < 100) {
|
||||
|
|
@ -596,20 +592,20 @@ public final class ScriptRunner {
|
|||
local639 = 16777215 + 32768000 - local642 * 327680;
|
||||
}
|
||||
}
|
||||
if (Static191.anIntArray391[local5] == 0) {
|
||||
if (OverheadChat.effects[local5] == 0) {
|
||||
Fonts.b12Full.renderCenter(local962, anInt1951 + arg2, arg0 + anInt548, local639, 0);
|
||||
}
|
||||
if (Static191.anIntArray391[local5] == 1) {
|
||||
if (OverheadChat.effects[local5] == 1) {
|
||||
Fonts.b12Full.renderWave(local962, arg2 + anInt1951, anInt548 + arg0, local639, anInt3325);
|
||||
}
|
||||
if (Static191.anIntArray391[local5] == 2) {
|
||||
if (OverheadChat.effects[local5] == 2) {
|
||||
Fonts.b12Full.renderWave2(local962, arg2 + anInt1951, arg0 - -anInt548, local639, anInt3325);
|
||||
}
|
||||
if (Static191.anIntArray391[local5] == 3) {
|
||||
Fonts.b12Full.renderShake(local962, arg2 + anInt1951, anInt548 + arg0, local639, anInt3325, 150 - Static191.anIntArray384[local5]);
|
||||
if (OverheadChat.effects[local5] == 3) {
|
||||
Fonts.b12Full.renderShake(local962, arg2 + anInt1951, anInt548 + arg0, local639, anInt3325, 150 - OverheadChat.loops[local5]);
|
||||
}
|
||||
if (Static191.anIntArray391[local5] == 4) {
|
||||
local642 = (150 - Static191.anIntArray384[local5]) * (Fonts.b12Full.getStringWidth(local962) + 100) / 150;
|
||||
if (OverheadChat.effects[local5] == 4) {
|
||||
local642 = (150 - OverheadChat.loops[local5]) * (Fonts.b12Full.getStringWidth(local962) + 100) / 150;
|
||||
if (GlRenderer.enabled) {
|
||||
GlRaster.method1183(anInt1951 + arg2 - 50, arg0, anInt1951 + arg2 + 50, arg4 + arg0);
|
||||
} else {
|
||||
|
|
@ -622,9 +618,9 @@ public final class ScriptRunner {
|
|||
SoftwareRaster.setClip(arg2, arg0, arg2 + arg1, arg0 + arg4);
|
||||
}
|
||||
}
|
||||
if (Static191.anIntArray391[local5] == 5) {
|
||||
if (OverheadChat.effects[local5] == 5) {
|
||||
@Pc(1372) int local1372 = 0;
|
||||
local642 = 150 - Static191.anIntArray384[local5];
|
||||
local642 = 150 - OverheadChat.loops[local5];
|
||||
if (GlRenderer.enabled) {
|
||||
GlRaster.method1183(arg2, anInt548 + arg0 - Fonts.b12Full.lineHeight - 1, arg1 + arg2, arg0 + anInt548 + 5);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
package rt4;
|
||||
|
||||
import org.openrs2.deob.annotation.OriginalMember;
|
||||
|
||||
public final class Static191 {
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "fb", descriptor = "I")
|
||||
public static final int anInt4506 = 50;
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "P", descriptor = "[Lclient!na;")
|
||||
public static final JagString[] aClass100Array132 = new JagString[anInt4506];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "Q", descriptor = "[I")
|
||||
public static final int[] anIntArray384 = new int[anInt4506];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "R", descriptor = "[I")
|
||||
public static final int[] anIntArray385 = new int[anInt4506];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "T", descriptor = "[I")
|
||||
public static final int[] anIntArray386 = new int[]{76, 8, 137, 4, 0, 1, 38, 2, 19};
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "V", descriptor = "I")
|
||||
public static final int anInt4504 = 50;
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "Z", descriptor = "[I")
|
||||
public static final int[] anIntArray387 = new int[anInt4506];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "cb", descriptor = "[I")
|
||||
public static final int[] anIntArray389 = new int[anInt4506];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "db", descriptor = "Lclient!na;")
|
||||
public static final JagString ASSISTREQ = JagString.parse(":assistreq:");
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "eb", descriptor = "[I")
|
||||
public static final int[] anIntArray390 = new int[anInt4506];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "kb", descriptor = "[I")
|
||||
public static final int[] anIntArray391 = new int[anInt4506];
|
||||
|
||||
@OriginalMember(owner = "client!pg", name = "lb", descriptor = "[I")
|
||||
public static final int[] anIntArray392 = new int[anInt4506];
|
||||
}
|
||||
|
|
@ -23,6 +23,8 @@ public final class Static87 {
|
|||
public static final JagString aClass100_375 = JagString.parse("<)4col> x");
|
||||
@OriginalMember(owner = "client!bd", name = "b", descriptor = "Lclient!na;")
|
||||
public static final JagString aClass100_80 = JagString.parse("(U(Y");
|
||||
@OriginalMember(owner = "client!pg", name = "V", descriptor = "I")
|
||||
public static final int anInt4504 = 50;
|
||||
|
||||
@OriginalMember(owner = "client!gn", name = "d", descriptor = "Z")
|
||||
public static boolean aBoolean130 = false;
|
||||
|
|
@ -826,7 +828,7 @@ public final class Static87 {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (component.type == 8 && Protocol.aClass13_11 == component && Protocol.anInt5235 == Static191.anInt4504) {
|
||||
if (component.type == 8 && Protocol.aClass13_11 == component && Protocol.anInt5235 == anInt4504) {
|
||||
local276 = 0;
|
||||
local270 = 0;
|
||||
@Pc(3297) JagString local3297 = component.text;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue