client: rev 198 (#3014)

* client: rev 198

* client: checkstyle

Co-authored-by: therealnull <therealnull@gmail.com>
This commit is contained in:
Tyler Bochard
2021-07-28 07:24:38 -04:00
committed by GitHub
parent c2af17f765
commit 56ae122b89
466 changed files with 65937 additions and 65851 deletions

View File

@@ -2,355 +2,249 @@ import net.runelite.mapping.Export;
import net.runelite.mapping.Implements;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.Reflection;
import net.runelite.rs.ScriptOpcodes;
@ObfuscatedName("mb")
@ObfuscatedName("mk")
@Implements("FontName")
public class FontName {
@ObfuscatedName("f")
@ObfuscatedName("s")
@ObfuscatedSignature(
descriptor = "Lmb;"
descriptor = "Lmk;"
)
@Export("FontName_plain11")
public static final FontName FontName_plain11;
@ObfuscatedName("e")
@ObfuscatedName("t")
@ObfuscatedSignature(
descriptor = "Lmb;"
descriptor = "Lmk;"
)
@Export("FontName_plain12")
public static final FontName FontName_plain12;
@ObfuscatedName("v")
@ObfuscatedSignature(
descriptor = "Lmb;"
descriptor = "Lmk;"
)
@Export("FontName_bold12")
public static final FontName FontName_bold12;
@ObfuscatedName("y")
@ObfuscatedName("j")
@ObfuscatedSignature(
descriptor = "Lmb;"
descriptor = "Lmk;"
)
@Export("FontName_verdana11")
public static final FontName FontName_verdana11;
@ObfuscatedName("j")
@ObfuscatedName("l")
@ObfuscatedSignature(
descriptor = "Lmb;"
descriptor = "Lmk;"
)
@Export("FontName_verdana13")
public static final FontName FontName_verdana13;
@ObfuscatedName("o")
@ObfuscatedName("n")
@ObfuscatedSignature(
descriptor = "Lmb;"
descriptor = "Lmk;"
)
@Export("FontName_verdana15")
public static final FontName FontName_verdana15;
@ObfuscatedName("i")
@ObfuscatedSignature(
descriptor = "Lba;"
)
@Export("pcmPlayerProvider")
static PlayerProvider pcmPlayerProvider;
@ObfuscatedName("m")
@ObfuscatedName("w")
@Export("name")
String name;
static {
FontName_plain11 = new FontName("p11_full"); // L: 7
FontName_plain12 = new FontName("p12_full"); // L: 8
FontName_bold12 = new FontName("b12_full"); // L: 9
FontName_verdana11 = new FontName("verdana_11pt_regular"); // L: 10
FontName_verdana13 = new FontName("verdana_13pt_regular"); // L: 11
FontName_verdana15 = new FontName("verdana_15pt_regular"); // L: 12
FontName_plain11 = new FontName("p11_full");
FontName_plain12 = new FontName("p12_full");
FontName_bold12 = new FontName("b12_full");
FontName_verdana11 = new FontName("verdana_11pt_regular");
FontName_verdana13 = new FontName("verdana_13pt_regular");
FontName_verdana15 = new FontName("verdana_15pt_regular");
}
FontName(String var1) {
this.name = var1; // L: 20
} // L: 21
this.name = var1;
}
@ObfuscatedName("t")
@ObfuscatedSignature(
descriptor = "(IB)V",
garbageValue = "13"
)
public static void method6374(int var0) {
if (class234.musicPlayerStatus != 0) {
HorizontalAlignment.musicTrackVolume = var0;
} else {
class234.midiPcmStream.setPcmStreamVolume(var0);
}
}
@ObfuscatedName("f")
@ObfuscatedSignature(
descriptor = "(B)[Lmb;",
garbageValue = "-107"
descriptor = "(ILbd;ZS)I",
garbageValue = "3144"
)
public static FontName[] method6334() {
return new FontName[]{FontName_verdana15, FontName_verdana11, FontName_verdana13, FontName_bold12, FontName_plain11, FontName_plain12}; // L: 16
}
@ObfuscatedName("v")
@ObfuscatedSignature(
descriptor = "(Ljava/lang/CharSequence;I)I",
garbageValue = "-562774219"
)
public static int method6335(CharSequence var0) {
return class8.method105(var0, 10, true); // L: 76
}
@ObfuscatedName("j")
@ObfuscatedSignature(
descriptor = "(Ljava/lang/String;B)Ljava/lang/Class;",
garbageValue = "2"
)
@Export("loadClassFromDescriptor")
static Class loadClassFromDescriptor(String var0) throws ClassNotFoundException {
if (var0.equals("B")) { // L: 222
return Byte.TYPE;
} else if (var0.equals("I")) { // L: 223
return Integer.TYPE;
} else if (var0.equals("S")) { // L: 224
return Short.TYPE;
} else if (var0.equals("J")) { // L: 225
return Long.TYPE;
} else if (var0.equals("Z")) { // L: 226
return Boolean.TYPE;
} else if (var0.equals("F")) { // L: 227
return Float.TYPE;
} else if (var0.equals("D")) { // L: 228
return Double.TYPE;
} else if (var0.equals("C")) { // L: 229
return Character.TYPE;
static int method6376(int var0, Script var1, boolean var2) {
boolean var3 = true;
Widget var4;
if (var0 >= 2000) {
var0 -= 1000;
var4 = UrlRequester.getWidget(Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize]);
var3 = false;
} else {
return var0.equals("void") ? Void.TYPE : Reflection.findClass(var0); // L: 230 231
var4 = var2 ? GrandExchangeOffer.scriptDotWidget : Interpreter.scriptActiveWidget;
}
int var11;
if (var0 == ScriptOpcodes.CC_SETOP) {
var11 = Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize] - 1;
if (var11 >= 0 && var11 <= 9) {
var4.setAction(var11, Interpreter.Interpreter_stringStack[--class1.Interpreter_stringStackSize]);
return 1;
} else {
--class1.Interpreter_stringStackSize;
return 1;
}
} else {
int var6;
if (var0 == ScriptOpcodes.CC_SETDRAGGABLE) {
Interpreter.Interpreter_intStackSize -= 2;
var11 = Interpreter.Interpreter_intStack[Interpreter.Interpreter_intStackSize];
var6 = Interpreter.Interpreter_intStack[Interpreter.Interpreter_intStackSize + 1];
var4.parent = ObjectSound.getWidgetChild(var11, var6);
return 1;
} else if (var0 == ScriptOpcodes.CC_SETDRAGGABLEBEHAVIOR) {
var4.isScrollBar = Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize] == 1;
return 1;
} else if (var0 == ScriptOpcodes.CC_SETDRAGDEADZONE) {
var4.dragZoneSize = Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize];
return 1;
} else if (var0 == ScriptOpcodes.CC_SETDRAGDEADTIME) {
var4.dragThreshold = Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize];
return 1;
} else if (var0 == ScriptOpcodes.CC_SETOPBASE) {
var4.dataText = Interpreter.Interpreter_stringStack[--class1.Interpreter_stringStackSize];
return 1;
} else if (var0 == ScriptOpcodes.CC_SETTARGETVERB) {
var4.spellActionName = Interpreter.Interpreter_stringStack[--class1.Interpreter_stringStackSize];
return 1;
} else if (var0 == ScriptOpcodes.CC_CLEAROPS) {
var4.actions = null;
return 1;
} else if (var0 == 1308) {
var4.prioritizeMenuEntry = Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize] == 1;
return 1;
} else if (var0 == 1309) {
--Interpreter.Interpreter_intStackSize;
return 1;
} else {
int var7;
byte[] var8;
if (var0 != ScriptOpcodes.CC_SETOPKEY) {
byte var5;
if (var0 == ScriptOpcodes.CC_SETOPTKEY) {
Interpreter.Interpreter_intStackSize -= 2;
var5 = 10;
var8 = new byte[]{(byte)Interpreter.Interpreter_intStack[Interpreter.Interpreter_intStackSize]};
byte[] var9 = new byte[]{(byte)Interpreter.Interpreter_intStack[Interpreter.Interpreter_intStackSize + 1]};
ItemComposition.Widget_setKey(var4, var5, var8, var9);
return 1;
} else if (var0 == ScriptOpcodes.CC_SETOPKEYRATE) {
Interpreter.Interpreter_intStackSize -= 3;
var11 = Interpreter.Interpreter_intStack[Interpreter.Interpreter_intStackSize] - 1;
var6 = Interpreter.Interpreter_intStack[Interpreter.Interpreter_intStackSize + 1];
var7 = Interpreter.Interpreter_intStack[Interpreter.Interpreter_intStackSize + 2];
if (var11 >= 0 && var11 <= 9) {
WorldMapSectionType.Widget_setKeyRate(var4, var11, var6, var7);
return 1;
} else {
throw new RuntimeException();
}
} else if (var0 == ScriptOpcodes.CC_SETOPTKEYRATE) {
var5 = 10;
var6 = Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize];
var7 = Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize];
WorldMapSectionType.Widget_setKeyRate(var4, var5, var6, var7);
return 1;
} else if (var0 == ScriptOpcodes.CC_SETOPKEYIGNOREHELD) {
--Interpreter.Interpreter_intStackSize;
var11 = Interpreter.Interpreter_intStack[Interpreter.Interpreter_intStackSize] - 1;
if (var11 >= 0 && var11 <= 9) {
StructComposition.Widget_setKeyIgnoreHeld(var4, var11);
return 1;
} else {
throw new RuntimeException();
}
} else if (var0 == ScriptOpcodes.CC_SETOPTKEYIGNOREHELD) {
var5 = 10;
StructComposition.Widget_setKeyIgnoreHeld(var4, var5);
return 1;
} else {
return 2;
}
} else {
byte[] var10 = null;
var8 = null;
if (var3) {
Interpreter.Interpreter_intStackSize -= 10;
for (var7 = 0; var7 < 10 && Interpreter.Interpreter_intStack[var7 + Interpreter.Interpreter_intStackSize] >= 0; var7 += 2) {
}
if (var7 > 0) {
var10 = new byte[var7 / 2];
var8 = new byte[var7 / 2];
for (var7 -= 2; var7 >= 0; var7 -= 2) {
var10[var7 / 2] = (byte)Interpreter.Interpreter_intStack[var7 + Interpreter.Interpreter_intStackSize];
var8[var7 / 2] = (byte)Interpreter.Interpreter_intStack[var7 + Interpreter.Interpreter_intStackSize + 1];
}
}
} else {
Interpreter.Interpreter_intStackSize -= 2;
var10 = new byte[]{(byte)Interpreter.Interpreter_intStack[Interpreter.Interpreter_intStackSize]};
var8 = new byte[]{(byte)Interpreter.Interpreter_intStack[Interpreter.Interpreter_intStackSize + 1]};
}
var7 = Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize] - 1;
if (var7 >= 0 && var7 <= 9) {
ItemComposition.Widget_setKey(var4, var7, var10, var8);
return 1;
} else {
throw new RuntimeException();
}
}
}
}
}
@ObfuscatedName("m")
@ObfuscatedSignature(
descriptor = "(Ljava/lang/CharSequence;B)I",
garbageValue = "57"
descriptor = "(ILbd;ZI)I",
garbageValue = "1821361801"
)
@Export("hashString")
public static int hashString(CharSequence var0) {
int var1 = var0.length(); // L: 144
int var2 = 0; // L: 145
for (int var3 = 0; var3 < var1; ++var3) { // L: 146
var2 = (var2 << 5) - var2 + class125.charToByteCp1252(var0.charAt(var3));
}
return var2; // L: 147
}
@ObfuscatedName("z")
@ObfuscatedSignature(
descriptor = "(IIIIIIII)Z",
garbageValue = "840735253"
)
static final boolean method6331(int var0, int var1, int var2, int var3, int var4, int var5, int var6) {
int var7 = ViewportMouse.ViewportMouse_y + var6; // L: 94
if (var7 < var0 && var7 < var1 && var7 < var2) { // L: 95
return false;
} else {
var7 = ViewportMouse.ViewportMouse_y - var6; // L: 96
if (var7 > var0 && var7 > var1 && var7 > var2) {
return false; // L: 97
} else {
var7 = ViewportMouse.ViewportMouse_x + var6; // L: 98
if (var7 < var3 && var7 < var4 && var7 < var5) { // L: 99
return false;
static int method6375(int var0, Script var1, boolean var2) {
Widget var3 = UrlRequester.getWidget(Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize]);
if (var0 == ScriptOpcodes.IF_GETTARGETMASK) {
Interpreter.Interpreter_intStack[++Interpreter.Interpreter_intStackSize - 1] = class103.Widget_unpackTargetMask(MusicPatchNode.getWidgetFlags(var3));
return 1;
} else if (var0 != ScriptOpcodes.IF_GETOP) {
if (var0 == ScriptOpcodes.IF_GETOPBASE) {
if (var3.dataText == null) {
Interpreter.Interpreter_stringStack[++class1.Interpreter_stringStackSize - 1] = "";
} else {
var7 = ViewportMouse.ViewportMouse_x - var6; // L: 100
return var7 <= var3 || var7 <= var4 || var7 <= var5; // L: 101
Interpreter.Interpreter_stringStack[++class1.Interpreter_stringStackSize - 1] = var3.dataText;
}
return 1;
} else {
return 2;
}
}
}
@ObfuscatedName("fo")
@ObfuscatedSignature(
descriptor = "(I)I",
garbageValue = "-1913570357"
)
static int method6329() {
if (Client.archiveLoaders != null && Client.archiveLoadersDone < Client.archiveLoaders.size()) { // L: 1714
int var0 = 0; // L: 1715
for (int var1 = 0; var1 <= Client.archiveLoadersDone; ++var1) { // L: 1716
var0 += ((ArchiveLoader)Client.archiveLoaders.get(var1)).loadedCount; // L: 1717
}
return var0 * 10000 / Client.field898; // L: 1719
} else {
return 10000;
int var4 = Interpreter.Interpreter_intStack[--Interpreter.Interpreter_intStackSize];
--var4;
if (var3.actions != null && var4 < var3.actions.length && var3.actions[var4] != null) {
Interpreter.Interpreter_stringStack[++class1.Interpreter_stringStackSize - 1] = var3.actions[var4];
} else {
Interpreter.Interpreter_stringStack[++class1.Interpreter_stringStackSize - 1] = "";
}
return 1;
}
}
@ObfuscatedName("is")
@ObfuscatedSignature(
descriptor = "(Lev;IIII)V",
garbageValue = "-281003514"
)
@Export("addNpcToMenu")
static final void addNpcToMenu(NPCComposition var0, int var1, int var2, int var3) {
if (Client.menuOptionsCount < 400) { // L: 9175
if (var0.transforms != null) { // L: 9176
var0 = var0.transform();
}
if (var0 != null) { // L: 9177
if (var0.isInteractable) { // L: 9178
if (!var0.isFollower || Client.followerIndex == var1) { // L: 9179
String var4 = var0.name; // L: 9180
int var7;
int var8;
if (var0.combatLevel != 0) { // L: 9181
var7 = var0.combatLevel; // L: 9184
var8 = class262.localPlayer.combatLevel; // L: 9185
int var9 = var8 - var7; // L: 9187
String var6;
if (var9 < -9) { // L: 9188
var6 = SecureRandomFuture.colorStartTag(16711680); // L: 9189
} else if (var9 < -6) { // L: 9192
var6 = SecureRandomFuture.colorStartTag(16723968); // L: 9193
} else if (var9 < -3) { // L: 9196
var6 = SecureRandomFuture.colorStartTag(16740352); // L: 9197
} else if (var9 < 0) { // L: 9200
var6 = SecureRandomFuture.colorStartTag(16756736); // L: 9201
} else if (var9 > 9) { // L: 9204
var6 = SecureRandomFuture.colorStartTag(65280); // L: 9205
} else if (var9 > 6) { // L: 9208
var6 = SecureRandomFuture.colorStartTag(4259584); // L: 9209
} else if (var9 > 3) { // L: 9212
var6 = SecureRandomFuture.colorStartTag(8453888); // L: 9213
} else if (var9 > 0) { // L: 9216
var6 = SecureRandomFuture.colorStartTag(12648192); // L: 9217
} else {
var6 = SecureRandomFuture.colorStartTag(16776960); // L: 9220
}
var4 = var4 + var6 + " " + " (" + "level-" + var0.combatLevel + ")"; // L: 9222
}
if (var0.isFollower && Client.followerOpsLowPriority) { // L: 9224
class22.insertMenuItemNoShift("Examine", SecureRandomFuture.colorStartTag(16776960) + var4, 1003, var1, var2, var3); // L: 9225
}
if (Client.isItemSelected == 1) { // L: 9228
class22.insertMenuItemNoShift("Use", Client.selectedItemName + " " + "->" + " " + SecureRandomFuture.colorStartTag(16776960) + var4, 7, var1, var2, var3); // L: 9229
} else if (Client.isSpellSelected) { // L: 9232
if ((LoginPacket.selectedSpellFlags & 2) == 2) { // L: 9233
class22.insertMenuItemNoShift(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + SecureRandomFuture.colorStartTag(16776960) + var4, 8, var1, var2, var3); // L: 9234
}
} else {
int var10 = var0.isFollower && Client.followerOpsLowPriority ? 2000 : 0; // L: 9239
String[] var11 = var0.actions; // L: 9240
if (var11 != null) { // L: 9241
for (var7 = 4; var7 >= 0; --var7) { // L: 9242
if (var11[var7] != null && !var11[var7].equalsIgnoreCase("Attack")) { // L: 9243
var8 = 0; // L: 9244
if (var7 == 0) { // L: 9245
var8 = var10 + 9;
}
if (var7 == 1) { // L: 9246
var8 = var10 + 10;
}
if (var7 == 2) { // L: 9247
var8 = var10 + 11;
}
if (var7 == 3) { // L: 9248
var8 = var10 + 12;
}
if (var7 == 4) { // L: 9249
var8 = var10 + 13;
}
class22.insertMenuItemNoShift(var11[var7], SecureRandomFuture.colorStartTag(16776960) + var4, var8, var1, var2, var3); // L: 9250
}
}
}
if (var11 != null) { // L: 9255
for (var7 = 4; var7 >= 0; --var7) { // L: 9256
if (var11[var7] != null && var11[var7].equalsIgnoreCase("Attack")) { // L: 9257
short var12 = 0; // L: 9258
if (AttackOption.AttackOption_hidden != Client.npcAttackOption) { // L: 9259
if (AttackOption.AttackOption_alwaysRightClick == Client.npcAttackOption || Client.npcAttackOption == AttackOption.AttackOption_dependsOnCombatLevels && var0.combatLevel > class262.localPlayer.combatLevel) { // L: 9260
var12 = 2000; // L: 9261
}
var8 = 0; // L: 9263
if (var7 == 0) { // L: 9264
var8 = var12 + 9;
}
if (var7 == 1) { // L: 9265
var8 = var12 + 10;
}
if (var7 == 2) { // L: 9266
var8 = var12 + 11;
}
if (var7 == 3) { // L: 9267
var8 = var12 + 12;
}
if (var7 == 4) { // L: 9268
var8 = var12 + 13;
}
class22.insertMenuItemNoShift(var11[var7], SecureRandomFuture.colorStartTag(16776960) + var4, var8, var1, var2, var3); // L: 9269
}
}
}
}
if (!var0.isFollower || !Client.followerOpsLowPriority) { // L: 9274
class22.insertMenuItemNoShift("Examine", SecureRandomFuture.colorStartTag(16776960) + var4, 1003, var1, var2, var3); // L: 9275
}
}
}
}
}
}
} // L: 9279
@ObfuscatedName("jh")
@ObfuscatedSignature(
descriptor = "(Liv;IIZS)V",
garbageValue = "-1497"
)
@Export("alignWidgetSize")
static void alignWidgetSize(Widget var0, int var1, int var2, boolean var3) {
int var4 = var0.width; // L: 9966
int var5 = var0.height; // L: 9967
if (var0.widthAlignment == 0) { // L: 9968
var0.width = var0.rawWidth;
} else if (var0.widthAlignment == 1) { // L: 9969
var0.width = var1 - var0.rawWidth;
} else if (var0.widthAlignment == 2) { // L: 9970
var0.width = var0.rawWidth * var1 >> 14;
}
if (var0.heightAlignment == 0) { // L: 9971
var0.height = var0.rawHeight;
} else if (var0.heightAlignment == 1) { // L: 9972
var0.height = var2 - var0.rawHeight;
} else if (var0.heightAlignment == 2) {
var0.height = var2 * var0.rawHeight >> 14; // L: 9973
}
if (var0.widthAlignment == 4) { // L: 9974
var0.width = var0.height * var0.field2977 / var0.field2957;
}
if (var0.heightAlignment == 4) { // L: 9975
var0.height = var0.field2957 * var0.width / var0.field2977;
}
if (var0.contentType == 1337) { // L: 9976
Client.viewportWidget = var0;
}
if (var3 && var0.onResize != null && (var4 != var0.width || var5 != var0.height)) { // L: 9977
ScriptEvent var6 = new ScriptEvent(); // L: 9978
var6.widget = var0; // L: 9979
var6.args = var0.onResize; // L: 9980
Client.scriptEvents.addFirst(var6); // L: 9981
}
} // L: 9983
}