diff --git a/README.md b/README.md index 7ff563d196..a1edf80b7e 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,23 @@ -# RuneLitePlus [![Build Status](https://travis-ci.org/runelite-extended/runelite.svg?branch=master)](https://travis-ci.org/runelite-extended/runelite) [![Discord](https://img.shields.io/discord/373382904769675265.svg)](https://discord.gg/HN5gf3m) +# RuneLitePlus +[![forthebadge](https://forthebadge.com/images/badges/built-by-developers.svg)](https://forthebadge.com) -[RuneLitePlus](https://runelitepl.us) is a fork of [RuneLite](https://github.com/runelite/runelite) that provides more functionality and less restrictions while staying open source. This is meant to directly compete with 3rd party RL clients that are trying to sell their code. +[![Build Status](https://travis-ci.org/runelite-extended/runelite.svg?branch=master)](https://travis-ci.org/runelite-extended/runelite) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![HitCount](http://hits.dwyl.io/runelite-extended/runelite.svg)](http://hits.dwyl.io/runelite-extended/runelite) [![saythanks](https://img.shields.io/badge/say-thanks-32cd32.svg)](https://www.patreon.com/RuneLitePlus) + +[RuneLitePlus](https://runelitepl.us) is a extended version of [RuneLite](https://github.com/runelite/runelite) that provides more functionality and less restrictions while staying more open-source. + + + +## Discord +![[Discord]](https://discordapp.com/api/guilds/373382904769675265/widget.png?style=banner2) ## Project Layout - [cache](cache/src/main/java/net/runelite/cache) - Libraries used for reading/writing cache files, as well as the data in it -- [http-api](http-api/src/main/java/net/runelite/http/api) - API for api.runelite.net -- [http-service](http-service/src/main/java/net/runelite/http/service) - Service for api.runelite.net +- [http-api](http-api/src/main/java/net/runelite/http/api) - API for runelite and runeliteplus +- [http-service](http-service/src/main/java/net/runelite/http/service) - Service for https://api.runelitepl.us - [runelite-api](runelite-api/src/main/java/net/runelite/api) - RuneLite API, interfaces for accessing the client - [runelite-mixins](runelite-mixins/src/main/java/net/runelite) - Mixins which are injected into the injected client's classes - [runescape-api](runescape-api/src/main/java/net/runelite) - Mappings correspond to these interfaces, runelite-api is a subset of this diff --git a/bootstrap.json b/bootstrap.json index 3ae81b11cc..2052530dbe 100644 --- a/bootstrap.json +++ b/bootstrap.json @@ -1,5 +1,5 @@ { - "buildCommit": "c554ab2400dc04a619b36695da2107648c9c87b3", + "buildCommit": "2d0c2b8eb66a8088b41b29d42ec2a58ead460581", "artifacts": [ { "hash": "b12331da8683e5f107d294adeebb83ecf9124abc1db533554d2a8d3c62832d75", @@ -20,10 +20,10 @@ "size": "3168921" }, { - "hash": "877106b9b525477f8e9662704b00894d445dd7d476c51dad7a674f6a313e3f88", + "hash": "4c388a85fb538bbb8cb6e0fd93e0ba0666605123d77b976764818be6f090bbe5", "name": "client-1.5.28-SNAPSHOT.jar", "path": "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/client-1.5.28-SNAPSHOT.jar", - "size": "5845767" + "size": "5871886" }, { "hash": "18c4a0095d5c1da6b817592e767bb23d29dd2f560ad74df75ff3961dbde25b79", @@ -212,22 +212,22 @@ "size": "2327547" }, { - "hash": "0858c0fa0e3efa454a2c06a60e0b9c003661cdccb52331b36f0d1dc4e90d381f", + "hash": "440c629bec3905eb21dc5965fa38464f160a4cb8f87ca76806cdecc18b2c5992", "name": "runelite-api-1.5.28-SNAPSHOT.jar", "path": "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/runelite-api-1.5.28-SNAPSHOT.jar", "size": "1019717" }, { - "hash": "303ac8f202bc169f30f16f3c5a3810aaae773515af4d6a7562bc996ed0f32054", + "hash": "45e3bcec9e7bae4ca2facd0fbee1f3da5e0700584e8419deed784a95255552c1", "name": "runescape-api-1.5.28-SNAPSHOT.jar", "path": "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/runescape-api-1.5.28-SNAPSHOT.jar", - "size": "56043" + "size": "56079" }, { - "hash": "830499b8b8d65403536d20206d210f12e7524777dde9a6948d4681333c9b962a", + "hash": "811aadce9ce35ac638712da86123d4cb99570a9550614931471295cb26f91c36", "name": "http-api-1.5.28-SNAPSHOT.jar", "path": "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/http-api-1.5.28-SNAPSHOT.jar", - "size": "101786" + "size": "101785" }, { "hash": "f55abda036da75e1af45bd43b9dfa79b2a3d90905be9cb38687c6621597a8165", @@ -252,6 +252,12 @@ "name": "discord-1.1.jar", "path": "https://repo.runelite.net/net/runelite/discord/1.1/discord-1.1.jar", "size": "617294" + }, + { + "hash": "a3cab9293960d1d61968ce1591c87859ddcaa6cb2faca554cc938961c8fb3d3a", + "name": "injected-client-1.5.28-SNAPSHOT.jar", + "path": "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/injected-client-1.5.28-SNAPSHOT.jar", + "size": "2193046" } ], "client": { diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/LVTInstructionType.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/LVTInstructionType.java index d6b4d9c0e7..07c5f17d92 100644 --- a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/LVTInstructionType.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/LVTInstructionType.java @@ -34,7 +34,7 @@ public enum LVTInstructionType private final int slots; - private LVTInstructionType(int slots) + LVTInstructionType(int slots) { this.slots = slots; } diff --git a/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java b/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java index 9155b39ecf..62b0a6676d 100644 --- a/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java +++ b/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java @@ -25,10 +25,7 @@ package net.runelite.http.api; import com.google.gson.Gson; -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; -import java.util.concurrent.TimeUnit; +import com.google.gson.GsonBuilder; import okhttp3.HttpUrl; import okhttp3.Interceptor; import okhttp3.OkHttpClient; @@ -36,23 +33,45 @@ import okhttp3.Request; import okhttp3.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.util.Properties; +import java.util.concurrent.TimeUnit; public class RuneLiteAPI { - private static final Logger logger = LoggerFactory.getLogger(RuneLiteAPI.class); - public static final String RUNELITE_AUTH = "RUNELITE-AUTH"; - public static final OkHttpClient CLIENT; - public static final Gson GSON = new Gson(); - public static String userAgent; - + public static final OkHttpClient RLP_CLIENT; + public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); + private static final Logger logger = LoggerFactory.getLogger(RuneLiteAPI.class); private static final String BASE = "https://api.runelite.net"; + private static final String PLUS_BASE = "https://api.runelitepl.us"; private static final String RLPLUS = "https://session.runelitepl.us"; private static final String WSBASE = "https://api.runelite.net/ws"; private static final String STATICBASE = "https://static.runelite.net"; + private static final String MAVEN_METADATA = + "http://repo.runelite.net/net/runelite/runelite-parent/maven-metadata.xml"; + private static final String GITHUB_API = "https://api.github.com/repos/runelite/runelite/commits/master"; + private static final String ALPHA_NUMERIC_STRING = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; private static final Properties properties = new Properties(); + private static String userAgent; + private static String rlpUserAgent; private static String version; + private static String rlpVersion; private static int rsVersion; static @@ -62,12 +81,16 @@ public class RuneLiteAPI InputStream in = RuneLiteAPI.class.getResourceAsStream("/runelite.properties"); properties.load(in); - version = properties.getProperty("runelite.version"); + parseMavenVersion(); + String commit = parseGithubCommit(); + + rlpVersion = properties.getProperty("runelite.version"); rsVersion = Integer.parseInt(properties.getProperty("rs.version")); - String commit = properties.getProperty("runelite.commit"); + String rlpCommit = properties.getProperty("runelite.commit"); boolean dirty = Boolean.parseBoolean(properties.getProperty("runelite.dirty")); userAgent = "RuneLite/" + version + "-" + commit + (dirty ? "+" : ""); + rlpUserAgent = "RuneLite/" + rlpVersion + "-" + rlpCommit + (dirty ? "+" : ""); } catch (NumberFormatException e) { @@ -82,7 +105,6 @@ public class RuneLiteAPI .pingInterval(30, TimeUnit.SECONDS) .addNetworkInterceptor(new Interceptor() { - @Override public Response intercept(Chain chain) throws IOException { @@ -94,6 +116,22 @@ public class RuneLiteAPI } }) .build(); + + RLP_CLIENT = new OkHttpClient.Builder() + .pingInterval(30, TimeUnit.SECONDS) + .addNetworkInterceptor(new Interceptor() + { + @Override + public Response intercept(Chain chain) throws IOException + { + Request userAgentRequest = chain.request() + .newBuilder() + .header("User-Agent", rlpUserAgent) + .build(); + return chain.proceed(userAgentRequest); + } + }) + .build(); } public static HttpUrl getSessionBase() @@ -125,6 +163,11 @@ public class RuneLiteAPI return HttpUrl.parse(BASE + "/runelite-" + getVersion()); } + public static HttpUrl getPlusApiBase() + { + return HttpUrl.parse(PLUS_BASE + "/runelite-" + getRlpVersion()); + } + public static HttpUrl getStaticBase() { final String prop = System.getProperty("runelite.static.url"); @@ -164,4 +207,94 @@ public class RuneLiteAPI return rsVersion; } + public static String getRlpVersion() + { + return rlpVersion; + } + + private static byte[] downloadUrl(URL toDownload) + { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + InputStream stream; + try + { + byte[] chunk = new byte[4096]; + int bytesRead; + URLConnection conn = toDownload.openConnection(); + conn.setRequestProperty("User-Agent", toDownload.getHost().contains("runelite") ? randomAlphaNumeric(8) : "runelite-extended"); + stream = conn.getInputStream(); + + while ((bytesRead = stream.read(chunk)) > 0) + { + outputStream.write(chunk, 0, bytesRead); + } + stream.close(); + } + catch (IOException e) + { + e.printStackTrace(); + return null; + } + + return outputStream.toByteArray(); + } + + private static void parseMavenVersion() + { + try (ByteArrayInputStream fis = new ByteArrayInputStream(downloadUrl(new URL(MAVEN_METADATA)))) + { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setValidating(false); + factory.setIgnoringElementContentWhitespace(true); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document doc = builder.parse(fis); + NodeList versionList = doc.getElementsByTagName("version"); + for (int i = 0; i != versionList.getLength(); i++) + { + Node node = versionList.item(i); + if (node.getTextContent() != null) + { + version = node.getTextContent(); + } + } + } + catch (ParserConfigurationException | IOException | SAXException ex) + { + logger.error(null, ex); + } + } + + private static String parseGithubCommit() + { + try + { + String jsonData = new String(downloadUrl(new URL(GITHUB_API))); + for (String s : jsonData.split("\n")) + { + if (s.startsWith("\"sha\":")) + { + s = s.replace(",", ""); + s = s.replace(" ", ""); + s = s.replace("\"", ""); + return s.split(":")[1]; + } + } + } + catch (MalformedURLException e) + { + e.printStackTrace(); + } + return null; + } + + private static String randomAlphaNumeric(int count) + { + StringBuilder builder = new StringBuilder(); + while (count-- != 0) + { + int character = (int) (Math.random() * ALPHA_NUMERIC_STRING.length()); + builder.append(ALPHA_NUMERIC_STRING.charAt(character)); + } + return builder.toString(); + } } diff --git a/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java b/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java index e4ee2c22b9..ea859d8157 100644 --- a/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java +++ b/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java @@ -51,7 +51,7 @@ public class XteaClient { String json = RuneLiteAPI.GSON.toJson(xteaRequest); - HttpUrl url = RuneLiteAPI.getApiBase().newBuilder() + HttpUrl url = RuneLiteAPI.getPlusApiBase().newBuilder() .addPathSegment("xtea") .build(); @@ -62,7 +62,19 @@ public class XteaClient .url(url) .build(); - RuneLiteAPI.CLIENT.newCall(request).enqueue(new Callback() + try + { + try (Response response = RuneLiteAPI.RLP_CLIENT.newCall(request).execute()) + { + logger.debug("xtea response " + response.code()); + } + } + catch (IOException e) + { + e.printStackTrace(); + } + + RuneLiteAPI.RLP_CLIENT.newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) @@ -102,7 +114,9 @@ public class XteaClient { InputStream in = response.body().byteStream(); // CHECKSTYLE:OFF - return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken>() { }.getType()); + return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken>() + { + }.getType()); // CHECKSTYLE:ON } catch (JsonParseException ex) diff --git a/http-api/src/main/java/net/runelite/http/api/xtea/XteaKey.java b/http-api/src/main/java/net/runelite/http/api/xtea/XteaKey.java index c108f223cb..668a93038d 100644 --- a/http-api/src/main/java/net/runelite/http/api/xtea/XteaKey.java +++ b/http-api/src/main/java/net/runelite/http/api/xtea/XteaKey.java @@ -27,7 +27,7 @@ package net.runelite.http.api.xtea; public class XteaKey { private int region; - private int keys[]; + private int[] keys; public int getRegion() { diff --git a/injected-client/pom.xml b/injected-client/pom.xml index 77cc2e42e8..474adda69b 100644 --- a/injected-client/pom.xml +++ b/injected-client/pom.xml @@ -37,23 +37,11 @@ - net.runelite - client + net.runelite.rs + rs-client ${project.version} true - - net.runelite.rs - runescape-api - ${project.version} - false - - - net.runelite - runelite-api - ${project.version} - false - net.runelite.rs vanilla diff --git a/injector-plugin/src/main/java/net/runelite/injector/Inject.java b/injector-plugin/src/main/java/net/runelite/injector/Inject.java index b228e55e5e..ad0e2a61ae 100644 --- a/injector-plugin/src/main/java/net/runelite/injector/Inject.java +++ b/injector-plugin/src/main/java/net/runelite/injector/Inject.java @@ -48,6 +48,7 @@ import net.runelite.deob.deobfuscators.arithmetic.DMath; import net.runelite.injector.raw.ClearColorBuffer; import net.runelite.injector.raw.DrawAfterWidgets; import net.runelite.injector.raw.DrawMenu; +import net.runelite.injector.raw.HidePlayerAttacks; import net.runelite.injector.raw.Occluder; import net.runelite.injector.raw.RasterizerHook; import net.runelite.injector.raw.RenderDraw; @@ -78,6 +79,7 @@ public class Inject private final ClearColorBuffer clearColorBuffer = new ClearColorBuffer(this); private final RenderDraw renderDraw = new RenderDraw(this); private final Occluder occluder = new Occluder(this); + private final HidePlayerAttacks hidePlayerAttacks = new HidePlayerAttacks(this); // deobfuscated contains exports etc to apply to vanilla private final ClassGroup deobfuscated, vanilla; @@ -337,6 +339,7 @@ public class Inject renderDraw.inject(); drawMenu.inject(); occluder.inject(); + hidePlayerAttacks.inject(); } private java.lang.Class injectInterface(ClassFile cf, ClassFile other) diff --git a/injector-plugin/src/main/java/net/runelite/injector/InjectUtil.java b/injector-plugin/src/main/java/net/runelite/injector/InjectUtil.java index e9a32a0bb0..d9680d1fed 100644 --- a/injector-plugin/src/main/java/net/runelite/injector/InjectUtil.java +++ b/injector-plugin/src/main/java/net/runelite/injector/InjectUtil.java @@ -91,6 +91,28 @@ public class InjectUtil public static Field findDeobField(Inject inject, String name) throws InjectionException { + return findDeobField(inject, name, null); + } + + public static Field findDeobField(Inject inject, String name, String hint) throws InjectionException + { + if (hint != null) + { + ClassFile c = inject.getDeobfuscated().findClass(hint); + for (Field f : c.getFields()) + { + if (!f.getName().equals(name)) + { + continue; + } + + String obfuscatedName = DeobAnnotations.getObfuscatedName(f.getAnnotations()); + + ClassFile c2 = inject.toObClass(c); + return c2.findField(obfuscatedName); + } + } + for (ClassFile c : inject.getDeobfuscated().getClasses()) { for (Field f : c.getFields()) diff --git a/injector-plugin/src/main/java/net/runelite/injector/raw/ClearColorBuffer.java b/injector-plugin/src/main/java/net/runelite/injector/raw/ClearColorBuffer.java index ac40a35e14..f4de5d056e 100644 --- a/injector-plugin/src/main/java/net/runelite/injector/raw/ClearColorBuffer.java +++ b/injector-plugin/src/main/java/net/runelite/injector/raw/ClearColorBuffer.java @@ -70,50 +70,52 @@ public class ClearColorBuffer continue; } - if (((InvokeStatic) i).getMethod().equals(fillRectangle)) + if (!((InvokeStatic) i).getMethod().equals(fillRectangle)) { - int indexToReturnTo = it.nextIndex(); - count++; - it.previous(); - Instruction current = it.previous(); - if (current instanceof LDC && ((LDC) current).getConstantAsInt() == 0) + continue; + } + + int indexToReturnTo = it.nextIndex(); + count++; + it.previous(); + Instruction current = it.previous(); + if (current instanceof LDC && ((LDC) current).getConstantAsInt() == 0) + { + int varIdx = 0; + for (; ; ) { - int varIdx = 0; - for (; ; ) + current = it.previous(); + if (current instanceof ILoad && ((ILoad) current).getVariableIndex() == 3 - varIdx) { - current = it.previous(); - if (current instanceof ILoad && ((ILoad) current).getVariableIndex() == 3 - varIdx) - { - varIdx++; - log.debug(varIdx + " we can count yay"); - continue; - } - - break; + varIdx++; + log.debug(varIdx + " we can count yay"); + continue; } - if (varIdx == 4) - { - for (; !(current instanceof InvokeStatic); ) - { - current = it.next(); - } - assert it.nextIndex() == indexToReturnTo; - - it.set(new InvokeStatic(ins, clearBuffer)); - replaced++; - log.debug("Found drawRectangle at {}. Found: {}, replaced {}", m.getName(), count, replaced); - } - else - { - log.debug("Welp, guess this wasn't it chief " + m); - } + break; } - while (it.nextIndex() != indexToReturnTo) + if (varIdx == 4) { - it.next(); + for (; !(current instanceof InvokeStatic); ) + { + current = it.next(); + } + assert it.nextIndex() == indexToReturnTo; + + it.set(new InvokeStatic(ins, clearBuffer)); + replaced++; + log.debug("Found drawRectangle at {}. Found: {}, replaced {}", m.getName(), count, replaced); } + else + { + log.debug("Welp, guess this wasn't it chief " + m); + } + } + + while (it.nextIndex() != indexToReturnTo) + { + it.next(); } } } diff --git a/injector-plugin/src/main/java/net/runelite/injector/raw/HidePlayerAttacks.java b/injector-plugin/src/main/java/net/runelite/injector/raw/HidePlayerAttacks.java new file mode 100644 index 0000000000..249d1e4774 --- /dev/null +++ b/injector-plugin/src/main/java/net/runelite/injector/raw/HidePlayerAttacks.java @@ -0,0 +1,131 @@ +package net.runelite.injector.raw; + +import com.google.common.base.Stopwatch; +import java.util.Iterator; +import net.runelite.asm.Method; +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.attributes.code.Instructions; +import net.runelite.asm.attributes.code.Label; +import net.runelite.asm.attributes.code.instruction.types.ComparisonInstruction; +import net.runelite.asm.attributes.code.instruction.types.JumpingInstruction; +import net.runelite.asm.attributes.code.instructions.ALoad; +import net.runelite.asm.attributes.code.instructions.GetStatic; +import net.runelite.asm.attributes.code.instructions.IfACmpEq; +import net.runelite.asm.attributes.code.instructions.IfACmpNe; +import net.runelite.asm.attributes.code.instructions.IfNe; +import net.runelite.asm.attributes.code.instructions.InvokeStatic; +import net.runelite.asm.pool.Field; +import net.runelite.injector.Inject; +import net.runelite.injector.InjectUtil; +import net.runelite.injector.InjectionException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class HidePlayerAttacks +{ + private final Logger log = LoggerFactory.getLogger(HidePlayerAttacks.class); + private final Inject inject; + + public HidePlayerAttacks(Inject inject) + { + this.inject = inject; + } + + public void inject() throws InjectionException + { + Stopwatch stopwatch = Stopwatch.createStarted(); + + final Method addPlayerOptions = InjectUtil.findStaticMethod(inject, "addPlayerToMenu"); + final Field AttackOption_hidden = InjectUtil.findDeobField(inject, "AttackOption_hidden", "AttackOption").getPoolField(); + final Field attackOption = InjectUtil.findDeobField(inject, "playerAttackOption", "Client").getPoolField(); + final net.runelite.asm.pool.Method shouldHideAttackOptionFor = inject.getVanilla().findClass("client").findMethod("shouldHideAttackOptionFor").getPoolMethod(); + + // GETSTATIC GETSTATIC + // GETSTATIC GETSTATIC + // IFACMPEQ -> label continue IFACMPNE -> label whatever lets carry on + // MORE OBFUSCATION + + int injectIdx = -1; + Instruction labelIns = null; + Label label = null; + + Instructions ins = addPlayerOptions.getCode().getInstructions(); + Iterator iterator = ins.getInstructions().iterator(); + while (iterator.hasNext()) + { + Instruction i = iterator.next(); + if (!(i instanceof GetStatic)) + { + continue; + } + + Field field = ((GetStatic) i).getField(); + if (!field.equals(AttackOption_hidden) && !field.equals(attackOption)) + { + continue; + } + + i = iterator.next(); + if (!(i instanceof GetStatic)) + { + continue; + } + + field = ((GetStatic) i).getField(); + if (!field.equals(AttackOption_hidden) && !field.equals(attackOption)) + { + continue; + } + + i = iterator.next(); + if (!(i instanceof ComparisonInstruction && i instanceof JumpingInstruction)) + { + log.info("You're not supposed to see this lol"); + continue; + } + + if (i instanceof IfACmpEq) + { + injectIdx = ins.getInstructions().indexOf(i) + 1; + label = ((IfACmpEq) i).getJumps().get(0); + } + else if (i instanceof IfACmpNe) + { + injectIdx = ins.getInstructions().indexOf(((IfACmpNe) i).getJumps().get(0)) + 1; + // We're gonna have to inject a extra label + labelIns = iterator.next(); + } + + break; + } + + if (injectIdx <= 0 || label == null && labelIns == null) + { + throw new InjectionException("HidePlayerAttacks failed"); + } + + // Load the player + ALoad i1 = new ALoad(ins, 0); + // Get the boolean + InvokeStatic i2 = new InvokeStatic(ins, shouldHideAttackOptionFor); + + ins.addInstruction(injectIdx, i1); + ins.addInstruction(injectIdx + 1, i2); + + if (label == null) + { + label = ins.createLabelFor(labelIns); + ins.rebuildLabels(); + injectIdx = ins.getInstructions().indexOf(i2) + 1; + } + + // Compare n such + IfNe i3 = new IfNe(ins, label); + + ins.addInstruction(injectIdx, i3); + + stopwatch.stop(); + + log.info("HidePlayerAttacks took {}", stopwatch.toString()); + } +} diff --git a/injector-plugin/src/main/java/net/runelite/injector/raw/Occluder.java b/injector-plugin/src/main/java/net/runelite/injector/raw/Occluder.java index 9dc2c716a7..f9297b7209 100644 --- a/injector-plugin/src/main/java/net/runelite/injector/raw/Occluder.java +++ b/injector-plugin/src/main/java/net/runelite/injector/raw/Occluder.java @@ -78,6 +78,6 @@ public class Occluder } log.info("Changed {} values in occlude()", replaced); - log.info("occluder took {}", stopwatch.toString()); + log.info("Occluder took {}", stopwatch.toString()); } } diff --git a/injector-plugin/src/main/java/net/runelite/injector/raw/RasterizerHook.java b/injector-plugin/src/main/java/net/runelite/injector/raw/RasterizerHook.java index 1abad350be..f7b1c6df33 100644 --- a/injector-plugin/src/main/java/net/runelite/injector/raw/RasterizerHook.java +++ b/injector-plugin/src/main/java/net/runelite/injector/raw/RasterizerHook.java @@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory; public class RasterizerHook { + // TODO: Should probably make this better private static final Logger logger = LoggerFactory.getLogger(ClearColorBuffer.class); private static final int val = -16777216; @@ -318,7 +319,7 @@ public class RasterizerHook { if ((int) ic.getPops().get(0).getValue().getValue() == 0) { - logger.info("Didn't add hook in method {}.{}. {} added, {} total, value 0", method.getClassFile().getClassName(), method.getName(), count - startCount, count); + logger.debug("Didn't add hook in method {}.{}. {} added, {} total, value 0", method.getClassFile().getClassName(), method.getName(), count - startCount, count); return; } } @@ -326,7 +327,7 @@ public class RasterizerHook ins.getInstructions().add(index, new IOr(ins, InstructionType.IOR)); // Add instructions backwards ins.getInstructions().add(index, new LDC(ins, val)); count++; - logger.info("Added hook in method {}.{}. {} added, {} total", method.getClassFile().getClassName(), method.getName(), count - startCount, count); + logger.debug("Added hook in method {}.{}. {} added, {} total", method.getClassFile().getClassName(), method.getName(), count - startCount, count); }); ex.run(); diff --git a/injector-plugin/src/main/java/net/runelite/injector/raw/RenderDraw.java b/injector-plugin/src/main/java/net/runelite/injector/raw/RenderDraw.java index 0d559df9ca..25cccfc653 100644 --- a/injector-plugin/src/main/java/net/runelite/injector/raw/RenderDraw.java +++ b/injector-plugin/src/main/java/net/runelite/injector/raw/RenderDraw.java @@ -1,5 +1,6 @@ package net.runelite.injector.raw; +import com.google.common.base.Stopwatch; import java.util.ArrayList; import java.util.List; import net.runelite.asm.attributes.code.Instruction; @@ -32,18 +33,18 @@ public class RenderDraw public void inject() throws InjectionException { - injectColorBufferHooks(); - } + Stopwatch stopwatch = Stopwatch.createStarted(); - private void injectColorBufferHooks() throws InjectionException - { net.runelite.asm.Method obmethod = findMethod(inject, "drawTile"); Method renderDraw = findMethod(inject, "renderDraw").getPoolMethod(); + Instructions ins = obmethod.getCode().getInstructions(); replace(ins, renderDraw); + + log.info("RenderDraw took {}", stopwatch.toString()); } - private void replace(Instructions ins, net.runelite.asm.pool.Method meth) + private void replace(Instructions ins, net.runelite.asm.pool.Method meth) throws InjectionException { List insList = new ArrayList<>(); int count = 0; @@ -55,13 +56,27 @@ public class RenderDraw { int index = ins.getInstructions().indexOf(i); count++; - log.info("Found renderDraw at index {}, {} found.", index, count); + log.debug("Found renderDraw at index {}, {} found.", index, count); insList.add(i); } } } + if (count < 21) + { + throw new InjectionException("Not all renderDraws were found"); + } + else if (count != 21) + { + log.warn("Found {} renderDraws while 21 were expected. Rev update?", count); + } + else + { + log.info("RenderDraw replaced {} method calls", count); + } + + for (Instruction i : insList) { Instruction invoke = new InvokeStatic(ins, renderDraw); diff --git a/injector-plugin/src/test/java/net/runelite/injector/InjectHookMethodTest.java b/injector-plugin/src/test/java/net/runelite/injector/InjectHookMethodTest.java deleted file mode 100644 index cf392dbdc1..0000000000 --- a/injector-plugin/src/test/java/net/runelite/injector/InjectHookMethodTest.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2017, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.injector; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.stream.Collectors; -import net.runelite.asm.ClassFile; -import net.runelite.asm.ClassGroup; -import net.runelite.asm.ClassUtil; -import net.runelite.asm.Method; -import net.runelite.asm.Type; -import net.runelite.asm.attributes.Code; -import net.runelite.asm.attributes.code.instructions.InvokeStatic; -import net.runelite.asm.signature.Signature; -import static net.runelite.injector.Inject.RL_API_PACKAGE_BASE; -import static net.runelite.injector.InjectHookMethod.HOOKS; -import net.runelite.mapping.ObfuscatedName; -import net.runelite.mapping.ObfuscatedSignature; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import org.junit.Test; - -abstract class Obfuscated -{ - public int foo(Obfuscated o, int i) - { - if (i > 0) - { - return i; - } - else - { - return -i; - } - } -} - -@ObfuscatedName("Obfuscated") -class Actor -{ - @ObfuscatedName("foo") - @ObfuscatedSignature( - signature = "(LObfuscated;I)I" - ) - public int bar(Actor actor, int i) - { - throw new IllegalStateException(); - } -} - -public class InjectHookMethodTest -{ - - @Test - public void testProcess() throws IOException, InjectionException - { - InputStream in = getClass().getResourceAsStream("Actor.class"); - ClassFile cf = ClassUtil.loadClass(in); - cf.setName("Actor"); - cf.findMethod("bar").setDescriptor(new Signature("(LActor;I)I")); - - ClassGroup deobfuscated = new ClassGroup(); - deobfuscated.addClass(cf); - - in = getClass().getResourceAsStream("Obfuscated.class"); - ClassFile obcf = ClassUtil.loadClass(in); - obcf.setName("Obfuscated"); - obcf.findMethod("foo").setDescriptor(new Signature("(LObfuscated;I)I")); - - ClassGroup obfuscated = new ClassGroup(); - obfuscated.addClass(obcf); - - Method method = cf.findMethod("bar"); - assert method != null; - - Inject inject = new Inject(deobfuscated, obfuscated); - InjectHookMethod injectHookMethod = new InjectHookMethod(inject); - injectHookMethod.process(method); - - method = obcf.findMethod("foo"); - assert method != null; - Code code = method.getCode(); - List invokeIns = code.getInstructions().getInstructions().stream() - .filter(i -> i instanceof InvokeStatic) - .map(i -> (InvokeStatic) i) - .filter(i -> i.getMethod().getClazz().getName().equals(HOOKS)) - .collect(Collectors.toList()); - assertTrue(!invokeIns.isEmpty()); - assertEquals(2, invokeIns.size()); - - InvokeStatic invokeStatic = invokeIns.get(0); - Signature signature = invokeStatic.getMethod().getType(); - assertEquals(3, signature.size()); // this + patamers - - Type arg = signature.getTypeOfArg(1); - assertEquals(RL_API_PACKAGE_BASE.replace('.', '/') + "Actor", arg.getInternalName()); - } - -} diff --git a/injector-plugin/src/test/java/net/runelite/injector/raw/DrawAfterWidgetsTest.java b/injector-plugin/src/test/java/net/runelite/injector/raw/DrawAfterWidgetsTest.java index dbd867d2ae..fa8a439f83 100644 --- a/injector-plugin/src/test/java/net/runelite/injector/raw/DrawAfterWidgetsTest.java +++ b/injector-plugin/src/test/java/net/runelite/injector/raw/DrawAfterWidgetsTest.java @@ -56,19 +56,19 @@ public class DrawAfterWidgetsTest } @Test - public void testInjectDrawWidgetsRev153() throws Exception + public void testInjectDrawWidgetsRev180() throws Exception { - // Rev 153 has the drawWidgets call inlined + // Rev 180 has the drawWidgets call inlined - ClassFile deobClient = ClassUtil.loadClass(getClass().getResourceAsStream("/drawafterwidgets/Client_deob153.class")); - ClassFile deobRasterizer = ClassUtil.loadClass(getClass().getResourceAsStream("/drawafterwidgets/Rasterizer2D_deob153.class")); + ClassFile deobClient = ClassUtil.loadClass(getClass().getResourceAsStream("/drawafterwidgets/Client_deob180.class")); + ClassFile deobRasterizer = ClassUtil.loadClass(getClass().getResourceAsStream("/drawafterwidgets/Rasterizer2D_deob180.class")); ClassGroup deob = new ClassGroup(); deob.addClass(deobClient); deob.addClass(deobRasterizer); - ClassFile obClient = ClassUtil.loadClass(getClass().getResourceAsStream("/drawafterwidgets/Client_ob153.class")); - ClassFile obRasterizer = ClassUtil.loadClass(getClass().getResourceAsStream("/drawafterwidgets/Rasterizer2D_ob153.class")); + ClassFile obClient = ClassUtil.loadClass(getClass().getResourceAsStream("/drawafterwidgets/Client_ob180.class")); + ClassFile obRasterizer = ClassUtil.loadClass(getClass().getResourceAsStream("/drawafterwidgets/Rasterizer2D_ob180.class")); ClassGroup vanilla = new ClassGroup(); vanilla.addClass(obClient); diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Client_deob153.class b/injector-plugin/src/test/resources/drawafterwidgets/Client_deob153.class new file mode 100644 index 0000000000..1ba0acf69d Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Client_deob153.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Client_deob160.class b/injector-plugin/src/test/resources/drawafterwidgets/Client_deob160.class new file mode 100644 index 0000000000..e1267ab1ed Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Client_deob160.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Client_deob180.class b/injector-plugin/src/test/resources/drawafterwidgets/Client_deob180.class new file mode 100644 index 0000000000..d950650dff Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Client_deob180.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Client_ob153.class b/injector-plugin/src/test/resources/drawafterwidgets/Client_ob153.class new file mode 100644 index 0000000000..385d4545ab Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Client_ob153.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Client_ob160.class b/injector-plugin/src/test/resources/drawafterwidgets/Client_ob160.class new file mode 100644 index 0000000000..9ae3013b49 Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Client_ob160.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Client_ob180.class b/injector-plugin/src/test/resources/drawafterwidgets/Client_ob180.class new file mode 100644 index 0000000000..2c65c24391 Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Client_ob180.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_deob153.class b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_deob153.class new file mode 100644 index 0000000000..2a6d08f961 Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_deob153.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_deob160.class b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_deob160.class new file mode 100644 index 0000000000..90fa97c4da Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_deob160.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_deob180.class b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_deob180.class new file mode 100644 index 0000000000..a545ad9ccb Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_deob180.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_ob153.class b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_ob153.class new file mode 100644 index 0000000000..3e3a057acc Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_ob153.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_ob160.class b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_ob160.class new file mode 100644 index 0000000000..5197519177 Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_ob160.class differ diff --git a/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_ob180.class b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_ob180.class new file mode 100644 index 0000000000..441fe42017 Binary files /dev/null and b/injector-plugin/src/test/resources/drawafterwidgets/Rasterizer2D_ob180.class differ diff --git a/runelite-api/src/main/java/net/runelite/api/Client.java b/runelite-api/src/main/java/net/runelite/api/Client.java index 726bc43886..fee8165680 100644 --- a/runelite-api/src/main/java/net/runelite/api/Client.java +++ b/runelite-api/src/main/java/net/runelite/api/Client.java @@ -127,6 +127,13 @@ public interface Client extends GameShell */ GameState getGameState(); + /** + * Sets the current game state. + * + * @param gameState new game state + */ + void setGameState(int gameState); + /** * Gets the current logged in username. * @@ -563,6 +570,11 @@ public interface Client extends GameShell */ MenuEntry[] getMenuEntries(); + /** + * @return amount of menu entries the client has (same as client.getMenuEntries().size()) + */ + int getMenuOptionCount(); + /** * Sets the array of open menu entries. *

@@ -934,7 +946,7 @@ public interface Client extends GameShell * * @return all projectiles */ - java.util.List getProjectiles(); + List getProjectiles(); /** * Gets a list of all graphics objects currently drawn. @@ -1503,14 +1515,6 @@ public interface Client extends GameShell */ NodeCache getWidgetSpriteCache(); - /** - * Overrides health bar sprites with the sprites from the specified override. - * Pass in {@code null} to revert the health bars back to their default. - * - * @param override the health bar override - */ - void setHealthBarOverride(HealthBarOverride override); - /** * Gets the current server tick count. * @@ -1639,7 +1643,9 @@ public interface Client extends GameShell void draw2010Menu(); - NodeCache getHealthBarCache(); + void resetHealthBarCaches(); + + boolean getRenderSelf(); void setRenderSelf(boolean enabled); @@ -1663,4 +1669,16 @@ public interface Client extends GameShell String getSelectedSpellName(); boolean getIsSpellSelected(); + + /** + * Set whether or not player attack options will be hidden for clanmembers/friends + */ + void setHideFriendAttackOptions(boolean yes); + + /** + * Sorts the current menu entries in the same way the client does this. + * The last entry will be the left click one after this. + */ + void sortMenuEntries(); + } diff --git a/runelite-api/src/main/java/net/runelite/api/Constants.java b/runelite-api/src/main/java/net/runelite/api/Constants.java index 2d8ea3deed..bdcb8f6374 100644 --- a/runelite-api/src/main/java/net/runelite/api/Constants.java +++ b/runelite-api/src/main/java/net/runelite/api/Constants.java @@ -99,7 +99,19 @@ public class Constants public static final int GAME_TICK_LENGTH = 600; /** - * Used when getting High Alchemy value - multiplied by general store price. + * High alchemy = shop price * HIGH_ALCHEMY_MULTIPLIER + * + * @see ItemDefinition#getPrice */ - public static final float HIGH_ALCHEMY_CONSTANT = 0.6f; + public static final float HIGH_ALCHEMY_MULTIPLIER = 0.6f; + + /** + * Width of a standard item sprite + */ + public static final int ITEM_SPRITE_WIDTH = 36; + + /** + * Height of a standard item sprite + */ + public static final int ITEM_SPRITE_HEIGHT = 32; } diff --git a/runelite-api/src/main/java/net/runelite/api/GraphicID.java b/runelite-api/src/main/java/net/runelite/api/GraphicID.java index 79ffd07145..5a6f7054bb 100644 --- a/runelite-api/src/main/java/net/runelite/api/GraphicID.java +++ b/runelite-api/src/main/java/net/runelite/api/GraphicID.java @@ -55,4 +55,5 @@ public class GraphicID public static final int OLM_HEAL = 1363; public static final int OLM_CRYSTAL = 1447; public static final int XERIC_TELEPORT = 1612; + public static final int HYDRA_LIGHTNING = 1666; } diff --git a/runelite-api/src/main/java/net/runelite/api/HealthBar.java b/runelite-api/src/main/java/net/runelite/api/HealthBar.java index 0d37e01c2a..89717b1435 100644 --- a/runelite-api/src/main/java/net/runelite/api/HealthBar.java +++ b/runelite-api/src/main/java/net/runelite/api/HealthBar.java @@ -30,5 +30,7 @@ public interface HealthBar Sprite getHealthBarBackSprite(); + int getHealthBarFrontSpriteId(); + void setPadding(int padding); } diff --git a/runelite-api/src/main/java/net/runelite/api/HealthBarOverride.java b/runelite-api/src/main/java/net/runelite/api/HealthBarOverride.java deleted file mode 100644 index e6d213e750..0000000000 --- a/runelite-api/src/main/java/net/runelite/api/HealthBarOverride.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2019, Lotto - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.api; - -import lombok.Data; - -@Data -public class HealthBarOverride -{ - public final Sprite frontSprite; - public final Sprite backSprite; - public final Sprite frontSpriteLarge; - public final Sprite backSpriteLarge; -} diff --git a/runelite-api/src/main/java/net/runelite/api/ItemDefinition.java b/runelite-api/src/main/java/net/runelite/api/ItemDefinition.java index ece176145f..373d066fb9 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemDefinition.java +++ b/runelite-api/src/main/java/net/runelite/api/ItemDefinition.java @@ -63,6 +63,8 @@ public interface ItemDefinition * alchemy values, respectively. * * @return the general store value of the item + * + * @see Constants#HIGH_ALCHEMY_MULTIPLIER */ int getPrice(); diff --git a/runelite-api/src/main/java/net/runelite/api/ItemID.java b/runelite-api/src/main/java/net/runelite/api/ItemID.java index 813c354a01..ab3252792a 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/ItemID.java @@ -10791,5 +10791,35 @@ public final class ItemID public static final int TORMENTED_BRACELET_OR = 23444; public static final int GIANT_EASTER_EGG = 23446; public static final int BUNNYMAN_MASK = 23448; + public static final int ENCHANTED_LYREI = 23458; + public static final int ATTACKER_ICON_23460 = 23460; + public static final int ATTACKER_ICON_23461 = 23461; + public static final int ATTACKER_ICON_23462 = 23462; + public static final int ATTACKER_ICON_23463 = 23463; + public static final int ATTACKER_ICON_23464 = 23464; + public static final int ATTACKER_ICON_23465 = 23465; + public static final int DEFENDER_ICON_23466 = 23466; + public static final int DEFENDER_ICON_23467 = 23467; + public static final int DEFENDER_ICON_23468 = 23468; + public static final int DEFENDER_ICON_23469 = 23469; + public static final int DEFENDER_ICON_23470 = 23470; + public static final int COLLECTOR_ICON_23471 = 23471; + public static final int COLLECTOR_ICON_23472 = 23472; + public static final int COLLECTOR_ICON_23473 = 23473; + public static final int COLLECTOR_ICON_23474 = 23474; + public static final int COLLECTOR_ICON_23475 = 23475; + public static final int COLLECTOR_ICON_23476 = 23476; + public static final int COLLECTOR_ICON_23477 = 23477; + public static final int HEALER_ICON_23478 = 23478; + public static final int HEALER_ICON_23479 = 23479; + public static final int HEALER_ICON_23480 = 23480; + public static final int HEALER_ICON_23481 = 23481; + public static final int HEALER_ICON_23482 = 23482; + public static final int HEALER_ICON_23483 = 23483; + public static final int HEALER_ICON_23484 = 23484; + public static final int HEALER_ICON_23485 = 23485; + public static final int HEALER_ICON_23486 = 23486; + public static final int WINE_OF_ZAMORAK_23489 = 23489; + public static final int LARRANS_KEY = 23490; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/MenuEntry.java b/runelite-api/src/main/java/net/runelite/api/MenuEntry.java index 6d9cc751f4..cda2997a21 100644 --- a/runelite-api/src/main/java/net/runelite/api/MenuEntry.java +++ b/runelite-api/src/main/java/net/runelite/api/MenuEntry.java @@ -24,12 +24,16 @@ */ package net.runelite.api; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.RequiredArgsConstructor; /** * A menu entry in a right-click menu. */ @Data +@AllArgsConstructor +@RequiredArgsConstructor public class MenuEntry { /** diff --git a/runelite-api/src/main/java/net/runelite/api/NpcID.java b/runelite-api/src/main/java/net/runelite/api/NpcID.java index 1ab55200fd..1288a33ba7 100644 --- a/runelite-api/src/main/java/net/runelite/api/NpcID.java +++ b/runelite-api/src/main/java/net/runelite/api/NpcID.java @@ -460,10 +460,9 @@ public final class NpcID public static final int SKELETAL_WYVERN_468 = 468; public static final int KILLERWATT = 469; public static final int KILLERWATT_470 = 470; - public static final int FUNGI = 471; - public static final int FUNGI_472 = 472; - public static final int ZYGOMITE = 473; - public static final int ZYGOMITE_474 = 474; + public static final int DARK_WIZARD = 472; + public static final int INVRIGAR_THE_NECROMANCER = 473; + public static final int DARK_WIZARD_474 = 474; public static final int HOLE_IN_THE_WALL = 475; public static final int WALL_BEAST = 476; public static final int GIANT_FROG = 477; @@ -493,40 +492,37 @@ public final class NpcID public static final int VANESSA = 502; public static final int RICHARD = 503; public static final int ALICE = 504; - public static final int BOB = 505; - public static final int SHOP_KEEPER = 506; - public static final int SHOP_ASSISTANT = 507; - public static final int SHOP_KEEPER_508 = 508; - public static final int SHOP_ASSISTANT_509 = 509; - public static final int SHOP_KEEPER_510 = 510; - public static final int SHOP_ASSISTANT_511 = 511; - public static final int SHOP_KEEPER_512 = 512; - public static final int SHOP_ASSISTANT_513 = 513; - public static final int SHOP_KEEPER_514 = 514; - public static final int SHOP_ASSISTANT_515 = 515; - public static final int SHOP_KEEPER_516 = 516; - public static final int SHOP_ASSISTANT_517 = 517; - public static final int SHOP_KEEPER_518 = 518; - public static final int SHOP_ASSISTANT_519 = 519; - public static final int FAIRY_SHOP_KEEPER = 520; - public static final int FAIRY_SHOP_ASSISTANT = 521; - public static final int VALAINE = 522; - public static final int SCAVVO = 523; - public static final int PEKSA = 524; - public static final int SILK_TRADER = 525; - public static final int GEM_TRADER = 526; - public static final int ZEKE = 527; - public static final int LOUIE_LEGS = 528; - public static final int KARIM = 529; - public static final int RANAEL = 530; - public static final int DOMMIK = 531; - public static final int ZAFF = 532; - public static final int BARAEK = 533; + public static final int MUGGER = 505; + public static final int WITCH = 506; + public static final int WITCH_507 = 507; + public static final int BLACK_KNIGHT = 508; + public static final int BLACK_KNIGHT_509 = 509; + public static final int HIGHWAYMAN = 510; + public static final int HIGHWAYMAN_511 = 511; + public static final int CHAOS_DRUID = 512; + public static final int PIRATE = 513; + public static final int PIRATE_514 = 514; + public static final int PIRATE_515 = 515; + public static final int PIRATE_516 = 516; + public static final int THUG = 517; + public static final int ROGUE = 518; + public static final int MONK_OF_ZAMORAK = 519; + public static final int MONK_OF_ZAMORAK_520 = 520; + public static final int MONK_OF_ZAMORAK_521 = 521; + public static final int TRIBESMAN = 522; + public static final int DARK_WARRIOR = 523; + public static final int CHAOS_DRUID_WARRIOR = 524; + public static final int NECROMANCER = 525; + public static final int BANDIT = 526; + public static final int GUARD_BANDIT = 527; + public static final int BARBARIAN_GUARD = 528; + public static final int PORTAL = 530; + public static final int PORTAL_532 = 532; + public static final int FUNGI = 533; public static final int THESSALIA = 534; - public static final int HORVIK = 535; - public static final int LOWE = 536; - public static final int SHOP_KEEPER_537 = 537; - public static final int SHOP_ASSISTANT_538 = 538; + public static final int FUNGI_535 = 535; + public static final int ZYGOMITE = 537; + public static final int FUNGI_538 = 538; public static final int ELFINLOCKS = 539; public static final int CLOCKWORK_CAT = 540; public static final int CLOCKWORK_CAT_541 = 541; @@ -625,7 +621,7 @@ public final class NpcID public static final int BREWER_634 = 634; public static final int FISHING_SPOT = 635; public static final int KARAMTHULHU = 636; - public static final int AUBURY = 637; + public static final int FUNGI_637 = 637; public static final int ELF_TRACKER = 638; public static final int TYRAS_GUARD = 639; public static final int UG = 640; @@ -678,7 +674,7 @@ public final class NpcID public static final int BARTENDER = 687; public static final int EBLIS = 688; public static final int EBLIS_689 = 689; - public static final int BANDIT = 690; + public static final int BANDIT_690 = 690; public static final int BANDIT_691 = 691; public static final int BANDIT_692 = 692; public static final int BANDIT_693 = 693; @@ -992,37 +988,34 @@ public final class NpcID public static final int RAT = 1020; public static final int RAT_1021 = 1021; public static final int RAT_1022 = 1022; - public static final int FANCY_DRESS_SHOP_OWNER = 1023; - public static final int SHOP_KEEPER_1024 = 1024; - public static final int GRUM = 1025; - public static final int WYDIN = 1026; - public static final int GERRANT = 1027; - public static final int BRIAN = 1028; - public static final int JIMINUA = 1029; - public static final int SHOP_KEEPER_1030 = 1030; - public static final int CANDLE_MAKER = 1031; - public static final int ARHEIN = 1032; - public static final int JUKAT = 1033; - public static final int LUNDERWIN = 1034; - public static final int IRKSOL = 1035; - public static final int FAIRY = 1036; - public static final int ZAMBO = 1037; - public static final int SILVER_MERCHANT = 1038; - public static final int GEM_MERCHANT = 1039; - public static final int BAKER = 1040; - public static final int SPICE_SELLER = 1041; - public static final int FUR_TRADER = 1042; - public static final int SILK_MERCHANT = 1043; - public static final int HICKTON = 1044; - public static final int HARRY = 1045; - public static final int CASSIE = 1046; - public static final int FRINCOS = 1047; - public static final int DROGO_DWARF = 1048; - public static final int FLYNN = 1049; - public static final int WAYNE = 1050; - public static final int DWARF_1051 = 1051; - public static final int BETTY = 1052; - public static final int HERQUIN = 1053; + public static final int ZYGOMITE_1024 = 1024; + public static final int BANKER_1027 = 1027; + public static final int BANKER_1028 = 1028; + public static final int BANKER_1029 = 1029; + public static final int BANKER_1030 = 1030; + public static final int BANKER_1031 = 1031; + public static final int BANKER_1032 = 1032; + public static final int BANKER_1033 = 1033; + public static final int BANKER_1034 = 1034; + public static final int BANKER_1035 = 1035; + public static final int BANKER_1036 = 1036; + public static final int SNAKE = 1037; + public static final int MONKEY_1038 = 1038; + public static final int ALBINO_BAT = 1039; + public static final int CRAB = 1040; + public static final int GIANT_MOSQUITO = 1041; + public static final int JUNGLE_HORROR = 1042; + public static final int JUNGLE_HORROR_1043 = 1043; + public static final int JUNGLE_HORROR_1044 = 1044; + public static final int JUNGLE_HORROR_1045 = 1045; + public static final int JUNGLE_HORROR_1046 = 1046; + public static final int CAVE_HORROR = 1047; + public static final int CAVE_HORROR_1048 = 1048; + public static final int CAVE_HORROR_1049 = 1049; + public static final int CAVE_HORROR_1050 = 1050; + public static final int CAVE_HORROR_1051 = 1051; + public static final int CAVEY_DAVEY = 1052; + public static final int PATCHY = 1053; public static final int LAUNA = 1054; public static final int LAUNA_1055 = 1055; public static final int BRANA = 1056; @@ -1134,13 +1127,12 @@ public final class NpcID public static final int MONK_OF_ENTRANA_1169 = 1169; public static final int MONK_OF_ENTRANA_1170 = 1170; public static final int MONK_1171 = 1171; - public static final int ROMMIK = 1172; - public static final int GAIUS = 1173; - public static final int JATIX = 1174; - public static final int DAVON = 1175; - public static final int ZENESHA = 1176; - public static final int AEMAD = 1177; - public static final int KORTAN = 1178; + public static final int CHICKEN = 1173; + public static final int CHICKEN_1174 = 1174; + public static final int ROOSTER = 1175; + public static final int LIL_LAMB = 1176; + public static final int LAMB = 1177; + public static final int SHEEP_1178 = 1178; public static final int LUMBRIDGE_GUIDE_1179 = 1179; public static final int LUMBRIDGE_GUIDE_1181 = 1181; public static final int ___ = 1182; @@ -1252,17 +1244,17 @@ public final class NpcID public static final int MORTTON_LOCAL_1296 = 1296; public static final int AFFLICTED_1297 = 1297; public static final int AFFLICTED_1298 = 1298; - public static final int ROACHEY = 1299; - public static final int FRENITA = 1300; - public static final int NURMOF = 1301; - public static final int TEA_SELLER = 1302; - public static final int FAT_TONY = 1303; - public static final int NOTERAZZO = 1304; + public static final int SHEEP_1299 = 1299; + public static final int SHEEP_1300 = 1300; + public static final int SHEEP_1301 = 1301; + public static final int SHEEP_1302 = 1302; + public static final int SHEEP_1303 = 1303; + public static final int SHEEP_1304 = 1304; public static final int HAIRDRESSER = 1305; public static final int MAKEOVER_MAGE = 1306; public static final int MAKEOVER_MAGE_1307 = 1307; - public static final int DIANGO = 1308; - public static final int BRIAN_1309 = 1309; + public static final int SHEEP_1308 = 1308; + public static final int SHEEP_1309 = 1309; public static final int BARTENDER_1310 = 1310; public static final int BARTENDER_1311 = 1311; public static final int BARTENDER_1312 = 1312; @@ -1392,12 +1384,12 @@ public final class NpcID public static final int DAERO = 1444; public static final int DAERO_1445 = 1445; public static final int WAYDAR = 1446; - public static final int PIRATE = 1447; + public static final int PIRATE_1447 = 1447; public static final int THIEF = 1448; public static final int LUMDO_1453 = 1453; public static final int LUMDO_1454 = 1454; public static final int GLO_CARANOCK = 1460; - public static final int MUGGER = 1461; + public static final int MUGGER_1461 = 1461; public static final int SMALL_NINJA_MONKEY = 1462; public static final int MEDIUM_NINJA_MONKEY = 1463; public static final int GORILLA = 1464; @@ -1478,7 +1470,7 @@ public final class NpcID public static final int FISHING_SPOT_1542 = 1542; public static final int GARGOYLE_1543 = 1543; public static final int FISHING_SPOT_1544 = 1544; - public static final int BLACK_KNIGHT = 1545; + public static final int BLACK_KNIGHT_1545 = 1545; public static final int GUARD_1546 = 1546; public static final int GUARD_1547 = 1547; public static final int GUARD_1548 = 1548; @@ -1486,7 +1478,7 @@ public final class NpcID public static final int GUARD_1550 = 1550; public static final int GUARD_1551 = 1551; public static final int GUARD_1552 = 1552; - public static final int CRAB = 1553; + public static final int CRAB_1553 = 1553; public static final int SEAGULL_1554 = 1554; public static final int SEAGULL_1555 = 1555; public static final int FIRE_WIZARD = 1556; @@ -1668,7 +1660,7 @@ public final class NpcID public static final int BRAWLER_1736 = 1736; public static final int BRAWLER_1737 = 1737; public static final int BRAWLER_1738 = 1738; - public static final int PORTAL = 1739; + public static final int PORTAL_1739 = 1739; public static final int PORTAL_1740 = 1740; public static final int PORTAL_1741 = 1741; public static final int PORTAL_1742 = 1742; @@ -1716,10 +1708,10 @@ public final class NpcID public static final int SKELETON_1785 = 1785; public static final int GHOST_1786 = 1786; public static final int SKELETON_MAGE_1787 = 1787; - public static final int BETTY_1788 = 1788; - public static final int GRUM_1789 = 1789; - public static final int GERRANT_1790 = 1790; - public static final int WYDIN_1791 = 1791; + public static final int BETTY = 1788; + public static final int GRUM = 1789; + public static final int GERRANT = 1790; + public static final int WYDIN = 1791; public static final int GOAT = 1792; public static final int GOAT_1793 = 1793; public static final int BILLY_GOAT = 1794; @@ -1767,7 +1759,7 @@ public final class NpcID public static final int STAG = 1845; public static final int WOOD_DRYAD = 1846; public static final int FAIRY_VERY_WISE = 1847; - public static final int FAIRY_1848 = 1848; + public static final int FAIRY = 1848; public static final int FAIRY_1849 = 1849; public static final int FAIRY_1850 = 1850; public static final int FAIRY_1851 = 1851; @@ -1915,7 +1907,7 @@ public final class NpcID public static final int FRITZ_THE_GLASSBLOWER = 2053; public static final int CHAOS_ELEMENTAL = 2054; public static final int CHAOS_ELEMENTAL_JR = 2055; - public static final int DARK_WIZARD = 2056; + public static final int DARK_WIZARD_2056 = 2056; public static final int DARK_WIZARD_2057 = 2057; public static final int DARK_WIZARD_2058 = 2058; public static final int DARK_WIZARD_2059 = 2059; @@ -2488,7 +2480,7 @@ public final class NpcID public static final int LILIYA = 2632; public static final int BANKER_2633 = 2633; public static final int MYRE_BLAMISH_SNAIL = 2634; - public static final int BOB_2635 = 2635; + public static final int BOB = 2635; public static final int BOB_2636 = 2636; public static final int SPHINX = 2637; public static final int NEITE = 2638; @@ -2544,11 +2536,12 @@ public final class NpcID public static final int IMIAGO = 2688; public static final int LILIWEN = 2689; public static final int COOL_MOM227 = 2690; - public static final int CHICKEN = 2692; - public static final int CHICKEN_2693 = 2693; - public static final int ROOSTER = 2694; - public static final int LIL_LAMB = 2695; - public static final int LAMB = 2696; + public static final int SHEEP_2691 = 2691; + public static final int SHEEP_2692 = 2692; + public static final int SHEEP_2693 = 2693; + public static final int SHEEP_2694 = 2694; + public static final int SHEEP_2695 = 2695; + public static final int SHEEP_2696 = 2696; public static final int SHEEP_2697 = 2697; public static final int SHEEP_2698 = 2698; public static final int SHEEP_2699 = 2699; @@ -2642,43 +2635,43 @@ public final class NpcID public static final int SHEEP_2787 = 2787; public static final int SHEEP_2788 = 2788; public static final int SHEEP_2789 = 2789; - public static final int SHEEP_2790 = 2790; - public static final int SHEEP_2791 = 2791; - public static final int SHEEP_2792 = 2792; - public static final int SHEEP_2793 = 2793; - public static final int SHEEP_2794 = 2794; - public static final int SHEEP_2795 = 2795; - public static final int SHEEP_2796 = 2796; - public static final int SHEEP_2797 = 2797; - public static final int SHEEP_2798 = 2798; - public static final int SHEEP_2799 = 2799; - public static final int SHEEP_2800 = 2800; - public static final int SHEEP_2801 = 2801; - public static final int SHEEP_2802 = 2802; - public static final int SHEEP_2803 = 2803; - public static final int SHEEP_2804 = 2804; - public static final int COW = 2805; - public static final int COW_2806 = 2806; - public static final int COW_CALF = 2807; - public static final int COW_2808 = 2808; - public static final int COW_CALF_2809 = 2809; - public static final int COW_2810 = 2810; - public static final int PIG = 2811; - public static final int PIG_2812 = 2812; - public static final int PIGLET = 2813; - public static final int PIGLET_2814 = 2814; - public static final int PIGLET_2815 = 2815; - public static final int COW_CALF_2816 = 2816; - public static final int SHEEPDOG = 2817; - public static final int ROOSTER_2818 = 2818; - public static final int CHICKEN_2819 = 2819; - public static final int CHICKEN_2820 = 2820; - public static final int CHICKEN_2821 = 2821; - public static final int PIG_2822 = 2822; - public static final int PIG_2823 = 2823; - public static final int PIGLET_2824 = 2824; - public static final int PIGLET_2825 = 2825; - public static final int PIGLET_2826 = 2826; + public static final int COW = 2790; + public static final int COW_2791 = 2791; + public static final int COW_CALF = 2792; + public static final int COW_2793 = 2793; + public static final int COW_CALF_2794 = 2794; + public static final int COW_2795 = 2795; + public static final int PIG = 2796; + public static final int PIG_2797 = 2797; + public static final int PIGLET = 2798; + public static final int PIGLET_2799 = 2799; + public static final int PIGLET_2800 = 2800; + public static final int COW_CALF_2801 = 2801; + public static final int SHEEPDOG = 2802; + public static final int ROOSTER_2803 = 2803; + public static final int CHICKEN_2804 = 2804; + public static final int CHICKEN_2805 = 2805; + public static final int CHICKEN_2806 = 2806; + public static final int PIG_2807 = 2807; + public static final int PIG_2808 = 2808; + public static final int PIGLET_2809 = 2809; + public static final int PIGLET_2810 = 2810; + public static final int PIGLET_2811 = 2811; + public static final int BOB_2812 = 2812; + public static final int SHOP_KEEPER = 2813; + public static final int SHOP_ASSISTANT = 2814; + public static final int SHOP_KEEPER_2815 = 2815; + public static final int SHOP_ASSISTANT_2816 = 2816; + public static final int SHOP_KEEPER_2817 = 2817; + public static final int SHOP_ASSISTANT_2818 = 2818; + public static final int SHOP_KEEPER_2819 = 2819; + public static final int SHOP_ASSISTANT_2820 = 2820; + public static final int SHOP_KEEPER_2821 = 2821; + public static final int SHOP_ASSISTANT_2822 = 2822; + public static final int SHOP_KEEPER_2823 = 2823; + public static final int SHOP_ASSISTANT_2824 = 2824; + public static final int SHOP_KEEPER_2825 = 2825; + public static final int SHOP_ASSISTANT_2826 = 2826; public static final int BAT = 2827; public static final int DRYAD = 2828; public static final int FAIRY_2829 = 2829; @@ -2697,7 +2690,7 @@ public final class NpcID public static final int ICE_WARRIOR_2842 = 2842; public static final int OTHERWORLDLY_BEING = 2843; public static final int MAGIC_AXE = 2844; - public static final int SNAKE = 2845; + public static final int SNAKE_2845 = 2845; public static final int SKAVID = 2846; public static final int YETI = 2847; public static final int MONKEY_2848 = 2848; @@ -2720,33 +2713,33 @@ public final class NpcID public static final int DUNGEON_RAT = 2865; public static final int DUNGEON_RAT_2866 = 2866; public static final int DUNGEON_RAT_2867 = 2867; - public static final int DARK_WIZARD_2868 = 2868; - public static final int INVRIGAR_THE_NECROMANCER = 2869; - public static final int DARK_WIZARD_2870 = 2870; - public static final int MUGGER_2871 = 2871; - public static final int WITCH = 2872; - public static final int WITCH_2873 = 2873; - public static final int BLACK_KNIGHT_2874 = 2874; - public static final int BLACK_KNIGHT_2875 = 2875; - public static final int HIGHWAYMAN = 2876; - public static final int HIGHWAYMAN_2877 = 2877; - public static final int CHAOS_DRUID = 2878; - public static final int PIRATE_2879 = 2879; - public static final int PIRATE_2880 = 2880; - public static final int PIRATE_2881 = 2881; - public static final int PIRATE_2882 = 2882; - public static final int THUG = 2883; - public static final int ROGUE = 2884; - public static final int MONK_OF_ZAMORAK = 2885; - public static final int MONK_OF_ZAMORAK_2886 = 2886; - public static final int MONK_OF_ZAMORAK_2887 = 2887; - public static final int TRIBESMAN = 2888; - public static final int DARK_WARRIOR = 2889; - public static final int CHAOS_DRUID_WARRIOR = 2890; - public static final int NECROMANCER = 2891; - public static final int BANDIT_2892 = 2892; - public static final int GUARD_BANDIT = 2893; - public static final int BARBARIAN_GUARD = 2894; + public static final int FAIRY_SHOP_KEEPER = 2868; + public static final int FAIRY_SHOP_ASSISTANT = 2869; + public static final int VALAINE = 2870; + public static final int SCAVVO = 2871; + public static final int PEKSA = 2872; + public static final int SILK_TRADER = 2873; + public static final int GEM_TRADER = 2874; + public static final int ZEKE = 2875; + public static final int LOUIE_LEGS = 2876; + public static final int KARIM = 2877; + public static final int RANAEL = 2878; + public static final int DOMMIK = 2879; + public static final int ZAFF = 2880; + public static final int BARAEK = 2881; + public static final int HORVIK = 2882; + public static final int LOWE = 2883; + public static final int SHOP_KEEPER_2884 = 2884; + public static final int SHOP_ASSISTANT_2885 = 2885; + public static final int AUBURY = 2886; + public static final int FANCY_DRESS_SHOP_OWNER = 2887; + public static final int SHOP_KEEPER_2888 = 2888; + public static final int GRUM_2889 = 2889; + public static final int WYDIN_2890 = 2890; + public static final int GERRANT_2891 = 2891; + public static final int BRIAN = 2892; + public static final int JIMINUA = 2893; + public static final int SHOP_KEEPER_2894 = 2894; public static final int COOK_2895 = 2895; public static final int COOK_2896 = 2896; public static final int BANKER_2897 = 2897; @@ -3022,23 +3015,23 @@ public final class NpcID public static final int EMERALD_BENEDICT = 3194; public static final int SPIN_BLADES = 3195; public static final int SPIN_BLADES_3196 = 3196; - public static final int SNAKE_3199 = 3199; - public static final int MONKEY_3200 = 3200; - public static final int ALBINO_BAT = 3201; - public static final int CRAB_3202 = 3202; - public static final int GIANT_MOSQUITO = 3203; - public static final int JUNGLE_HORROR = 3204; - public static final int JUNGLE_HORROR_3205 = 3205; - public static final int JUNGLE_HORROR_3206 = 3206; - public static final int JUNGLE_HORROR_3207 = 3207; - public static final int JUNGLE_HORROR_3208 = 3208; - public static final int CAVE_HORROR = 3209; - public static final int CAVE_HORROR_3210 = 3210; - public static final int CAVE_HORROR_3211 = 3211; - public static final int CAVE_HORROR_3212 = 3212; - public static final int CAVE_HORROR_3213 = 3213; - public static final int CAVEY_DAVEY = 3214; - public static final int PATCHY = 3215; + public static final int CANDLE_MAKER = 3199; + public static final int ARHEIN = 3200; + public static final int JUKAT = 3201; + public static final int LUNDERWIN = 3202; + public static final int IRKSOL = 3203; + public static final int FAIRY_3204 = 3204; + public static final int ZAMBO = 3205; + public static final int SILVER_MERCHANT = 3206; + public static final int GEM_MERCHANT = 3207; + public static final int BAKER = 3208; + public static final int SPICE_SELLER = 3209; + public static final int FUR_TRADER = 3210; + public static final int SILK_MERCHANT = 3211; + public static final int HICKTON = 3212; + public static final int HARRY = 3213; + public static final int CASSIE = 3214; + public static final int FRINCOS = 3215; public static final int MELEE_COMBAT_TUTOR = 3216; public static final int RANGED_COMBAT_TUTOR = 3217; public static final int MAGIC_COMBAT_TUTOR = 3218; @@ -4354,7 +4347,7 @@ public final class NpcID public static final int GEM_MERCHANT_4581 = 4581; public static final int SILVER_MERCHANT_4582 = 4582; public static final int SILK_MERCHANT_4583 = 4583; - public static final int ZENESHA_4584 = 4584; + public static final int ZENESHA = 4584; public static final int ALI_MORRISANE_4585 = 4585; public static final int GRIMESQUIT = 4586; public static final int PHINGSPET = 4587; @@ -5591,11 +5584,11 @@ public final class NpcID public static final int TZREKJAD = 5892; public static final int TZREKJAD_5893 = 5893; public static final int BAST = 5894; - public static final int BANKER_5895 = 5895; - public static final int BANKER_5896 = 5896; - public static final int BANKER_5897 = 5897; - public static final int BANKER_5904 = 5904; - public static final int BANKER_5905 = 5905; + public static final int DROGO_DWARF = 5895; + public static final int FLYNN = 5896; + public static final int WAYNE = 5897; + public static final int DWARF_5904 = 5904; + public static final int BETTY_5905 = 5905; public static final int PROBITA = 5906; public static final int CHAOS_ELEMENTAL_JR_5907 = 5907; public static final int ABYSSAL_SIRE_5908 = 5908; @@ -6021,8 +6014,8 @@ public final class NpcID public static final int FIDELIO = 6525; public static final int SBOTT = 6526; public static final int ROAVAR = 6527; - public static final int BANKER_6529 = 6529; - public static final int BANKER_6530 = 6530; + public static final int HERQUIN = 6529; + public static final int ROMMIK = 6530; public static final int BLURBERRY = 6531; public static final int BARMAN_6532 = 6532; public static final int ROMILY_WEAKLAX = 6533; @@ -7135,7 +7128,7 @@ public final class NpcID public static final int ANCIENT_WYVERN = 7795; public static final int LOBSTROSITY = 7796; public static final int ANCIENT_ZYGOMITE = 7797; - public static final int ANCIENT_FUNGI = 7798; + public static final int GAIUS = 7798; public static final int AMMONITE_CRAB = 7799; public static final int FOSSIL_ROCK = 7800; public static final int TAR_BUBBLES = 7801; @@ -7745,7 +7738,7 @@ public final class NpcID public static final int TRAPPED_SOUL_HARD = 8529; public static final int AMELIA_8530 = 8530; public static final int ALLANNA = 8531; - public static final int LEKE_QUO_KERAN = 8532; + public static final int JATIX = 8532; public static final int NIKKIE = 8533; public static final int ROSIE = 8534; public static final int ALAN = 8535; @@ -7855,11 +7848,23 @@ public final class NpcID public static final int ILFEEN_8677 = 8677; public static final int FERAL_VAMPYRE_8678 = 8678; public static final int ABIDOR_CRANK_8679 = 8679; - public static final int BANKER_8680 = 8680; - public static final int BANKER_8681 = 8681; - public static final int BANKER_8682 = 8682; - public static final int PORTAL_8684 = 8684; - public static final int PORTAL_8686 = 8686; + public static final int DAVON = 8680; + public static final int ZENESHA_8681 = 8681; + public static final int AEMAD = 8682; + public static final int KORTAN = 8683; + public static final int ROACHEY = 8684; + public static final int FRENITA = 8685; + public static final int NURMOF = 8686; + public static final int TEA_SELLER = 8687; + public static final int FAT_TONY = 8688; + public static final int ANCIENT_FUNGI = 8690; + public static final int ANCIENT_FUNGI_8691 = 8691; + public static final int NOTERAZZO = 8692; + public static final int DIANGO = 8693; + public static final int BRIAN_8694 = 8694; public static final int MOSOL_REI_8696 = 8696; + public static final int LEKE_QUO_KERAN = 8697; + public static final int MONK_OF_ZAMORAK_8698 = 8698; + public static final int LARRAN = 8699; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/NullItemID.java b/runelite-api/src/main/java/net/runelite/api/NullItemID.java index 1bc9028389..f31d40f26e 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullItemID.java @@ -12456,5 +12456,12 @@ public final class NullItemID public static final int NULL_23455 = 23455; public static final int NULL_23456 = 23456; public static final int NULL_23457 = 23457; + public static final int NULL_23459 = 23459; + public static final int NULL_23487 = 23487; + public static final int NULL_23488 = 23488; + public static final int NULL_23491 = 23491; + public static final int NULL_23492 = 23492; + public static final int NULL_23493 = 23493; + public static final int NULL_23494 = 23494; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java b/runelite-api/src/main/java/net/runelite/api/NullObjectID.java index 279f795689..103bf0143c 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullObjectID.java @@ -16209,5 +16209,7 @@ public final class NullObjectID public static final int NULL_34823 = 34823; public static final int NULL_34824 = 34824; public static final int NULL_34825 = 34825; + public static final int NULL_34831 = 34831; + public static final int NULL_34832 = 34832; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/ObjectID.java b/runelite-api/src/main/java/net/runelite/api/ObjectID.java index e31bd024d8..9d5ee32bfb 100644 --- a/runelite-api/src/main/java/net/runelite/api/ObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/ObjectID.java @@ -16133,7 +16133,7 @@ public final class ObjectID public static final int GRAND_EXCHANGE_BOOTH_30390 = 30390; public static final int IRON_LADDER_30391 = 30391; public static final int IRON_LADDER_30392 = 30392; - public static final int JADFEST_PORTAL = 30395; + public static final int MYSTERIOUS_POOL = 30395; public static final int SHIMMERING_BARRIER_30396 = 30396; public static final int SHIMMERING_BARRIER_30397 = 30397; public static final int SHIMMERING_BARRIER_30398 = 30398; @@ -17528,7 +17528,7 @@ public final class ObjectID public static final int FIRE_OF_DEHUMIDIFICATION = 33322; public static final int PILE_OF_RUBBLE_33340 = 33340; public static final int PILE_OF_RUBBLE_33341 = 33341; - public static final int HUB_PORTAL = 33343; + public static final int LARRANS_SMALL_CHEST = 33343; public static final int BROKEN_WALL_33344 = 33344; public static final int PORTAL_NEXUS_SPACE = 33346; public static final int RUG_SPACE_33347 = 33347; @@ -18605,5 +18605,10 @@ public final class ObjectID public static final int RUBBLE_34803 = 34803; public static final int RUBBLE_34804 = 34804; public static final int RUBBLE_34805 = 34805; + public static final int JADFEST_PORTAL = 34826; + public static final int HUB_PORTAL = 34827; + public static final int LARRANS_SMALL_CHEST_34828 = 34828; + public static final int LARRANS_BIG_CHEST = 34829; + public static final int LARRANS_BIG_CHEST_34830 = 34830; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/ScriptID.java b/runelite-api/src/main/java/net/runelite/api/ScriptID.java index 12774bf1b9..62acbe1454 100644 --- a/runelite-api/src/main/java/net/runelite/api/ScriptID.java +++ b/runelite-api/src/main/java/net/runelite/api/ScriptID.java @@ -110,6 +110,16 @@ public final class ScriptID */ public static final int KEPT_LOST_ITEM_EXAMINE = 1603; + /** + * Displays the game messages when clicking on an item inside the Items Kept on Death interface + *

    + *
  • int (boolean) Item kept on death
  • + *
  • int Item Quantity
  • + *
  • String Item Name
  • + *
+ */ + public static final int DEATH_KEEP_ITEM_EXAMINE = 1603; + /** * Checks the state of the given stash unit. *
    diff --git a/runelite-api/src/main/java/net/runelite/api/SpriteID.java b/runelite-api/src/main/java/net/runelite/api/SpriteID.java index e83c268535..a0c35e0367 100644 --- a/runelite-api/src/main/java/net/runelite/api/SpriteID.java +++ b/runelite-api/src/main/java/net/runelite/api/SpriteID.java @@ -1564,9 +1564,28 @@ public final class SpriteID public static final int MOBILE_FUNCTION_MODE_DISABLED = 1624; public static final int MOBILE_YELLOW_TOUCH_ANIMATION_1 = 1625; public static final int MOBILE_YELLOW_TOUCH_ANIMATION_2 = 1626; + /* Unmapped: 1627~1707 */ public static final int TAB_MAGIC_SPELLBOOK_ARCEUUS_UNUSED = 1708; + /* Unmapped: 1709, 1710 */ public static final int TAB_MAGIC_SPELLBOOK_ARCEUUS = 1711; public static final int BIG_ASS_GUTHIX_SPELL = 1774; public static final int BIG_SUPERHEAT = 1800; public static final int BIG_SPEC_TRANSFER = 1959; + /* Unmapped: 1712~2175 */ + public static final int HEALTHBAR_DEFAULT_FRONT_30PX = 2176; + public static final int HEALTHBAR_DEFAULT_BACK_30PX = 2177; + public static final int HEALTHBAR_DEFAULT_FRONT_50PX = 2178; + public static final int HEALTHBAR_DEFAULT_BACK_50PX = 2179; + public static final int HEALTHBAR_DEFAULT_FRONT_60PX = 2180; + public static final int HEALTHBAR_DEFAULT_BACK_60PX = 2181; + public static final int HEALTHBAR_DEFAULT_FRONT_80PX = 2182; + public static final int HEALTHBAR_DEFAULT_BACK_80PX = 2183; + public static final int HEALTHBAR_DEFAULT_FRONT_100PX = 2184; + public static final int HEALTHBAR_DEFAULT_BACK_100PX = 2185; + public static final int HEALTHBAR_DEFAULT_FRONT_120PX = 2186; + public static final int HEALTHBAR_DEFAULT_BACK_120PX = 2187; + public static final int HEALTHBAR_DEFAULT_FRONT_140PX = 2188; + public static final int HEALTHBAR_DEFAULT_BACK_140PX = 2189; + public static final int HEALTHBAR_DEFAULT_FRONT_160PX = 2190; + public static final int HEALTHBAR_DEFAULT_BACK_160PX = 2191; } diff --git a/runelite-api/src/main/java/net/runelite/api/WorldType.java b/runelite-api/src/main/java/net/runelite/api/WorldType.java index 06ec983a12..167fd83f39 100644 --- a/runelite-api/src/main/java/net/runelite/api/WorldType.java +++ b/runelite-api/src/main/java/net/runelite/api/WorldType.java @@ -62,6 +62,16 @@ public enum WorldType PVP, SEASONAL_DEADMAN ); + + private static final EnumSet DEADMAN_WORLD_TYPES = EnumSet.of( + DEADMAN, + DEADMAN_TOURNAMENT, + SEASONAL_DEADMAN + ); + + private static final EnumSet HIGHRISK_WORLD_TYPES = EnumSet.of( + HIGH_RISK + ); /** * Create enum set of world types from mask. @@ -103,14 +113,24 @@ public enum WorldType } /** - * Checks whether a world having a {@link Collection} of {@link WorldType}s is a PVP world. + * Checks whether a world having a {@link Collection} of {@link WorldType}s is a PVP/DEADMAN/HIGHRISK world. * * @param worldTypes A {@link Collection} of {@link WorldType}s describing the given world. - * @return True if the given worldtypes of the world are a PVP world, false otherwise. + * @return True if the given worldtypes of the world are a PVP/DEADMAN/HIGHRISK world, false otherwise. * @see Client#getWorldType() */ public static boolean isPvpWorld(final Collection worldTypes) { return worldTypes.stream().anyMatch(PVP_WORLD_TYPES::contains); } + + public static boolean isDeadmanWorld(final Collection worldTypes) + { + return worldTypes.stream().anyMatch(DEADMAN_WORLD_TYPES::contains); + } + + public static boolean isHighRiskWorld(final Collection worldTypes) + { + return worldTypes.stream().anyMatch(HIGHRISK_WORLD_TYPES::contains); + } } diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java b/runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java index e6aa08b600..37f73ec792 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java +++ b/runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java @@ -26,6 +26,7 @@ package net.runelite.api.events; import lombok.AllArgsConstructor; import lombok.Data; +import net.runelite.api.MenuEntry; /** * An event when a new entry is added to a right-click menu. @@ -35,30 +36,42 @@ import lombok.Data; public class MenuEntryAdded { /** - * The option text added to the menu (ie. "Walk here", "Use"). + * The MenuEntry object that was actually added */ - private final String option; - /** - * The target of the action (ie. Item or Actor name). - *

    - * If the option does not apply to any target, this field - * will be set to empty string. - */ - private final String target; - /** - * The action type that will be triggered. - */ - private final int type; - /** - * An identifier value for the target of the action - */ - private final int identifier; - /** - * An additional parameter for the action. - */ - private final int actionParam0; - /** - * A second additional parameter for the action. - */ - private final int actionParam1; + private final MenuEntry menuEntry; + + public String getOption() + { + return menuEntry.getOption(); + } + + public String getTarget() + { + return menuEntry.getTarget(); + } + + public int getType() + { + return menuEntry.getType(); + } + + public int getIdentifier() + { + return menuEntry.getIdentifier(); + } + + public int getActionParam0() + { + return menuEntry.getParam0(); + } + + public int getActionParam1() + { + return menuEntry.getParam1(); + } + + public boolean isForceLeftClick() + { + return menuEntry.isForceLeftClick(); + } } diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java b/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java index a2ded77511..e186ca0bf1 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java +++ b/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java @@ -26,6 +26,7 @@ package net.runelite.api.events; import lombok.Data; import net.runelite.api.MenuAction; +import net.runelite.api.MenuEntry; /** * An event where a menu option has been clicked. @@ -42,31 +43,71 @@ import net.runelite.api.MenuAction; public class MenuOptionClicked { /** - * The action parameter used in the click. + * The actual MenuEntry object representing what was clicked */ - private int actionParam; + private final MenuEntry menuEntry; + /** * The option text added to the menu. */ - private String menuOption; + public String getOption() + { + return menuEntry.getOption(); + } + /** * The target of the action. */ - private String menuTarget; + public String getTarget() + { + return menuEntry.getTarget(); + } + /** - * The action performed. + * MenuAction but int-ish */ - private MenuAction menuAction; + public int getType() + { + return menuEntry.getType(); + } + /** * The ID of the object, actor, or item that the interaction targets. */ - private int id; + public int getIdentifier() + { + return menuEntry.getIdentifier(); + } + /** - * The ID of the widget where the menu was clicked. - * - * @see net.runelite.api.WidgetID + * The action parameter used in the click. */ - private int widgetId; + public int getActionParam0() + { + return menuEntry.getParam0(); + } + + /** + * shit docs + */ + public int getActionParam1() + { + return menuEntry.getParam1(); + } + + public boolean isForceLeftClick() + { + return menuEntry.isForceLeftClick(); + } + + /** + * The action performed. + */ + public MenuAction getMenuAction() + { + return MenuAction.of(getType()); + } + /** * Whether or not the event has been consumed by a subscriber. */ diff --git a/runelite-api/src/main/java/net/runelite/api/vars/SlayerUnlock.java b/runelite-api/src/main/java/net/runelite/api/vars/SlayerUnlock.java index 72733d768d..05081da7a2 100644 --- a/runelite-api/src/main/java/net/runelite/api/vars/SlayerUnlock.java +++ b/runelite-api/src/main/java/net/runelite/api/vars/SlayerUnlock.java @@ -56,7 +56,7 @@ public enum SlayerUnlock TZHARR_ENABLE(18), BOSS_ENABLE(19), BLOODVELD_EXTEND(20), - ABBERANT_SPECTRE_EXTEND(21), + ABERRANT_SPECTRE_EXTEND(21), AVIANSIES_EXTEND(22), MITHRIL_DRAGON_EXTEND(23), CAVE_HORROR_EXTEND(24), @@ -79,7 +79,7 @@ public enum SlayerUnlock RUNE_DRAGON_EXTEND(41), VORKATH_SLAYER_HELM(42), FOSSIL_ISLAND_WYVERN_DISABLE(43, Varbits.FOSSIL_ISLAND_WYVERN_DISABLE), - GROTESQUE_GARDIAN_DOUBLE_COUNT(44); + GROTESQUE_GUARDIAN_DOUBLE_COUNT(44); private Varbits toggleVarbit; diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index 6638b1326a..672dc24324 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -149,6 +149,7 @@ public class WidgetID public static final int BEGINNER_CLUE_MAP_NORTH_OF_FALADOR = 351; public static final int BEGINNER_CLUE_MAP_WIZARDS_TOWER = 356; public static final int SEED_BOX_GROUP_ID = 128; + public static final int ITEMS_KEPT_ON_DEATH_GROUP_ID = 4; static class WorldMap { @@ -962,9 +963,9 @@ public class WidgetID static final int ATTACK_RANGE = 59; // OUTDATED? static final int BOUNTY_HUNTER_INFO = 19; static final int KILLDEATH_RATIO = 15; - static final int SKULL_CONTAINER = 62; - static final int SAFE_ZONE = 64; - static final int WILDERNESS_LEVEL = 67; // this can also be the Deadman Mode "Protection" text + static final int SKULL_CONTAINER = 61; + static final int SAFE_ZONE = 63; + static final int WILDERNESS_LEVEL = 66; // this can also be the Deadman Mode "Protection" text } static class KourendFavour @@ -1047,12 +1048,13 @@ public class WidgetID static class KeptOnDeath { static final int KEPT_ITEMS_CONTAINER = 18; + static final int KEPT_ITEMS_TEXT = 17; + static final int LOST_ITEMS_TEXT = 20; static final int LOST_ITEMS_CONTAINER = 21; static final int LOST_ITEMS_VALUE = 23; static final int INFORMATION_CONTAINER = 29; static final int MAX_ITEMS_KEPT_ON_DEATH = 30; static final int SAFE_ZONE_CONTAINER = 31; - static final int CUSTOM_TEXT_CONTAINER = 33; } diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java index bc666fad45..4a99733ec3 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java @@ -739,7 +739,10 @@ public enum WidgetInfo XP_DROP_4(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_4), XP_DROP_5(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_5), XP_DROP_6(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_6), - XP_DROP_7(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_7); + XP_DROP_7(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_7), + + ITEMS_KEPT_ON_DEATH_TEXT(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.KEPT_ITEMS_TEXT), + ITEMS_LOST_ON_DEATH_TEXT(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_TEXT); private final int groupId; private final int childId; diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 5e690979e2..70c5c83000 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -209,11 +209,12 @@ net.runelite.rs runescape-api ${project.version} + runtime - net.runelit - client-patch - 1.5.26.2 + net.runelite + injected-client + ${project.version} runtime @@ -334,8 +335,8 @@ - - net.runelite:api + + net.runelite:* ** @@ -346,13 +347,6 @@ ** - - - net.runelit:client-patch - - ** - - net.runelite.pushingpixels:* diff --git a/runelite-client/src/main/java/net/runelite/client/Notifier.java b/runelite-client/src/main/java/net/runelite/client/Notifier.java index 3978bebfa4..43c833e6b4 100644 --- a/runelite-client/src/main/java/net/runelite/client/Notifier.java +++ b/runelite-client/src/main/java/net/runelite/client/Notifier.java @@ -46,11 +46,13 @@ import javax.inject.Singleton; import lombok.extern.slf4j.Slf4j; import net.runelite.api.ChatMessageType; import net.runelite.api.Client; +import net.runelite.api.Constants; import net.runelite.api.GameState; import net.runelite.client.chat.ChatColorType; import net.runelite.client.chat.ChatMessageBuilder; import net.runelite.client.chat.ChatMessageManager; import net.runelite.client.chat.QueuedMessage; +import net.runelite.client.config.FlashNotification; import net.runelite.client.config.RuneLiteConfig; import net.runelite.client.ui.ClientUI; import net.runelite.client.util.OSType; @@ -68,7 +70,8 @@ public class Notifier // Notifier properties private static final Color FLASH_COLOR = new Color(255, 0, 0, 70); - private static final int FLASH_DURATION = 2000; + private static final int MINIMUM_FLASH_DURATION_MILLIS = 2000; + private static final int MINIMUM_FLASH_DURATION_TICKS = MINIMUM_FLASH_DURATION_MILLIS / Constants.CLIENT_TICK_LENGTH; private final Client client; private final String appName; @@ -79,6 +82,7 @@ public class Notifier private final Path notifyIconPath; private final boolean terminalNotifierAvailable; private Instant flashStart; + private long mouseLastPressedMillis; @Inject private Notifier( @@ -146,9 +150,10 @@ public class Notifier .build()); } - if (runeLiteConfig.enableFlashNotification()) + if (runeLiteConfig.flashNotification() != FlashNotification.DISABLED) { flashStart = Instant.now(); + mouseLastPressedMillis = client.getMouseLastPressedMillis(); } log.debug(message); @@ -156,24 +161,48 @@ public class Notifier public void processFlash(final Graphics2D graphics) { - if (flashStart == null || client.getGameCycle() % 40 >= 20) - { - return; - } - else if (client.getGameState() != GameState.LOGGED_IN) + if (flashStart == null || client.getGameState() != GameState.LOGGED_IN) { flashStart = null; return; } + FlashNotification flashNotification = runeLiteConfig.flashNotification(); + + if (client.getGameCycle() % 40 >= 20 + // For solid colour, fall through every time. + && (flashNotification == FlashNotification.FLASH_TWO_SECONDS + || flashNotification == FlashNotification.FLASH_UNTIL_CANCELLED)) + { + return; + } + final Color color = graphics.getColor(); graphics.setColor(FLASH_COLOR); graphics.fill(new Rectangle(client.getCanvas().getSize())); graphics.setColor(color); - if (Instant.now().minusMillis(FLASH_DURATION).isAfter(flashStart)) + if (!Instant.now().minusMillis(MINIMUM_FLASH_DURATION_MILLIS).isAfter(flashStart)) { - flashStart = null; + return; + } + + switch (flashNotification) + { + case FLASH_TWO_SECONDS: + case SOLID_TWO_SECONDS: + flashStart = null; + break; + case SOLID_UNTIL_CANCELLED: + case FLASH_UNTIL_CANCELLED: + // Any interaction with the client since the notification started will cancel it after the minimum duration + if (client.getMouseIdleTicks() < MINIMUM_FLASH_DURATION_TICKS + || client.getKeyboardIdleTicks() < MINIMUM_FLASH_DURATION_TICKS + || client.getMouseLastPressedMillis() > mouseLastPressedMillis) + { + flashStart = null; + } + break; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveMonster.java b/runelite-client/src/main/java/net/runelite/client/config/FlashNotification.java similarity index 72% rename from runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveMonster.java rename to runelite-client/src/main/java/net/runelite/client/config/FlashNotification.java index 3c93005f37..f90ce26ad2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveMonster.java +++ b/runelite-client/src/main/java/net/runelite/client/config/FlashNotification.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Jordan Atwood + * Copyright (c) 2019, Twiglet1022 * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,29 +22,26 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.client.plugins.inferno; +package net.runelite.client.config; -import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.RequiredArgsConstructor; -@AllArgsConstructor -enum InfernoWaveMonster +@Getter +@RequiredArgsConstructor +public enum FlashNotification { - - JAL_NIB("Jal-Nib", 32), - JAL_MEJRAH("Jal-MejRah", 85), - JAL_AK("Jal-Ak", 165), - JAL_IMKOT("Jal-ImKot", 240), - JAL_XIL("Jal-XIL", 370), - JAL_ZEK("Jal-Zek", 490), - JALTOK_JAD("JalTok-Jad", 900), - TZKAL_ZUK("TzKal-Zuk", 1400); + DISABLED("Off"), + FLASH_TWO_SECONDS("Flash for 2 seconds"), + SOLID_TWO_SECONDS("Solid for 2 seconds"), + FLASH_UNTIL_CANCELLED("Flash until cancelled"), + SOLID_UNTIL_CANCELLED("Solid until cancelled"); - private final String name; - private final int level; + private final String type; @Override public String toString() { - return String.format("%s - Level %s", name, level); + return type; } } diff --git a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java index 4c349b2131..fea5ab1734 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java @@ -191,9 +191,9 @@ public interface RuneLiteConfig extends Config description = "Flashes the game frame as a notification", position = 24 ) - default boolean enableFlashNotification() + default FlashNotification flashNotification() { - return false; + return FlashNotification.DISABLED; } @ConfigItem( diff --git a/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java b/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java index 44a47789d7..02f5a8785d 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java +++ b/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java @@ -44,8 +44,9 @@ import javax.inject.Singleton; import lombok.Value; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; +import net.runelite.api.Constants; import static net.runelite.api.Constants.CLIENT_DEFAULT_ZOOM; -import static net.runelite.api.Constants.HIGH_ALCHEMY_CONSTANT; +import static net.runelite.api.Constants.HIGH_ALCHEMY_MULTIPLIER; import net.runelite.api.GameState; import net.runelite.api.ItemDefinition; import net.runelite.api.ItemID; @@ -423,7 +424,7 @@ public class ItemManager return 1000; } - return (int) Math.max(1, composition.getPrice() * HIGH_ALCHEMY_CONSTANT); + return (int) Math.max(1, composition.getPrice() * HIGH_ALCHEMY_MULTIPLIER); } public int getAlchValue(int itemID) @@ -437,7 +438,7 @@ public class ItemManager return 1000; } - return (int) Math.max(1, getItemDefinition(itemID).getPrice() * HIGH_ALCHEMY_CONSTANT); + return (int) Math.max(1, getItemDefinition(itemID).getPrice() * HIGH_ALCHEMY_MULTIPLIER); } /** @@ -521,7 +522,7 @@ public class ItemManager */ private AsyncBufferedImage loadImage(int itemId, int quantity, boolean stackable) { - AsyncBufferedImage img = new AsyncBufferedImage(36, 32, BufferedImage.TYPE_INT_ARGB); + AsyncBufferedImage img = new AsyncBufferedImage(Constants.ITEM_SPRITE_WIDTH, Constants.ITEM_SPRITE_HEIGHT, BufferedImage.TYPE_INT_ARGB); clientThread.invoke(() -> { if (client.getGameState().ordinal() < GameState.LOGIN_SCREEN.ordinal()) diff --git a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java index 28420abcb5..1c5d861649 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java +++ b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java @@ -144,10 +144,12 @@ public enum ItemMapping // Bounty hunter ITEM_GRANITE_MAUL(GRANITE_MAUL, GRANITE_MAUL_12848), ITEM_MAGIC_SHORTBOW(MAGIC_SHORTBOW, MAGIC_SHORTBOW_I), + ITEM_MAGIC_SHORTBOW_SCROLL(MAGIC_SHORTBOW_SCROLL, MAGIC_SHORTBOW_I), ITEM_SARADOMINS_BLESSED_SWORD(SARADOMINS_TEAR, SARADOMINS_BLESSED_SWORD), // Jewellery with charges ITEM_RING_OF_WEALTH(RING_OF_WEALTH, RING_OF_WEALTH_I, RING_OF_WEALTH_1, RING_OF_WEALTH_I1, RING_OF_WEALTH_2, RING_OF_WEALTH_I2, RING_OF_WEALTH_3, RING_OF_WEALTH_I3, RING_OF_WEALTH_4, RING_OF_WEALTH_I4, RING_OF_WEALTH_I5), + ITEM_RING_OF_WEALTH_SCROLL(RING_OF_WEALTH_SCROLL, RING_OF_WEALTH_I, RING_OF_WEALTH_I1, RING_OF_WEALTH_I2, RING_OF_WEALTH_I3, RING_OF_WEALTH_I4, RING_OF_WEALTH_I5), ITEM_AMULET_OF_GLORY(AMULET_OF_GLORY, AMULET_OF_GLORY1, AMULET_OF_GLORY2, AMULET_OF_GLORY3, AMULET_OF_GLORY5), ITEM_AMULET_OF_GLORY_T(AMULET_OF_GLORY_T, AMULET_OF_GLORY_T1, AMULET_OF_GLORY_T2, AMULET_OF_GLORY_T3, AMULET_OF_GLORY_T5), ITEM_SKILLS_NECKLACE(SKILLS_NECKLACE, SKILLS_NECKLACE1, SKILLS_NECKLACE2, SKILLS_NECKLACE3, SKILLS_NECKLACE5), diff --git a/runelite-client/src/main/java/net/runelite/client/game/LootManager.java b/runelite-client/src/main/java/net/runelite/client/game/LootManager.java index 4dcdb918c3..e297e103c7 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/LootManager.java +++ b/runelite-client/src/main/java/net/runelite/client/game/LootManager.java @@ -109,7 +109,7 @@ public class LootManager case NpcID.LIZARD: case NpcID.ZYGOMITE: - case NpcID.ZYGOMITE_474: + case NpcID.ZYGOMITE_1024: case NpcID.ANCIENT_ZYGOMITE: // these monsters die with >0 hp, so we just look for coincident diff --git a/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java b/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java index a221d1f36c..82f76b877d 100644 --- a/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java +++ b/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java @@ -42,9 +42,11 @@ import javax.inject.Singleton; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import net.runelite.api.MenuAction; -import static net.runelite.api.MenuAction.MENU_ACTION_DEPRIORITIZE_OFFSET; +import static net.runelite.api.MenuAction.GAME_OBJECT_FIRST_OPTION; +import static net.runelite.api.MenuAction.WIDGET_DEFAULT; import net.runelite.api.MenuEntry; import net.runelite.api.NPCDefinition; +import net.runelite.api.events.ClientTick; import net.runelite.api.events.MenuEntryAdded; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.events.NpcActionChanged; @@ -147,14 +149,6 @@ public class MenuManager Collection options = managedMenuOptions.get(widgetId); MenuEntry[] menuEntries = client.getMenuEntries(); - if (menuEntries.length == 1) - { - // Menu entries reset, so priority entries should reset as well - currentPriorityEntries.clear(); - - originalTypes.clear(); - } - for (WidgetMenuOption currentMenu : options) { if (!menuContainsCustomMenu(currentMenu))//Don't add if we have already added it to this widget @@ -173,22 +167,14 @@ public class MenuManager final MenuEntry newestEntry = menuEntries[menuEntries.length - 1]; - boolean isPrio = false; for (ComparableEntry p : priorityEntries) { if (p.matches(newestEntry)) { - isPrio = true; - break; + currentPriorityEntries.add(newestEntry); } } - // If the last entry was a priority entry, keep track of it - if (isPrio) - { - currentPriorityEntries.add(newestEntry); - } - // Make a copy of the menu entries, cause you can't remove from Arrays.asList() List copy = Lists.newArrayList(menuEntries); @@ -197,88 +183,26 @@ public class MenuManager { copy.retainAll(currentPriorityEntries); - copy.add(0, CANCEL()); - } - - // Find the current entry in the swaps map - ComparableEntry swapEntry = null; - for (ComparableEntry e : swaps.keySet()) - { - if (e.matches(newestEntry)) + // This is because players existing changes walk-here target + // so without this we lose track of em + if (copy.size() != currentPriorityEntries.size()) { - swapEntry = e; - break; - } - } - - if (swapEntry != null) - { - ComparableEntry swapTarget = swaps.get(swapEntry); - - // Find the target for the swap in current menu entries - MenuEntry foundSwap = null; - for (MenuEntry entry : Lists.reverse(copy)) - { - if (swapTarget.matches(entry)) + for (MenuEntry e : currentPriorityEntries) { - foundSwap = entry; - break; - } - } - - if (foundSwap != null) - { - // This is the type for the entry we're swapping the newest with - final int foundType = foundSwap.getType(); - // This is the type for the newest entry - final int lastType = newestEntry.getType(); - - // MenuActions with an id of over 1000 get shifted to the back of the menu entry array - // They have different id's in the packet buffer though, so we got to modify them back on click - // I couldn't get this to work with objects, so we're using modified objectcomposition for that - final boolean shouldModifyFoundType = foundType >= 1000; - - final boolean shouldModifyLastType = lastType >= 1000; - - // Bitwise or so we don't end up making things left click when they shouldn't - if (shouldModifyFoundType ^ shouldModifyLastType) - { - int typeToSet; - switch (MenuAction.of(shouldModifyFoundType ? foundType : lastType)) + if (copy.contains(e)) { - case EXAMINE_ITEM_BANK_EQ: - typeToSet = MenuAction.WIDGET_DEFAULT.getId(); - break; - case GAME_OBJECT_FIFTH_OPTION: - typeToSet = MenuAction.GAME_OBJECT_FIRST_OPTION.getId(); - break; - default: - typeToSet = shouldModifyFoundType ? foundType : lastType; - break; + continue; } - if (shouldModifyFoundType) + for (MenuEntry e2 : client.getMenuEntries()) { - foundSwap.setType(typeToSet); - originalTypes.put(foundSwap, foundType); - } - else - { - newestEntry.setType(typeToSet); - originalTypes.put(newestEntry, lastType); - - // We're probably trying to make something left click, so just slap on - // the menu action deprioritize 2000-inator++ - foundSwap.setType(foundType + MENU_ACTION_DEPRIORITIZE_OFFSET); + if (e.getType() == e2.getType()) + { + e.setTarget(e2.getTarget()); + copy.add(e); + } } } - - // Swap - int index = copy.indexOf(foundSwap); - int newIndex = copy.indexOf(newestEntry); - - copy.set(index, newestEntry); - copy.set(newIndex, foundSwap); } } @@ -300,6 +224,69 @@ public class MenuManager client.setMenuEntries(copy.toArray(new MenuEntry[0])); } + @Subscribe + private void onClientTick(ClientTick event) + { + originalTypes.clear(); + client.sortMenuEntries(); + + final MenuEntry[] oldentries = client.getMenuEntries(); + MenuEntry[] newEntries; + + if (!currentPriorityEntries.isEmpty()) + { + newEntries = new MenuEntry[client.getMenuOptionCount() + 1]; + newEntries[0] = CANCEL(); + + System.arraycopy(oldentries, 0, newEntries, 1, oldentries.length); + } + else + { + newEntries = Arrays.copyOf(oldentries, client.getMenuOptionCount()); + } + + MenuEntry leftClickEntry = newEntries[newEntries.length - 1]; + + + for (ComparableEntry src : swaps.keySet()) + { + if (!src.matches(leftClickEntry)) + { + continue; + } + + ComparableEntry tgt = swaps.get(src); + + for (int i = newEntries.length - 2; i > 0; i--) + { + MenuEntry e = newEntries[i]; + + if (tgt.matches(e)) + { + newEntries[newEntries.length - 1] = e; + newEntries[i] = leftClickEntry; + + int type = e.getType(); + + if (type >= 1000) + { + int newType = getLeftClickType(type); + if (newType != -1 && newType != type) + { + e.setType(newType); + originalTypes.put(e, type); + } + } + + break; + } + } + } + + client.setMenuEntries(newEntries); + currentPriorityEntries.clear(); + } + public void addPlayerMenuItem(String menuText) { Preconditions.checkNotNull(menuText); @@ -361,6 +348,24 @@ public class MenuManager } } + private int getLeftClickType(int oldType) + { + if (oldType > 2000) + { + oldType -= 2000; + } + + switch (MenuAction.of(oldType)) + { + case GAME_OBJECT_FIFTH_OPTION: + return GAME_OBJECT_FIRST_OPTION.getId(); + case EXAMINE_ITEM_BANK_EQ: + return WIDGET_DEFAULT.getId(); + default: + return oldType; + } + } + private void addNpcOption(NPCDefinition composition, String npcOption) { String[] actions = composition.getActions(); @@ -404,69 +409,21 @@ public class MenuManager @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - // if (originalTypes.get(event.ge - // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - // This right here. That's the moment I realized once again that - // this event still is one of the worst fucking things that has - // ever happened to this project. MenuOptionClicked right? What - // do you expect the data in the event object to be? - // A FUCKING MENU ENTRY. Honestly I originally forgot why I wrote - // the rant below this, but the hate is coming back to me once again. - // What the fuck do you expect me to do? Make another MenuEntry from - // all the info WHICH WOULD HAVE BEEN INSIDE THE FUCKING MENUENTRY TO - // BEGIN WITH??? I am legit still perplexed over why someone would do - // it like this, and I don't want them to take this lightly cause they - // should really really really feel terrible about this. - - if (!event.getMenuTarget().equals("do not edit") && - !originalTypes.isEmpty() && - event.getMenuAction() == MenuAction.WIDGET_DEFAULT || - event.getMenuAction() == MenuAction.GAME_OBJECT_FIRST_OPTION) + if (originalTypes.containsKey(event.getMenuEntry()) && + !event.getTarget().equals("do not edit")) { - for (Map.Entry ent : originalTypes.entrySet()) - { - // Honestly, I was about to write a huge ass rant about - // how I hate whoever wrote the menuoptionclicked class - // but I decided that that'd be un-nice to them, and they - // probably spent over 24 hours writing it. Not because - // it was that difficult to write, of course, but because - // they must have the fucking iq of a retarded, under developed, - // braindead, basically good-for-nothing, idiotic chimp. - // - // Just kidding, of course, that would be too big of an - // insult towards those poor chimps. It's not their fault - // some dumbass is the way they are, right? Why should they - // feel bad for something they can't do anything about? - // - // Whoever wrote that class though, should actually feel - // 100% terrible. If they aren't depressed, I really wish - // they become depressed very, very soon. What the fuck - // were they even thinking. + event.consume(); - MenuEntry e = ent.getKey(); - - if (event.getMenuAction().getId() != e.getType() - || event.getId() != e.getIdentifier() - || !event.getMenuOption().equals(e.getOption())) - { - continue; - } - - event.consume(); - - client.invokeMenuAction( - event.getActionParam(), - event.getWidgetId(), - ent.getValue(), - event.getId(), - event.getMenuOption(), - "do not edit", - client.getMouseCanvasPosition().getX(), - client.getMouseCanvasPosition().getY() - ); - - break; - } + client.invokeMenuAction( + event.getActionParam0(), + event.getActionParam1(), + originalTypes.get(event.getMenuEntry()), + event.getIdentifier(), + event.getOption(), + "do not edit", + client.getMouseCanvasPosition().getX(), + client.getMouseCanvasPosition().getY() + ); } if (event.getMenuAction() != MenuAction.RUNELITE) @@ -474,31 +431,31 @@ public class MenuManager return; // not a player menu } - int widgetId = event.getWidgetId(); + int widgetId = event.getActionParam1(); Collection options = managedMenuOptions.get(widgetId); for (WidgetMenuOption curMenuOption : options) { - if (curMenuOption.getMenuTarget().equals(event.getMenuTarget()) - && curMenuOption.getMenuOption().equals(event.getMenuOption())) + if (curMenuOption.getMenuTarget().equals(event.getTarget()) + && curMenuOption.getMenuOption().equals(event.getOption())) { WidgetMenuOptionClicked customMenu = new WidgetMenuOptionClicked(); - customMenu.setMenuOption(event.getMenuOption()); - customMenu.setMenuTarget(event.getMenuTarget()); + customMenu.setMenuOption(event.getOption()); + customMenu.setMenuTarget(event.getTarget()); customMenu.setWidget(curMenuOption.getWidget()); eventBus.post(customMenu); return; // don't continue because it's not a player option } } - String target = event.getMenuTarget(); + String target = event.getTarget(); // removes tags and level from player names for example: // username (level-42) or username String username = Text.removeTags(target).split("[(]")[0].trim(); PlayerMenuOptionClicked playerMenuOptionClicked = new PlayerMenuOptionClicked(); - playerMenuOptionClicked.setMenuOption(event.getMenuOption()); + playerMenuOptionClicked.setMenuOption(event.getOption()); playerMenuOptionClicked.setMenuTarget(username); eventBus.post(playerMenuOptionClicked); diff --git a/runelite-client/src/main/java/net/runelite/client/menus/WidgetMenuOption.java b/runelite-client/src/main/java/net/runelite/client/menus/WidgetMenuOption.java index 53b28c0d92..1b630a235c 100644 --- a/runelite-client/src/main/java/net/runelite/client/menus/WidgetMenuOption.java +++ b/runelite-client/src/main/java/net/runelite/client/menus/WidgetMenuOption.java @@ -32,15 +32,15 @@ import net.runelite.client.util.ColorUtil; public final class WidgetMenuOption { /** - * The left hand text to be displayed on the menu option. Ex. the menuOption of "Drop Bones" is "Drop" + * The left hand text to be displayed on the menu option. Ex. the option of "Drop Bones" is "Drop" */ private String menuOption; /** - * The right hand text to be displayed on the menu option Ex. the menuTarget of "Drop Bones" is "Bones" + * The right hand text to be displayed on the menu option Ex. the target of "Drop Bones" is "Bones" */ private String menuTarget; /** - * The color that the menuTarget should be. Defaults to the brownish color that most menu options have. + * The color that the target should be. Defaults to the brownish color that most menu options have. */ private Color color = JagexColors.MENU_TARGET; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/Hydra.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/Hydra.java index ff979672a2..3b332f3589 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/Hydra.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/Hydra.java @@ -24,74 +24,119 @@ */ package net.runelite.client.plugins.alchemicalhydra; +import java.awt.image.BufferedImage; import javax.inject.Singleton; +import lombok.AccessLevel; import lombok.Getter; +import lombok.RequiredArgsConstructor; import lombok.Setter; import net.runelite.api.NPC; import net.runelite.api.Prayer; import net.runelite.api.ProjectileID; +import net.runelite.api.SpriteID; +import net.runelite.client.game.SpriteManager; +import net.runelite.client.util.ImageUtil; +@Getter(AccessLevel.PACKAGE) +@RequiredArgsConstructor @Singleton class Hydra { + @Getter(AccessLevel.PACKAGE) + @RequiredArgsConstructor enum AttackStyle { - MAGIC(ProjectileID.HYDRA_MAGIC, Prayer.PROTECT_FROM_MAGIC), - RANGED(ProjectileID.HYDRA_RANGED, Prayer.PROTECT_FROM_MISSILES); + MAGIC(ProjectileID.HYDRA_MAGIC, Prayer.PROTECT_FROM_MAGIC, SpriteID.PRAYER_PROTECT_FROM_MAGIC), + RANGED(ProjectileID.HYDRA_RANGED, Prayer.PROTECT_FROM_MISSILES, SpriteID.PRAYER_PROTECT_FROM_MISSILES); - @Getter - private int projId; + private final int projectileID; + private final Prayer prayer; + private final int spriteID; - @Getter - private Prayer prayer; + @Getter(AccessLevel.NONE) + private BufferedImage image; - AttackStyle(int projId, Prayer prayer) + BufferedImage getImage(SpriteManager spriteManager) { - this.projId = projId; - this.prayer = prayer; + if (image == null) + { + BufferedImage tmp = spriteManager.getSprite(spriteID, 0); + image = tmp == null ? null : ImageUtil.resizeImage(tmp, HydraOverlay.IMGSIZE, HydraOverlay.IMGSIZE); + } + + return image; } } - @Getter - private NPC npc; + private final NPC npc; - @Getter - @Setter - private HydraPhase phase; + private HydraPhase phase = HydraPhase.ONE; - @Getter - @Setter - private int attackCount; + private int attackCount = 0; + private int nextSwitch = phase.getAttacksPerSwitch(); - @Getter - @Setter - private int nextSwitch; + @Setter(AccessLevel.PACKAGE) + private int nextSpecial = 3; - @Getter - @Setter - private int nextSpecial; + private AttackStyle nextAttack = AttackStyle.MAGIC; + private AttackStyle lastAttack = AttackStyle.MAGIC; - @Getter - @Setter - private AttackStyle nextAttack; + @Setter(AccessLevel.PACKAGE) + private boolean weakened = false; - @Getter - @Setter - private AttackStyle lastAttack; - - @Getter - @Setter - private boolean weakened; - - Hydra(NPC npc) + void changePhase(HydraPhase newPhase) { - this.npc = npc; - this.phase = HydraPhase.ONE; - this.nextAttack = AttackStyle.MAGIC; - this.lastAttack = AttackStyle.MAGIC; // important, else we wouldn't switch if the first attack is ranged - this.nextSpecial = 3; - this.nextSwitch = phase.getAttacksPerSwitch(); - this.attackCount = 0; - this.weakened = false; + phase = newPhase; + nextSpecial = 3; + attackCount = 0; + weakened = false; + + if (newPhase == HydraPhase.FOUR) + { + weakened = true; + switchStyles(); + nextSwitch = phase.getAttacksPerSwitch(); + } + } + + private void switchStyles() + { + nextAttack = lastAttack == Hydra.AttackStyle.MAGIC + ? Hydra.AttackStyle.RANGED + : Hydra.AttackStyle.MAGIC; + } + + void handleAttack(int id) + { + if (id != nextAttack.getProjectileID()) + { + if (id == lastAttack.getProjectileID()) + { + // If the current attack isn't what was expected and we accidentally counted 1 too much + return; + } + + // If the current attack isn't what was expected and we should have switched prayers + switchStyles(); + nextSwitch = phase.getAttacksPerSwitch() - 1; + } + else + { + nextSwitch--; + } + + lastAttack = nextAttack; + attackCount++; + + if (nextSwitch <= 0) + { + switchStyles(); + nextSwitch = phase.getAttacksPerSwitch(); + } + } + + int getNextSpecialRelative() + { + return nextSpecial - attackCount; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraOverlay.java index 50d683c78d..e5860abcd0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraOverlay.java @@ -26,16 +26,12 @@ package net.runelite.client.plugins.alchemicalhydra; import java.awt.Color; import java.awt.Dimension; -import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.Image; import java.awt.Rectangle; -import java.awt.image.BufferedImage; import javax.inject.Inject; import javax.inject.Singleton; import net.runelite.api.Client; import net.runelite.api.Prayer; -import net.runelite.api.SpriteID; import net.runelite.client.game.SpriteManager; import net.runelite.client.ui.overlay.Overlay; import net.runelite.client.ui.overlay.OverlayPosition; @@ -46,13 +42,16 @@ import net.runelite.client.ui.overlay.components.PanelComponent; @Singleton class HydraOverlay extends Overlay { + + private static final Color RED_BG_COL = new Color(156, 0, 0, 156); + private static final Color YEL_BG_COL = new Color(200, 156, 0, 156); + private static final Color GRN_BG_COL = new Color(0, 156, 0, 156); + static final int IMGSIZE = 36; + private final HydraPlugin plugin; private final Client client; private final SpriteManager spriteManager; private final PanelComponent panelComponent = new PanelComponent(); - private static final Color redBgCol = new Color(156, 0, 0, 156); - private static final Color yelBgCol = new Color(200, 156, 0, 156); - private static final Color grnBgCol = new Color(0, 156, 0, 156); @Inject HydraOverlay(HydraPlugin plugin, Client client, SpriteManager spriteManager) @@ -76,9 +75,8 @@ class HydraOverlay extends Overlay } //Add spec overlay first, to keep it above pray - HydraPhase phase = hydra.getPhase(); - int attackCount = hydra.getAttackCount(); - int nextSpec = hydra.getNextSpecial() - attackCount; + final HydraPhase phase = hydra.getPhase(); + final int nextSpec = hydra.getNextSpecialRelative(); if (nextSpec <= 3) { @@ -86,37 +84,34 @@ class HydraOverlay extends Overlay if (nextSpec == 0) { - specComponent.setBackgroundColor(redBgCol); + specComponent.setBackgroundColor(RED_BG_COL); } else if (nextSpec == 1) { - specComponent.setBackgroundColor(yelBgCol); + specComponent.setBackgroundColor(YEL_BG_COL); } - Image specImg = scaleImg(spriteManager.getSprite(phase.getSpecImage(), 0)); - specComponent.setImage(specImg); + specComponent.setImage(phase.getSpecImage(spriteManager)); specComponent.setText(" " + (nextSpec)); //hacky way to not have to figure out how to move text specComponent.setPreferredSize(new Dimension(40, 40)); panelComponent.getChildren().add(specComponent); } - - Prayer nextPrayer = hydra.getNextAttack().getPrayer(); - Image prayImg = scaleImg(getPrayerImage(hydra.getNextAttack().getPrayer())); - int nextSwitch = hydra.getNextSwitch(); + final Prayer nextPrayer = hydra.getNextAttack().getPrayer(); + final int nextSwitch = hydra.getNextSwitch(); InfoBoxComponent prayComponent = new InfoBoxComponent(); if (nextSwitch == 1) { - prayComponent.setBackgroundColor(client.isPrayerActive(nextPrayer) ? yelBgCol : redBgCol); + prayComponent.setBackgroundColor(client.isPrayerActive(nextPrayer) ? YEL_BG_COL : RED_BG_COL); } else { - prayComponent.setBackgroundColor(client.isPrayerActive(nextPrayer) ? grnBgCol : redBgCol); + prayComponent.setBackgroundColor(client.isPrayerActive(nextPrayer) ? GRN_BG_COL : RED_BG_COL); } - prayComponent.setImage(prayImg); + prayComponent.setImage(hydra.getNextAttack().getImage(spriteManager)); prayComponent.setText(" " + nextSwitch); prayComponent.setColor(Color.white); prayComponent.setPreferredSize(new Dimension(40, 40)); @@ -126,32 +121,4 @@ class HydraOverlay extends Overlay panelComponent.setBorder(new Rectangle(0, 0, 0, 0)); return panelComponent.render(graphics2D); } - - private BufferedImage getPrayerImage(Prayer pray) - { - return pray == Prayer.PROTECT_FROM_MAGIC - ? spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0) - : spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0); - } - - private Image scaleImg(final Image img) - { - if (img == null) - { - return null; - } - final double width = img.getWidth(null); - final double height = img.getHeight(null); - final double size = 36; // Limit size to 2 as that is minimum size not causing breakage - final double scalex = size / width; - final double scaley = size / height; - final double scale = Math.min(scalex, scaley); - final int newWidth = (int) (width * scale); - final int newHeight = (int) (height * scale); - final BufferedImage scaledImage = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_ARGB); - final Graphics g = scaledImage.createGraphics(); - g.drawImage(img, 0, 0, newWidth, newHeight, null); - g.dispose(); - return scaledImage; - } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPhase.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPhase.java index 7f2db35e5b..4fa739e6d8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPhase.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPhase.java @@ -24,48 +24,46 @@ */ package net.runelite.client.plugins.alchemicalhydra; +import java.awt.image.BufferedImage; +import lombok.AccessLevel; import lombok.Getter; +import lombok.RequiredArgsConstructor; import net.runelite.api.AnimationID; import net.runelite.api.ProjectileID; import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; +import net.runelite.client.game.SpriteManager; +import net.runelite.client.util.ImageUtil; +@Getter(AccessLevel.PACKAGE) +@RequiredArgsConstructor enum HydraPhase -{ // Sorry for the autism +{ ONE(3, AnimationID.HYDRA_1_1, AnimationID.HYDRA_1_2, ProjectileID.HYDRA_POISON, 0, SpriteID.BIG_ASS_GUTHIX_SPELL, new WorldPoint(1371, 10263, 0)), TWO(3, AnimationID.HYDRA_2_1, AnimationID.HYDRA_2_2, 0, AnimationID.HYDRA_LIGHTNING, SpriteID.BIG_SPEC_TRANSFER, new WorldPoint(1371, 10272, 0)), THREE(3, AnimationID.HYDRA_3_1, AnimationID.HYDRA_3_2, 0, AnimationID.HYDRA_FIRE, SpriteID.BIG_SUPERHEAT, new WorldPoint(1362, 10272, 0)), FOUR(1, AnimationID.HYDRA_4_1, AnimationID.HYDRA_4_2, ProjectileID.HYDRA_POISON, 0, SpriteID.BIG_ASS_GUTHIX_SPELL, null); - @Getter private final int attacksPerSwitch; - - @Getter private final int deathAnim1; - - @Getter private final int deathAnim2; - - @Getter private final int specProjectileId; - - @Getter private final int specAnimationId; - @Getter - private final int specImage; + @Getter(AccessLevel.NONE) + private final int specImageID; + private final WorldPoint fountain; - @Getter - private WorldPoint fountain; + private BufferedImage specImage; - HydraPhase(int attacksPerSwitch, int deathAnim1, int deathAnim2, int specProjectileId, int specAnimationId, int specImage, WorldPoint fountain) + BufferedImage getSpecImage(SpriteManager spriteManager) { - this.attacksPerSwitch = attacksPerSwitch; - this.deathAnim1 = deathAnim1; - this.deathAnim2 = deathAnim2; - this.specProjectileId = specProjectileId; - this.specAnimationId = specAnimationId; - this.specImage = specImage; - this.fountain = fountain; + if (specImage == null) + { + BufferedImage tmp = spriteManager.getSprite(specImageID, 0); + specImage = tmp == null ? null : ImageUtil.resizeImage(tmp, HydraOverlay.IMGSIZE, HydraOverlay.IMGSIZE); + } + + return specImage; } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPlugin.java index f15e02b25d..b92b6f3875 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPlugin.java @@ -30,6 +30,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import javax.inject.Inject; +import lombok.AccessLevel; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Actor; @@ -60,10 +61,10 @@ import net.runelite.client.ui.overlay.OverlayManager; @Slf4j public class HydraPlugin extends Plugin { - @Getter + @Getter(AccessLevel.PACKAGE) private Map poisonProjectiles = new HashMap<>(); - @Getter + @Getter(AccessLevel.PACKAGE) private Hydra hydra; private boolean inHydraInstance; @@ -84,7 +85,7 @@ public class HydraPlugin extends Plugin private HydraOverlay overlay; @Inject - private HydraPoisonOverlay poisonOverlay; + private HydraSceneOverlay poisonOverlay; @Override protected void startUp() @@ -124,18 +125,16 @@ public class HydraPlugin extends Plugin } return; } - NPC hydraNpc = null; for (NPC npc : client.getNpcs()) { if (npc.getId() == NpcID.ALCHEMICAL_HYDRA) { - hydraNpc = npc; + hydra = new Hydra(npc); break; } } - hydra = new Hydra(hydraNpc); addOverlays(); } @@ -171,13 +170,13 @@ public class HydraPlugin extends Plugin switch (phase) { case ONE: - changePhase(HydraPhase.TWO); + hydra.changePhase(HydraPhase.TWO); return; case TWO: - changePhase(HydraPhase.THREE); + hydra.changePhase(HydraPhase.THREE); return; case THREE: - changePhase(HydraPhase.FOUR); + hydra.changePhase(HydraPhase.FOUR); return; case FOUR: hydra = null; @@ -237,9 +236,9 @@ public class HydraPlugin extends Plugin poisonProjectiles.put(event.getPosition(), projectile); } else if (client.getTickCount() != lastAttackTick - && (id == Hydra.AttackStyle.MAGIC.getProjId() || id == Hydra.AttackStyle.RANGED.getProjId())) + && (id == Hydra.AttackStyle.MAGIC.getProjectileID() || id == Hydra.AttackStyle.RANGED.getProjectileID())) { - handleAttack(id); + hydra.handleAttack(id); lastAttackTick = client.getTickCount(); } } @@ -271,53 +270,4 @@ public class HydraPlugin extends Plugin overlayManager.remove(overlay); overlayManager.remove(poisonOverlay); } - - private void changePhase(HydraPhase newPhase) - { - hydra.setPhase(newPhase); - hydra.setNextSpecial(3); - hydra.setAttackCount(0); - hydra.setWeakened(false); - - if (newPhase == HydraPhase.FOUR) - { - hydra.setWeakened(true); - switchStyles(); - hydra.setNextSwitch(newPhase.getAttacksPerSwitch()); - } - } - - private void switchStyles() - { - hydra.setNextAttack(hydra.getLastAttack() == Hydra.AttackStyle.MAGIC - ? Hydra.AttackStyle.RANGED - : Hydra.AttackStyle.MAGIC); - } - - private void handleAttack(int id) - { - if (id != hydra.getNextAttack().getProjId() && id != hydra.getLastAttack().getProjId()) - { // If the current attack isn't what was expected and we should have switched prayers - switchStyles(); - hydra.setNextSwitch(hydra.getPhase().getAttacksPerSwitch() - 1); - hydra.setLastAttack(hydra.getNextAttack()); - } - else if (id != hydra.getNextAttack().getProjId() && id == hydra.getLastAttack().getProjId()) - { // If the current attack isn't what was expected and we accidentally counted 1 too much - return; - } - else - { - hydra.setNextSwitch(hydra.getNextSwitch() - 1); - hydra.setLastAttack(hydra.getNextAttack()); - } - - hydra.setAttackCount(hydra.getAttackCount() + 1); - - if (hydra.getNextSwitch() <= 0) - { - switchStyles(); - hydra.setNextSwitch(hydra.getPhase().getAttacksPerSwitch()); - } - } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPoisonOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraSceneOverlay.java similarity index 91% rename from runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPoisonOverlay.java rename to runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraSceneOverlay.java index 0e72d3e399..52e02fadca 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraPoisonOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/alchemicalhydra/HydraSceneOverlay.java @@ -45,13 +45,17 @@ import net.runelite.client.ui.overlay.OverlayLayer; import net.runelite.client.ui.overlay.OverlayPosition; @Singleton -class HydraPoisonOverlay extends Overlay +class HydraSceneOverlay extends Overlay { + private static final Color GREEN = new Color(0, 255, 0, 100); + private static final Color RED = new Color(255, 0, 0, 100); + private static final Color REDFILL = new Color(255, 0, 0, 50); + private final HydraPlugin plugin; private final Client client; @Inject - public HydraPoisonOverlay(Client client, HydraPlugin plugin) + public HydraSceneOverlay(Client client, HydraPlugin plugin) { setPosition(OverlayPosition.DYNAMIC); setLayer(OverlayLayer.UNDER_WIDGETS); @@ -99,9 +103,9 @@ class HydraPoisonOverlay extends Overlay } graphics.setPaintMode(); - graphics.setColor(new Color(255, 0, 0, 100)); + graphics.setColor(RED); graphics.draw(poisonTiles); - graphics.setColor(new Color(255, 0, 0, 50)); + graphics.setColor(REDFILL); graphics.fill(poisonTiles); } @@ -133,11 +137,15 @@ class HydraPoisonOverlay extends Overlay return; } - Color color = new Color(255, 0, 0, 100); // like + Color color; // like if (hydra.getNpc().getWorldArea().intersectsWith(new WorldArea(wp, 1, 1))) // coords { // WHICH FUCKING RETARD DID X, Y, dX, dY, Z???? IT'S XYZdXdY REEEEEEEEEE - color = new Color(0, 255, 0, 100); + color = GREEN; + } + else + { + color = RED; } graphics.setColor(color); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java index 11d3ac84a8..d593b9f0aa 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java @@ -321,12 +321,12 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - if (event.getWidgetId() == WidgetInfo.BANK_ITEM_CONTAINER.getId() + if (event.getActionParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() && event.getMenuAction() == MenuAction.RUNELITE - && event.getMenuOption().startsWith(EDIT_TAGS_MENU_OPTION)) + && event.getOption().startsWith(EDIT_TAGS_MENU_OPTION)) { event.consume(); - int inventoryIndex = event.getActionParam(); + int inventoryIndex = event.getActionParam0(); ItemContainer bankContainer = client.getItemContainer(InventoryID.BANK); if (bankContainer == null) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java index eeaa5a3c3f..d2f7a4af52 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java @@ -50,6 +50,7 @@ import javax.inject.Inject; import javax.inject.Singleton; import lombok.Getter; import net.runelite.api.Client; +import net.runelite.api.Constants; import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemDefinition; @@ -230,9 +231,9 @@ public class TabInterface .filter(id -> id != -1) .collect(Collectors.toList()); - if (!Strings.isNullOrEmpty(event.getMenuTarget())) + if (!Strings.isNullOrEmpty(event.getTarget())) { - if (activeTab != null && Text.removeTags(event.getMenuTarget()).equals(activeTab.getTag())) + if (activeTab != null && Text.removeTags(event.getTarget()).equals(activeTab.getTag())) { for (Integer item : items) { @@ -564,9 +565,9 @@ public class TabInterface return; } - if (event.getWidgetId() == WidgetInfo.BANK_ITEM_CONTAINER.getId() + if (event.getActionParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() && event.getMenuAction() == MenuAction.EXAMINE_ITEM_BANK_EQ - && event.getMenuOption().equalsIgnoreCase("withdraw-x")) + && event.getOption().equalsIgnoreCase("withdraw-x")) { waitSearchTick = true; rememberedSearch = client.getVar(VarClientStr.INPUT_TEXT); @@ -575,9 +576,9 @@ public class TabInterface if (iconToSet != null) { - if (event.getMenuOption().startsWith(CHANGE_ICON + " (")) + if (event.getOption().startsWith(CHANGE_ICON + " (")) { - ItemDefinition item = getItem(event.getActionParam()); + ItemDefinition item = getItem(event.getActionParam0()); int itemId = itemManager.canonicalize(item.getId()); iconToSet.setIconItemId(itemId); iconToSet.getIcon().setItemId(itemId); @@ -590,7 +591,7 @@ public class TabInterface } if (activeTab != null - && event.getMenuOption().equals("Search") + && event.getOption().equals("Search") && client.getWidget(WidgetInfo.BANK_SEARCH_BUTTON_BACKGROUND).getSpriteId() != SpriteID.EQUIPMENT_SLOT_SELECTED) { activateTab(null); @@ -600,27 +601,27 @@ public class TabInterface client.setVar(VarClientInt.INPUT_TYPE, 0); } else if (activeTab != null - && event.getMenuOption().startsWith("View tab")) + && event.getOption().startsWith("View tab")) { activateTab(null); } else if (activeTab != null - && event.getWidgetId() == WidgetInfo.BANK_ITEM_CONTAINER.getId() + && event.getActionParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() && event.getMenuAction() == MenuAction.RUNELITE - && event.getMenuOption().startsWith(REMOVE_TAG)) + && event.getOption().startsWith(REMOVE_TAG)) { // Add "remove" menu entry to all items in bank while tab is selected event.consume(); - final ItemDefinition item = getItem(event.getActionParam()); + final ItemDefinition item = getItem(event.getActionParam0()); final int itemId = item.getId(); tagManager.removeTag(itemId, activeTab.getTag()); bankSearch.search(InputType.SEARCH, TAG_SEARCH + activeTab.getTag(), true); } else if (event.getMenuAction() == MenuAction.RUNELITE - && ((event.getWidgetId() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId() && event.getMenuOption().equals(TAG_INVENTORY)) - || (event.getWidgetId() == WidgetInfo.BANK_DEPOSIT_EQUIPMENT.getId() && event.getMenuOption().equals(TAG_GEAR)))) + && ((event.getActionParam1() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId() && event.getOption().equals(TAG_INVENTORY)) + || (event.getActionParam1() == WidgetInfo.BANK_DEPOSIT_EQUIPMENT.getId() && event.getOption().equals(TAG_GEAR)))) { - handleDeposit(event, event.getWidgetId() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId()); + handleDeposit(event, event.getActionParam1() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId()); } } @@ -730,7 +731,13 @@ public class TabInterface if (tagTab.getIcon() == null) { - Widget icon = createGraphic(ColorUtil.wrapWithColorTag(tagTab.getTag(), HILIGHT_COLOR), -1, tagTab.getIconItemId(), 36, 32, bounds.x + 3, 1, false); + Widget icon = createGraphic( + ColorUtil.wrapWithColorTag(tagTab.getTag(), HILIGHT_COLOR), + -1, + tagTab.getIconItemId(), + Constants.ITEM_SPRITE_WIDTH, Constants.ITEM_SPRITE_HEIGHT, + bounds.x + 3, 1, + false); int clickmask = icon.getClickMask(); clickmask |= WidgetConfig.DRAG; clickmask |= WidgetConfig.DRAG_ON; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banlist/BanListPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/banlist/BanListPlugin.java index 8363960a15..92371331cc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banlist/BanListPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banlist/BanListPlugin.java @@ -27,12 +27,10 @@ package net.runelite.client.plugins.banlist; import com.google.inject.Provides; - import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import javax.inject.Inject; - import lombok.extern.slf4j.Slf4j; import net.runelite.api.ChatMessageType; import net.runelite.api.ClanMember; @@ -62,12 +60,12 @@ import okhttp3.Request; import okhttp3.Response; @PluginDescriptor( - name = "Ban List", - description = "Displays warning in chat when you join a" + - "clan chat/new member join your clan chat and he is in a WDR/RuneWatch/Manual List", - tags = {"PVM", "WDR", "RuneWatch"}, - type = PluginType.UTILITY, - enabledByDefault = false + name = "Ban List", + description = "Displays warning in chat when you join a" + + "clan chat/new member join your clan chat and he is in a WDR/RuneWatch/Manual List", + tags = {"PVM", "WDR", "RuneWatch"}, + type = PluginType.UTILITY, + enabledByDefault = false ) @Slf4j @@ -137,10 +135,10 @@ public class BanListPlugin extends Plugin public void onWidgetHiddenChanged(WidgetHiddenChanged widgetHiddenChanged) { if (client.getGameState() != GameState.LOGGED_IN - || client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null - || client.getViewportWidget() == null - || client.getWidget(WidgetInfo.CLAN_CHAT) == null - || !config.highlightInClan()) + || client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null + || client.getViewportWidget() == null + || client.getWidget(WidgetInfo.CLAN_CHAT) == null + || !config.highlightInClan()) { return; } @@ -159,10 +157,21 @@ public class BanListPlugin extends Plugin public void onClanMemberJoined(ClanMemberJoined event) { ClanMember member = event.getMember(); - ListType listType = checkBanList(Text.standardize(member.getUsername())); - if (listType != null) + ListType scamList = checkScamList(Text.standardize(member.getUsername())); + ListType toxicList = checkToxicList(Text.standardize(member.getUsername())); + + if (scamList != null) { - sendWarning(Text.standardize(member.getUsername()), listType); + sendWarning(Text.standardize(member.getUsername()), scamList); + if (config.highlightInClan()) + { + highlightRedInCC(); + } + } + + if (toxicList != null) + { + sendWarning(Text.standardize(member.getUsername()), toxicList); if (config.highlightInClan()) { highlightRedInCC(); @@ -184,10 +193,14 @@ public class BanListPlugin extends Plugin { Widget tradingWith = client.getWidget(335, 31); String name = tradingWith.getText().replaceAll("Trading With: ", ""); - if (checkBanList(name) != null) + if (checkScamList(name) != null) { tradingWith.setText(tradingWith.getText().replaceAll(name, "" + name + " (Scammer)" + "")); } + if (checkToxicList(name) != null) + { + tradingWith.setText(tradingWith.getText().replaceAll(name, "" + name + " (Toxic)" + "")); + } }); } } @@ -196,7 +209,7 @@ public class BanListPlugin extends Plugin /** * Compares player name to everything in the ban lists */ - private ListType checkBanList(String nameToBeChecked) + private ListType checkScamList(String nameToBeChecked) { if (wdrScamArrayList.size() > 0 && config.enableWDR()) { @@ -206,14 +219,6 @@ public class BanListPlugin extends Plugin } } - if (wdrToxicArrayList.size() > 0 && config.enableWDR()) - { - if (wdrToxicArrayList.stream().anyMatch(nameToBeChecked::equalsIgnoreCase)) - { - return ListType.WEDORAIDSTOXIC_LIST; - } - } - if (runeWatchArrayList.size() > 0 && config.enableRuneWatch()) { if (runeWatchArrayList.stream().anyMatch(nameToBeChecked::equalsIgnoreCase)) @@ -233,6 +238,20 @@ public class BanListPlugin extends Plugin return null; } + private ListType checkToxicList(String nameToBeChecked) + { + + if (wdrToxicArrayList.size() > 0 && config.enableWDR()) + { + if (wdrToxicArrayList.stream().anyMatch(nameToBeChecked::equalsIgnoreCase)) + { + return ListType.WEDORAIDSTOXIC_LIST; + } + } + + return null; + } + /** * Sends a warning to our player, notifying them that a player is on a ban list */ @@ -242,53 +261,53 @@ public class BanListPlugin extends Plugin { case WEDORAIDSSCAM_LIST: final String wdr__scam_message = new ChatMessageBuilder() - .append(ChatColorType.HIGHLIGHT) - .append("Warning! " + playerName + " is on WeDoRaids\' scammer list!") - .build(); + .append(ChatColorType.HIGHLIGHT) + .append("Warning! " + playerName + " is on WeDoRaids\' scammer list!") + .build(); chatMessageManager.queue( - QueuedMessage.builder() - .type(ChatMessageType.CONSOLE) - .runeLiteFormattedMessage(wdr__scam_message) - .build()); + QueuedMessage.builder() + .type(ChatMessageType.CONSOLE) + .runeLiteFormattedMessage(wdr__scam_message) + .build()); break; case WEDORAIDSTOXIC_LIST: final String wdr__toxic_message = new ChatMessageBuilder() - .append(ChatColorType.HIGHLIGHT) - .append("Warning! " + playerName + " is on WeDoRaids\' toxic list!") - .build(); + .append(ChatColorType.HIGHLIGHT) + .append("Warning! " + playerName + " is on WeDoRaids\' toxic list!") + .build(); chatMessageManager.queue( - QueuedMessage.builder() - .type(ChatMessageType.CONSOLE) - .runeLiteFormattedMessage(wdr__toxic_message) - .build()); + QueuedMessage.builder() + .type(ChatMessageType.CONSOLE) + .runeLiteFormattedMessage(wdr__toxic_message) + .build()); break; case RUNEWATCH_LIST: final String rw_message = new ChatMessageBuilder() - .append(ChatColorType.HIGHLIGHT) - .append("Warning! " + playerName + " is on the Runewatch\'s scammer list!") - .build(); + .append(ChatColorType.HIGHLIGHT) + .append("Warning! " + playerName + " is on the Runewatch\'s scammer list!") + .build(); chatMessageManager.queue( - QueuedMessage.builder() - .type(ChatMessageType.CONSOLE) - .runeLiteFormattedMessage(rw_message) - .build()); + QueuedMessage.builder() + .type(ChatMessageType.CONSOLE) + .runeLiteFormattedMessage(rw_message) + .build()); break; case MANUAL_LIST: final String manual_message = new ChatMessageBuilder() - .append(ChatColorType.HIGHLIGHT) - .append("Warning! " + playerName + " is on your manual scammer list!") - .build(); + .append(ChatColorType.HIGHLIGHT) + .append("Warning! " + playerName + " is on your manual scammer list!") + .build(); chatMessageManager.queue( - QueuedMessage.builder() - .type(ChatMessageType.CONSOLE) - .runeLiteFormattedMessage(manual_message) - .build()); + QueuedMessage.builder() + .type(ChatMessageType.CONSOLE) + .runeLiteFormattedMessage(manual_message) + .build()); break; } } @@ -299,8 +318,8 @@ public class BanListPlugin extends Plugin private void fetchFromWebsites() { Request request = new Request.Builder() - .url("https://wdrdev.github.io/index") - .build(); + .url("https://wdrdev.github.io/index") + .build(); RuneLiteAPI.CLIENT.newCall(request).enqueue(new Callback() { @Override @@ -327,8 +346,8 @@ public class BanListPlugin extends Plugin Request secondRequest = new Request.Builder() - .url("https://runewatch.com/incident-index-page/") - .build(); + .url("https://runewatch.com/incident-index-page/") + .build(); RuneLiteAPI.CLIENT.newCall(secondRequest).enqueue(new Callback() { @Override @@ -356,8 +375,8 @@ public class BanListPlugin extends Plugin }); Request thirdRequest = new Request.Builder() - .url("https://wdrdev.github.io/toxic") - .build(); + .url("https://wdrdev.github.io/toxic") + .build(); RuneLiteAPI.CLIENT.newCall(thirdRequest).enqueue(new Callback() { @Override @@ -393,13 +412,18 @@ public class BanListPlugin extends Plugin Widget widget = client.getWidget(WidgetInfo.CLAN_CHAT_LIST); for (Widget widgetChild : widget.getDynamicChildren()) { - ListType listType = checkBanList(widgetChild.getText()); + ListType scamList = checkScamList(widgetChild.getText()); + ListType toxicList = checkToxicList(widgetChild.getText()); - if (listType != null) + if (scamList != null) { widgetChild.setText("" + widgetChild.getText() + ""); } + else if (toxicList != null) + { + widgetChild.setText("" + widgetChild.getText() + ""); + } } }); } -} \ No newline at end of file +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/batools/BAToolsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/batools/BAToolsPlugin.java index 138197e5e9..d7ca339124 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/batools/BAToolsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/batools/BAToolsPlugin.java @@ -707,21 +707,21 @@ public class BAToolsPlugin extends Plugin implements KeyListener @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - String target = event.getMenuTarget(); + String target = event.getTarget(); - if (config.tagging() && (event.getMenuTarget().contains("Penance Ranger") || event.getMenuTarget().contains("Penance Fighter"))) + if (config.tagging() && (event.getTarget().contains("Penance Ranger") || event.getTarget().contains("Penance Fighter"))) { - if (event.getMenuOption().contains("Attack")) + if (event.getOption().contains("Attack")) { - foodPressed.put(event.getId(), Instant.now()); + foodPressed.put(event.getIdentifier(), Instant.now()); } log.info(target); } if (config.healerMenuOption() && target.contains("Penance Healer") && target.contains("Poisoned") && target.contains("->")) { - foodPressed.put(event.getId(), Instant.now()); - lastHealer = event.getId(); + foodPressed.put(event.getIdentifier(), Instant.now()); + lastHealer = event.getIdentifier(); log.info("Last healer changed: " + lastHealer); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonSpots.java b/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonSpots.java index 7ebaed9c2b..ea145942ac 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonSpots.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonSpots.java @@ -35,7 +35,7 @@ public enum CannonSpots BLOODVELDS(new WorldPoint(2439, 9821, 0), new WorldPoint(2448, 9821, 0), new WorldPoint(2472, 9833, 0), new WorldPoint(2453, 9817, 0)), FIRE_GIANTS(new WorldPoint(2393, 9782, 0), new WorldPoint(2412, 9776, 0), new WorldPoint(2401, 9780, 0)), - ABBERANT_SPECTRES(new WorldPoint(2456, 9791, 0)), + ABERRANT_SPECTRES(new WorldPoint(2456, 9791, 0)), HELLHOUNDS(new WorldPoint(2431, 9776, 0), new WorldPoint(2413, 9786, 0), new WorldPoint(2783, 9686, 0), new WorldPoint(3198, 10071, 0)), BLACK_DEMONS(new WorldPoint(2859, 9778, 0), new WorldPoint(2841, 9791, 0)), ELVES(new WorldPoint(2044, 4635, 0)), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java index 9877ab9f71..d6ed9d888d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java @@ -168,7 +168,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - String menuOption = event.getMenuOption(); + String menuOption = event.getOption(); if (menuOption.contains(CLEAR_HISTORY)) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPlugin.java index 6399a17e48..0f9f000b28 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPlugin.java @@ -129,9 +129,12 @@ public class ChatNotificationsPlugin extends Plugin { List items = Text.fromCSV(config.highlightWordsString()); String joined = items.stream() + .map(Text::escapeJagex) // we compare these strings to the raw Jagex ones .map(Pattern::quote) .collect(Collectors.joining("|")); - highlightMatcher = Pattern.compile("\\b(" + joined + ")\\b", Pattern.CASE_INSENSITIVE); + // To match \b doesn't work due to <> not being in \w, + // so match \b or \s + highlightMatcher = Pattern.compile("(?:\\b|(?<=\\s))(" + joined + ")(?:\\b|(?=\\s))", Pattern.CASE_INSENSITIVE); } } @@ -139,7 +142,6 @@ public class ChatNotificationsPlugin extends Plugin public void onChatMessage(ChatMessage chatMessage) { MessageNode messageNode = chatMessage.getMessageNode(); - String nodeValue = Text.removeTags(messageNode.getValue()); boolean update = false; switch (chatMessage.getType()) @@ -202,6 +204,7 @@ public class ChatNotificationsPlugin extends Plugin if (highlightMatcher != null) { + String nodeValue = messageNode.getValue(); Matcher matcher = highlightMatcher.matcher(nodeValue); boolean found = false; StringBuffer stringBuffer = new StringBuffer(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/clanmanmode/ClanManModePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/clanmanmode/ClanManModePlugin.java index e5e82c8477..65f6bbe8a2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/clanmanmode/ClanManModePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/clanmanmode/ClanManModePlugin.java @@ -3,29 +3,22 @@ package net.runelite.client.plugins.clanmanmode; import com.google.inject.Provides; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.inject.Inject; import net.runelite.api.Client; import net.runelite.api.GameState; -import net.runelite.api.MenuEntry; import net.runelite.api.Player; import net.runelite.api.Varbits; import net.runelite.api.coords.WorldPoint; +import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; -import net.runelite.api.events.MenuEntryAdded; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; -import net.runelite.client.game.ClanManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginType; import net.runelite.client.ui.overlay.OverlayManager; -import net.runelite.client.util.Text; -import org.apache.commons.lang3.ArrayUtils; @PluginDescriptor( name = "Clan Man Mode", @@ -37,10 +30,6 @@ import org.apache.commons.lang3.ArrayUtils; public class ClanManModePlugin extends Plugin { - - private static final String WALK_HERE = "WALK HERE"; - private static final String CANCEL = "CANCEL"; - @Inject private OverlayManager overlayManager; @@ -59,18 +48,6 @@ public class ClanManModePlugin extends Plugin @Inject private Client client; - @Inject - private ClanManager clanManager; - - private static final String CAST = "CAST"; - private static final String ATTACK_OPTIONS_ATTACK = "ATTACK"; - public static final HashSet ATTACK_OPTIONS_KEYWORDS = new HashSet<>(); - static - { - ATTACK_OPTIONS_KEYWORDS.add(CAST); - ATTACK_OPTIONS_KEYWORDS.add(ATTACK_OPTIONS_ATTACK); - } - @Provides ClanManModeConfig provideConfig(ConfigManager configManager) { @@ -90,6 +67,7 @@ public class ClanManModePlugin extends Plugin overlayManager.add(ClanManModeOverlay); overlayManager.add(ClanManModeTileOverlay); overlayManager.add(ClanManModeMinimapOverlay); + client.setHideFriendAttackOptions(config.hideAtkOpt()); } @Override @@ -98,6 +76,7 @@ public class ClanManModePlugin extends Plugin overlayManager.remove(ClanManModeOverlay); overlayManager.remove(ClanManModeTileOverlay); overlayManager.remove(ClanManModeMinimapOverlay); + client.setHideFriendAttackOptions(false); clan.clear(); ticks = 0; wildernessLevel = 0; @@ -106,6 +85,17 @@ public class ClanManModePlugin extends Plugin inwildy = 0; } + @Subscribe + private void onConfigChanged(ConfigChanged event) + { + if (!"clanmanmode".equals(event.getGroup())) + { + return; + } + + client.setHideFriendAttackOptions(config.hideAtkOpt()); + } + @Subscribe public void onGameStateChanged(GameStateChanged gameStateChanged) { @@ -135,111 +125,4 @@ public class ClanManModePlugin extends Plugin clanmax = Collections.max(clan.values()); } } - - @Subscribe - public void onMenuEntryAdded(MenuEntryAdded event) - { - - if (client.getGameState() != GameState.LOGGED_IN) - { - return; - } - - Player[] players = client.getCachedPlayers(); - Player player = null; - int identifier = event.getIdentifier(); - - if (identifier >= 0 && identifier < players.length) - { - player = players[identifier]; - } - - if (player == null) - { - return; - } - - final String pOptionToReplace = Text.removeTags(event.getOption()).toUpperCase(); - - //If the option is already to walk there, or cancel we don't need to swap it with anything - if (pOptionToReplace.equals(CANCEL) || pOptionToReplace.equals(WALK_HERE)) - { - return; - } - - if (config.hideAtkOpt() - && ATTACK_OPTIONS_KEYWORDS.contains(pOptionToReplace) - && (player.isFriend() || player.isClanMember())) - { - swap(pOptionToReplace); - } - else if (!config.hideAtkOpt()) - { - return; - } - - final String option = Text.removeTags(event.getOption()).toLowerCase(); - - if (option.equals("attack")) - { - final Pattern ppattern = Pattern.compile("(.+?) 0) { panelComponent.getChildren().add(TitleComponent.builder() .text("Vanguards") diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/coxhelper/CoxPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/coxhelper/CoxPlugin.java index 6a2b2efe7f..975638265e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/coxhelper/CoxPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/coxhelper/CoxPlugin.java @@ -108,7 +108,7 @@ public class CoxPlugin extends Plugin @Getter(AccessLevel.PACKAGE) private boolean runOlm; @Getter(AccessLevel.PACKAGE) - private boolean runVanguard; + private int vanguards; @Getter(AccessLevel.PACKAGE) private boolean tektonActive; @Getter(AccessLevel.PACKAGE) @@ -165,13 +165,6 @@ public class CoxPlugin extends Plugin { overlayManager.add(coxOverlay); overlayManager.add(coxInfoBox); - } - - @Override - protected void shutDown() - { - overlayManager.remove(coxOverlay); - overlayManager.remove(coxInfoBox); HandCripple = false; hand = null; acidTarget = null; @@ -183,6 +176,14 @@ public class CoxPlugin extends Plugin burnTicks = 40; acidTicks = 25; teleportTicks = 10; + vanguards = 0; + } + + @Override + protected void shutDown() + { + overlayManager.remove(coxOverlay); + overlayManager.remove(coxInfoBox); } @Subscribe @@ -226,22 +227,30 @@ public class CoxPlugin extends Plugin needOlm = true; Olm_NextSpec = -1; break; - case "the great olm's left claw clenches to protect itself temporarily.": - HandCripple = true; - timer = 45; - break; case "the great olm fires a sphere of aggression your way. your prayers have been sapped.": prayAgainstOlm = PrayAgainst.MELEE; lastPrayTime = System.currentTimeMillis(); break; + case "the great olm fires a sphere of aggression your way.": + prayAgainstOlm = PrayAgainst.MELEE; + lastPrayTime = System.currentTimeMillis(); + break; case "the great olm fires a sphere of magical power your way. your prayers have been sapped.": prayAgainstOlm = PrayAgainst.MAGIC; lastPrayTime = System.currentTimeMillis(); break; + case "the great olm fires a sphere of magical power your way.": + prayAgainstOlm = PrayAgainst.MAGIC; + lastPrayTime = System.currentTimeMillis(); + break; case "the great olm fires a sphere of accuracy and dexterity your way. your prayers have been sapped.": prayAgainstOlm = PrayAgainst.RANGED; lastPrayTime = System.currentTimeMillis(); break; + case "the great olm fires a sphere of accuracy and dexterity your way.": + prayAgainstOlm = PrayAgainst.RANGED; + lastPrayTime = System.currentTimeMillis(); + break; } } @@ -316,7 +325,7 @@ public class CoxPlugin extends Plugin case NpcID.VANGUARD_7527: case NpcID.VANGUARD_7528: case NpcID.VANGUARD_7529: - runVanguard = true; + vanguards++; npcContainer.put(npc, new NPCContainer(npc)); break; case NpcID.GREAT_OLM_LEFT_CLAW: @@ -362,7 +371,7 @@ public class CoxPlugin extends Plugin { npcContainer.remove(event.getNpc()); } - runVanguard = false; + vanguards--; break; case NpcID.GREAT_OLM_RIGHT_CLAW_7553: case NpcID.GREAT_OLM_RIGHT_CLAW: @@ -513,16 +522,22 @@ public class CoxPlugin extends Plugin } break; case NpcID.VANGUARD_7529: - npcs.setAttackStyle(NPCContainer.Attackstyle.MAGE); + if (npcs.getAttackStyle() == NPCContainer.Attackstyle.UNKNOWN) + { + npcs.setAttackStyle(NPCContainer.Attackstyle.MAGE); + } break; case NpcID.VANGUARD_7528: - npcs.setAttackStyle(NPCContainer.Attackstyle.RANGE); + if (npcs.getAttackStyle() == NPCContainer.Attackstyle.UNKNOWN) + { + npcs.setAttackStyle(NPCContainer.Attackstyle.RANGE); + } break; case NpcID.VANGUARD_7527: - npcs.setAttackStyle(NPCContainer.Attackstyle.MELEE); - break; - case NpcID.VANGUARD_7526: - npcs.setAttackStyle(NPCContainer.Attackstyle.UNKNOWN); + if (npcs.getAttackStyle() == NPCContainer.Attackstyle.UNKNOWN) + { + npcs.setAttackStyle(NPCContainer.Attackstyle.MELEE); + } break; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/emojis/EmojiPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/emojis/EmojiPlugin.java index 988e73a625..21eb1eab10 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/emojis/EmojiPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/emojis/EmojiPlugin.java @@ -26,6 +26,8 @@ package net.runelite.client.plugins.emojis; import java.awt.image.BufferedImage; import java.util.Arrays; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.annotation.Nullable; import javax.inject.Inject; import joptsimple.internal.Strings; @@ -52,6 +54,8 @@ import net.runelite.client.util.ImageUtil; @Slf4j public class EmojiPlugin extends Plugin { + private static final Pattern TAG_REGEXP = Pattern.compile("<[^>]*>"); + @Inject private Client client; @@ -128,7 +132,8 @@ public class EmojiPlugin extends Plugin return; } - final String message = chatMessage.getMessage(); + final MessageNode messageNode = chatMessage.getMessageNode(); + final String message = messageNode.getValue(); final String updatedMessage = updateMessage(message); if (updatedMessage == null) @@ -136,7 +141,6 @@ public class EmojiPlugin extends Plugin return; } - final MessageNode messageNode = chatMessage.getMessageNode(); messageNode.setRuneLiteFormatMessage(updatedMessage); chatMessageManager.update(messageNode); client.refreshChat(); @@ -169,7 +173,9 @@ public class EmojiPlugin extends Plugin boolean editedMessage = false; for (int i = 0; i < messageWords.length; i++) { - final Emoji emoji = Emoji.getEmoji(messageWords[i]); + // Remove tags except for and + final String trigger = removeTags(messageWords[i]); + final Emoji emoji = Emoji.getEmoji(trigger); if (emoji == null) { @@ -178,7 +184,7 @@ public class EmojiPlugin extends Plugin final int emojiId = modIconsStart + emoji.ordinal(); - messageWords[i] = ""; + messageWords[i] = messageWords[i].replace(trigger, ""); editedMessage = true; } @@ -190,4 +196,29 @@ public class EmojiPlugin extends Plugin return Strings.join(messageWords, " "); } + + /** + * Remove tags, except for <lt> and <gt> + * + * @return + */ + private static String removeTags(String str) + { + StringBuffer stringBuffer = new StringBuffer(); + Matcher matcher = TAG_REGEXP.matcher(str); + while (matcher.find()) + { + matcher.appendReplacement(stringBuffer, ""); + String match = matcher.group(0); + switch (match) + { + case "": + case "": + stringBuffer.append(match); + break; + } + } + matcher.appendTail(stringBuffer); + return stringBuffer.toString(); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java index 389fbdfc81..ddc21c724b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java @@ -104,7 +104,7 @@ public class ExaminePlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - if (!event.getMenuOption().equals("Examine")) + if (!event.getOption().equals("Examine")) { return; } @@ -116,20 +116,20 @@ public class ExaminePlugin extends Plugin case EXAMINE_ITEM: { type = ExamineType.ITEM; - id = event.getId(); + id = event.getIdentifier(); - int widgetId = event.getWidgetId(); + int widgetId = event.getActionParam1(); int widgetGroup = TO_GROUP(widgetId); int widgetChild = TO_CHILD(widgetId); Widget widget = client.getWidget(widgetGroup, widgetChild); - WidgetItem widgetItem = widget.getWidgetItem(event.getActionParam()); + WidgetItem widgetItem = widget.getWidgetItem(event.getActionParam0()); quantity = widgetItem != null && widgetItem.getId() >= 0 ? widgetItem.getQuantity() : 1; break; } case EXAMINE_ITEM_BANK_EQ: { type = ExamineType.ITEM_BANK_EQ; - int[] qi = findItemFromWidget(event.getWidgetId(), event.getActionParam()); + int[] qi = findItemFromWidget(event.getActionParam1(), event.getActionParam0()); if (qi == null) { log.debug("Examine for item with unknown widget: {}", event); @@ -141,11 +141,11 @@ public class ExaminePlugin extends Plugin } case EXAMINE_OBJECT: type = ExamineType.OBJECT; - id = event.getId(); + id = event.getIdentifier(); break; case EXAMINE_NPC: type = ExamineType.NPC; - id = event.getId(); + id = event.getIdentifier(); break; default: return; @@ -199,26 +199,26 @@ public class ExaminePlugin extends Plugin log.debug("Got examine for {} {}: {}", pendingExamine.getType(), pendingExamine.getId(), event.getMessage()); // If it is an item, show the price of it - final ItemDefinition itemComposition; + final ItemDefinition Itemdefinition; if (pendingExamine.getType() == ExamineType.ITEM || pendingExamine.getType() == ExamineType.ITEM_BANK_EQ) { final int itemId = pendingExamine.getId(); final int itemQuantity = pendingExamine.getQuantity(); - itemComposition = itemManager.getItemDefinition(itemId); + Itemdefinition = itemManager.getItemDefinition(itemId); - if (itemComposition != null) + if (Itemdefinition != null) { - final int id = itemManager.canonicalize(itemComposition.getId()); - executor.submit(() -> getItemPrice(id, itemComposition, itemQuantity)); + final int id = itemManager.canonicalize(Itemdefinition.getId()); + executor.submit(() -> getItemPrice(id, Itemdefinition, itemQuantity)); } } else { - itemComposition = null; + Itemdefinition = null; } // Don't submit examine info for tradeable items, which we already have from the RS item api - if (itemComposition != null && itemComposition.isTradeable()) + if (Itemdefinition != null && Itemdefinition.isTradeable()) { return; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/WaveOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/WaveOverlay.java index 6421dfbcbc..2b5fdf370b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/WaveOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/WaveOverlay.java @@ -38,6 +38,7 @@ import net.runelite.client.ui.overlay.OverlayPosition; import net.runelite.client.ui.overlay.components.PanelComponent; import net.runelite.client.ui.overlay.components.TitleComponent; import net.runelite.client.ui.overlay.components.table.TableComponent; +import net.runelite.client.ui.overlay.components.table.TableAlignment; class WaveOverlay extends Overlay { @@ -97,14 +98,19 @@ class WaveOverlay extends Overlay .color(HEADER_COLOR) .build()); + TableComponent tableComponent = new TableComponent(); + tableComponent.setColumnAlignments(TableAlignment.CENTER); for (String line : buildWaveLines(waveContents)) { tableComponent.addRow(line); } - panelComponent.getChildren().add(tableComponent); + if (!tableComponent.isEmpty()) + { + panelComponent.getChildren().add(tableComponent); + } } private static Collection buildWaveLines(final Map wave) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsDrawListener.java b/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsDrawListener.java index 2ee44ed9ac..671098a333 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsDrawListener.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsDrawListener.java @@ -45,6 +45,7 @@ public class FpsDrawListener implements Runnable private static final int SAMPLE_SIZE = 4; private final FpsConfig config; + private final FpsPlugin plugin; private long targetDelay = 0; @@ -58,9 +59,10 @@ public class FpsDrawListener implements Runnable private long sleepDelay = 0; @Inject - private FpsDrawListener(FpsConfig config) + private FpsDrawListener(FpsConfig config, FpsPlugin plugin) { this.config = config; + this.plugin = plugin; reloadConfig(); } @@ -83,8 +85,8 @@ public class FpsDrawListener implements Runnable private boolean isEnforced() { - return FpsLimitMode.ALWAYS == config.limitMode() - || (FpsLimitMode.UNFOCUSED == config.limitMode() && !isFocused); + return FpsLimitMode.ALWAYS == plugin.getLimitMode() + || (FpsLimitMode.UNFOCUSED == plugin.getLimitMode() && !isFocused); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsOverlay.java index 559d0ea2d3..110a447966 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsOverlay.java @@ -50,7 +50,6 @@ import net.runelite.client.ui.overlay.OverlayUtil; public class FpsOverlay extends Overlay { // Local dependencies - private final FpsConfig config; private final Client client; private final FpsPlugin plugin; @@ -58,9 +57,8 @@ public class FpsOverlay extends Overlay private boolean isFocused = true; @Inject - private FpsOverlay(FpsPlugin plugin, FpsConfig config, Client client) + private FpsOverlay(FpsPlugin plugin, Client client) { - this.config = config; this.client = client; this.plugin = plugin; setLayer(OverlayLayer.ABOVE_WIDGETS); @@ -75,8 +73,8 @@ public class FpsOverlay extends Overlay private boolean isEnforced() { - return FpsLimitMode.ALWAYS == config.limitMode() - || (FpsLimitMode.UNFOCUSED == config.limitMode() && !isFocused); + return FpsLimitMode.ALWAYS == plugin.getLimitMode() + || (FpsLimitMode.UNFOCUSED == plugin.getLimitMode() && !isFocused); } private Color getFpsValueColor() @@ -110,7 +108,7 @@ public class FpsOverlay extends Overlay @Override public Dimension render(Graphics2D graphics) { - if (!config.drawFps() && !config.drawPing()) + if (!plugin.isDrawFps() && !plugin.isDrawPing()) { return null; } @@ -121,7 +119,7 @@ public class FpsOverlay extends Overlay int baseYOffset = (fontMetrics.getAscent() - fontMetrics.getDescent()) + 1; - if (config.drawFps()) + if (plugin.isDrawFps()) { final String fpsText = String.format("%d FPS", client.getFPS()); final int textWidth = fontMetrics.stringWidth(fpsText); @@ -132,7 +130,7 @@ public class FpsOverlay extends Overlay baseYOffset += 11; } - if (config.drawPing()) + if (plugin.isDrawPing()) { final String pingText = String.format("%dms", plugin.getPing()); final int textWidth = fontMetrics.stringWidth(pingText); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsPlugin.java index e2e3484f3b..2ef788fab8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fps/FpsPlugin.java @@ -29,6 +29,7 @@ import com.google.inject.Provides; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import lombok.AccessLevel; import lombok.Getter; import net.runelite.api.Client; import net.runelite.api.GameState; @@ -90,6 +91,15 @@ public class FpsPlugin extends Plugin private final ScheduledExecutorService pingExecutorService = new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor()); + @Getter(AccessLevel.PACKAGE) + private FpsLimitMode limitMode; + + @Getter(AccessLevel.PACKAGE) + private boolean drawFps; + + @Getter(AccessLevel.PACKAGE) + private boolean drawPing; + @Provides FpsConfig provideConfig(ConfigManager configManager) { @@ -102,6 +112,10 @@ public class FpsPlugin extends Plugin if (event.getGroup().equals(CONFIG_GROUP_KEY)) { drawListener.reloadConfig(); + + limitMode = fpsConfig.limitMode(); + drawFps = fpsConfig.drawFps(); + drawPing = fpsConfig.drawPing(); } } @@ -115,6 +129,9 @@ public class FpsPlugin extends Plugin @Override protected void startUp() throws Exception { + limitMode = fpsConfig.limitMode(); + drawFps = fpsConfig.drawFps(); + drawPing = fpsConfig.drawPing(); overlayManager.add(overlay); drawManager.registerEveryFrameListener(drawListener); drawListener.reloadConfig(); @@ -131,7 +148,7 @@ public class FpsPlugin extends Plugin private void getPingToCurrentWorld() { - if (client.getGameState().equals(GameState.LOGGED_IN) && fpsConfig.drawPing()) + if (client.getGameState().equals(GameState.LOGGED_IN) && drawPing) { ping = Ping.ping(String.format("oldschool%d.runescape.com", client.getWorld() - 300)); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersOverlay.java index 0680c1591e..87e3a0ee98 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersOverlay.java @@ -119,6 +119,11 @@ public class FreezeTimersOverlay extends Overlay String text = processTickCounter(finishedAt); int test = Integer.parseInt(text); Point poi = actor.getCanvasTextLocation(g, text, 0); + if (poi == null) + { + return false; + } + int xpoi = poi.getX(); int ypoi = poi.getY(); Point FixedPoint = new Point(xpoi, ypoi); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java index 75cc26163c..fe27938a7e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java @@ -190,20 +190,20 @@ public class FriendNotesPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - if (WidgetInfo.TO_GROUP(event.getWidgetId()) == WidgetInfo.FRIENDS_LIST.getGroupId()) + if (WidgetInfo.TO_GROUP(event.getActionParam1()) == WidgetInfo.FRIENDS_LIST.getGroupId()) { - if (Strings.isNullOrEmpty(event.getMenuTarget())) + if (Strings.isNullOrEmpty(event.getTarget())) { return; } // Handle clicks on "Add Note" or "Edit Note" - if (event.getMenuOption().equals(ADD_NOTE) || event.getMenuOption().equals(EDIT_NOTE)) + if (event.getOption().equals(ADD_NOTE) || event.getOption().equals(EDIT_NOTE)) { event.consume(); //Friends have color tags - final String sanitizedTarget = Text.toJagexName(Text.removeTags(event.getMenuTarget())); + final String sanitizedTarget = Text.toJagexName(Text.removeTags(event.getTarget())); final String note = getFriendNote(sanitizedTarget); // Open the new chatbox input dialog diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/friendtagging/FriendTaggingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/friendtagging/FriendTaggingPlugin.java index 70167aa49f..99434bcffe 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/friendtagging/FriendTaggingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/friendtagging/FriendTaggingPlugin.java @@ -162,16 +162,16 @@ public class FriendTaggingPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - if (WidgetInfo.TO_GROUP(event.getWidgetId()) == WidgetInfo.FRIENDS_LIST.getGroupId()) + if (WidgetInfo.TO_GROUP(event.getActionParam1()) == WidgetInfo.FRIENDS_LIST.getGroupId()) { - if (Strings.isNullOrEmpty(event.getMenuTarget())) + if (Strings.isNullOrEmpty(event.getTarget())) { return; } - final String sanitizedTarget = Text.removeTags(event.getMenuTarget()); + final String sanitizedTarget = Text.removeTags(event.getTarget()); - if (event.getMenuOption().equals(ADD_TAG)) + if (event.getOption().equals(ADD_TAG)) { event.consume(); final ChatboxTextInput build = chatboxPanelManager.openTextInput("Enter the tag").value("") @@ -185,7 +185,7 @@ public class FriendTaggingPlugin extends Plugin setTag(sanitizedTarget, content); }).build(); } - if (event.getMenuOption().equals(DELETE_TAG)) + if (event.getOption().equals(DELETE_TAG)) { event.consume(); client.getLogger().info(sanitizedTarget); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java index ce66dd8a8f..69f4894e93 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java @@ -46,6 +46,7 @@ class GroundItem private int offset; private boolean tradeable; private boolean isMine; + private int ticks; private int durationMillis; private boolean isAlwaysPrivate; private boolean isOwnedByPlayer; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java index 0385296120..60b984f66d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java @@ -606,4 +606,16 @@ public interface GroundItemsConfig extends Config { return false; } + + @ConfigItem( + keyName = "showTimer", + name = "Show ground item tick countdown timer", + description = "Shows how many ticks left until disappearing.", + position = 48, + parent = "miscStub" + ) + default boolean showTimer() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java index ac7f8b2f75..09ad99417c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java @@ -277,6 +277,13 @@ public class GroundItemsOverlay extends Overlay } } + if (item.getTicks() > 0 && config.showTimer()) + { + itemStringBuilder + .append(" - ") + .append(item.getTicks()); + } + final String itemString = itemStringBuilder.toString(); itemStringBuilder.setLength(0); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java index 6093650b1b..0da4ce2c94 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java @@ -69,6 +69,7 @@ import net.runelite.api.events.ItemDespawned; import net.runelite.api.events.ItemQuantityChanged; import net.runelite.api.events.ItemSpawned; import net.runelite.api.events.MenuEntryAdded; +import net.runelite.api.events.GameTick; import net.runelite.client.Notifier; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; @@ -204,6 +205,16 @@ public class GroundItemsPlugin extends Plugin collectedGroundItems.clear(); } + @Subscribe + public void onGameTick(GameTick event) + { + for (GroundItem item : collectedGroundItems.values()) + { + if (item.getTicks() == -1) continue; + item.setTicks(item.getTicks() - 1); + } + } + @Subscribe public void onConfigChanged(ConfigChanged event) { @@ -461,6 +472,7 @@ public class GroundItemsPlugin extends Plugin if (groundItem != null) { groundItem.setMine(true); + groundItem.setTicks(200); boolean shouldNotify = config.onlyShowLoot() && config.highlightedColor().equals(getHighlighted( groundItem.getName(), @@ -511,6 +523,7 @@ public class GroundItemsPlugin extends Plugin .durationMillis(durationMillis) .isAlwaysPrivate(client.isInInstancedRegion() || (!itemComposition.isTradeable() && realItemId != COINS)) .isOwnedByPlayer(tile.getWorldLocation().equals(playerLocation)) + .ticks(tile.getWorldLocation().equals(client.getLocalPlayer().getWorldLocation()) ? 200 : 100) .build(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java index d467577541..400b01bd52 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java @@ -315,13 +315,13 @@ public class GroundMarkerPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - if (!event.getMenuOption().contains(MARK) && !event.getMenuOption().contains(UNMARK)) + if (!event.getOption().contains(MARK) && !event.getOption().contains(UNMARK)) { return; } int group = 1; - Matcher m = GROUP_MATCHER.matcher(event.getMenuOption()); + Matcher m = GROUP_MATCHER.matcher(event.getOption()); if (m.matches()) { group = Integer.parseInt(m.group(1)); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hideprayers/HidePrayersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/hideprayers/HidePrayersPlugin.java index 46704631ab..d2e4bba211 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hideprayers/HidePrayersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hideprayers/HidePrayersPlugin.java @@ -36,7 +36,9 @@ import javax.inject.Inject; import net.runelite.api.Client; import net.runelite.api.GameState; import net.runelite.api.HashTable; +import net.runelite.api.Skill; import net.runelite.api.WidgetNode; +import net.runelite.api.WorldType; import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.WidgetLoaded; @@ -120,6 +122,7 @@ public class HidePrayersPlugin extends Plugin { if (event.getGameState() == GameState.LOGGED_IN) { + reallyHidePrayers(); hidePrayers(); } } @@ -506,9 +509,19 @@ public class HidePrayersPlugin extends Plugin prayerWidgets.get(9).setHidden(false); // Rapid Heal } + if (WorldType.isHighRiskWorld(client.getWorldType()) || client.getRealSkillLevel(Skill.PRAYER) <= 24) + { + prayerWidgets.get(10).setHidden(true); // Protect Item + } + else + { + prayerWidgets.get(10).setHidden(false); // Protect Item + } + switch (config.pvpprayers()) { case DISABLED: + reallyHidePrayers(); break; case PRAY1: prayerWidgets.get(0).setHidden(false); // Thick Skin @@ -521,30 +534,21 @@ public class HidePrayersPlugin extends Plugin prayerWidgets.get(6).setHidden(false); // Super Human Strength break; case PRAY16: - prayerWidgets.get(3).setHidden(false); // Sharp Eye - prayerWidgets.get(4).setHidden(false); // Mystic Will - prayerWidgets.get(5).setHidden(false); // Rock Skin - prayerWidgets.get(6).setHidden(false); // Super Human Strength - prayerWidgets.get(7).setHidden(false); // Improved Reflexed - break; case PRAY25: prayerWidgets.get(3).setHidden(false); // Sharp Eye prayerWidgets.get(4).setHidden(false); // Mystic Will prayerWidgets.get(5).setHidden(false); // Rock Skin prayerWidgets.get(6).setHidden(false); // Super Human Strength prayerWidgets.get(7).setHidden(false); // Improved Reflexed - prayerWidgets.get(10).setHidden(false); // Protect Item break; case PRAY31: prayerWidgets.get(7).setHidden(false); // Improved Reflexed - prayerWidgets.get(10).setHidden(false); // Protect Item prayerWidgets.get(11).setHidden(false); // Hawk Eye prayerWidgets.get(12).setHidden(false); // Mystic Lore prayerWidgets.get(13).setHidden(false); // Steel Skin prayerWidgets.get(14).setHidden(false); // Ultimate Strength break; case PRAY43: - prayerWidgets.get(10).setHidden(false); // Protect Item prayerWidgets.get(11).setHidden(false); // Hawk Eye prayerWidgets.get(12).setHidden(false); // Mystic Lore prayerWidgets.get(13).setHidden(false); // Steel Skin @@ -555,7 +559,6 @@ public class HidePrayersPlugin extends Plugin prayerWidgets.get(18).setHidden(false); // Protect from Melee break; case PRAY44: - prayerWidgets.get(10).setHidden(false); // Protect Item prayerWidgets.get(12).setHidden(false); // Mystic Lore prayerWidgets.get(13).setHidden(false); // Steel Skin prayerWidgets.get(14).setHidden(false); // Ultimate Strength @@ -566,7 +569,6 @@ public class HidePrayersPlugin extends Plugin prayerWidgets.get(19).setHidden(false); // Eagle Eye break; case PRAY45: - prayerWidgets.get(10).setHidden(false); // Protect Item prayerWidgets.get(13).setHidden(false); // Steel Skin prayerWidgets.get(14).setHidden(false); // Ultimate Strength prayerWidgets.get(15).setHidden(false); // Incredible Reflexes @@ -577,7 +579,6 @@ public class HidePrayersPlugin extends Plugin prayerWidgets.get(20).setHidden(false); // Mystic Might break; case PRAY52: - prayerWidgets.get(10).setHidden(false); // Protect Item prayerWidgets.get(13).setHidden(false); // Steel Skin prayerWidgets.get(14).setHidden(false); // Ultimate Strength prayerWidgets.get(15).setHidden(false); // Incredible Reflexes @@ -590,7 +591,6 @@ public class HidePrayersPlugin extends Plugin prayerWidgets.get(23).setHidden(false); // Smite break; case PRAY55: - prayerWidgets.get(10).setHidden(false); // Protect Item prayerWidgets.get(13).setHidden(false); // Steel Skin prayerWidgets.get(14).setHidden(false); // Ultimate Strength prayerWidgets.get(15).setHidden(false); // Incredible Reflexes @@ -604,7 +604,6 @@ public class HidePrayersPlugin extends Plugin prayerWidgets.get(24).setHidden(false); // Preserve break; case PRAY60: - prayerWidgets.get(10).setHidden(false); // Protect Item prayerWidgets.get(16).setHidden(false); // Protect from Magic prayerWidgets.get(17).setHidden(false); // Protect from Range prayerWidgets.get(18).setHidden(false); // Protect from Melee @@ -616,7 +615,6 @@ public class HidePrayersPlugin extends Plugin prayerWidgets.get(25).setHidden(false); // Chivalry break; case PRAY70: - prayerWidgets.get(10).setHidden(false); // Protect Item prayerWidgets.get(16).setHidden(false); // Protect from Magic prayerWidgets.get(17).setHidden(false); // Protect from Range prayerWidgets.get(18).setHidden(false); // Protect from Melee @@ -628,7 +626,6 @@ public class HidePrayersPlugin extends Plugin prayerWidgets.get(26).setHidden(false); // Piety break; case PRAY74: - prayerWidgets.get(10).setHidden(false); // Protect Item prayerWidgets.get(16).setHidden(false); // Protect from Magic prayerWidgets.get(17).setHidden(false); // Protect from Range prayerWidgets.get(18).setHidden(false); // Protect from Melee @@ -640,7 +637,6 @@ public class HidePrayersPlugin extends Plugin prayerWidgets.get(27).setHidden(false); // Rigour break; case PRAY77: - prayerWidgets.get(10).setHidden(false); // Protect Item prayerWidgets.get(16).setHidden(false); // Protect from Magic prayerWidgets.get(17).setHidden(false); // Protect from Range prayerWidgets.get(18).setHidden(false); // Protect from Melee diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoConfig.java index 1d25deef3e..bd7c2b045e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoConfig.java @@ -27,40 +27,63 @@ package net.runelite.client.plugins.inferno; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import java.awt.Color; @ConfigGroup("inferno") public interface InfernoConfig extends Config -{ + { @ConfigItem( - position = 0, - keyName = "Nibbler Overlay", - name = "Nibbler Overlay", - description = "Shows if there are any Nibblers left" + position = 0, + keyName = "Nibbler Overlay", + name = "Nibbler Overlay", + description = "Shows if there are any Nibblers left" ) default boolean displayNibblerOverlay() - { - return false; - } + { + return false; + } @ConfigItem( - position = 1, - keyName = "Prayer Helper", - name = "Prayer Helper", - description = "Tells you what to flick in how many ticks" + position = 1, + keyName = "Prayer Helper", + name = "Prayer Helper", + description = "Tells you what to flick in how many ticks" ) default boolean showPrayerHelp() - { - return false; - } - + { + return false; + } + @ConfigItem( - position = 2, - keyName = "Wave Display", - name = "Wave display", - description = "Shows monsters that will spawn on the selected wave(s)." + position = 2, + keyName = "waveDisplay", + name = "Wave display", + description = "Shows monsters that will spawn on the selected wave(s)." ) default InfernoWaveDisplayMode waveDisplay() - { - return InfernoWaveDisplayMode.BOTH; - } -} + { + return InfernoWaveDisplayMode.BOTH; + } + + @ConfigItem( + position = 3, + keyName = "getWaveOverlayHeaderColor", + name = "Wave Header", + description = "Color for Wave Header" + ) + default Color getWaveOverlayHeaderColor() + { + return Color.ORANGE; + } + + @ConfigItem( + position = 4, + keyName = "getWaveTextColor", + name = "Wave Text Color", + description = "Color for Wave Texts" + ) + default Color getWaveTextColor() + { + return Color.WHITE; + } + } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoPlugin.java index fd48d077b7..8a8549c4d5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoPlugin.java @@ -1,427 +1,477 @@ -/* - * Copyright (c) 2019, Jacky - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.inferno; - -import com.google.inject.Provides; -import java.util.ArrayList; -import java.util.EnumMap; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.annotation.Nullable; -import javax.inject.Inject; -import lombok.AccessLevel; -import lombok.Getter; -import net.runelite.api.ChatMessageType; -import net.runelite.api.Client; -import net.runelite.api.GameState; -import net.runelite.api.HeadIcon; -import net.runelite.api.NPC; -import net.runelite.api.NpcID; -import net.runelite.api.events.AnimationChanged; -import net.runelite.api.events.ChatMessage; -import net.runelite.api.events.GameStateChanged; -import net.runelite.api.events.GameTick; -import net.runelite.api.events.NpcDespawned; -import net.runelite.api.events.NpcSpawned; -import net.runelite.client.config.ConfigManager; -import net.runelite.client.eventbus.Subscribe; -import net.runelite.client.plugins.Plugin; -import net.runelite.client.plugins.PluginDescriptor; -import net.runelite.client.plugins.PluginType; -import net.runelite.client.ui.overlay.OverlayManager; -import org.apache.commons.lang3.ArrayUtils; - -@PluginDescriptor( - name = "Inferno", - description = "Inferno helper", - tags = {"combat", "overlay", "pve", "pvm"}, - type = PluginType.PVM -) -public class InfernoPlugin extends Plugin -{ - - private static final Pattern WAVE_PATTERN = Pattern.compile(".*Wave: (\\d+).*"); - private static final int MAX_MONSTERS_OF_TYPE_PER_WAVE = 6; - private static final int INFERNO_REGION = 9043; - static final int MAX_WAVE = 69; - - @Inject - private Client client; - - @Inject - private OverlayManager overlayManager; - - @Inject - private InfernoOverlay infernoOverlay; - - @Inject - private InfernoWaveOverlay waveOverlay; - - @Inject - private InfernoJadOverlay jadOverlay; - - @Inject - private InfernoInfobox infernoInfobox; - - @Inject - private InfernoNibblerOverlay nibblerOverlay; - - @Inject - private InfernoConfig config; - - @Getter - static final List> WAVES = new ArrayList<>(); - - @Getter - private int currentWave = -1; - - @Getter - private Map monsters; - - @Getter - private Map> monsterCurrentAttackMap; - - @Getter - private List nibblers; - - @Getter - private InfernoNPC[] priorityNPC; - - - @Getter(AccessLevel.PACKAGE) - @Nullable - private InfernoJadAttack attack; - - private NPC jad; - - - static - { - final InfernoWaveMonster[] waveMonsters = InfernoWaveMonster.values(); - - // Add wave 1, future waves are derived from its contents - final EnumMap waveOne = new EnumMap<>(InfernoWaveMonster.class); - waveOne.put(waveMonsters[0], 1); - WAVES.add(waveOne); - - for (int wave = 1; wave < MAX_WAVE; wave++) - { - final EnumMap prevWave = WAVES.get(wave - 1).clone(); - int maxMonsterOrdinal = -1; - - for (int i = 0; i < waveMonsters.length; i++) - { - final int ordinalMonsterQuantity = prevWave.getOrDefault(waveMonsters[i], 0); - - if (ordinalMonsterQuantity == MAX_MONSTERS_OF_TYPE_PER_WAVE) - { - maxMonsterOrdinal = i; - break; - } - } - - if (maxMonsterOrdinal >= 0) - { - prevWave.remove(waveMonsters[maxMonsterOrdinal]); - } - - final int addedMonsterOrdinal = maxMonsterOrdinal >= 0 ? maxMonsterOrdinal + 1 : 0; - final InfernoWaveMonster addedMonster = waveMonsters[addedMonsterOrdinal]; - final int addedMonsterQuantity = prevWave.getOrDefault(addedMonster, 0); - - prevWave.put(addedMonster, addedMonsterQuantity + 1); - - WAVES.add(prevWave); - } - } - - @Provides - InfernoConfig provideConfig(ConfigManager configManager) - { - return configManager.getConfig(InfernoConfig.class); - } - - @Override - protected void startUp() throws Exception - { - overlayManager.add(infernoOverlay); - overlayManager.add(infernoInfobox); - overlayManager.add(nibblerOverlay); - overlayManager.add(waveOverlay); - overlayManager.add(jadOverlay); - monsters = new HashMap<>(); - monsterCurrentAttackMap = new HashMap<>(6); - for (int i = 1; i <= 6; i++) - { - monsterCurrentAttackMap.put(i, new ArrayList<>()); - } - nibblers = new ArrayList<>(); - priorityNPC = new InfernoNPC[4]; - } - - @Override - protected void shutDown() throws Exception - { - overlayManager.remove(infernoInfobox); - overlayManager.remove(infernoOverlay); - overlayManager.remove(nibblerOverlay); - overlayManager.remove(waveOverlay); - overlayManager.remove(jadOverlay); - jad = null; - attack = null; - } - - @Subscribe - public void onNpcSpawned(NpcSpawned event) - { - if (client.getMapRegions()[0] != 9043) return; - - NPC npc = event.getNpc(); - if (isValidInfernoMob(npc)) - { - monsters.put(npc, new InfernoNPC(npc)); - System.out.println(monsters.size()); - } - if (npc.getId() == NpcID.JALNIB) - { - nibblers.add(npc); - } - - final int id = event.getNpc().getId(); - - if (id == NpcID.JALTOKJAD || id == NpcID.JALTOKJAD_7704) - { - jad = event.getNpc(); - } - } - - @Subscribe - public void onNpcDespawned(NpcDespawned event) - { - if (client.getMapRegions()[0] != 9043) return; - - NPC npc = event.getNpc(); - if (monsters.containsKey(npc)) - { - monsters.remove(npc); - System.out.println(monsters.size()); - } - - if (npc.getId() == NpcID.JALNIB) - { - nibblers.remove(npc); - } - - if (jad == event.getNpc()) - { - jad = null; - attack = null; - } - } - - @Subscribe - public void onGameStateChanged(GameStateChanged event) - { - if (event.getGameState() != GameState.LOGGED_IN) - { - return; - } - - if (!inInferno()) - { - currentWave = -1; - } - } - - @Subscribe - public void onChatMessage(ChatMessage event) - { - final Matcher waveMatcher = WAVE_PATTERN.matcher(event.getMessage()); - - if (event.getType() != ChatMessageType.GAMEMESSAGE - || !inInferno() - || !waveMatcher.matches()) - { - return; - } - - currentWave = Integer.parseInt(waveMatcher.group(1)); - } - - @Subscribe - public void onGameTick(GameTick event) - { - if (client.getMapRegions()[0] != 9043) return; - - clearMapAndPriority(); - - for (InfernoNPC monster : monsters.values()) - { - calculateDistanceToPlayer(monster); - - NPC npc = monster.getNpc(); - - // if they are not attacking but are still attacking - if (monster.isAttacking()) - { - monster.setTicksTillAttack(monster.getTicksTillAttack() - 1); - - // sets the blobs attack style - if (monster.getName().equals("blob") && monster.getTicksTillAttack() == 3 && monster.getDistanceToPlayer() <= 15) - { - if (client.getLocalPlayer().getOverheadIcon() == null) - { - monster.setAttackstyle(InfernoNPC.Attackstyle.RANDOM); - } - else if (client.getLocalPlayer().getOverheadIcon().equals(HeadIcon.MAGIC)) - { - monster.setAttackstyle(InfernoNPC.Attackstyle.RANGE); - } - else if (client.getLocalPlayer().getOverheadIcon().equals(HeadIcon.RANGED)) - { - monster.setAttackstyle(InfernoNPC.Attackstyle.MAGE); - } - } - - // we know the monster is not attacking because it should have attacked and is idling - if (monster.getTicksTillAttack() == 0) - { - if (npc.getAnimation() == -1) - { - monster.setAttacking(false); - } - else - { - // want to reset the monsters attack back to attacking - monster.attacked(); - } - } - } - else - { - // they've just attacked - if (npc.getAnimation() == monster.getAttackAnimation() || npc.getAnimation() == 7581) // special case for blob - { - monster.attacked(); - } - } - - if (monster.getTicksTillAttack() >= 1) - { - monsterCurrentAttackMap.get(monster.getTicksTillAttack()).add(monster); - } - } - - calculatePriorityNPC(); - } - - @Subscribe - public void onAnimationChanged(final AnimationChanged event) - { - if (event.getActor() != jad) - { - return; - } - - if (jad.getAnimation() == InfernoJadAttack.MAGIC.getAnimation()) - { - attack = InfernoJadAttack.MAGIC; - } - else if (jad.getAnimation() == InfernoJadAttack.RANGE.getAnimation()) - { - attack = InfernoJadAttack.RANGE; - } - } - - private void calculatePriorityNPC() - { - for (int i = 0; i < priorityNPC.length; i++) - { - ArrayList monsters = monsterCurrentAttackMap.get(i + 1); - - if ( monsters.size() == 0) continue; - - int priority = monsters.get(0).getPriority(); - - InfernoNPC infernoNPC = monsters.get(0); - - for (InfernoNPC npc : monsters) - { - if (npc.getPriority() < priority) - { - priority = npc.getPriority(); - infernoNPC = npc; - } - } - priorityNPC[i] = infernoNPC; - System.out.println("i: " + i + " " + infernoNPC.getName()); - } - } - - // TODO: blob calculator - private void calculateDistanceToPlayer(InfernoNPC monster) - { - monster.setDistanceToPlayer(client.getLocalPlayer().getWorldLocation().distanceTo(monster.getNpc().getWorldArea())); - } - - private void clearMapAndPriority() - { - for (List l : monsterCurrentAttackMap.values()) - { - l.clear(); - } - - for (int i = 0; i < priorityNPC.length; i++) - { - priorityNPC[i] = null; - } - } - - public boolean isValidInfernoMob(NPC npc) - { - // we only want the bat, blob, melee, ranger and mager - if (npc.getId() == NpcID.JALMEJRAH || - npc.getId() == NpcID.JALAK || - npc.getId() == NpcID.JALIMKOT || - npc.getId() == NpcID.JALXIL || - npc.getId() == NpcID.JALZEK) return true; - - return false; - } - - boolean inInferno() - { - return ArrayUtils.contains(client.getMapRegions(), INFERNO_REGION); - } - - static String formatMonsterQuantity(final InfernoWaveMonster monster, final int quantity) - { - return String.format("%dx %s", quantity, monster); - } - -} \ No newline at end of file +/* + * Copyright (c) 2019, Jacky + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.inferno; + +import com.google.inject.Provides; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; +import javax.inject.Inject; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import net.runelite.api.Actor; +import net.runelite.api.ChatMessageType; +import net.runelite.api.Client; +import net.runelite.api.GameState; +import net.runelite.api.HeadIcon; +import net.runelite.api.NPC; +import net.runelite.api.NpcID; +import net.runelite.api.events.AnimationChanged; +import net.runelite.api.events.ChatMessage; +import net.runelite.api.events.ConfigChanged; +import net.runelite.api.events.GameStateChanged; +import net.runelite.api.events.GameTick; +import net.runelite.api.events.NpcDespawned; +import net.runelite.api.events.NpcSpawned; +import net.runelite.client.config.ConfigManager; +import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; +import net.runelite.client.plugins.PluginType; +import net.runelite.client.ui.overlay.OverlayManager; +import org.apache.commons.lang3.ArrayUtils; + +@PluginDescriptor( + name = "Inferno", + description = "Inferno helper", + tags = {"combat", "overlay", "pve", "pvm"}, + type = PluginType.PVM +) +@Slf4j +public class InfernoPlugin extends Plugin +{ + private static final int INFERNO_REGION = 9043; + + @Inject + private Client client; + + @Inject + private OverlayManager overlayManager; + + @Inject + private InfernoOverlay infernoOverlay; + + @Inject + private InfernoWaveOverlay waveOverlay; + + @Inject + private InfernoJadOverlay jadOverlay; + + @Inject + private InfernoInfobox infernoInfobox; + + @Inject + private InfernoNibblerOverlay nibblerOverlay; + + @Inject + private InfernoConfig config; + + @Getter + private int currentWave = -1; + + @Getter + private Map monsters; + + @Getter + private Map> monsterCurrentAttackMap; + + @Getter + private List nibblers; + + @Getter + private InfernoNPC[] priorityNPC; + + + @Getter(AccessLevel.PACKAGE) + @Nullable + private InfernoJadAttack attack; + + private NPC jad; + + @Getter(AccessLevel.PACKAGE) + private int currentWaveNumber; + + private List waveMonsters; + + public InfernoPlugin() + { + waveMonsters = new ArrayList<>(); + } + + @Provides + InfernoConfig provideConfig(ConfigManager configManager) + { + return configManager.getConfig(InfernoConfig.class); + } + + @Override + protected void startUp() throws Exception + { + waveOverlay.setDisplayMode(config.waveDisplay()); + + if (isInInferno()) + { + overlayManager.add(infernoOverlay); + overlayManager.add(infernoInfobox); + overlayManager.add(nibblerOverlay); + + if (config.waveDisplay() != InfernoWaveDisplayMode.NONE) + { + overlayManager.add(waveOverlay); + } + + overlayManager.add(jadOverlay); + } + + waveOverlay.setWaveHeaderColor(config.getWaveOverlayHeaderColor()); + waveOverlay.setWaveTextColor(config.getWaveTextColor()); + + monsters = new HashMap<>(); + monsterCurrentAttackMap = new HashMap<>(6); + + for (int i = 1; i <= 6; i++) + { + monsterCurrentAttackMap.put(i, new ArrayList<>()); + } + + nibblers = new ArrayList<>(); + priorityNPC = new InfernoNPC[4]; + } + + @Override + protected void shutDown() throws Exception + { + overlayManager.remove(infernoInfobox); + overlayManager.remove(infernoOverlay); + overlayManager.remove(nibblerOverlay); + overlayManager.remove(waveOverlay); + overlayManager.remove(jadOverlay); + jad = null; + attack = null; + monsters = null; + currentWaveNumber = -1; + } + @Subscribe + private void onConfigChanged(ConfigChanged event) + { + if (!"inferno".equals(event.getGroup())) + { + return; + } + + if (event.getKey().endsWith("color")) + { + waveOverlay.setWaveHeaderColor(config.getWaveOverlayHeaderColor()); + waveOverlay.setWaveTextColor(config.getWaveTextColor()); + } + else if ("waveDisplay".equals(event.getKey())) + { + overlayManager.remove(waveOverlay); + + waveOverlay.setDisplayMode(config.waveDisplay()); + + if (isInInferno() && config.waveDisplay() != InfernoWaveDisplayMode.NONE) + { + overlayManager.add(waveOverlay); + } + } + } + + @Subscribe + public void onNpcSpawned(NpcSpawned event) + { + if (client.getMapRegions()[0] != 9043) return; + + NPC npc = event.getNpc(); + if (isValidInfernoMob(npc)) + { + monsters.put(npc, new InfernoNPC(npc)); + log.debug(String.valueOf(monsters.size())); + } + + if (npc.getId() == NpcID.JALNIB) + { + nibblers.add(npc); + } + + final int id = event.getNpc().getId(); + + if (id == NpcID.JALTOKJAD || id == NpcID.JALTOKJAD_7704) + { + jad = event.getNpc(); + } + + final Actor actor = event.getActor(); + + if (actor != null) + { + waveMonsters.add(actor); + } + } + + @Subscribe + public void onNpcDespawned(NpcDespawned event) + { + if (client.getMapRegions()[0] != 9043) return; + + NPC npc = event.getNpc(); + if (monsters.containsKey(npc)) + { + monsters.remove(npc); + log.debug(String.valueOf(monsters.size())); + } + + if (npc.getId() == NpcID.JALNIB) + { + nibblers.remove(npc); + } + + if (jad == event.getNpc()) + { + jad = null; + attack = null; + } + final Actor actor = event.getActor(); + if (actor != null) + { + waveMonsters.remove(actor); + } + } + + @Subscribe + public void onGameStateChanged(GameStateChanged event) + { + if (event.getGameState() != GameState.LOGGED_IN) + { + return; + } + + if (!isInInferno()) + { + currentWaveNumber = -1; + overlayManager.remove(infernoInfobox); + overlayManager.remove(infernoOverlay); + overlayManager.remove(nibblerOverlay); + overlayManager.remove(waveOverlay); + overlayManager.remove(jadOverlay); + } + else if (currentWaveNumber == -1) + { + currentWaveNumber = 1; + overlayManager.add(infernoOverlay); + overlayManager.add(infernoInfobox); + overlayManager.add(nibblerOverlay); + + if (config.waveDisplay() != InfernoWaveDisplayMode.NONE) + { + overlayManager.add(waveOverlay); + } + + overlayManager.add(jadOverlay); + } + } + + @Subscribe + public void onChatMessage(ChatMessage event) + { + if (!isInInferno() || event.getType() != ChatMessageType.GAMEMESSAGE) + { + return; + } + + String message = event.getMessage(); + + if (event.getMessage().contains("Wave:")) + { + message = message.substring(message.indexOf(": ") + 2); + currentWaveNumber = Integer.parseInt(message.substring(0, message.indexOf("<"))); + } + } + + @Subscribe + public void onGameTick(GameTick event) + { + if (client.getMapRegions()[0] != 9043) return; + + clearMapAndPriority(); + + for (InfernoNPC monster : monsters.values()) + { + calculateDistanceToPlayer(monster); + + NPC npc = monster.getNpc(); + + // if they are not attacking but are still attacking + if (monster.isAttacking()) + { + monster.setTicksTillAttack(monster.getTicksTillAttack() - 1); + + // sets the blobs attack style + if (monster.getName().equals("blob") && monster.getTicksTillAttack() == 3 && monster.getDistanceToPlayer() <= 15) + { + if (client.getLocalPlayer().getOverheadIcon() == null) + { + monster.setAttackstyle(InfernoNPC.Attackstyle.RANDOM); + } + else if (client.getLocalPlayer().getOverheadIcon().equals(HeadIcon.MAGIC)) + { + monster.setAttackstyle(InfernoNPC.Attackstyle.RANGE); + } + else if (client.getLocalPlayer().getOverheadIcon().equals(HeadIcon.RANGED)) + { + monster.setAttackstyle(InfernoNPC.Attackstyle.MAGE); + } + } + + // we know the monster is not attacking because it should have attacked and is idling + if (monster.getTicksTillAttack() == 0) + { + if (npc.getAnimation() == -1) + { + monster.setAttacking(false); + } + else + { + // want to reset the monsters attack back to attacking + monster.attacked(); + } + } + } + else + { + // they've just attacked + if (npc.getAnimation() == monster.getAttackAnimation() || npc.getAnimation() == 7581) // special case for blob + { + monster.attacked(); + } + } + + if (monster.getTicksTillAttack() >= 1) + { + monsterCurrentAttackMap.get(monster.getTicksTillAttack()).add(monster); + } + } + + calculatePriorityNPC(); + } + + @Subscribe + public void onAnimationChanged(final AnimationChanged event) + { + if (event.getActor() != jad) + { + return; + } + + if (jad.getAnimation() == InfernoJadAttack.MAGIC.getAnimation()) + { + attack = InfernoJadAttack.MAGIC; + } + else if (jad.getAnimation() == InfernoJadAttack.RANGE.getAnimation()) + { + attack = InfernoJadAttack.RANGE; + } + } + + private void calculatePriorityNPC() + { + for (int i = 0; i < priorityNPC.length; i++) + { + ArrayList monsters = monsterCurrentAttackMap.get(i + 1); + + if (monsters.size() == 0) continue; + + int priority = monsters.get(0).getPriority(); + + InfernoNPC infernoNPC = monsters.get(0); + + for (InfernoNPC npc : monsters) + { + if (npc.getPriority() < priority) + { + priority = npc.getPriority(); + infernoNPC = npc; + } + } + + priorityNPC[i] = infernoNPC; + + log.debug("i: " + i + " " + infernoNPC.getName()); + } + } + + // TODO: blob calculator + private void calculateDistanceToPlayer(InfernoNPC monster) + { + monster.setDistanceToPlayer(client.getLocalPlayer().getWorldLocation().distanceTo(monster.getNpc().getWorldArea())); + } + + private void clearMapAndPriority() + { + for (List l : monsterCurrentAttackMap.values()) + { + l.clear(); + } + + for (int i = 0; i < priorityNPC.length; i++) + { + priorityNPC[i] = null; + } + } + + private boolean isValidInfernoMob(NPC npc) + { + // we only want the bat, blob, melee, ranger and mager + return npc.getId() == NpcID.JALMEJRAH || + npc.getId() == NpcID.JALAK || + npc.getId() == NpcID.JALIMKOT || + npc.getId() == NpcID.JALXIL || + npc.getId() == NpcID.JALZEK; + } + + private boolean isInInferno() + { + return ArrayUtils.contains(client.getMapRegions(), INFERNO_REGION); + } + + boolean isNotFinalWave() + { + return currentWaveNumber <= 68; + } + + List getWaveMonsters() + { + return waveMonsters; + } + + int getNextWaveNumber() + { + return currentWaveNumber == -1 || currentWaveNumber == 69 ? -1 : currentWaveNumber + 1; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveDisplayMode.java b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveDisplayMode.java index 628c4e814c..96c7d12001 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveDisplayMode.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveDisplayMode.java @@ -31,7 +31,8 @@ public enum InfernoWaveDisplayMode { CURRENT("Current wave"), NEXT("Next wave"), - BOTH("Both"); + BOTH("Both"), + NONE("None"); private final String name; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveMappings.java b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveMappings.java new file mode 100644 index 0000000000..0e87b0c13b --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveMappings.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2019, Kyleeld + * Copyright (c) 2019, RuneLitePlus + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.inferno; + +import com.google.common.collect.ImmutableMap; +import java.awt.Color; +import lombok.Getter; +import net.runelite.client.ui.overlay.components.PanelComponent; +import net.runelite.client.ui.overlay.components.TitleComponent; + +class InfernoWaveMappings +{ + @Getter + private static final ImmutableMap waveMapping; + + @Getter + private static final ImmutableMap npcNameMapping; + + static + { + ImmutableMap.Builder waveMapBuilder = new ImmutableMap.Builder<>(); + + waveMapBuilder.put(1, new int[]{32, 32, 32, 85}); + waveMapBuilder.put(2, new int[]{32, 32, 32, 85, 85}); + waveMapBuilder.put(3, new int[]{32, 32, 32, 32, 32, 32}); + waveMapBuilder.put(4, new int[]{32, 32, 32, 165}); + waveMapBuilder.put(5, new int[]{32, 32, 32, 85, 165}); + waveMapBuilder.put(6, new int[]{32, 32, 32, 85, 85, 165}); + waveMapBuilder.put(7, new int[]{32, 32, 32, 165, 165}); + waveMapBuilder.put(8, new int[]{32, 32, 32, 32, 32, 32}); + waveMapBuilder.put(9, new int[]{32, 32, 32, 240}); + waveMapBuilder.put(10, new int[]{32, 32, 32, 85, 240}); + waveMapBuilder.put(11, new int[]{32, 32, 32, 85, 85, 240}); + waveMapBuilder.put(12, new int[]{32, 32, 32, 165, 240}); + waveMapBuilder.put(13, new int[]{32, 32, 32, 85, 165, 240}); + waveMapBuilder.put(14, new int[]{32, 32, 32, 85, 85, 165, 240}); + waveMapBuilder.put(15, new int[]{32, 32, 32, 165, 165, 240}); + waveMapBuilder.put(16, new int[]{32, 32, 32, 240, 240}); + waveMapBuilder.put(17, new int[]{32, 32, 32, 32, 32, 32}); + waveMapBuilder.put(18, new int[]{32, 32, 32, 370}); + waveMapBuilder.put(19, new int[]{32, 32, 32, 85, 370}); + waveMapBuilder.put(20, new int[]{32, 32, 32, 85, 85, 370}); + waveMapBuilder.put(21, new int[]{32, 32, 32, 165, 370}); + waveMapBuilder.put(22, new int[]{32, 32, 32, 85, 165, 370}); + waveMapBuilder.put(23, new int[]{32, 32, 32, 85, 85, 165, 370}); + waveMapBuilder.put(24, new int[]{32, 32, 32, 165, 165, 370}); + waveMapBuilder.put(25, new int[]{32, 32, 32, 240, 370}); + waveMapBuilder.put(26, new int[]{32, 32, 32, 85, 240, 370}); + waveMapBuilder.put(27, new int[]{32, 32, 32, 85, 85, 240, 370}); + waveMapBuilder.put(28, new int[]{32, 32, 32, 165, 240, 370}); + waveMapBuilder.put(29, new int[]{32, 32, 32, 85, 165, 240, 370}); + waveMapBuilder.put(30, new int[]{32, 32, 32, 85, 85, 165, 240, 370}); + waveMapBuilder.put(31, new int[]{32, 32, 32, 165, 165, 240, 370}); + waveMapBuilder.put(32, new int[]{32, 32, 32, 240, 240, 370}); + waveMapBuilder.put(33, new int[]{32, 32, 32, 370, 370}); + waveMapBuilder.put(34, new int[]{32, 32, 32, 32, 32, 32}); + waveMapBuilder.put(35, new int[]{32, 32, 32, 490}); + waveMapBuilder.put(36, new int[]{32, 32, 32, 85, 490}); + waveMapBuilder.put(37, new int[]{32, 32, 32, 85, 85, 490}); + waveMapBuilder.put(38, new int[]{32, 32, 32, 165, 490}); + waveMapBuilder.put(39, new int[]{32, 32, 32, 85, 165, 490}); + waveMapBuilder.put(40, new int[]{32, 32, 32, 85, 85, 165, 490}); + waveMapBuilder.put(41, new int[]{32, 32, 32, 165, 165, 490}); + waveMapBuilder.put(42, new int[]{32, 32, 32, 240, 490}); + waveMapBuilder.put(43, new int[]{32, 32, 32, 85, 240, 490}); + waveMapBuilder.put(44, new int[]{32, 32, 32, 85, 85, 240, 490}); + waveMapBuilder.put(45, new int[]{32, 32, 32, 165, 240, 490 }); + waveMapBuilder.put(46, new int[]{32, 32, 32, 85, 165, 240, 490}); + waveMapBuilder.put(47, new int[]{32, 32, 32, 85, 85, 165, 240, 490}); + waveMapBuilder.put(48, new int[]{32, 32, 32, 165, 165, 240, 490}); + waveMapBuilder.put(49, new int[]{32, 32, 32, 240, 240, 490}); + waveMapBuilder.put(50, new int[]{32, 32, 32, 370, 490}); + waveMapBuilder.put(51, new int[]{32, 32, 32, 85, 370, 490}); + waveMapBuilder.put(52, new int[]{32, 32, 32, 85, 85, 370, 490}); + waveMapBuilder.put(53, new int[]{32, 32, 32, 165, 370, 490}); + waveMapBuilder.put(54, new int[]{32, 32, 32, 85, 165, 370, 490}); + waveMapBuilder.put(55, new int[]{32, 32, 32, 85, 85, 165, 370, 490}); + waveMapBuilder.put(56, new int[]{32, 32, 32, 165, 165, 370, 490}); + waveMapBuilder.put(57, new int[]{32, 32, 32, 240, 370, 490}); + waveMapBuilder.put(58, new int[]{32, 32, 32, 85, 240, 370, 490}); + waveMapBuilder.put(59, new int[]{32, 32, 32, 85, 85, 240, 370, 490}); + waveMapBuilder.put(60, new int[]{32, 32, 32, 165, 240, 370, 490}); + waveMapBuilder.put(61, new int[]{32, 32, 32, 85, 165, 240, 370, 490}); + waveMapBuilder.put(62, new int[]{32, 32, 32, 85, 85, 165, 240, 370, 490}); + waveMapBuilder.put(63, new int[]{32, 32, 32, 165, 165, 240, 370, 490}); + waveMapBuilder.put(64, new int[]{32, 32, 32, 85, 240, 240, 370, 490}); + waveMapBuilder.put(65, new int[]{32, 32, 32, 85, 370, 370, 490}); + waveMapBuilder.put(66, new int[]{32, 32, 32, 85, 490, 490}); + waveMapBuilder.put(67, new int[]{900}); + waveMapBuilder.put(68, new int[]{900, 900, 900}); + waveMapBuilder.put(69, new int[]{1400}); + + waveMapping = waveMapBuilder.build(); + + ImmutableMap.Builder nameMapBuilder = new ImmutableMap.Builder<>(); + + nameMapBuilder.put(32, "Jal-Nib - Level 32"); + nameMapBuilder.put(85, "Jal-MejRah - Level 85"); + nameMapBuilder.put(165, "Jal-Ak - Level 165"); + nameMapBuilder.put(240, "Jal-ImKot - Level 240"); + nameMapBuilder.put(370, "Jal-Xil - Level 370"); + nameMapBuilder.put(490, "Jal-Zek - Level 490"); + nameMapBuilder.put(900, "JalTok-Jad - Level 900"); + nameMapBuilder.put(1400, "TzKal-Zuk - Level 1400"); + + npcNameMapping = nameMapBuilder.build(); + } + + static void addWaveComponent(PanelComponent panelComponent, String header, int wave, Color titleColor, Color color) + { + int[] monsters = waveMapping.get(wave); + + if (monsters == null) + { + return; + } + + panelComponent.getChildren() + .add(TitleComponent.builder() + .text(header) + .color(titleColor) + .build() + ); + + + for (int i = 0; i < monsters.length; i++) + { + int monsterType = monsters[i]; + int count = 1; + + for (; i < monsters.length - 1 && monsters[i + 1] == monsterType; i++) + { + count++; + } + + TitleComponent.TitleComponentBuilder builder = TitleComponent.builder(); + + builder.text(count + "x " + npcNameMapping.get(monsterType)); + builder.color(color); + + panelComponent.getChildren().add(builder.build()); + } + } +} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveOverlay.java index 32fb60d2f4..88e3e32766 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoWaveOverlay.java @@ -1,127 +1,69 @@ -/* - * Copyright (c) 2018, Jordan Atwood - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ package net.runelite.client.plugins.inferno; import java.awt.Color; -import java.awt.Dimension; +import com.google.inject.Inject; +import lombok.Setter; +import static net.runelite.client.plugins.inferno.InfernoWaveMappings.addWaveComponent; import java.awt.Graphics2D; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import javax.inject.Inject; -import net.runelite.client.ui.ColorScheme; -import net.runelite.client.ui.overlay.Overlay; +import net.runelite.client.ui.overlay.OverlayPriority; import net.runelite.client.ui.overlay.OverlayPosition; +import java.awt.Dimension; import net.runelite.client.ui.overlay.components.PanelComponent; -import net.runelite.client.ui.overlay.components.TitleComponent; -import net.runelite.client.ui.overlay.components.table.TableComponent; +import net.runelite.client.ui.overlay.Overlay; -class InfernoWaveOverlay extends Overlay -{ - private static final Color HEADER_COLOR = ColorScheme.BRAND_ORANGE; - - private final InfernoConfig config; +public class InfernoWaveOverlay extends Overlay + { private final InfernoPlugin plugin; + private final PanelComponent panelComponent; - private final PanelComponent panelComponent = new PanelComponent(); + @Setter + private Color waveHeaderColor; + + @Setter + private Color waveTextColor; + + @Setter + private InfernoWaveDisplayMode displayMode; @Inject - private InfernoWaveOverlay(InfernoConfig config, InfernoPlugin plugin) + InfernoWaveOverlay(final InfernoPlugin plugin) { - setPosition(OverlayPosition.TOP_RIGHT); - this.config = config; + this.panelComponent = new PanelComponent(); + this.setPosition(OverlayPosition.TOP_RIGHT); + this.setPriority(OverlayPriority.HIGH); this.plugin = plugin; + + panelComponent.setPreferredSize(new Dimension(160, 0)); } - @Override - public Dimension render(Graphics2D graphics) + public Dimension render(final Graphics2D graphics) { - if (!plugin.inInferno() - || plugin.getCurrentWave() < 0) - { - return null; - } - panelComponent.getChildren().clear(); - final int currentWave = plugin.getCurrentWave(); - final int waveIndex = currentWave - 1; - - if (config.waveDisplay() == InfernoWaveDisplayMode.CURRENT - || config.waveDisplay() == InfernoWaveDisplayMode.BOTH) + if (displayMode == InfernoWaveDisplayMode.CURRENT || + displayMode == InfernoWaveDisplayMode.BOTH) { - final Map waveContents = InfernoPlugin.getWAVES().get(waveIndex); - - addWaveInfo("Wave " + plugin.getCurrentWave(), waveContents); + addWaveComponent( + panelComponent, + "Current Wave (Wave " + plugin.getCurrentWaveNumber() + ")", + plugin.getCurrentWaveNumber(), + waveHeaderColor, + waveTextColor + ); } - if ((config.waveDisplay() == InfernoWaveDisplayMode.NEXT - || config.waveDisplay() == InfernoWaveDisplayMode.BOTH) - && currentWave != InfernoPlugin.MAX_WAVE) + if (displayMode == InfernoWaveDisplayMode.NEXT || + displayMode == InfernoWaveDisplayMode.BOTH) { - final Map waveContents = InfernoPlugin.getWAVES().get(waveIndex + 1); - - addWaveInfo("Next wave", waveContents); + addWaveComponent( + panelComponent, + "Next Wave (Wave " + plugin.getNextWaveNumber() + ")", + plugin.getNextWaveNumber(), + waveHeaderColor, + waveTextColor + ); } return panelComponent.render(graphics); } - - private void addWaveInfo(final String headerText, final Map waveContents) - { - panelComponent.getChildren().add(TitleComponent.builder() - .text(headerText) - .color(HEADER_COLOR) - .build()); - - TableComponent tableComponent = new TableComponent(); - - for (String line : buildWaveLines(waveContents)) - { - tableComponent.addRow(line); - } - - panelComponent.getChildren().add(tableComponent); - } - - private static Collection buildWaveLines(final Map wave) - { - final List> monsters = new ArrayList<>(wave.entrySet()); - monsters.sort(Map.Entry.comparingByKey()); - final List outputLines = new ArrayList<>(); - - for (Map.Entry monsterEntry : monsters) - { - final InfernoWaveMonster monster = monsterEntry.getKey(); - final int quantity = monsterEntry.getValue(); - final String line = InfernoPlugin.formatMonsterQuantity(monster, quantity); - - outputLines.add(line); - } - - return outputLines; - } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/HealthbarOverride.java b/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/HealthbarOverride.java new file mode 100644 index 0000000000..c0e844939a --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/HealthbarOverride.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2019 Hydrox6 + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.interfacestyles; + +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import static net.runelite.api.SpriteID.*; +import net.runelite.client.game.SpriteOverride; + +@RequiredArgsConstructor +enum HealthbarOverride implements SpriteOverride +{ + BACK_30PX(HEALTHBAR_DEFAULT_BACK_30PX, "back_30px.png"), + BACK_50PX(HEALTHBAR_DEFAULT_BACK_50PX, "back_30px.png"), + BACK_60PX(HEALTHBAR_DEFAULT_BACK_60PX, "back_30px.png"), + BACK_80PX(HEALTHBAR_DEFAULT_BACK_80PX, "back_90px.png"), + BACK_100PX(HEALTHBAR_DEFAULT_BACK_100PX, "back_90px.png"), + BACK_120PX(HEALTHBAR_DEFAULT_BACK_120PX, "back_90px.png"), + BACK_140PX(HEALTHBAR_DEFAULT_BACK_140PX, "back_90px.png"), + BACK_160PX(HEALTHBAR_DEFAULT_BACK_160PX, "back_90px.png"), + + FRONT_30PX(HEALTHBAR_DEFAULT_FRONT_30PX, "front_30px.png"), + FRONT_50PX(HEALTHBAR_DEFAULT_FRONT_50PX, "front_30px.png"), + FRONT_60PX(HEALTHBAR_DEFAULT_FRONT_60PX, "front_30px.png"), + FRONT_80PX(HEALTHBAR_DEFAULT_FRONT_80PX, "front_90px.png"), + FRONT_100PX(HEALTHBAR_DEFAULT_FRONT_100PX, "front_90px.png"), + FRONT_120PX(HEALTHBAR_DEFAULT_FRONT_120PX, "front_90px.png"), + FRONT_140PX(HEALTHBAR_DEFAULT_FRONT_140PX, "front_90px.png"), + FRONT_160PX(HEALTHBAR_DEFAULT_FRONT_160PX, "front_90px.png"); + + @Getter + private final int spriteId; + + private final String fileName; + + @Getter + private int padding = 1; + + private static final Map MAP; + + static + { + ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); + + for (HealthbarOverride override : values()) + { + builder.put(override.spriteId, override); + } + + MAP = builder.build(); + } + + static HealthbarOverride get(int spriteID) + { + return MAP.get(spriteID); + } + + @Override + public String getFileName() + { + return Skin.AROUND_2010.toString() + "/healthbar/" + this.fileName; + } +} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesPlugin.java index 78a82431c1..fa70dff0fc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesPlugin.java @@ -32,8 +32,6 @@ import javax.inject.Inject; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import net.runelite.api.HealthBar; -import net.runelite.api.HealthBarOverride; -import net.runelite.api.NodeCache; import net.runelite.api.SpriteID; import net.runelite.api.Sprite; import net.runelite.api.events.BeforeMenuRender; @@ -71,8 +69,6 @@ public class InterfaceStylesPlugin extends Plugin @Inject private SpriteManager spriteManager; - private HealthBarOverride healthBarOverride; - @Provides InterfaceStylesConfig provideConfig(ConfigManager configManager) { @@ -92,10 +88,7 @@ public class InterfaceStylesPlugin extends Plugin { restoreWidgetDimensions(); removeGameframe(); - healthBarOverride = null; - client.setHealthBarOverride(null); - NodeCache heathBarCache = client.getHealthBarCache(); - heathBarCache.reset(); // invalidate healthbar cache so padding resets + restoreHealthBars(); }); } @@ -117,19 +110,19 @@ public class InterfaceStylesPlugin extends Plugin @Subscribe public void onPostHealthBar(PostHealthBar postHealthBar) { - if (healthBarOverride == null || !config.hdHealthBars()) + if (!config.hdHealthBars()) { return; } HealthBar healthBar = postHealthBar.getHealthBar(); - Sprite frontSprite = healthBar.getHealthBarFrontSprite(); + HealthbarOverride override = HealthbarOverride.get(healthBar.getHealthBarFrontSpriteId()); // Check if this is the health bar we are replacing - if (frontSprite == healthBarOverride.getFrontSprite() || frontSprite == healthBarOverride.getFrontSpriteLarge()) + if (override != null) { // Increase padding to show some more green at very low hp percentages - healthBar.setPadding(1); + healthBar.setPadding(override.getPadding()); } } @@ -162,7 +155,7 @@ public class InterfaceStylesPlugin extends Plugin if (skin == config.skin()) { String file = config.skin().toString() + "/" + spriteOverride.getSpriteID() + ".png"; - Sprite spritePixels = getFileSprite(file); + Sprite spritePixels = getFileSpritePixels(file); if (spriteOverride.getSpriteID() == SpriteID.COMPASS_TEXTURE) { @@ -194,7 +187,7 @@ public class InterfaceStylesPlugin extends Plugin if (widgetOverride.getSkin() == config.skin()) { String file = config.skin().toString() + "/widget/" + widgetOverride.getName() + ".png"; - Sprite spritePixels = getFileSprite(file); + Sprite spritePixels = getFileSpritePixels(file); if (spritePixels != null) { @@ -218,7 +211,7 @@ public class InterfaceStylesPlugin extends Plugin } } - private Sprite getFileSprite(String file) + private Sprite getFileSpritePixels(String file) { try { @@ -272,31 +265,24 @@ public class InterfaceStylesPlugin extends Plugin private void overrideHealthBars() { - // Reset health bar cache to reset applied padding - NodeCache healthBarCache = client.getHealthBarCache(); - healthBarCache.reset(); - if (config.hdHealthBars()) { - String fileBase = Skin.AROUND_2010.toString() + "/healthbar/"; - - Sprite frontSprite = getFileSprite(fileBase + "front.png"); - Sprite backSprite = getFileSprite(fileBase + "back.png"); - - Sprite frontSpriteLarge = getFileSprite(fileBase + "front_large.png"); - Sprite backSpriteLarge = getFileSprite(fileBase + "back_large.png"); - - HealthBarOverride override = new HealthBarOverride(frontSprite, backSprite, frontSpriteLarge, backSpriteLarge); - healthBarOverride = override; - client.setHealthBarOverride(override); + spriteManager.addSpriteOverrides(HealthbarOverride.values()); + // Reset health bar caches to apply the override + clientThread.invokeLater(client::resetHealthBarCaches); } else { - healthBarOverride = null; - client.setHealthBarOverride(null); + restoreHealthBars(); } } + private void restoreHealthBars() + { + spriteManager.removeSpriteOverrides(HealthbarOverride.values()); + clientThread.invokeLater(client::resetHealthBarCaches); + } + private void restoreWidgetDimensions() { for (WidgetOffset widgetOffset : WidgetOffset.values()) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridConfig.java index eda6b7cbb8..33c6868c4d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridConfig.java @@ -27,6 +27,7 @@ package net.runelite.client.plugins.inventorygrid; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.Range; @ConfigGroup("inventorygrid") public interface InventoryGridConfig extends Config @@ -60,4 +61,15 @@ public interface InventoryGridConfig extends Config { return true; } + + @ConfigItem( + keyName = "dragDelay", + name = "Drag Delay", + description = "Time in ms to wait after item press before showing grid" + ) + @Range(min = 100) + default int dragDelay() + { + return 100; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java index f628f007c6..e7395f299d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java @@ -34,6 +34,7 @@ import java.awt.Point; import java.awt.Rectangle; import java.awt.image.BufferedImage; import net.runelite.api.Client; +import net.runelite.api.Constants; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; import net.runelite.api.widgets.WidgetItem; @@ -45,7 +46,6 @@ import net.runelite.client.ui.overlay.OverlayPosition; class InventoryGridOverlay extends Overlay { private static final int INVENTORY_SIZE = 28; - private static final int DRAG_DELAY = 5; private static final Color HIGHLIGHT = new Color(0, 255, 0, 45); private static final Color GRID = new Color(255, 255, 255, 45); @@ -72,7 +72,7 @@ class InventoryGridOverlay extends Overlay final Widget inventoryWidget = client.getWidget(WidgetInfo.INVENTORY); if (if1DraggingWidget == null || if1DraggingWidget != inventoryWidget - || client.getItemPressedDuration() < DRAG_DELAY) + || client.getItemPressedDuration() < config.dragDelay() / Constants.CLIENT_TICK_LENGTH) { return null; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventorysetups/InventorySetupPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventorysetups/InventorySetupPlugin.java index c6ccacac8f..fa35f2718e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventorysetups/InventorySetupPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventorysetups/InventorySetupPlugin.java @@ -32,6 +32,7 @@ import java.awt.image.BufferedImage; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; +import java.util.Map; import java.util.Objects; import javax.inject.Inject; import javax.swing.JOptionPane; @@ -102,7 +103,7 @@ public class InventorySetupPlugin extends Plugin private InventorySetupPluginPanel panel; - private HashMap inventorySetups; + private Map inventorySetups = new HashMap<>(); private NavigationButton navButton; @@ -270,7 +271,7 @@ public class InventorySetupPlugin extends Plugin final String json = configManager.getConfiguration(CONFIG_GROUP, CONFIG_KEY); if (json == null || json.isEmpty()) { - inventorySetups = new HashMap<>(); + inventorySetups.clear(); } else { @@ -280,7 +281,8 @@ public class InventorySetupPlugin extends Plugin { }.getType(); - inventorySetups = gson.fromJson(json, type); + inventorySetups.clear(); + inventorySetups.putAll(gson.fromJson(json, type)); } for (final String key : inventorySetups.keySet()) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java index 4683328550..23e518e1f5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java @@ -165,15 +165,15 @@ public class InventoryTagsPlugin extends Plugin return; } - final String selectedMenu = Text.removeTags(event.getMenuTarget()); + final String selectedMenu = Text.removeTags(event.getTarget()); - if (event.getMenuOption().equals(MENU_SET)) + if (event.getOption().equals(MENU_SET)) { - setTag(event.getId(), selectedMenu); + setTag(event.getIdentifier(), selectedMenu); } - else if (event.getMenuOption().equals(MENU_REMOVE)) + else if (event.getOption().equals(MENU_REMOVE)) { - unsetTag(event.getId()); + unsetTag(event.getIdentifier()); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventoryviewer/InventoryViewerOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventoryviewer/InventoryViewerOverlay.java index 0396ab98de..efe6df33a0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventoryviewer/InventoryViewerOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventoryviewer/InventoryViewerOverlay.java @@ -34,12 +34,14 @@ import java.awt.Rectangle; import java.awt.image.BufferedImage; import javax.inject.Inject; import net.runelite.api.Client; +import net.runelite.api.Constants; import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemDefinition; import net.runelite.api.ItemContainer; import net.runelite.api.VarClientInt; import net.runelite.client.game.ItemManager; +import static net.runelite.client.plugins.lootingbagviewer.LootingBagViewerOverlay.PLACEHOLDER_WIDTH; import net.runelite.client.ui.overlay.Overlay; import net.runelite.client.ui.overlay.OverlayPosition; import net.runelite.client.ui.overlay.components.ComponentConstants; @@ -51,9 +53,8 @@ import net.runelite.client.ui.overlay.components.TitleComponent; class InventoryViewerOverlay extends Overlay { private static final int INVENTORY_SIZE = 28; - private static final int PLACEHOLDER_WIDTH = 36; - private static final int PLACEHOLDER_HEIGHT = 32; - private static final ImageComponent PLACEHOLDER_IMAGE = new ImageComponent(new BufferedImage(PLACEHOLDER_WIDTH, PLACEHOLDER_HEIGHT, BufferedImage.TYPE_4BYTE_ABGR)); + private static final ImageComponent PLACEHOLDER_IMAGE = new ImageComponent( + new BufferedImage(Constants.ITEM_SPRITE_WIDTH, Constants.ITEM_SPRITE_HEIGHT, BufferedImage.TYPE_4BYTE_ABGR)); private final Client client; private final ItemManager itemManager; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java index 274eaab6c5..c252bc054c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java @@ -29,6 +29,7 @@ import java.awt.Dimension; import java.awt.Graphics2D; import javax.inject.Inject; import net.runelite.api.Client; +import net.runelite.api.Constants; import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemDefinition; @@ -93,6 +94,8 @@ class ItemPricesOverlay extends Overlay // Tooltip action type handling switch (action) { + case ITEM_USE_ON_WIDGET: + if (!menuEntry.getTarget().contains("High Level Alchemy") || !config.showAlchProfit()) return null; case WIDGET_DEFAULT: case ITEM_USE: case ITEM_FIRST_OPTION: @@ -194,6 +197,7 @@ class ItemPricesOverlay extends Overlay int gePrice = 0; int haPrice = 0; int haProfit = 0; + final int itemHaPrice = Math.round(itemDef.getPrice() * Constants.HIGH_ALCHEMY_MULTIPLIER); if (config.showGEPrice()) { @@ -203,9 +207,9 @@ class ItemPricesOverlay extends Overlay { haPrice = itemManager.getAlchValue(id); } - if (gePrice > 0 && haPrice > 0 && config.showAlchProfit()) + if (gePrice > 0 && itemHaPrice > 0 && config.showAlchProfit()) { - haProfit = calculateHAProfit(haPrice, gePrice); + haProfit = calculateHAProfit(itemHaPrice, gePrice); } if (gePrice > 0 || haPrice > 0) diff --git a/http-api/src/test/java/net/runelite/http/api/RuneLiteAPITest.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/AlwaysLostItem.java similarity index 53% rename from http-api/src/test/java/net/runelite/http/api/RuneLiteAPITest.java rename to runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/AlwaysLostItem.java index 42fadf4363..37066622bc 100644 --- a/http-api/src/test/java/net/runelite/http/api/RuneLiteAPITest.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/AlwaysLostItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Adam + * Copyright (c) 2018, TheStonedTurtle * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,44 +22,44 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.http.api; +package net.runelite.client.plugins.itemskeptondeath; -import java.io.IOException; -import okhttp3.Request; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import org.junit.After; -import static org.junit.Assert.assertTrue; -import org.junit.Before; -import org.junit.Test; +import com.google.common.collect.ImmutableMap; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.runelite.api.ItemID; -public class RuneLiteAPITest +/** + * Certain Items receive a white outline by Jagex as they are always lost on death. This is sometimes incorrectly + * added to Items by Jagex as the item is actually kept in non-pvp areas of the game, such as the Rune Pouch. + * + * The white outline will be added to these items when they are lost on death. + */ +@AllArgsConstructor +@Getter +enum AlwaysLostItem { - private final MockWebServer server = new MockWebServer(); + RUNE_POUCH(ItemID.RUNE_POUCH, true), + LOOTING_BAG(ItemID.LOOTING_BAG, false), + CLUE_BOX(ItemID.CLUE_BOX, false); - @Before - public void before() throws IOException + private final int itemID; + private final boolean keptOutsideOfWilderness; + + private static final ImmutableMap ID_MAP; + + static { - server.enqueue(new MockResponse().setBody("OK")); - - server.start(); + final ImmutableMap.Builder map = ImmutableMap.builder(); + for (final AlwaysLostItem p : values()) + { + map.put(p.itemID, p); + } + ID_MAP = map.build(); } - @After - public void after() throws IOException + static AlwaysLostItem getByItemID(final int itemID) { - server.shutdown(); + return ID_MAP.get(itemID); } - - @Test - public void testUserAgent() throws IOException, InterruptedException - { - Request request = new Request.Builder() - .url(server.url("/").url()) - .build(); - RuneLiteAPI.CLIENT.newCall(request).execute().close(); - - // rest of UA depends on if git is found - assertTrue(server.takeRequest().getHeader("User-Agent").startsWith("RuneLite/" + RuneLiteAPI.getVersion())); - } -} \ No newline at end of file +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/BrokenOnDeathItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/BrokenOnDeathItem.java new file mode 100644 index 0000000000..9f1fd5c95e --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/BrokenOnDeathItem.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2018, TheStonedTurtle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.itemskeptondeath; + +import com.google.common.collect.ImmutableSet; +import lombok.AllArgsConstructor; +import net.runelite.api.ItemID; + +/** + * Some non tradeable items are kept on death inside low level wilderness (1-20) but are turned into a broken variant. + * + * The non-broken variant will be shown inside the interface. + */ +@AllArgsConstructor +enum BrokenOnDeathItem +{ + // Capes + FIRE_CAPE(ItemID.FIRE_CAPE), + FIRE_MAX_CAPE(ItemID.FIRE_MAX_CAPE), + INFERNAL_CAPE(ItemID.INFERNAL_CAPE), + INFERNAL_MAX_CAPE(ItemID.INFERNAL_MAX_CAPE), + AVAS_ASSEMBLER(ItemID.AVAS_ASSEMBLER), + ASSEMBLER_MAX_CAPE(ItemID.ASSEMBLER_MAX_CAPE), + + // Defenders + BRONZE_DEFENDER(ItemID.BRONZE_DEFENDER), + IRON_DEFENDER(ItemID.IRON_DEFENDER), + STEEL_DEFENDER(ItemID.STEEL_DEFENDER), + BLACK_DEFENDER(ItemID.BLACK_DEFENDER), + MITHRIL_DEFENDER(ItemID.MITHRIL_DEFENDER), + ADAMANT_DEFENDER(ItemID.ADAMANT_DEFENDER), + RUNE_DEFENDER(ItemID.RUNE_DEFENDER), + DRAGON_DEFENDER(ItemID.DRAGON_DEFENDER), + AVERNIC_DEFENDER(ItemID.AVERNIC_DEFENDER), + + // Void + VOID_MAGE_HELM(ItemID.VOID_MAGE_HELM), + VOID_RANGER_HELM(ItemID.VOID_RANGER_HELM), + VOID_MELEE_HELM(ItemID.VOID_MELEE_HELM), + VOID_KNIGHT_TOP(ItemID.VOID_KNIGHT_TOP), + VOID_KNIGHT_ROBE(ItemID.VOID_KNIGHT_ROBE), + VOID_KNIGHT_GLOVES(ItemID.VOID_KNIGHT_GLOVES), + VOID_KNIGHT_MACE(ItemID.VOID_KNIGHT_MACE), + ELITE_VOID_TOP(ItemID.ELITE_VOID_TOP), + ELITE_VOID_ROBE(ItemID.ELITE_VOID_ROBE), + + // Barb Assault + FIGHTER_HAT(ItemID.FIGHTER_HAT), + RANGER_HAT(ItemID.RANGER_HAT), + HEALER_HAT(ItemID.HEALER_HAT), + FIGHTER_TORSO(ItemID.FIGHTER_TORSO), + PENANCE_SKIRT(ItemID.PENANCE_SKIRT), + + // Castle Wars + SARADOMIN_HALO(ItemID.SARADOMIN_HALO), + ZAMORAK_HALO(ItemID.ZAMORAK_HALO), + GUTHIX_HALO(ItemID.GUTHIX_HALO), + DECORATIVE_MAGIC_HAT(ItemID.DECORATIVE_ARMOUR_11898), + DECORATIVE_MAGIC_ROBE_TOP(ItemID.DECORATIVE_ARMOUR_11896), + DECORATIVE_MAGIC_ROBE_LEGS(ItemID.DECORATIVE_ARMOUR_11897), + DECORATIVE_RANGE_TOP(ItemID.DECORATIVE_ARMOUR_11899), + DECORATIVE_RANGE_BOTTOM(ItemID.DECORATIVE_ARMOUR_11900), + DECORATIVE_RANGE_QUIVER(ItemID.DECORATIVE_ARMOUR_11901), + GOLD_DECORATIVE_HELM(ItemID.DECORATIVE_HELM_4511), + GOLD_DECORATIVE_BODY(ItemID.DECORATIVE_ARMOUR_4509), + GOLD_DECORATIVE_LEGS(ItemID.DECORATIVE_ARMOUR_4510), + GOLD_DECORATIVE_SKIRT(ItemID.DECORATIVE_ARMOUR_11895), + GOLD_DECORATIVE_SHIELD(ItemID.DECORATIVE_SHIELD_4512), + GOLD_DECORATIVE_SWORD(ItemID.DECORATIVE_SWORD_4508); + + private final int itemID; + + private static final ImmutableSet ID_SET; + + static + { + final ImmutableSet.Builder set = new ImmutableSet.Builder<>(); + for (final BrokenOnDeathItem p : values()) + { + set.add(p.itemID); + } + ID_SET = set.build(); + } + + static boolean isBrokenOnDeath(final int itemID) + { + return ID_SET.contains(itemID); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/FixedPriceItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/FixedPriceItem.java new file mode 100644 index 0000000000..a40851dc65 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/FixedPriceItem.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2019, Adam + * Copyright (c) 2019, TheStonedTurtle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.itemskeptondeath; + +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import javax.annotation.Nullable; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.runelite.api.ItemID; + +/** + * Some items have a fixed price that is added to its default value when calculating death prices. + * These are typically imbued items, such as Berserker ring (i), to help it protect over the non-imbued variants. + */ +@AllArgsConstructor +@Getter +enum FixedPriceItem +{ + IMBUED_BLACK_MASK_I(ItemID.BLACK_MASK_I, 5000), + IMBUED_BLACK_MASK_1_I(ItemID.BLACK_MASK_1_I, 5000), + IMBUED_BLACK_MASK_2_I(ItemID.BLACK_MASK_2_I, 5000), + IMBUED_BLACK_MASK_3_I(ItemID.BLACK_MASK_3_I, 5000), + IMBUED_BLACK_MASK_4_I(ItemID.BLACK_MASK_4_I, 5000), + IMBUED_BLACK_MASK_5_I(ItemID.BLACK_MASK_5_I, 5000), + IMBUED_BLACK_MASK_6_I(ItemID.BLACK_MASK_6_I, 5000), + IMBUED_BLACK_MASK_7_I(ItemID.BLACK_MASK_7_I, 5000), + IMBUED_BLACK_MASK_8_I(ItemID.BLACK_MASK_8_I, 5000), + IMBUED_BLACK_MASK_9_I(ItemID.BLACK_MASK_9_I, 5000), + IMBUED_BLACK_MASK_10_I(ItemID.BLACK_MASK_10_I, 5000), + + IMBUED_SLAYER_HELMET_I(ItemID.SLAYER_HELMET_I, 1000), + IMBUED_BLACK_SLAYER_HELMET_I(ItemID.BLACK_SLAYER_HELMET_I, 1000), + IMBUED_PURPLE_SLAYER_HELMET_I(ItemID.PURPLE_SLAYER_HELMET_I, 1000), + IMBUED_RED_SLAYER_HELMET_I(ItemID.RED_SLAYER_HELMET_I, 1000), + IMBUED_GREEN_SLAYER_HELMET_I(ItemID.GREEN_SLAYER_HELMET_I, 1000), + IMBUED_TURQUOISE_SLAYER_HELMET_I(ItemID.TURQUOISE_SLAYER_HELMET_I, 1000), + IMBUED_HYDRA_SLAYER_HELMET_I(ItemID.HYDRA_SLAYER_HELMET_I, 1000), + + IMBUED_ARCHERS_RING_I(ItemID.ARCHERS_RING_I, 2000), + IMBUED_BERSERKER_RING_I(ItemID.BERSERKER_RING_I, 2000), + IMBUED_SEERS_RING_I(ItemID.SEERS_RING_I, 2000), + + IMBUED_RING_OF_THE_GODS_I(ItemID.RING_OF_THE_GODS_I, 2000), + IMBUED_TREASONOUS_RING_I(ItemID.TREASONOUS_RING_I, 2000), + IMBUED_TYRANNICAL_RING_I(ItemID.TYRANNICAL_RING_I, 2000); + + private final int itemId; + private final int offset; + + private static final Map FIXED_ITEMS; + + static + { + final ImmutableMap.Builder map = ImmutableMap.builder(); + for (final FixedPriceItem p : values()) + { + map.put(p.itemId, p); + } + FIXED_ITEMS = map.build(); + } + + @Nullable + static FixedPriceItem find(int itemId) + { + return FIXED_ITEMS.get(itemId); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPlugin.java new file mode 100644 index 0000000000..ee761ad9a9 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPlugin.java @@ -0,0 +1,610 @@ +/* + * Copyright (c) 2018, TheStonedTurtle + * Copyright (c) 2019, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.itemskeptondeath; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.EnumSet; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.inject.Inject; +import lombok.extern.slf4j.Slf4j; +import net.runelite.api.Client; +import net.runelite.api.Constants; +import net.runelite.api.FontID; +import net.runelite.api.InventoryID; +import net.runelite.api.Item; +import net.runelite.api.ItemDefinition; +import net.runelite.api.ItemContainer; +import net.runelite.api.ItemID; +import net.runelite.api.ScriptID; +import net.runelite.api.SkullIcon; +import net.runelite.api.SpriteID; +import net.runelite.api.Varbits; +import net.runelite.api.WorldType; +import net.runelite.api.events.ScriptCallbackEvent; +import net.runelite.api.vars.AccountType; +import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetInfo; +import net.runelite.api.widgets.WidgetType; +import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.game.ItemManager; +import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; +import net.runelite.client.util.StackFormatter; + +@PluginDescriptor( + name = "Items Kept on Death", + description = "Updates the Items Kept on Death interface to be more accurate", + enabledByDefault = false +) +@Slf4j +public class ItemsKeptOnDeathPlugin extends Plugin +{ + private static final int DEEP_WILDY = 20; + private static final Pattern WILDERNESS_LEVEL_PATTERN = Pattern.compile("^Level: (\\d+).*"); + + // Item Container helpers + private static final int MAX_ROW_ITEMS = 8; + private static final int ITEM_X_OFFSET = 5; + private static final int ITEM_Y_OFFSET = 25; + private static final int ITEM_X_STRIDE = 38; + private static final int ITEM_Y_STRIDE = 38; + private static final int ORIGINAL_LOST_HEIGHT = 209; + private static final int ORIGINAL_LOST_Y = 107; + + // Information panel text helpers + private static final String LINE_BREAK = "
    "; + private static final int INFORMATION_CONTAINER_HEIGHT = 183; + private static final int FONT_COLOR = 0xFF981F; + + // Button Images + private static final int PROTECT_ITEM_SPRITE_ID = SpriteID.PRAYER_PROTECT_ITEM; + private static final int SKULL_SPRITE_ID = SpriteID.PLAYER_KILLER_SKULL_523; + private static final int SWORD_SPRITE_ID = SpriteID.MULTI_COMBAT_ZONE_CROSSED_SWORDS; + private static final int SKULL_2_SPRITE_ID = SpriteID.FIGHT_PITS_WINNER_SKULL_RED; + + @Inject + private Client client; + + @Inject + private ItemManager itemManager; + + private WidgetButton deepWildyButton; + private WidgetButton lowWildyButton; + + private boolean isSkulled; + private boolean protectingItem; + private int wildyLevel; + + @Subscribe + public void onScriptCallbackEvent(ScriptCallbackEvent event) + { + if (event.getEventName().equals("itemsKeptOnDeath")) + { + // The script in charge of building the Items Kept on Death interface has finished running. + // Make all necessary changes now. + + // Players inside Safe Areas (POH/Clan Wars) or playing DMM see the default interface + if (isInSafeArea() || client.getWorldType().contains(WorldType.DEADMAN)) + { + return; + } + + syncSettings(); + createWidgetButtons(); + rebuildItemsKeptOnDeathInterface(); + + final Widget keptText = client.getWidget(WidgetInfo.ITEMS_KEPT_ON_DEATH_TEXT); + keptText.setText("Items you will keep on death:"); + + final Widget lostText = client.getWidget(WidgetInfo.ITEMS_LOST_ON_DEATH_TEXT); + lostText.setText("Items you will lose on death:"); + } + } + + // Sync user settings + private void syncSettings() + { + final SkullIcon s = client.getLocalPlayer().getSkullIcon(); + // Ultimate iron men deaths are treated like they are always skulled + isSkulled = s == SkullIcon.SKULL || isUltimateIronman(); + protectingItem = client.getVar(Varbits.PRAYER_PROTECT_ITEM) == 1; + syncWildernessLevel(); + } + + private void syncWildernessLevel() + { + if (client.getVar(Varbits.IN_WILDERNESS) != 1) + { + // if they are in a PvP world and not in a safe zone act like in lvl 1 wildy + if (isInPvpWorld() && !isInPvPSafeZone()) + { + wildyLevel = 1; + return; + } + wildyLevel = -1; + return; + } + + final Widget wildernessLevelWidget = client.getWidget(WidgetInfo.PVP_WILDERNESS_LEVEL); + if (wildernessLevelWidget == null) + { + wildyLevel = -1; + return; + } + + final String wildernessLevelText = wildernessLevelWidget.getText(); + final Matcher m = WILDERNESS_LEVEL_PATTERN.matcher(wildernessLevelText); + if (!m.matches()) + { + wildyLevel = -1; + return; + } + + wildyLevel = Integer.parseInt(m.group(1)); + } + + private boolean isInPvpWorld() + { + final EnumSet world = client.getWorldType(); + return world.contains(WorldType.PVP); + } + + private boolean isProtectItemAllowed() + { + return !client.getWorldType().contains(WorldType.HIGH_RISK) + && !isUltimateIronman(); + } + + private boolean isInPvPSafeZone() + { + final Widget w = client.getWidget(WidgetInfo.PVP_WORLD_SAFE_ZONE); + return w != null && !w.isHidden(); + } + + private boolean isInSafeArea() + { + final Widget w = client.getWidget(WidgetInfo.ITEMS_KEPT_SAFE_ZONE_CONTAINER); + return w != null && !w.isHidden(); + } + + private boolean isUltimateIronman() + { + return client.getAccountType() == AccountType.ULTIMATE_IRONMAN; + } + + private int getDefaultItemsKept() + { + final int count = isSkulled ? 0 : 3; + return count + (protectingItem ? 1 : 0); + } + + private void rebuildItemsKeptOnDeathInterface() + { + final Widget lost = client.getWidget(WidgetInfo.ITEMS_LOST_ON_DEATH_CONTAINER); + final Widget kept = client.getWidget(WidgetInfo.ITEMS_KEPT_ON_DEATH_CONTAINER); + if (lost == null || kept == null) + { + return; + } + + lost.deleteAllChildren(); + kept.deleteAllChildren(); + + // Grab all items on player + final ItemContainer inventory = client.getItemContainer(InventoryID.INVENTORY); + final Item[] inv = inventory == null ? new Item[0] : inventory.getItems(); + final ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT); + final Item[] equip = equipment == null ? new Item[0] : equipment.getItems(); + + final List items = new ArrayList<>(); + Collections.addAll(items, inv); + Collections.addAll(items, equip); + + // Sort by item price + items.sort(Comparator.comparing(this::getDeathPrice).reversed()); + + boolean hasAlwaysLost = false; + int keepCount = getDefaultItemsKept(); + + final List keptItems = new ArrayList<>(); + final List lostItems = new ArrayList<>(); + for (final Item i : items) + { + final int id = i.getId(); + int itemQuantity = i.getQuantity(); + + if (id == -1) + { + continue; + } + + final ItemDefinition c = itemManager.getItemDefinition(i.getId()); + + // Bonds are always kept and do not count towards the limit. + if (id == ItemID.OLD_SCHOOL_BOND || id == ItemID.OLD_SCHOOL_BOND_UNTRADEABLE) + { + final Widget itemWidget = createItemWidget(kept, itemQuantity, c); + itemWidget.setOnOpListener(ScriptID.DEATH_KEEP_ITEM_EXAMINE, 1, itemQuantity, c.getName()); + keptItems.add(itemWidget); + continue; + } + + // Certain items are always lost on death and have a white outline which we need to add + final AlwaysLostItem alwaysLostItem = AlwaysLostItem.getByItemID(i.getId()); + if (alwaysLostItem != null) + { + // Some of these items are kept on death (outside wildy), like the Rune pouch. Ignore them + if (!alwaysLostItem.isKeptOutsideOfWilderness() || wildyLevel > 0) + { + final Widget itemWidget = createItemWidget(lost, itemQuantity, c); + itemWidget.setOnOpListener(ScriptID.DEATH_KEEP_ITEM_EXAMINE, 0, itemQuantity, c.getName()); + itemWidget.setBorderType(2); // white outline + lostItems.add(itemWidget); + hasAlwaysLost = true; + continue; + } + // the rune pouch is "always lost" but its kept outside of pvp, and does not count towards your keep count + } + else if (keepCount > 0) + { + // Keep most valuable items regardless of trade-ability. + if (i.getQuantity() > keepCount) + { + final Widget itemWidget = createItemWidget(kept, keepCount, c); + itemWidget.setOnOpListener(ScriptID.DEATH_KEEP_ITEM_EXAMINE, 1, keepCount, c.getName()); + keptItems.add(itemWidget); + itemQuantity -= keepCount; + keepCount = 0; + // Fall through to below to drop the rest of the stack + } + else + { + final Widget itemWidget = createItemWidget(kept, itemQuantity, c); + itemWidget.setOnOpListener(ScriptID.DEATH_KEEP_ITEM_EXAMINE, 1, itemQuantity, c.getName()); + keptItems.add(itemWidget); + keepCount -= i.getQuantity(); + continue; + } + } + + // Items are kept if: + // 1) is not tradeable + // 2) is under the deep wilderness line + // 3) is outside of the wilderness, or item has a broken form + if (!Pets.isPet(id) + && !isTradeable(c) && wildyLevel <= DEEP_WILDY + && (wildyLevel <= 0 || BrokenOnDeathItem.isBrokenOnDeath(i.getId()))) + { + final Widget itemWidget = createItemWidget(kept, itemQuantity, c); + itemWidget.setOnOpListener(ScriptID.DEATH_KEEP_ITEM_EXAMINE, 1, itemQuantity, c.getName()); + keptItems.add(itemWidget); + } + else + { + // Otherwise, the item is lost + final Widget itemWidget = createItemWidget(lost, itemQuantity, c); + itemWidget.setOnOpListener(ScriptID.DEATH_KEEP_ITEM_EXAMINE, 0, itemQuantity, c.getName()); + lostItems.add(itemWidget); + } + } + + int rows = (keptItems.size() + MAX_ROW_ITEMS - 1) / MAX_ROW_ITEMS; + // Show an empty row if there isn't anything + if (rows > 0) + { + // ORIGINAL_LOST_Y/HEIGHT includes a row already + rows--; + } + // Adjust items lost container position if new rows were added to kept items container + lost.setOriginalY(ORIGINAL_LOST_Y + (rows * ITEM_Y_STRIDE)); + lost.setOriginalHeight(ORIGINAL_LOST_HEIGHT - (rows * ITEM_Y_STRIDE)); + positionWidgetItems(kept, keptItems); + positionWidgetItems(lost, lostItems); + + updateKeptWidgetInfoText(hasAlwaysLost, keptItems, lostItems); + } + + /** + * Get the price of an item + * @param item + * @return + */ + private int getDeathPrice(Item item) + { + int itemId = item.getId(); + // Unnote/unplaceholder item + int canonicalizedItemId = itemManager.canonicalize(itemId); + int exchangePrice = itemManager.getItemPrice(canonicalizedItemId); + if (exchangePrice == 0) + { + final ItemDefinition c1 = itemManager.getItemDefinition(canonicalizedItemId); + exchangePrice = c1.getPrice(); + } + else + { + // Some items have artifically applied death prices - such as ring imbues + // which are +2k over the non imbues. Check if the item has a fixed price. + FixedPriceItem fixedPrice = FixedPriceItem.find(canonicalizedItemId); + if (fixedPrice != null) + { + // Apply fixed price offset + exchangePrice += fixedPrice.getOffset(); + } + } + return exchangePrice; + } + + /** + * Position a list of widget items in the parent container + */ + private static void positionWidgetItems(final Widget parent, final List widgets) + { + int startingIndex = 0; + for (final Widget w : widgets) + { + final int originalX = ITEM_X_OFFSET + ((startingIndex % MAX_ROW_ITEMS) * ITEM_X_STRIDE); + final int originalY = ITEM_Y_OFFSET + ((startingIndex / MAX_ROW_ITEMS) * ITEM_Y_STRIDE); + + w.setOriginalX(originalX); + w.setOriginalY(originalY); + w.revalidate(); + + ++startingIndex; + } + + parent.revalidate(); + } + + /** + * Creates the text to be displayed in the right side of the interface based on current selections + */ + private String getInfoText(final boolean hasAlwaysLost) + { + final StringBuilder sb = new StringBuilder(); + if (isUltimateIronman()) + { + sb.append("You are an UIM which means 0 items are protected by default"); + } + else + { + sb.append("3 items protected by default"); + + if (isSkulled) + { + sb.append(LINE_BREAK) + .append("PK skull -3"); + } + + if (protectingItem) + { + sb.append(LINE_BREAK) + .append("Protect Item prayer +1"); + } + + sb.append(LINE_BREAK) + .append(String.format("Actually protecting %s items", getDefaultItemsKept())); + } + + + if (wildyLevel < 1) + { + sb.append(LINE_BREAK) + .append(LINE_BREAK) + .append("You will have 1 hour to retrieve your lost items."); + } + + if (hasAlwaysLost) + { + sb.append(LINE_BREAK) + .append(LINE_BREAK) + .append("Items with a white outline will always be lost."); + } + + sb.append(LINE_BREAK) + .append(LINE_BREAK) + .append("Untradeable items are kept on death in non-pvp scenarios."); + + return sb.toString(); + } + + /** + * Updates the information panel based on the item containers + */ + private void updateKeptWidgetInfoText(final boolean hasAlwaysLost, final List keptItems, final List lostItems) + { + // Add Information text widget + final Widget textWidget = findOrCreateInfoText(); + textWidget.setText(getInfoText(hasAlwaysLost)); + textWidget.revalidate(); + + // Update Items lost total value + long total = 0; + for (final Widget w : lostItems) + { + int cid = itemManager.canonicalize(w.getItemId()); + int price = itemManager.getItemPrice(cid); + if (price == 0) + { + // Default to alch price + price = (int) (itemManager.getItemDefinition(cid).getPrice() * Constants.HIGH_ALCHEMY_MULTIPLIER); + } + total += (long) price * w.getItemQuantity(); + } + final Widget lostValue = client.getWidget(WidgetInfo.ITEMS_LOST_VALUE); + lostValue.setText(StackFormatter.quantityToStackSize(total) + " gp"); + + // Update Max items kept + final Widget max = client.getWidget(WidgetInfo.ITEMS_KEPT_MAX); + final int keptQty = keptItems.stream().mapToInt(Widget::getItemQuantity).sum(); + max.setText(String.format("Max items kept on death:

    ~ %d ~", keptQty)); + } + + /** + * Check if an item is tradeable to another player + * + * @param c The item + * @return + */ + private static boolean isTradeable(final ItemDefinition c) + { + // ItemDefinition:: isTradeable checks if they are traded on the grand exchange, some items are trade-able but not via GE + if (c.getNote() != -1 + || c.getLinkedNoteId() != -1 + || c.isTradeable()) + { + return true; + } + + final int id = c.getId(); + switch (id) + { + case ItemID.COINS_995: + case ItemID.PLATINUM_TOKEN: + return true; + default: + return false; + } + } + + private Widget findOrCreateInfoText() + { + // The text was on the ITEMS_KEPT_INFORMATION_CONTAINER widget - but now that it is a layer, + // we need to create a child widget to hold the text + final Widget parent = client.getWidget(WidgetInfo.ITEMS_KEPT_INFORMATION_CONTAINER); + + // Use the text TEXT widget if it already exists. It should be the last child of the parent + final Widget[] children = parent.getChildren(); + if (children != null && children.length > 0) + { + final Widget w = parent.getChild(children.length - 1); + if (w != null && w.getType() == WidgetType.TEXT) + { + log.debug("Reusing old text widget"); + return w; + } + } + + log.debug("Creating new text widget"); + + final Widget w = parent.createChild(-1, WidgetType.TEXT); + // Position under buttons taking remaining space + w.setOriginalWidth(parent.getOriginalWidth()); + w.setOriginalHeight(INFORMATION_CONTAINER_HEIGHT - parent.getOriginalHeight()); + w.setOriginalY(parent.getOriginalHeight()); + + w.setFontId(FontID.PLAIN_11); + w.setTextShadowed(true); + w.setTextColor(FONT_COLOR); + + // Need to adjust parent height so text is visible + parent.setOriginalHeight(INFORMATION_CONTAINER_HEIGHT); + parent.revalidate(); + + return w; + } + + private void createWidgetButtons() + { + final Widget parent = client.getWidget(WidgetInfo.ITEMS_KEPT_INFORMATION_CONTAINER); + // Change the information container from a text widget to a layer + parent.setType(WidgetType.LAYER); + parent.deleteAllChildren(); + + // Ultimate Iron men are always skulled and can't use the protect item prayer + WidgetButton protectItemButton = isProtectItemAllowed() + ? new WidgetButton(parent, "Protect Item Prayer", PROTECT_ITEM_SPRITE_ID, protectingItem, selected -> + { + protectingItem = selected; + rebuildItemsKeptOnDeathInterface(); + }) : null; + + WidgetButton skulledButton = !isUltimateIronman() + ? new WidgetButton(parent, "Skulled", SKULL_SPRITE_ID, isSkulled, selected -> + { + isSkulled = selected; + rebuildItemsKeptOnDeathInterface(); + }) : null; + + lowWildyButton = new WidgetButton(parent, "Low Wildy (1-20)", SWORD_SPRITE_ID, wildyLevel > 0 && wildyLevel <= DEEP_WILDY, selected -> + { + if (!selected) + { + syncWildernessLevel(); + } + else + { + wildyLevel = 1; + deepWildyButton.setSelected(false); + } + + rebuildItemsKeptOnDeathInterface(); + }); + + deepWildyButton = new WidgetButton(parent, "Deep Wildy (21+)", SKULL_2_SPRITE_ID, wildyLevel > DEEP_WILDY, selected -> + { + if (!selected) + { + syncWildernessLevel(); + } + else + { + wildyLevel = DEEP_WILDY + 1; + lowWildyButton.setSelected(false); + } + + rebuildItemsKeptOnDeathInterface(); + }); + + parent.revalidate(); + WidgetButton.layoutButtonsToContainer(parent, protectItemButton, skulledButton, lowWildyButton, deepWildyButton); + } + + /** + * Creates an Item Widget for use inside the Kept on Death Interface + * + * @param qty Amount of item + * @param c Items Composition + * @return + */ + private static Widget createItemWidget(final Widget parent, final int qty, final ItemDefinition c) + { + final Widget itemWidget = parent.createChild(-1, WidgetType.GRAPHIC); + itemWidget.setItemId(c.getId()); + itemWidget.setItemQuantity(qty); + itemWidget.setHasListener(true); + itemWidget.setOriginalWidth(Constants.ITEM_SPRITE_WIDTH); + itemWidget.setOriginalHeight(Constants.ITEM_SPRITE_HEIGHT); + itemWidget.setBorderType(1); + + itemWidget.setAction(1, String.format("Item: %s", c.getName())); + + return itemWidget; + } +} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/Pets.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/Pets.java new file mode 100644 index 0000000000..de2b0edcb7 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/Pets.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2018 Abex + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.itemskeptondeath; + +import com.google.common.collect.ImmutableSet; +import java.util.Set; +import static net.runelite.api.ItemID.*; + +final class Pets +{ + private Pets() + { + } + + private static final Set PETS = ImmutableSet.of( + BABY_MOLE, + PRINCE_BLACK_DRAGON, + PET_CORPOREAL_CRITTER, PET_DARK_CORE, + JALNIBREK, TZREKZUK, + KALPHITE_PRINCESS, KALPHITE_PRINCESS_12654, + LIL_ZIK, + SKOTOS, + PET_SNAKELING, PET_SNAKELING_12939, PET_SNAKELING_12940, + TZREKJAD, + VORKI, + + OLMLET, PUPPADILE, TEKTINY, VANGUARD, VASA_MINIRIO, VESPINA, + + PET_DAGANNOTH_PRIME, PET_DAGANNOTH_REX, PET_DAGANNOTH_SUPREME, + + PET_GENERAL_GRAARDOR, PET_KRIL_TSUTSAROTH, PET_KREEARRA, PET_ZILYANA, + + ABYSSAL_ORPHAN, + HELLPUPPY, + PET_KRAKEN, + MIDNIGHT, NOON, + PET_SMOKE_DEVIL, PET_SMOKE_DEVIL_22663, + IKKLE_HYDRA, IKKLE_HYDRA_22748, IKKLE_HYDRA_22750, IKKLE_HYDRA_22752, + + CALLISTO_CUB, + PET_CHAOS_ELEMENTAL, + SCORPIAS_OFFSPRING, + VENENATIS_SPIDERLING, + VETION_JR, VETION_JR_13180, + + BABY_CHINCHOMPA, BABY_CHINCHOMPA_13324, BABY_CHINCHOMPA_13325, BABY_CHINCHOMPA_13326, + BEAVER, + GIANT_SQUIRREL, + HERON, + RIFT_GUARDIAN, RIFT_GUARDIAN_20667, RIFT_GUARDIAN_20669, RIFT_GUARDIAN_20671, RIFT_GUARDIAN_20673, RIFT_GUARDIAN_20675, + RIFT_GUARDIAN_20677, RIFT_GUARDIAN_20679, RIFT_GUARDIAN_20681, RIFT_GUARDIAN_20683, RIFT_GUARDIAN_20685, RIFT_GUARDIAN_20687, + RIFT_GUARDIAN_20689, RIFT_GUARDIAN_20691, RIFT_GUARDIAN_21990, + ROCK_GOLEM, ROCK_GOLEM_21187, ROCK_GOLEM_21188, ROCK_GOLEM_21189, ROCK_GOLEM_21190, ROCK_GOLEM_21191, ROCK_GOLEM_21192, + ROCK_GOLEM_21193, ROCK_GOLEM_21194, ROCK_GOLEM_21195, ROCK_GOLEM_21196, ROCK_GOLEM_21197, ROCK_GOLEM_21340, ROCK_GOLEM_21358, + ROCK_GOLEM_21359, ROCK_GOLEM_21360, + ROCKY, + TANGLEROOT, + + PET_KITTEN, PET_KITTEN_1556, PET_KITTEN_1557, PET_KITTEN_1558, PET_KITTEN_1559, PET_KITTEN_1560, + PET_CAT, PET_CAT_1562, PET_CAT_1563, PET_CAT_1564, PET_CAT_1565, PET_CAT_1566, PET_CAT_1567, PET_CAT_1568, PET_CAT_1569, + PET_CAT_1570, PET_CAT_1571, PET_CAT_1572, + LAZY_CAT, LAZY_CAT_6550, LAZY_CAT_6551, LAZY_CAT_6552, LAZY_CAT_6553, LAZY_CAT_6554, + WILY_CAT, WILY_CAT_6556, WILY_CAT_6557, WILY_CAT_6558, WILY_CAT_6559, WILY_CAT_6560, + OVERGROWN_HELLCAT, HELL_CAT, HELLKITTEN, LAZY_HELL_CAT, WILY_HELLCAT, + + BLOODHOUND, + CHOMPY_CHICK, + HERBI, + PET_PENANCE_QUEEN, + PHOENIX + ); + + public static boolean isPet(int id) + { + return PETS.contains(id); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/WidgetButton.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/WidgetButton.java new file mode 100644 index 0000000000..93cb27e41c --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/WidgetButton.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2018, TheStonedTurtle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.itemskeptondeath; + +import net.runelite.api.ScriptEvent; +import net.runelite.api.SpriteID; +import net.runelite.api.widgets.JavaScriptCallback; +import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetType; + +class WidgetButton +{ + private static final int ICON_HEIGHT = 26; + private static final int ICON_WIDTH = 26; + private static final int BACKGROUND_HEIGHT = 32; + private static final int BACKGROUND_WIDTH = 32; + private static final int PADDING = 5; + private static final int ICON_PADDING = (BACKGROUND_HEIGHT - ICON_HEIGHT) / 2; + + private static final int BACKGROUND_SPRITE_ID = SpriteID.EQUIPMENT_SLOT_TILE; + private static final int SELECTED_BACKGROUND_SPRITE_ID = SpriteID.EQUIPMENT_SLOT_SELECTED; + + @FunctionalInterface + public interface WidgetButtonCallback + { + void run(boolean newState); + } + + private final Widget parent; + private final String name; + private final int spriteID; + private boolean selected; + private final WidgetButtonCallback callback; + + private Widget icon; + private Widget background; + + WidgetButton( + final Widget parent, + final String name, + final int spriteID, + final boolean selectedStartState, + final WidgetButtonCallback callback) + { + this.parent = parent; + this.name = name; + this.spriteID = spriteID; + this.selected = selectedStartState; + this.callback = callback; + createBackgroundWidget(); + createIconWidget(); + } + + private void createBackgroundWidget() + { + background = createWidget(); + background.setOriginalWidth(BACKGROUND_WIDTH); + background.setOriginalHeight(BACKGROUND_HEIGHT); + syncBackgroundSprite(); + } + + private void createIconWidget() + { + icon = createWidget(); + icon.setAction(1, "Toggle:"); + icon.setOnOpListener((JavaScriptCallback) this::onButtonClicked); + icon.setOnMouseRepeatListener((JavaScriptCallback) e -> e.getSource().setOpacity(120)); + icon.setOnMouseLeaveListener((JavaScriptCallback) e -> e.getSource().setOpacity(0)); + icon.setHasListener(true); + icon.setSpriteId(spriteID); + } + + private Widget createWidget() + { + final Widget w = parent.createChild(-1, WidgetType.GRAPHIC); + w.setOriginalWidth(ICON_WIDTH); + w.setOriginalHeight(ICON_HEIGHT); + w.setName("" + this.name); + return w; + } + + public void setSelected(boolean selected) + { + this.selected = selected; + syncBackgroundSprite(); + } + + private void syncBackgroundSprite() + { + background.setSpriteId(selected ? SELECTED_BACKGROUND_SPRITE_ID : BACKGROUND_SPRITE_ID); + } + + /** + * Adds the collection of WidgetButtons to the container overriding any existing children. + * + * @param container Widget to add buttons too + * @param buttons buttons to add + */ + static void layoutButtonsToContainer(final Widget container, final WidgetButton... buttons) + { + // Each button has two widgets, Icon and Background + final int xIncrement = BACKGROUND_WIDTH + PADDING; + final int yIncrement = BACKGROUND_HEIGHT + PADDING; + int maxRowItems = container.getWidth() / xIncrement; + // Ensure at least 1 button per row + maxRowItems = maxRowItems < 1 ? 1 : maxRowItems; + + int index = 0; + for (final WidgetButton w : buttons) + { + if (w == null) + { + continue; + } + + final int originalX = ((index % maxRowItems) * xIncrement); + final int originalY = ((index / maxRowItems) * yIncrement); + w.background.setOriginalX(originalX); + w.background.setOriginalY(originalY); + w.background.revalidate(); + + // Icon must be padded to center inside image + w.icon.setOriginalX(originalX + ICON_PADDING); + w.icon.setOriginalY(originalY + ICON_PADDING); + w.icon.revalidate(); + + index++; + } + + final int numButtons = index; + final int rows = 1 + (numButtons > maxRowItems ? numButtons / maxRowItems : 0); + container.setOriginalHeight(yIncrement * rows); + container.revalidate(); + } + + private void onButtonClicked(ScriptEvent scriptEvent) + { + setSelected(!selected); + callback.run(selected); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatConfig.java index 34cec317a2..1bf4c37222 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatConfig.java @@ -92,6 +92,16 @@ public interface ItemStatConfig extends Config return false; } + @ConfigItem( + keyName = "showWeight", + name = "Show Weight", + description = "Show weight in tooltip" + ) + default boolean showWeight() + { + return true; + } + @ConfigItem( keyName = "colorBetterUncapped", name = "Better (Uncapped)", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java index 6af02ea31a..209e86aa41 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java @@ -189,7 +189,10 @@ public class ItemStatOverlay extends Overlay private String buildStatBonusString(ItemStats s) { final StringBuilder b = new StringBuilder(); - b.append(getChangeString("Weight", s.getWeight(), true, false)); + if (config.showWeight()) + { + b.append(getChangeString("Weight", s.getWeight(), true, false)); + } ItemStats other = null; final ItemEquipmentStats currentEquipment = s.getEquipment(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatPlugin.java index 9c41fa5883..2b0e476677 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatPlugin.java @@ -35,6 +35,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import net.runelite.api.Client; +import net.runelite.api.Constants; import net.runelite.api.FontID; import net.runelite.api.InventoryID; import net.runelite.api.Item; @@ -232,8 +233,8 @@ public class ItemStatPlugin extends Plugin Widget icon = invContainer.createChild(-1, WidgetType.GRAPHIC); icon.setOriginalX(8); icon.setOriginalY(yPos); - icon.setOriginalWidth(36); - icon.setOriginalHeight(32); + icon.setOriginalWidth(Constants.ITEM_SPRITE_WIDTH); + icon.setOriginalHeight(Constants.ITEM_SPRITE_HEIGHT); icon.setItemId(id); icon.setItemQuantityMode(0); icon.setBorderType(1); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryPlugin.java index 0918d02dd6..aea8d9b034 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryPlugin.java @@ -179,9 +179,9 @@ public class KourendLibraryPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked menuOpt) { - if (MenuAction.GAME_OBJECT_FIRST_OPTION == menuOpt.getMenuAction() && menuOpt.getMenuTarget().contains("Bookshelf")) + if (MenuAction.GAME_OBJECT_FIRST_OPTION == menuOpt.getMenuAction() && menuOpt.getTarget().contains("Bookshelf")) { - lastBookcaseClick = WorldPoint.fromScene(client, menuOpt.getActionParam(), menuOpt.getWidgetId(), client.getPlane()); + lastBookcaseClick = WorldPoint.fromScene(client, menuOpt.getActionParam0(), menuOpt.getActionParam1(), client.getPlane()); overlay.setHidden(false); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/lootingbagviewer/LootingBagViewerOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/lootingbagviewer/LootingBagViewerOverlay.java index 461e752386..ecfe3dc5da 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/lootingbagviewer/LootingBagViewerOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/lootingbagviewer/LootingBagViewerOverlay.java @@ -41,10 +41,10 @@ import net.runelite.client.ui.overlay.components.ComponentOrientation; import net.runelite.client.ui.overlay.components.ImageComponent; import net.runelite.client.ui.overlay.components.PanelComponent; -class LootingBagViewerOverlay extends Overlay +public class LootingBagViewerOverlay extends Overlay { private static final int INVENTORY_SIZE = 28; - private static final int PLACEHOLDER_WIDTH = 36; + public static final int PLACEHOLDER_WIDTH = 36; private static final int PLACEHOLDER_HEIGHT = 32; private static final ImageComponent PLACEHOLDER_IMAGE = new ImageComponent(new BufferedImage(PLACEHOLDER_WIDTH, PLACEHOLDER_HEIGHT, BufferedImage.TYPE_4BYTE_ABGR)); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java index 0e800a8094..6e459949c5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java @@ -35,7 +35,9 @@ public interface LootTrackerConfig extends Config @ConfigItem( keyName = "ignoredItems", name = "Ignored items", - description = "Configures which items should be ignored when calculating loot prices." + description = "Configures which items should be ignored when calculating loot prices.", + position = 0, + group = "Filters" ) default String getIgnoredItems() { @@ -91,6 +93,7 @@ public interface LootTrackerConfig extends Config { return true; } + @ConfigItem( keyName = "sortType", name = "Sorting", @@ -101,4 +104,59 @@ public interface LootTrackerConfig extends Config return LootRecordSortType.TIMESTAMP; } + @ConfigItem( + keyName = "whitelistEnabled", + name = "NPC Whitelist", + description = "Only track drops from specific NPCs", + position = 1, + group = "Filters", + disabledBy = "blacklistEnabled" + ) + default boolean whitelistEnabled() + { + return false; + } + + @ConfigItem( + keyName = "getWhitelist", + name = "Whitelist", + description = "Comma-separated list of NPCs to track drops from", + position = 2, + group = "Filters", + hidden = true, + unhide = "whitelistEnabled" + ) + default String getWhitelist() + { + return ""; + } + + @ConfigItem( + keyName = "blacklistEnabled", + name = "NPC Blacklist", + description = "Track drops from all NPCs except for specified ones", + position = 3, + group = "Filters", + disabledBy = "whitelistEnabled" + ) + default boolean blacklistEnabled() + { + return false; + } + + @ConfigItem( + keyName = "getBlacklist", + name = "Blacklist", + description = "Comma-separated list of NPCs to not track drops from", + position = 4, + group = "Filters", + hidden = true, + unhide = "blacklistEnabled" + ) + default String getBlacklist() + { + return ""; + } + + } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index f53a71739e..94847fe8eb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -323,13 +323,14 @@ public class LootTrackerPlugin extends Plugin log.debug("Loaded {} remote data entries", lootRecords.size()); } - if (config.localPersistence() ) + if (config.localPersistence()) { try { lootRecords.addAll(RuneLiteAPI.GSON.fromJson(new FileReader(LOOT_RECORDS_FILE), new TypeToken>() - { }.getType())); + { + }.getType())); } catch (IOException | NullPointerException e) { @@ -370,8 +371,28 @@ public class LootTrackerPlugin extends Plugin final int combat = npc.getCombatLevel(); final LootTrackerItem[] entries = buildEntries(stack(items)); String localUsername = client.getLocalPlayer().getName(); + + if (config.whitelistEnabled()) + { + final String configNpcs = config.getWhitelist().toLowerCase(); + List whitelist = Text.fromCSV(configNpcs); + if (!whitelist.contains(name.toLowerCase())) + { + return; + } + } + else if (config.blacklistEnabled()) + { + final String configNpcs = config.getBlacklist().toLowerCase(); + List blacklist = Text.fromCSV(configNpcs); + if (blacklist.contains(name.toLowerCase())) + { + return; + } + } + SwingUtilities.invokeLater(() -> panel.add(name, localUsername, combat, entries)); - LootRecord lootRecord = new LootRecord( name, localUsername, LootRecordType.NPC, + LootRecord lootRecord = new LootRecord(name, localUsername, LootRecordType.NPC, toGameItems(items), Instant.now()); if (lootTrackerClient != null && config.saveLoot()) @@ -404,7 +425,7 @@ public class LootTrackerPlugin extends Plugin final LootTrackerItem[] entries = buildEntries(stack(items)); String localUsername = client.getLocalPlayer().getName(); SwingUtilities.invokeLater(() -> panel.add(name, localUsername, combat, entries)); - LootRecord lootRecord = new LootRecord( name, localUsername, LootRecordType.PLAYER, + LootRecord lootRecord = new LootRecord(name, localUsername, LootRecordType.PLAYER, toGameItems(items), Instant.now()); if (lootTrackerClient != null && config.saveLoot()) { @@ -599,7 +620,7 @@ public class LootTrackerPlugin extends Plugin SwingUtilities.invokeLater(() -> panel.add(name, client.getLocalPlayer().getName(), client.getLocalPlayer().getCombatLevel(), entries)); LootRecord lootRecord = new LootRecord(name, client.getLocalPlayer().getName(), LootRecordType.DEATH, - toGameItems(itemsLost), Instant.now()); + toGameItems(itemsLost), Instant.now()); if (lootTrackerClient != null && config.saveLoot()) { lootTrackerClient.submit(lootRecord); @@ -685,10 +706,10 @@ public class LootTrackerPlugin extends Plugin .forEach(item -> inventorySnapshot.add(item.getId(), item.getQuantity())); } - if (equipment != null) - { - Arrays.stream(equipment.getItems()) - .forEach(item -> inventorySnapshot.add(item.getId(), item.getQuantity())); + if (equipment != null) + { + Arrays.stream(equipment.getItems()) + .forEach(item -> inventorySnapshot.add(item.getId(), item.getQuantity())); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index 31af4a8239..c75a8859ef 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -474,20 +474,20 @@ public class MenuEntrySwapperPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - if (event.getMenuAction() != MenuAction.RUNELITE || event.getWidgetId() != WidgetInfo.INVENTORY.getId()) + if (event.getMenuAction() != MenuAction.RUNELITE || event.getActionParam1() != WidgetInfo.INVENTORY.getId()) { return; } - int itemId = event.getId(); + int itemId = event.getIdentifier(); if (itemId == -1) { return; } - String option = event.getMenuOption(); - String target = event.getMenuTarget(); + String option = event.getOption(); + String target = event.getTarget(); ItemDefinition itemComposition = client.getItemDefinition(itemId); if (option.equals(RESET) && target.equals(MENU_TARGET)) @@ -862,7 +862,7 @@ public class MenuEntrySwapperPlugin extends Plugin } } } - else if (target.equals("magpie impling jar") || (target.equals("nature impling jar"))) + else if (target.equals("magpie impling jar") || (target.equals("nature impling jar")) || (target.equals("ninja impling jar"))) { if (client.getItemContainer(InventoryID.INVENTORY) != null) { @@ -1309,7 +1309,17 @@ public class MenuEntrySwapperPlugin extends Plugin if (!Strings.isNullOrEmpty(config)) { - Map split = NEWLINE_SPLITTER.withKeyValueSeparator(':').split(config); + StringBuilder sb = new StringBuilder(); + + for (String str : config.split("\n")) + { + if (!str.startsWith("//")) + { + sb.append(str + "\n"); + } + } + + Map split = NEWLINE_SPLITTER.withKeyValueSeparator(':').split(sb); for (Map.Entry entry : split.entrySet()) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/Parse.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/Parse.java index a44b56eb5e..d4e9785f5f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/Parse.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/Parse.java @@ -32,12 +32,22 @@ public class Parse { try { + StringBuilder sb = new StringBuilder(); + + for (String str : value.split("\n")) + { + if (!str.startsWith("//")) + { + sb.append(str + "\n"); + } + } + Splitter NEWLINE_SPLITTER = Splitter .on("\n") .omitEmptyStrings() .trimResults(); - NEWLINE_SPLITTER.withKeyValueSeparator(':').split(value); + NEWLINE_SPLITTER.withKeyValueSeparator(':').split(sb); return true; } catch (IllegalArgumentException ex) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java index 87e4e8a897..3ce12efcf7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java @@ -47,7 +47,7 @@ class MiningOverlay extends Overlay { // Range of Motherlode vein respawn time not 100% confirmed but based on observation @Getter(AccessLevel.PACKAGE) - private static final int ORE_VEIN_MAX_RESPAWN_TIME = 123; + public static final int ORE_VEIN_MAX_RESPAWN_TIME = 123; private static final int ORE_VEIN_MIN_RESPAWN_TIME = 90; private static final float ORE_VEIN_RANDOM_PERCENT_THRESHOLD = (float) ORE_VEIN_MIN_RESPAWN_TIME / ORE_VEIN_MAX_RESPAWN_TIME; private static final Color DARK_GREEN = new Color(0, 100, 0); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java index 4bc5232701..0c526222c3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java @@ -168,6 +168,7 @@ public class MiningPlugin extends Plugin case ORE_VEIN_26663: // Motherlode vein case ORE_VEIN_26664: // Motherlode vein { + // If the vein respawns before the timer is up, remove it final WorldPoint point = object.getWorldLocation(); respawns.removeIf(rockRespawn -> rockRespawn.getWorldPoint().equals(point)); break; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java b/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java index 7f27596356..19207b7fd6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java @@ -49,6 +49,7 @@ import static net.runelite.api.ObjectID.ROCKS_11376; import static net.runelite.api.ObjectID.ROCKS_11377; import static net.runelite.api.ObjectID.ROCKS_11386; import static net.runelite.api.ObjectID.ROCKS_11387; +import static net.runelite.api.ObjectID.ASH_PILE; enum Rock { @@ -98,8 +99,9 @@ enum Rock return inMiningGuild ? Duration.ofMinutes(6) : super.respawnTime; } }, - ORE_VEIN(Duration.ofSeconds(MiningOverlay.getORE_VEIN_MAX_RESPAWN_TIME()), 150), - AMETHYST(Duration.ofSeconds(75), 120); + ORE_VEIN(Duration.ofSeconds(MiningOverlay.ORE_VEIN_MAX_RESPAWN_TIME), 150), + AMETHYST(Duration.ofSeconds(75), 120), + ASH_VEIN(Duration.ofSeconds(30), 0, ASH_PILE); private static final Map ROCKS; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java index 6f2d748c91..0e23e85a19 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java @@ -328,11 +328,11 @@ public class MotherlodePlugin extends Plugin return; } - if (MINE_SPOTS.contains(menu.getId()) && menu.getMenuAction() == MenuAction.GAME_OBJECT_FIRST_OPTION) + if (MINE_SPOTS.contains(menu.getIdentifier()) && menu.getMenuAction() == MenuAction.GAME_OBJECT_FIRST_OPTION) { resetIdleChecks(); - int veinX = menu.getActionParam(); - int veinY = menu.getWidgetId(); + int veinX = menu.getActionParam0(); + int veinY = menu.getActionParam1(); targetVeinLocation = WorldPoint.fromScene(client, veinX, veinY, client.getPlane()); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MapLocations.java b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MapLocations.java index de1525e6d8..044e9bdb36 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MapLocations.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MapLocations.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, Woox + * Copyright (c) 2019, Enza-Denino * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,11 +35,12 @@ import net.runelite.api.Constants; public class MapLocations { - private static final List[] MULTICOMBAT = new List[Constants.MAX_Z]; - private static final List[] NOT_MULTICOMBAT = new List[Constants.MAX_Z]; - private static final List[] ROUGH_WILDERNESS = new List[Constants.MAX_Z]; - private static final List[] DEADMAN_SAFE_ZONES = new List[Constants.MAX_Z]; - private static final List[] PVP_WORLD_SAFE_ZONES = new List[Constants.MAX_Z]; + private static final List[] MULTICOMBAT = new List[Constants.MAX_Z]; + private static final List[] NOT_MULTICOMBAT = new List[Constants.MAX_Z]; + private static final List[] ROUGH_WILDERNESS = new List[Constants.MAX_Z]; + private static final List[] WILDERNESS_LEVEL_LINES = new List[Constants.MAX_Z]; + private static final List[] DEADMAN_SAFE_ZONES = new List[Constants.MAX_Z]; + private static final List[] PVP_WORLD_SAFE_ZONES = new List[Constants.MAX_Z]; private static Area getArea(List shapes) { @@ -87,6 +89,16 @@ public class MapLocations return getArea(ROUGH_WILDERNESS[plane], view); } + public static Area getWildernessLevelLines(int plane) + { + return getArea(WILDERNESS_LEVEL_LINES[plane]); + } + + public static Area getWildernessLevelLines(Rectangle view, int plane) + { + return getArea(WILDERNESS_LEVEL_LINES[plane], view); + } + public static Area getDeadmanSafeZones(int plane) { return getArea(DEADMAN_SAFE_ZONES[plane]); @@ -107,33 +119,28 @@ public class MapLocations return getArea(PVP_WORLD_SAFE_ZONES[plane], view); } + private static void initializeWithEmptyLists(List[] array) + { + for (int i = 0; i < array.length; i++) + { + array[i] = new ArrayList<>(); + } + } + static { - for (int i = 0; i < MULTICOMBAT.length; i++) - { - MULTICOMBAT[i] = new ArrayList<>(); - } - for (int i = 0; i < NOT_MULTICOMBAT.length; i++) - { - NOT_MULTICOMBAT[i] = new ArrayList<>(); - } - for (int i = 0; i < ROUGH_WILDERNESS.length; i++) - { - ROUGH_WILDERNESS[i] = new ArrayList<>(); - } - for (int i = 0; i < DEADMAN_SAFE_ZONES.length; i++) - { - DEADMAN_SAFE_ZONES[i] = new ArrayList<>(); - } - for (int i = 0; i < PVP_WORLD_SAFE_ZONES.length; i++) - { - PVP_WORLD_SAFE_ZONES[i] = new ArrayList<>(); - } + initializeWithEmptyLists(MULTICOMBAT); + initializeWithEmptyLists(NOT_MULTICOMBAT); + initializeWithEmptyLists(ROUGH_WILDERNESS); + initializeWithEmptyLists(WILDERNESS_LEVEL_LINES); + initializeWithEmptyLists(DEADMAN_SAFE_ZONES); + initializeWithEmptyLists(PVP_WORLD_SAFE_ZONES); defineMulticombatAreas(); defineDeadmanSafeZones(); definePvpSafeZones(); defineWilderness(); + defineWildernessLevelLines(); } private static void defineMulticombatAreas() @@ -3441,6 +3448,33 @@ public class MapLocations 3264, 9918); } + private static void defineWildernessLevelLines() + { + int wildyLeftX = 2944; + int wildyRightX = 3392; + int wildyBottomY = 3525; + int wildyTopY = 3971; + + // define wilderness level lines at ground level + int accumulatedY = 0; + for (int level = 1; level <= 56; level++) + { + int levelTiles = level == 1 ? 3 : 8; + // only draw every 2 levels, otherwise lines on two adjacent levels will collide + // and it will not show up + if (level % 2 != 0) + { + addPolygonTo(WILDERNESS_LEVEL_LINES, + wildyLeftX, wildyBottomY + accumulatedY, + wildyRightX, wildyBottomY + accumulatedY, + wildyRightX, wildyBottomY + accumulatedY + levelTiles, + wildyLeftX, wildyBottomY + accumulatedY + levelTiles); + } + accumulatedY += levelTiles; + } + } + + private static void addPolygonTo(List[] shapes, int... coords) { Polygon poly = new Polygon(); @@ -3476,4 +3510,4 @@ public class MapLocations shapes[i].add(poly); } } -} \ No newline at end of file +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsConfig.java index 27aed88be3..da14992e01 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsConfig.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, Woox + * Copyright (c) 2019, Enza-Denino * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,14 +67,14 @@ public interface MultiIndicatorsConfig extends Config } @ConfigItem( - keyName = "collisionDetection", - name = "Collision detection", - description = "Only show lines where they can be walked through", + keyName = "wildernessLevelLines", + name = "Wilderness level lines", + description = "Show wilderness level lines", position = 4 ) - default boolean collisionDetection() + default boolean showWildernessLevelLines() { - return false; + return true; } @ConfigItem( @@ -108,4 +109,16 @@ public interface MultiIndicatorsConfig extends Config { return Color.GREEN; } + + @ConfigItem( + keyName = "wildernessLevelLinesColor", + name = "Wilderness level lines color", + description = "Choose color to use for marking wilderness level lines", + position = 8 + ) + default Color wildernessLevelLinesColor() + { + return Color.WHITE; + } + } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsMinimapOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsMinimapOverlay.java index 8fd85bd934..b0c1187745 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsMinimapOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsMinimapOverlay.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, Woox + * Copyright (c) 2019, Enza-Denino * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -102,6 +103,7 @@ public class MultiIndicatorsMinimapOverlay extends Overlay GeneralPath multicombatPath = plugin.getMulticombatPathToDisplay()[client.getPlane()]; GeneralPath pvpPath = plugin.getPvpPathToDisplay()[client.getPlane()]; + GeneralPath wildernessLevelLinesPath = plugin.getWildernessLevelLinesPathToDisplay()[client.getPlane()]; if (config.multicombatZoneVisibility() != ZoneVisibility.HIDE && multicombatPath != null) { @@ -111,6 +113,10 @@ public class MultiIndicatorsMinimapOverlay extends Overlay { renderPath(graphics, pvpPath, getTransparentColorVersion(config.safeZoneColor())); } + if (config.showWildernessLevelLines() && wildernessLevelLinesPath != null) + { + renderPath(graphics, wildernessLevelLinesPath, getTransparentColorVersion(config.wildernessLevelLinesColor())); + } return null; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsOverlay.java index 73985fd08e..d9268121f0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsOverlay.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, Woox + * Copyright (c) 2019, Enza-Denino * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -98,6 +99,7 @@ public class MultiIndicatorsOverlay extends Overlay { GeneralPath multicombatPath = plugin.getMulticombatPathToDisplay()[client.getPlane()]; GeneralPath pvpPath = plugin.getPvpPathToDisplay()[client.getPlane()]; + GeneralPath wildernessLevelLinesPath = plugin.getWildernessLevelLinesPathToDisplay()[client.getPlane()]; if (config.multicombatZoneVisibility() != ZoneVisibility.HIDE && multicombatPath != null) { @@ -107,6 +109,10 @@ public class MultiIndicatorsOverlay extends Overlay { renderPath(graphics, pvpPath, getTransparentColorVersion(config.safeZoneColor())); } + if (config.showWildernessLevelLines() && wildernessLevelLinesPath != null) + { + renderPath(graphics, wildernessLevelLinesPath, getTransparentColorVersion(config.wildernessLevelLinesColor())); + } return null; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsPlugin.java index 8568d26fb1..c20fa25810 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsPlugin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, Woox + * Copyright (c) 2019, Enza-Denino * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,6 +28,7 @@ package net.runelite.client.plugins.multiindicators; import com.google.inject.Provides; import java.awt.Rectangle; import java.awt.geom.GeneralPath; +import java.time.temporal.ChronoUnit; import java.util.Arrays; import javax.inject.Inject; import lombok.Getter; @@ -50,6 +52,7 @@ import net.runelite.client.eventbus.Subscribe; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginType; +import net.runelite.client.task.Schedule; import net.runelite.client.ui.overlay.OverlayManager; @PluginDescriptor( @@ -86,6 +89,9 @@ public class MultiIndicatorsPlugin extends Plugin @Getter private GeneralPath[] pvpPathToDisplay; + @Getter + private GeneralPath[] wildernessLevelLinesPathToDisplay; + @Getter private boolean inPvp; @@ -106,8 +112,7 @@ public class MultiIndicatorsPlugin extends Plugin overlayManager.add(overlay); overlayManager.add(minimapOverlay); - multicombatPathToDisplay = new GeneralPath[Constants.MAX_Z]; - pvpPathToDisplay = new GeneralPath[Constants.MAX_Z]; + initializePaths(); clientThread.invokeLater(() -> { @@ -124,8 +129,37 @@ public class MultiIndicatorsPlugin extends Plugin overlayManager.remove(overlay); overlayManager.remove(minimapOverlay); + uninitializePaths(); + } + + private void initializePaths() + { + multicombatPathToDisplay = new GeneralPath[Constants.MAX_Z]; + pvpPathToDisplay = new GeneralPath[Constants.MAX_Z]; + wildernessLevelLinesPathToDisplay = new GeneralPath[Constants.MAX_Z]; + } + + private void uninitializePaths() + { multicombatPathToDisplay = null; pvpPathToDisplay = null; + wildernessLevelLinesPathToDisplay = null; + } + + // sometimes the lines get offset (seems to happen when there is a delay + // due to map reloading when walking/running "Loading - please wait") + // resetting the lines generation logic fixes this + @Schedule( + period = 1800, + unit = ChronoUnit.MILLIS + ) + public void update() + { + if (client.getGameState() == GameState.LOGGED_IN) + { + findLinesInScene(); + } + } private void transformWorldToLocal(float[] coords) @@ -134,7 +168,6 @@ public class MultiIndicatorsPlugin extends Plugin coords[0] = lp.getX() - Perspective.LOCAL_TILE_SIZE / 2; coords[1] = lp.getY() - Perspective.LOCAL_TILE_SIZE / 2; } - private boolean isOpenableAt(WorldPoint wp) { int sceneX = wp.getX() - client.getBaseX(); @@ -153,6 +186,7 @@ public class MultiIndicatorsPlugin extends Plugin } ObjectDefinition objectComposition = client.getObjectDefinition(wallObject.getId()); + if (objectComposition == null) { return false; @@ -240,7 +274,7 @@ public class MultiIndicatorsPlugin extends Plugin lines = Geometry.clipPath(lines, MapLocations.getRoughWilderness(i)); } lines = Geometry.splitIntoSegments(lines, 1); - if (config.collisionDetection()) + if (useCollisionLogic()) { lines = Geometry.filterPath(lines, this::collisionFilter); } @@ -267,7 +301,7 @@ public class MultiIndicatorsPlugin extends Plugin { safeZonePath = Geometry.clipPath(safeZonePath, sceneRect); safeZonePath = Geometry.splitIntoSegments(safeZonePath, 1); - if (config.collisionDetection()) + if (useCollisionLogic()) { safeZonePath = Geometry.filterPath(safeZonePath, this::collisionFilter); } @@ -275,6 +309,35 @@ public class MultiIndicatorsPlugin extends Plugin } pvpPathToDisplay[i] = safeZonePath; } + + // Generate wilderness level lines + for (int i = 0; i < wildernessLevelLinesPathToDisplay.length; i++) + { + currentPlane = i; + + GeneralPath wildernessLevelLinesPath = null; + if (config.showWildernessLevelLines()) + { + wildernessLevelLinesPath = new GeneralPath(MapLocations.getWildernessLevelLines(sceneRect, i)); + } + if (wildernessLevelLinesPath != null) + { + wildernessLevelLinesPath = Geometry.clipPath(wildernessLevelLinesPath, sceneRect); + wildernessLevelLinesPath = Geometry.splitIntoSegments(wildernessLevelLinesPath, 1); + if (useCollisionLogic()) + { + wildernessLevelLinesPath = Geometry.filterPath(wildernessLevelLinesPath, this::collisionFilter); + } + wildernessLevelLinesPath = Geometry.transformPath(wildernessLevelLinesPath, this::transformWorldToLocal); + } + wildernessLevelLinesPathToDisplay[i] = wildernessLevelLinesPath; + } + } + + private boolean useCollisionLogic() + { + // currently prevents overlay lines from showing up if this is ever enabled right now + return false; } @Subscribe @@ -283,7 +346,8 @@ public class MultiIndicatorsPlugin extends Plugin if (event.getKey().equals("collisionDetection") || event.getKey().equals("multicombatZoneVisibility") || event.getKey().equals("deadmanSafeZones") || - event.getKey().equals("pvpSafeZones")) + event.getKey().equals("pvpSafeZones") || + event.getKey().equals("wildernessLevelLines")) { findLinesInScene(); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/ZoneVisibility.java b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/ZoneVisibility.java index b024a93846..c3e9a8fcf4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/ZoneVisibility.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/ZoneVisibility.java @@ -40,4 +40,4 @@ public enum ZoneVisibility { return visibility; } -} \ No newline at end of file +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java index 14ccc92d17..34d89e1944 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java @@ -286,13 +286,13 @@ public class NpcIndicatorsPlugin extends Plugin public void onMenuOptionClicked(MenuOptionClicked click) { if (click.getMenuAction() != MenuAction.RUNELITE - || (!click.getMenuOption().equals(TAG) - && !click.getMenuOption().equals(UNTAG))) + || (!click.getOption().equals(TAG) + && !click.getOption().equals(UNTAG))) { return; } - final int id = click.getId(); + final int id = click.getIdentifier(); final boolean removed = npcTags.remove(id); final NPC[] cachedNPCs = client.getCachedNPCs(); final NPC npc = cachedNPCs[id]; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java index 4b0bdd9ffd..adb0cb4bc5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java @@ -272,20 +272,20 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener public void onMenuOptionClicked(MenuOptionClicked event) { if (event.getMenuAction() != MenuAction.RUNELITE - || (!event.getMenuOption().equals(MARK) - && !event.getMenuOption().equals(UNMARK))) + || (!event.getOption().equals(MARK) + && !event.getOption().equals(UNMARK))) { return; } Scene scene = client.getScene(); Tile[][][] tiles = scene.getTiles(); - final int x = event.getActionParam(); - final int y = event.getWidgetId(); + final int x = event.getActionParam0(); + final int y = event.getActionParam1(); final int z = client.getPlane(); final Tile tile = tiles[z][x][y]; - TileObject object = findTileObject(tile, event.getId()); + TileObject object = findTileObject(tile, event.getIdentifier()); if (object == null) { return; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pestcontrol/PestControlPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/pestcontrol/PestControlPlugin.java index b9ce9922a9..272ec5d6ab 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pestcontrol/PestControlPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pestcontrol/PestControlPlugin.java @@ -73,6 +73,8 @@ import net.runelite.client.util.Text; ) public class PestControlPlugin extends Plugin { + private static final int VOID_KNIGHTS_OUTPOST = 10537; + private final int NOVICE_GANGPLANK = 14315; // Combat 40+ (3 points) private final int INTERMEDIATE_GANGPLANK = 25631; // Combat 70+ (4 points) private final int VETERAN_GANGPLANK = 25632; // Combat 100+ (5 points) @@ -662,6 +664,10 @@ public class PestControlPlugin extends Plugin boolean isOnPestControlMainIsland() { - return client.getLocalPlayer().getWorldLocation().getRegionID() == 10537; + if (client.getLocalPlayer() != null) + { + return client.getLocalPlayer().getWorldLocation().getRegionID() == VOID_KNIGHTS_OUTPOST; + } + return false; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsConfig.java index f761236a96..44da3efac0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsConfig.java @@ -35,10 +35,10 @@ import net.runelite.client.config.Stub; public interface PileIndicatorsConfig extends Config { @ConfigItem( - keyName = "playerPilesStub", - name = "Player Piles", - description = "", - position = 0 + keyName = "playerPilesStub", + name = "Player Piles", + description = "", + position = 0 ) default Stub playerPilesStub() { @@ -46,11 +46,11 @@ public interface PileIndicatorsConfig extends Config } @ConfigItem( - position = 1, - keyName = "enablePlayers", - name = "Enable Player Piling", - description = "Enable the option to highlight players when they pile.", - parent = "playerPilesStub" + position = 1, + keyName = "enablePlayers", + name = "Enable Player Piling", + description = "Enable the option to highlight players when they pile.", + parent = "playerPilesStub" ) default boolean enablePlayers() { @@ -58,11 +58,11 @@ public interface PileIndicatorsConfig extends Config } @ConfigItem( - position = 2, - keyName = "wildyOnlyPlayer", - name = "Wilderness Only", - description = "Show player piling only when in the Wilderness.", - parent = "playerPilesStub" + position = 2, + keyName = "wildyOnlyPlayer", + name = "Wilderness Only", + description = "Show player piling only when in the Wilderness.", + parent = "playerPilesStub" ) default boolean wildyOnlyPlayer() { @@ -70,22 +70,22 @@ public interface PileIndicatorsConfig extends Config } @ConfigItem( - position = 3, - keyName = "playerPileColor", - name = "Player Pile Color", - description = "Color used for player piles.", - parent = "playerPilesStub" + position = 3, + keyName = "playerPileColor", + name = "Player Pile Color", + description = "Color used for player piles.", + parent = "playerPilesStub" ) default Color playerPileColor() { return Color.RED; } - + @ConfigItem( - keyName = "npcPilesStub", - name = "NPC Piles", - description = "", - position = 4 + keyName = "npcPilesStub", + name = "NPC Piles", + description = "", + position = 4 ) default Stub npcPilesStub() { @@ -93,11 +93,11 @@ public interface PileIndicatorsConfig extends Config } @ConfigItem( - position = 5, - keyName = "enableNPCS", - name = "Enable NPC Piling", - description = "Enable the option to highlight NPCs when they pile.", - parent = "npcPilesStub" + position = 5, + keyName = "enableNPCS", + name = "Enable NPC Piling", + description = "Enable the option to highlight NPCs when they pile.", + parent = "npcPilesStub" ) default boolean enableNPCS() { @@ -105,11 +105,11 @@ public interface PileIndicatorsConfig extends Config } @ConfigItem( - position = 6, - keyName = "npcPileColor", - name = "NPC Pile Color", - description = "Color used for NPC piles.", - parent = "npcPilesStub" + position = 6, + keyName = "npcPileColor", + name = "NPC Pile Color", + description = "Color used for NPC piles.", + parent = "npcPilesStub" ) default Color npcPileColor() { @@ -117,10 +117,10 @@ public interface PileIndicatorsConfig extends Config } @ConfigItem( - keyName = "mixedPilesStub", - name = "Mixed Piles", - description = "", - position = 7 + keyName = "mixedPilesStub", + name = "Mixed Piles", + description = "", + position = 7 ) default Stub mixedPilesStub() { @@ -128,11 +128,11 @@ public interface PileIndicatorsConfig extends Config } @ConfigItem( - position = 8, - keyName = "mixedPileColor", - name = "Mixed Pile Color", - description = "Color used for mixed piles.", - parent = "mixedPilesStub" + position = 8, + keyName = "mixedPileColor", + name = "Mixed Pile Color", + description = "Color used for mixed piles.", + parent = "mixedPilesStub" ) default Color mixedPileColor() { @@ -140,10 +140,10 @@ public interface PileIndicatorsConfig extends Config } @ConfigItem( - keyName = "pilesSizeStub", - name = "Pile size", - description = "", - position = 9 + keyName = "pilesSizeStub", + name = "Pile size", + description = "", + position = 9 ) default Stub pilesSizeStub() { @@ -151,14 +151,14 @@ public interface PileIndicatorsConfig extends Config } @Range( - min = 2 + min = 2 ) @ConfigItem( - position = 10, - keyName = "minimumPileSize", - name = "Minimum Pile Size", - description = "Any pile under this size will not show up. (Minimum: 2)", - parent = "pilesSizeStub" + position = 10, + keyName = "minimumPileSize", + name = "Minimum Pile Size", + description = "Any pile under this size will not show up. (Minimum: 2)", + parent = "pilesSizeStub" ) default int minimumPileSize() { @@ -166,10 +166,10 @@ public interface PileIndicatorsConfig extends Config } @ConfigItem( - keyName = "miscellaneousStub", - name = "Miscellaneous", - description = "", - position = 11 + keyName = "miscellaneousStub", + name = "Miscellaneous", + description = "", + position = 11 ) default Stub miscellaneousStub() { @@ -177,14 +177,39 @@ public interface PileIndicatorsConfig extends Config } @ConfigItem( - position = 12, - keyName = "numberOnly", - name = "Display Number Only", - description = "Shorten \"PILE SIZE: 1\" to \"1\"", - parent = "miscellaneousStub" + position = 12, + keyName = "numberOnly", + name = "Display Number Only", + description = "Shorten \"PILE SIZE: 1\" to \"1\"", + parent = "miscellaneousStub" ) default boolean numberOnly() { return false; } + + @ConfigItem( + position = 13, + keyName = "drawPileTile", + name = "Draw Pile Tile", + description = "Draws the tile of the pile for best visibility.", + parent = "miscellaneousStub" + ) + default boolean drawPileTile() + { + return true; + } + + @ConfigItem( + position = 14, + keyName = "drawPileHull", + name = "Draw Pile Convex Hull", + description = "Draws the hull of the pile for best visibility.", + parent = "miscellaneousStub" + ) + default boolean drawPileHull() + { + return false; + } + } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsOverlay.java index 98bb064132..1479c1f2fa 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsOverlay.java @@ -26,11 +26,15 @@ package net.runelite.client.plugins.pileindicators; import net.runelite.api.Actor; import net.runelite.api.Client; -import net.runelite.client.ui.overlay.*; import javax.inject.Inject; import java.awt.*; import java.util.ArrayList; +import net.runelite.client.ui.overlay.Overlay; +import net.runelite.client.ui.overlay.OverlayLayer; +import net.runelite.client.ui.overlay.OverlayPosition; +import net.runelite.client.ui.overlay.OverlayPriority; +import net.runelite.client.ui.overlay.OverlayUtil; public class PileIndicatorsOverlay extends Overlay { @@ -65,22 +69,21 @@ public class PileIndicatorsOverlay extends Overlay PileType pileType = plugin.getPileType(actorArrayList); Color pileColor = plugin.getColorByPileType(pileType); - try + try { Actor actorToRender = actorArrayList.get(0); //guaranteed to have at least two players - final String text; - if (config.numberOnly()) + final String pileTypeStr = pileType == PileType.PLAYER_PILE ? "PLAYER" : pileType == PileType.NPC_PILE ? "NPC" : pileType == PileType.MIXED_PILE ? "MIXED" : ""; + final String text = config.numberOnly() ? "" + actorArrayList.size() : (pileTypeStr + " PILE SIZE: " + actorArrayList.size()); + if (config.drawPileTile()) { - text = "" + actorArrayList.size(); + OverlayUtil.renderPolygon(graphics, actorToRender.getCanvasTilePoly(), pileColor); } - else + if (config.drawPileHull()) { - text = "PILE SIZE: " + actorArrayList.size(); + OverlayUtil.renderPolygon(graphics, actorToRender.getConvexHull(), pileColor); } - - OverlayUtil.renderPolygon(graphics, actorToRender.getCanvasTilePoly(), pileColor); OverlayUtil.renderTextLocation(graphics, actorToRender.getCanvasTextLocation(graphics, text, 40), text, pileColor); - } + } catch (Exception ignored) { } @@ -89,4 +92,5 @@ public class PileIndicatorsOverlay extends Overlay return null; } + } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsPlugin.java index 4685d1a64f..2afa035caa 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsPlugin.java @@ -27,7 +27,11 @@ package net.runelite.client.plugins.pileindicators; import com.google.inject.Binder; import com.google.inject.Provides; import lombok.extern.slf4j.Slf4j; -import net.runelite.api.*; +import net.runelite.api.Actor; +import net.runelite.api.Client; +import net.runelite.api.NPC; +import net.runelite.api.Player; +import net.runelite.api.Varbits; import net.runelite.client.config.ConfigManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; @@ -40,11 +44,11 @@ import java.awt.*; import java.util.ArrayList; @PluginDescriptor( - name = "Pile Indicators", - description = "Highlight and count how many npcs/players are stacked on each other.", - tags = {"overlay", "pile", "stack", "pvp", "pvm", "pve"}, - type = PluginType.UTILITY, - enabledByDefault = false + name = "Pile Indicators", + description = "Highlight and count how many npcs/players are stacked on each other.", + tags = {"overlay", "pile", "stack", "pvp", "pvm", "pve"}, + type = PluginType.UTILITY, + enabledByDefault = false ) @Singleton diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsConfig.java index be6e7f0067..47ce1fd775 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsConfig.java @@ -29,7 +29,6 @@ import net.runelite.api.ClanMemberRank; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Range; @ConfigGroup("playerindicators") public interface PlayerIndicatorsConfig extends Config @@ -365,46 +364,6 @@ public interface PlayerIndicatorsConfig extends Config return Color.WHITE; } - @ConfigItem( - position = 27, - keyName = "highlightPile", - name = "Highlight Pile", - description = "Highlights Pile Onscreen", - group = "Callers" - ) - default boolean highlightPile() - { - return false; - } - - @ConfigItem( - position = 29, - keyName = "drawPileHull", - name = "Draws the hull of the pile.", - description = "Draws the hull of the pile for best visibility.", - group = "Callers" - ) - default boolean drawPileHull() - { - return false; - } - - @Range( - min = 1, - max = 10 - ) - @ConfigItem( - position = 30, - keyName = "pileColor", - name = "Pile Color", - description = "Color of Indicated Pile", - group = "Callers" - ) - default Color pileColor() - { - return Color.WHITE; - } - @ConfigItem( position = 27, keyName = "unchargedGlory", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java index 85ff9f4192..bd9d0bed03 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java @@ -172,10 +172,6 @@ public class PlayerIndicatorsOverlay extends Overlay { name = "[C] " + name; } - if (config.highlightPile() && playerIndicatorsPlugin.isPile(actor)) - { - name = "[P] " + name; - } if (config.showCombatLevel()) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsPlugin.java index 2bf360fdc2..12358a2273 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsPlugin.java @@ -29,9 +29,7 @@ import java.awt.Color; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Objects; import javax.inject.Inject; -import net.runelite.api.Actor; import net.runelite.api.ClanMember; import net.runelite.api.ClanMemberRank; import static net.runelite.api.ClanMemberRank.UNRANKED; @@ -54,7 +52,6 @@ import net.runelite.api.Player; import net.runelite.api.events.ClanMemberJoined; import net.runelite.api.events.ClanMemberLeft; import net.runelite.api.events.ConfigChanged; -import net.runelite.api.events.GameTick; import net.runelite.api.events.MenuEntryAdded; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; @@ -128,35 +125,6 @@ public class PlayerIndicatorsPlugin extends Plugin } } - @Subscribe - public void onGameTick(GameTick gameTick) - { - if (config.highlightPile() && callers != null) - { - for (Player p : client.getPlayers()) - { - for (String name : callers) - { - Actor pile; - String finalName = name.toLowerCase().replace("_", " "); - if (p.getName().toLowerCase().replace("_", " ").equals(finalName)) - { - pile = p.getInteracting(); - if (pile != null) - { - pileList.set(callers.indexOf(name), pile.getName()); - //pileList.add(pile.getName()); - } - else - { - pileList.set(callers.indexOf(name), ""); - } - } - } - } - } - } - @Subscribe public void onClanMemberJoined(ClanMemberJoined event) { @@ -213,14 +181,6 @@ public class PlayerIndicatorsPlugin extends Plugin return false; } - boolean isPile(Player player) - { - if (Objects.nonNull(pileList) && pileList.size() > 0) - { - return pileList.contains(player.getName()); - } - return false; - } @Subscribe public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded) @@ -328,10 +288,6 @@ public class PlayerIndicatorsPlugin extends Plugin { color = config.callerColor(); } - if (config.colorPlayerMenu() && config.highlightPile() && this.isPile(player)) - { - color = config.pileColor(); - } if (image != -1 || color != null) { MenuEntry[] menuEntries = client.getMenuEntries(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsService.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsService.java index 0fae391e05..51717af33f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsService.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsService.java @@ -50,8 +50,7 @@ public class PlayerIndicatorsService public void forEachPlayer(final BiConsumer consumer) { if (!config.highlightOwnPlayer() && !config.drawClanMemberNames() - && !config.highlightFriends() && !config.highlightNonClanMembers() && !config.highlightTargets() - && !config.highlightPile() && !config.highlightCallers() && !config.highlightTeamMembers()) + && !config.highlightFriends() && !config.highlightNonClanMembers() && !config.highlightTargets() && !config.highlightCallers() && !config.highlightTeamMembers()) { return; } @@ -107,11 +106,6 @@ public class PlayerIndicatorsService { consumer.accept(player, config.callerColor()); } - if (config.highlightPile() && playerIndicatorsPlugin.isPile(player) - && !player.isClanMember()) - { - consumer.accept(player, config.pileColor()); - } } } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsTileOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsTileOverlay.java index bf69efda5f..5ae7299db6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsTileOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsTileOverlay.java @@ -25,8 +25,6 @@ package net.runelite.client.plugins.playerindicators; -import java.awt.BasicStroke; -import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Polygon; @@ -58,18 +56,6 @@ public class PlayerIndicatorsTileOverlay extends Overlay @Override public Dimension render(Graphics2D graphics) { - if (config.drawPileHull()) - { - playerIndicatorsService.forEachPlayer((player, color) -> - { - if (playerIndicatorsPlugin.isPile(player)) - { - Polygon objectClickbox = player.getConvexHull(); - - renderPoly(graphics, config.pileColor(), objectClickbox); - } - }); - } if (!config.drawTiles() /*&& !config.drawPlayerHull()*/) { return null; @@ -89,15 +75,4 @@ public class PlayerIndicatorsTileOverlay extends Overlay return null; } - private void renderPoly(Graphics2D graphics, Color color, Polygon polygon) - { - if (polygon != null) - { - graphics.setColor(color); - graphics.setStroke(new BasicStroke(2)); - graphics.draw(polygon); - graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 20)); - graphics.fill(polygon); - } - } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/puzzlesolver/PuzzleSolverPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/puzzlesolver/PuzzleSolverPlugin.java index a2dfb8577b..d0d194cf1f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/puzzlesolver/PuzzleSolverPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/puzzlesolver/PuzzleSolverPlugin.java @@ -138,7 +138,7 @@ public class PuzzleSolverPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked) { - int widgetId = menuOptionClicked.getWidgetId(); + int widgetId = menuOptionClicked.getActionParam1(); if (TO_GROUP(widgetId) != WidgetID.LIGHT_BOX_GROUP_ID) { return; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PlayerCountOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PlayerCountOverlay.java index 1cb2079421..1952838914 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PlayerCountOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PlayerCountOverlay.java @@ -16,6 +16,9 @@ import java.awt.Dimension; import java.awt.Graphics2D; import java.util.Arrays; import javax.inject.Inject; +import net.runelite.api.Client; +import net.runelite.api.Varbits; +import net.runelite.api.WorldType; import net.runelite.client.ui.overlay.Overlay; import net.runelite.client.ui.overlay.OverlayLayer; import net.runelite.client.ui.overlay.OverlayPosition; @@ -23,18 +26,23 @@ import net.runelite.client.ui.overlay.OverlayPriority; import net.runelite.client.ui.overlay.components.table.TableComponent; import net.runelite.client.ui.overlay.components.table.TableElement; import net.runelite.client.ui.overlay.components.table.TableRow; +import org.apache.commons.lang3.ArrayUtils; public class PlayerCountOverlay extends Overlay { + private static int[] CLAN_WARS_REGIONS = {9520, 13135, 13134, 13133, 13131, 13130, 13387, 13386}; private final PvpToolsPlugin pvpToolsPlugin; private final PvpToolsConfig config; + private final Client client; + @Inject - public PlayerCountOverlay(PvpToolsPlugin pvpToolsPlugin, PvpToolsConfig pvpToolsConfig) + public PlayerCountOverlay(PvpToolsPlugin pvpToolsPlugin, PvpToolsConfig pvpToolsConfig, Client client) { this.pvpToolsPlugin = pvpToolsPlugin; this.config = pvpToolsConfig; + this.client = client; setLayer(OverlayLayer.ABOVE_WIDGETS); setPriority(OverlayPriority.HIGHEST); setPosition(OverlayPosition.TOP_LEFT); @@ -46,17 +54,23 @@ public class PlayerCountOverlay extends Overlay { if (config.countPlayers()) { - TableComponent tableComponent = new TableComponent(); - TableElement[] firstRowElements = { + if ((client.getVar(Varbits.IN_WILDERNESS) == 1) || WorldType.isPvpWorld(client.getWorldType()) + || ArrayUtils.contains(CLAN_WARS_REGIONS, client.getMapRegions()[0]) || + WorldType.isDeadmanWorld(client.getWorldType())) + { + // Make this stop showing up when its not relevant + TableComponent tableComponent = new TableComponent(); + TableElement[] firstRowElements = { TableElement.builder().content("Friendly").color(Color.GREEN).build(), - TableElement.builder().content(String.valueOf(pvpToolsPlugin.getFriendlyPlayerCount())).build()}; - TableRow firstRow = TableRow.builder().elements(Arrays.asList(firstRowElements)).build(); - TableElement[] secondRowElements = { - TableElement.builder().content("Enemy").color(Color.RED).build(), - TableElement.builder().content(String.valueOf(pvpToolsPlugin.getEnemyPlayerCount())).build()}; - TableRow secondRow = TableRow.builder().elements(Arrays.asList(secondRowElements)).build(); - tableComponent.addRows(firstRow, secondRow); - return tableComponent.render(graphics); + TableElement.builder().content(String.valueOf(pvpToolsPlugin.getFriendlyPlayerCount())).build()}; + TableRow firstRow = TableRow.builder().elements(Arrays.asList(firstRowElements)).build(); + TableElement[] secondRowElements = { + TableElement.builder().content("Enemy").color(Color.RED).build(), + TableElement.builder().content(String.valueOf(pvpToolsPlugin.getEnemyPlayerCount())).build()}; + TableRow secondRow = TableRow.builder().elements(Arrays.asList(secondRowElements)).build(); + tableComponent.addRows(firstRow, secondRow); + return tableComponent.render(graphics); + } } return null; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsPlugin.java index 39ed25ccda..0fda9fe9af 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsPlugin.java @@ -178,10 +178,10 @@ public class PvpToolsPlugin extends Plugin }; private final HotkeyListener renderselfHotkeyListener = new HotkeyListener(() -> config.renderSelf()) - { //TODO FIX + { public void hotkeyPressed() { - //client.toggleRenderSelf(); + client.setRenderSelf(!client.getRenderSelf()); } }; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java index c1c55c5111..dec84b0a5f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java @@ -59,6 +59,18 @@ public interface RaidsConfig extends Config return true; } + @ConfigItem( + position = 2, + parent = "scouterConfig", + keyName = "hideBackground", + name = "Hide Scouter Background", + description = "Removes the scouter background, and makes it transparent." + ) + default boolean hideBackground() + { + return true; + } + @ConfigItem( position = 2, parent = "scouterConfig", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsOverlay.java index b65e380c1b..3c15b0b678 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsOverlay.java @@ -52,6 +52,7 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE; import net.runelite.client.ui.overlay.OverlayMenuEntry; import net.runelite.client.ui.overlay.OverlayPosition; import net.runelite.client.ui.overlay.OverlayPriority; +import net.runelite.client.ui.overlay.components.ComponentConstants; import net.runelite.client.ui.overlay.components.ComponentOrientation; import net.runelite.client.ui.overlay.components.ImageComponent; import net.runelite.client.ui.overlay.components.PanelComponent; @@ -154,6 +155,15 @@ public class RaidsOverlay extends Overlay scouterActive = false; panelComponent.getChildren().clear(); + if (config.hideBackground()) + { + panelComponent.setBackgroundColor(null); + } + else + { + panelComponent.setBackgroundColor(ComponentConstants.STANDARD_BACKGROUND_COLOR); + } + if (plugin.getRaid() == null || plugin.getRaid().getLayout() == null) { panelComponent.getChildren().add(TitleComponent.builder() @@ -279,14 +289,13 @@ public class RaidsOverlay extends Overlay scavsBeforeIceRooms.add(prev); } int lastScavs = scavRooms.get(scavRooms.size() - 1); - if (!recordRaid()) - { - panelComponent.getChildren().add(TitleComponent.builder() - .text(displayLayout) - .color(color) - .build()); - } - else + + panelComponent.getChildren().add(TitleComponent.builder() + .text(displayLayout) + .color(color) + .build()); + + if (recordRaid()) { panelComponent.getChildren().add(TitleComponent.builder() .text("Record Raid") @@ -294,6 +303,17 @@ public class RaidsOverlay extends Overlay .build()); panelComponent.setBackgroundColor(new Color(0, 255, 0, 10)); } + else + { + if (config.hideBackground()) + { + panelComponent.setBackgroundColor(null); + } + else + { + panelComponent.setBackgroundColor(ComponentConstants.STANDARD_BACKGROUND_COLOR); + } + } TableComponent tableComponent = new TableComponent(); tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT); @@ -304,7 +324,7 @@ public class RaidsOverlay extends Overlay String clanOwner = Text.removeTags(client.getWidget(WidgetInfo.CLAN_CHAT_OWNER).getText()); if (clanOwner.equals("None")) { - clanOwner = "Open CC tab..."; + clanOwner = "Open CC Tab"; color = Color.RED; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPanel.java index 7c62909195..0f4e8c916b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPanel.java @@ -27,7 +27,6 @@ package net.runelite.client.plugins.raids; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.event.ActionEvent; -import java.lang.reflect.Method; import javax.inject.Inject; import javax.swing.BorderFactory; import javax.swing.JButton; @@ -78,22 +77,9 @@ class RaidsPanel extends PluginPanel JPanel scoutFrame = new JPanel(); reloadButton.addActionListener((ActionEvent e) -> { - - if ((client.getGameState() == GameState.LOGGED_IN)) { - try - { - //look for client.gameStateChanged(-1); in src files to find - Method m = client.getClass().getClassLoader().loadClass("ba").getDeclaredMethod("ec", int.class, byte.class); - m.setAccessible(true); - m.invoke(null, 40, (byte) 3); - - } - catch (ReflectiveOperationException f) - { - throw new RuntimeException(f); - } + client.setGameState(40); } }); reloadScouter.addActionListener((ActionEvent e) -> diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuConfig.java index 48d0d3efb3..0e44decfa0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuConfig.java @@ -28,16 +28,29 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.Stub; @ConfigGroup("runedoku") public interface RunedokuConfig extends Config { @ConfigItem( - position = 0, - keyName = "mindRuneColor", - name = "Mind Rune Color", - description = "Color used to highlight Mind runes." + position = 0, + keyName = "colorStub", + name = "Colors", + description = "" //stubs don't show descriptions when hovered over + ) + default Stub colorStub() + { + return new Stub(); + } + + @ConfigItem( + position = 1, + keyName = "mindRuneColor", + name = "Mind Rune Color", + description = "Color used to highlight Mind runes.", + parent = "colorStub" ) default Color mindRuneColor() { @@ -45,10 +58,11 @@ public interface RunedokuConfig extends Config } @ConfigItem( - position = 1, - keyName = "fireRuneColor", - name = "Fire Rune Color", - description = "Color used to highlight Fire runes." + position = 2, + keyName = "fireRuneColor", + name = "Fire Rune Color", + description = "Color used to highlight Fire runes.", + parent = "colorStub" ) default Color fireRuneColor() { @@ -56,10 +70,11 @@ public interface RunedokuConfig extends Config } @ConfigItem( - position = 2, - keyName = "bodyRuneColor", - name = "Body Rune Color", - description = "Color used to highlight Body runes." + position = 3, + keyName = "bodyRuneColor", + name = "Body Rune Color", + description = "Color used to highlight Body runes.", + parent = "colorStub" ) default Color bodyRuneColor() { @@ -67,10 +82,11 @@ public interface RunedokuConfig extends Config } @ConfigItem( - position = 3, - keyName = "airRuneColor", - name = "Air Rune Color", - description = "Color used to highlight Air runes." + position = 4, + keyName = "airRuneColor", + name = "Air Rune Color", + description = "Color used to highlight Air runes.", + parent = "colorStub" ) default Color airRuneColor() { @@ -78,10 +94,11 @@ public interface RunedokuConfig extends Config } @ConfigItem( - position = 4, - keyName = "deathRuneColor", - name = "Death Rune Color", - description = "Color used to highlight Death runes." + position = 5, + keyName = "deathRuneColor", + name = "Death Rune Color", + description = "Color used to highlight Death runes.", + parent = "colorStub" ) default Color deathRuneColor() { @@ -89,10 +106,11 @@ public interface RunedokuConfig extends Config } @ConfigItem( - position = 5, - keyName = "waterRuneColor", - name = "Water Rune Color", - description = "Color used to highlight Water runes." + position = 6, + keyName = "waterRuneColor", + name = "Water Rune Color", + description = "Color used to highlight Water runes.", + parent = "colorStub" ) default Color waterRuneColor() { @@ -100,10 +118,11 @@ public interface RunedokuConfig extends Config } @ConfigItem( - position = 6, - keyName = "chaosRuneColor", - name = "Chaos Rune Color", - description = "Color used to highlight Chaos runes." + position = 7, + keyName = "chaosRuneColor", + name = "Chaos Rune Color", + description = "Color used to highlight Chaos runes.", + parent = "colorStub" ) default Color chaosRuneColor() { @@ -111,10 +130,11 @@ public interface RunedokuConfig extends Config } @ConfigItem( - position = 7, - keyName = "earthRuneColor", - name = "Earth Rune Color", - description = "Color used to highlight Earth runes." + position = 8, + keyName = "earthRuneColor", + name = "Earth Rune Color", + description = "Color used to highlight Earth runes.", + parent = "colorStub" ) default Color earthRuneColor() { @@ -122,14 +142,37 @@ public interface RunedokuConfig extends Config } @ConfigItem( - position = 8, - keyName = "lawRuneColor", - name = "Law Rune Color", - description = "Color used to highlight Law runes." + position = 9, + keyName = "lawRuneColor", + name = "Law Rune Color", + description = "Color used to highlight Law runes.", + parent = "colorStub" ) default Color lawRuneColor() { return Color.CYAN; } + @ConfigItem( + position = 10, + keyName = "miscFeature", + name = "Miscellaneous Features", + description = "" + ) + default Stub miscFeature() + { + return new Stub(); + } + + @ConfigItem( + position = 11, + keyName = "onlyHighlightSelectedPiece", + name = "Only Highlight Selected Piece", + description = "Instead of showing all, this option only show what rune you have selected." + ) + default boolean onlyHighlightSelectedPiece() + { + return false; + } + } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuOverlay.java index 2394c66166..5e44e55bee 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuOverlay.java @@ -47,15 +47,17 @@ class RunedokuOverlay extends Overlay private final RunedokuPlugin plugin; private final Client client; private final RunedokuUtil util; + private final RunedokuConfig config; @Inject - private RunedokuOverlay(final RunedokuPlugin plugin, final Client client, final RunedokuUtil util) + private RunedokuOverlay(final RunedokuPlugin plugin, final Client client, final RunedokuUtil util, final RunedokuConfig config) { super(plugin); this.plugin = plugin; this.client = client; this.util = util; + this.config = config; setPosition(OverlayPosition.DETACHED); setLayer(OverlayLayer.ALWAYS_ON_TOP); @@ -138,7 +140,10 @@ class RunedokuOverlay extends Overlay } else { - OverlayUtil.renderPolygon(graphics, RunedokuUtil.rectangleToPolygon(squareToHighlight.getBounds()), util.sudokuPieceToColor(simpleArr.get(iteration))); + if (!config.onlyHighlightSelectedPiece() ^ (config.onlyHighlightSelectedPiece() && util.getSelectedPiece(client) == simpleArr.get(iteration))) + { + OverlayUtil.renderPolygon(graphics, RunedokuUtil.rectangleToPolygon(squareToHighlight.getBounds()), util.sudokuPieceToColor(simpleArr.get(iteration))); + } } iteration++; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuUtil.java b/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuUtil.java index 8dba20275d..36c5ac5662 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuUtil.java @@ -180,4 +180,41 @@ class RunedokuUtil return myArr; } + /** + * @param client + * @return + */ + int getSelectedPiece(Client client) + { + for (int i = 91; i < 100; i++) + { + Widget selectedPieceWidget = client.getWidget(288, i); + if (!selectedPieceWidget.isHidden()) + { + switch (i) + { + case 91: + return 8; + case 92: + return 6; + case 93: + return 4; + case 94: + return 2; + case 95: + return 1; + case 96: + return 3; + case 97: + return 5; + case 98: + return 7; + case 99: + return 9; + } + } + } + return -1; + } + } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java index 845dd15ac1..e15e641d33 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java @@ -784,7 +784,7 @@ public class SlayerPlugin extends Plugin private boolean doubleTroubleExtraKill() { return WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation()).getRegionID() == GROTESQUE_GUARDIANS_REGION && - SlayerUnlock.GROTESQUE_GARDIAN_DOUBLE_COUNT.isEnabled(client); + SlayerUnlock.GROTESQUE_GUARDIAN_DOUBLE_COUNT.isEnabled(client); } // checks if any contiguous subsequence of seq0 exactly matches the String toMatch diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayermusiq/SlayermusiqPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayermusiq/SlayermusiqPlugin.java index 15a363a797..9584d17c34 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/slayermusiq/SlayermusiqPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayermusiq/SlayermusiqPlugin.java @@ -126,10 +126,10 @@ public class SlayermusiqPlugin extends Plugin @Subscribe private void onMenuOptionClicked(MenuOptionClicked ev) { - if (ev.getMenuAction() == MenuAction.RUNELITE && ev.getMenuOption().equals(MENUOP_SLAYERMUSIQ)) + if (ev.getMenuAction() == MenuAction.RUNELITE && ev.getOption().equals(MENUOP_SLAYERMUSIQ)) { ev.consume(); - String quest = Text.removeTags(ev.getMenuTarget()); + String quest = Text.removeTags(ev.getTarget()); QuestGuideLinks.tryOpenGuide(quest, chatMessageManager); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/suppliestracker/SuppliesTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/suppliestracker/SuppliesTrackerPlugin.java index 59193719ea..3731f6df9a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/suppliestracker/SuppliesTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/suppliestracker/SuppliesTrackerPlugin.java @@ -603,23 +603,23 @@ public class SuppliesTrackerPlugin extends Plugin // Create pattern to find eat/drink at beginning Pattern eatPattern = Pattern.compile(EAT_PATTERN); Pattern drinkPattern = Pattern.compile(DRINK_PATTERN); - if (eatPattern.matcher(event.getMenuTarget().toLowerCase()).find() || drinkPattern.matcher(event.getMenuTarget().toLowerCase()).find()) + if (eatPattern.matcher(event.getTarget().toLowerCase()).find() || drinkPattern.matcher(event.getTarget().toLowerCase()).find()) { if (actionStack.stream().noneMatch(a -> { if (a instanceof MenuAction.ItemAction) { MenuAction.ItemAction i = (MenuAction.ItemAction) a; - return i.getItemID() == event.getId(); + return i.getItemID() == event.getIdentifier(); } return false; })) { old = client.getItemContainer(InventoryID.INVENTORY); - int slot = event.getActionParam(); + int slot = event.getActionParam0(); if (old.getItems() != null) { - int pushItem = old.getItems()[event.getActionParam()].getId(); + int pushItem = old.getItems()[event.getActionParam0()].getId(); MenuAction newAction = new MenuAction.ItemAction(CONSUMABLE, old.getItems(), pushItem, slot); actionStack.push(newAction); } @@ -629,8 +629,8 @@ public class SuppliesTrackerPlugin extends Plugin // Create pattern for teleport scrolls and tabs Pattern teleportPattern = Pattern.compile(TELEPORT_PATTERN); Pattern teletabPattern = Pattern.compile(TELETAB_PATTERN); - if (teleportPattern.matcher(event.getMenuTarget().toLowerCase()).find() || - teletabPattern.matcher(event.getMenuTarget().toLowerCase()).find()) + if (teleportPattern.matcher(event.getTarget().toLowerCase()).find() || + teletabPattern.matcher(event.getTarget().toLowerCase()).find()) { old = client.getItemContainer(InventoryID.INVENTORY); @@ -638,17 +638,17 @@ public class SuppliesTrackerPlugin extends Plugin if (old != null && old.getItems() != null && actionStack.stream().noneMatch(a -> a.getType() == TELEPORT)) { - int teleid = event.getId(); - MenuAction newAction = new MenuAction.ItemAction(TELEPORT, old.getItems(), teleid, event.getActionParam()); + int teleid = event.getIdentifier(); + MenuAction newAction = new MenuAction.ItemAction(TELEPORT, old.getItems(), teleid, event.getActionParam0()); actionStack.push(newAction); } } // Create pattern for spell cast Pattern spellPattern = Pattern.compile(SPELL_PATTERN); - // note that here we look at the menuOption not menuTarget b/c the option for all spells is cast + // note that here we look at the option not target b/c the option for all spells is cast // but the target differs based on each spell name - if (spellPattern.matcher(event.getMenuOption().toLowerCase()).find()) + if (spellPattern.matcher(event.getOption().toLowerCase()).find()) { old = client.getItemContainer(InventoryID.INVENTORY); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index d0e166492c..db7048c094 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -126,13 +126,13 @@ public class TimersPlugin extends Plugin private static final String CANNON_REPAIR_MESSAGE = "You repair your cannon, restoring it to working order."; private static final String CHARGE_EXPIRED_MESSAGE = "Your magical charge fades away."; private static final String CHARGE_MESSAGE = "You feel charged with magic power."; - private static final String DEADMAN_HALF_TELEBLOCK_MESSAGE = "A teleblock spell has been cast on you. It will expire in 1 minute, 15 seconds."; + private static final String DEADMAN_HALF_TELEBLOCK_MESSAGE = "A Tele Block spell has been cast on you. It will expire in 1 minute, 15 seconds."; private static final String EXTENDED_ANTIFIRE_DRINK_MESSAGE = "You drink some of your extended antifire potion."; private static final String EXTENDED_SUPER_ANTIFIRE_DRINK_MESSAGE = "You drink some of your extended super antifire potion."; private static final String FROZEN_MESSAGE = "You have been frozen!"; - private static final String FULL_TELEBLOCK_MESSAGE = "A teleblock spell has been cast on you. It will expire in 5 minutes, 0 seconds."; + private static final String FULL_TELEBLOCK_MESSAGE = "A Tele Block spell has been cast on you. It will expire in 5 minutes, 0 seconds."; private static final String GOD_WARS_ALTAR_MESSAGE = "you recharge your prayer."; - private static final String HALF_TELEBLOCK_MESSAGE = "A teleblock spell has been cast on you. It will expire in 2 minutes, 30 seconds."; + private static final String HALF_TELEBLOCK_MESSAGE = "A Tele Block spell has been cast on you. It will expire in 2 minutes, 30 seconds."; private static final String IMBUED_HEART_READY_MESSAGE = "Your imbued heart has regained its magical power."; private static final String IMBUED_HEART_NOTREADY_MESSAGE = "The heart is still drained of its power."; private static final String MAGIC_IMBUE_EXPIRED_MESSAGE = "Your Magic Imbue charge has ended."; @@ -396,9 +396,9 @@ public class TimersPlugin extends Plugin public void onMenuOptionClicked(MenuOptionClicked event) { if (config.showStamina() - && event.getMenuOption().contains("Drink") - && (event.getId() == ItemID.STAMINA_MIX1 - || event.getId() == ItemID.STAMINA_MIX2)) + && event.getOption().contains("Drink") + && (event.getIdentifier() == ItemID.STAMINA_MIX1 + || event.getIdentifier() == ItemID.STAMINA_MIX2)) { // Needs menu option hook because mixes use a common drink message, distinct from their standard potion messages createGameTimer(STAMINA); @@ -406,9 +406,9 @@ public class TimersPlugin extends Plugin } if (config.showAntiFire() - && event.getMenuOption().contains("Drink") - && (event.getId() == ItemID.ANTIFIRE_MIX1 - || event.getId() == ItemID.ANTIFIRE_MIX2)) + && event.getOption().contains("Drink") + && (event.getIdentifier() == ItemID.ANTIFIRE_MIX1 + || event.getIdentifier() == ItemID.ANTIFIRE_MIX2)) { // Needs menu option hook because mixes use a common drink message, distinct from their standard potion messages createGameTimer(ANTIFIRE); @@ -416,9 +416,9 @@ public class TimersPlugin extends Plugin } if (config.showAntiFire() - && event.getMenuOption().contains("Drink") - && (event.getId() == ItemID.EXTENDED_ANTIFIRE_MIX1 - || event.getId() == ItemID.EXTENDED_ANTIFIRE_MIX2)) + && event.getOption().contains("Drink") + && (event.getIdentifier() == ItemID.EXTENDED_ANTIFIRE_MIX1 + || event.getIdentifier() == ItemID.EXTENDED_ANTIFIRE_MIX2)) { // Needs menu option hook because mixes use a common drink message, distinct from their standard potion messages createGameTimer(EXANTIFIRE); @@ -426,9 +426,9 @@ public class TimersPlugin extends Plugin } if (config.showAntiFire() - && event.getMenuOption().contains("Drink") - && (event.getId() == ItemID.SUPER_ANTIFIRE_MIX1 - || event.getId() == ItemID.SUPER_ANTIFIRE_MIX2)) + && event.getOption().contains("Drink") + && (event.getIdentifier() == ItemID.SUPER_ANTIFIRE_MIX1 + || event.getIdentifier() == ItemID.SUPER_ANTIFIRE_MIX2)) { // Needs menu option hook because mixes use a common drink message, distinct from their standard potion messages createGameTimer(SUPERANTIFIRE); @@ -436,23 +436,23 @@ public class TimersPlugin extends Plugin } if (config.showAntiFire() - && event.getMenuOption().contains("Drink") - && (event.getId() == ItemID.EXTENDED_SUPER_ANTIFIRE_MIX1 - || event.getId() == ItemID.EXTENDED_SUPER_ANTIFIRE_MIX2)) + && event.getOption().contains("Drink") + && (event.getIdentifier() == ItemID.EXTENDED_SUPER_ANTIFIRE_MIX1 + || event.getIdentifier() == ItemID.EXTENDED_SUPER_ANTIFIRE_MIX2)) { // Needs menu option hook because mixes use a common drink message, distinct from their standard potion messages createGameTimer(EXSUPERANTIFIRE); return; } - TeleportWidget teleportWidget = TeleportWidget.of(event.getWidgetId()); + TeleportWidget teleportWidget = TeleportWidget.of(event.getActionParam1()); if (teleportWidget != null) { lastTeleportClicked = teleportWidget; } if (config.showImbuedHeart() - && event.getMenuOption().contains("Invigorate")) + && event.getOption().contains("Invigorate")) { // Needs a hook as there's a few cases where potions boost the same amount as the heart imbuedHeartClicked = true; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/OverviewItemPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/OverviewItemPanel.java index 520dcb0f3b..973eec5eaa 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/OverviewItemPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/OverviewItemPanel.java @@ -35,6 +35,7 @@ import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; +import net.runelite.api.Constants; import net.runelite.client.game.ItemManager; import net.runelite.client.ui.ColorScheme; import net.runelite.client.ui.FontManager; @@ -60,7 +61,7 @@ class OverviewItemPanel extends JPanel setBorder(new EmptyBorder(7, 7, 7, 7)); JLabel iconLabel = new JLabel(); - iconLabel.setMinimumSize(new Dimension(36, 32)); + iconLabel.setMinimumSize(new Dimension(Constants.ITEM_SPRITE_WIDTH, Constants.ITEM_SPRITE_HEIGHT)); itemManager.getImage(tab.getItemID()).addTo(iconLabel); add(iconLabel, BorderLayout.WEST); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java index 8bbb5ae4ab..c01f770063 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java @@ -33,6 +33,7 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import lombok.Getter; +import net.runelite.api.Constants; import net.runelite.client.ui.ColorScheme; import net.runelite.client.ui.FontManager; import net.runelite.client.ui.components.ThinProgressBar; @@ -58,7 +59,7 @@ public class TimeablePanel extends JPanel topContainer.setLayout(new BorderLayout()); topContainer.setBackground(ColorScheme.DARKER_GRAY_COLOR); - icon.setMinimumSize(new Dimension(36, 32)); + icon.setMinimumSize(new Dimension(Constants.ITEM_SPRITE_WIDTH, Constants.ITEM_SPRITE_HEIGHT)); JPanel infoPanel = new JPanel(); infoPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/wiki/WikiPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/wiki/WikiPlugin.java index 7e32f9382b..8ff438b68f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/wiki/WikiPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/wiki/WikiPlugin.java @@ -215,7 +215,7 @@ public class WikiPlugin extends Plugin case SPELL_CAST_ON_GROUND_ITEM: { type = "item"; - id = itemManager.canonicalize(ev.getId()); + id = itemManager.canonicalize(ev.getIdentifier()); name = itemManager.getItemDefinition(id).getName(); location = null; break; @@ -223,7 +223,7 @@ public class WikiPlugin extends Plugin case SPELL_CAST_ON_NPC: { type = "npc"; - NPC npc = client.getCachedNPCs()[ev.getId()]; + NPC npc = client.getCachedNPCs()[ev.getIdentifier()]; NPCDefinition nc = npc.getTransformedDefinition(); id = nc.getId(); name = nc.getName(); @@ -233,14 +233,14 @@ public class WikiPlugin extends Plugin case SPELL_CAST_ON_GAME_OBJECT: { type = "object"; - ObjectDefinition lc = client.getObjectDefinition(ev.getId()); + ObjectDefinition lc = client.getObjectDefinition(ev.getIdentifier()); if (lc.getImpostorIds() != null) { lc = lc.getImpostor(); } id = lc.getId(); name = lc.getName(); - location = WorldPoint.fromScene(client, ev.getActionParam(), ev.getWidgetId(), client.getPlane()); + location = WorldPoint.fromScene(client, ev.getActionParam0(), ev.getActionParam1(), client.getPlane()); break; } default: @@ -272,14 +272,14 @@ public class WikiPlugin extends Plugin if (ev.getMenuAction() == MenuAction.RUNELITE) { boolean quickguide = false; - switch (ev.getMenuOption()) + switch (ev.getOption()) { case MENUOP_QUICKGUIDE: quickguide = true; //fallthrough; case MENUOP_GUIDE: ev.consume(); - String quest = Text.removeTags(ev.getMenuTarget()); + String quest = Text.removeTags(ev.getTarget()); HttpUrl.Builder ub = WIKI_BASE.newBuilder() .addPathSegment("w") .addPathSegment(quest) @@ -291,8 +291,8 @@ public class WikiPlugin extends Plugin LinkBrowser.browse(ub.build().toString()); break; case MENUOP_WIKI: - Matcher skillRegex = WikiPlugin.SKILL_REGEX.matcher(Text.removeTags(ev.getMenuTarget())); - Matcher diaryRegex = WikiPlugin.DIARY_REGEX.matcher(Text.removeTags(ev.getMenuTarget())); + Matcher skillRegex = WikiPlugin.SKILL_REGEX.matcher(Text.removeTags(ev.getTarget())); + Matcher diaryRegex = WikiPlugin.DIARY_REGEX.matcher(Text.removeTags(ev.getTarget())); if (skillRegex.find()) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java index b49a56a2a0..43f2f73a8a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java @@ -27,151 +27,159 @@ package net.runelite.client.plugins.worldmap; import lombok.Getter; import net.runelite.api.coords.WorldPoint; +import net.runelite.api.Quest; +// Some quests are in the same spot, but they are done in order. If multiple +// quests start in the same location, an array of quests is expected. enum QuestStartLocation { //Free Quests - COOKS_ASSISTANT_RFD("Cook's Assistant", new WorldPoint(3211, 3216, 0)), - THE_CORSAIR_CURSE("The Corsair Curse", new WorldPoint(3029, 3273, 0)), - DEMON_SLAYER("Demon Slayer", new WorldPoint(3204, 3424, 0)), - DORICS_QUEST("Doric's Quest", new WorldPoint(2952, 3450, 0)), - DRAGON_SLAYER("Dragon Slayer", new WorldPoint(3190, 3362, 0)), - ERNEST_THE_CHICKEN("Ernest the Chicken", new WorldPoint(3109, 3330, 0)), - GOBLIN_DIPLOMACY("Goblin Diplomacy", new WorldPoint(2957, 3509, 0)), - IMP_CATCHER("Imp Catcher", new WorldPoint(3108, 3160, 0)), - THE_KNIGHTS_SWORD("The Knight's Sword", new WorldPoint(2976, 3342, 0)), - MISTHALIN_MYSTERY("Misthalin Mystery", new WorldPoint(3234, 3155, 0)), - PIRATES_TREASURE("Pirate's Treasure", new WorldPoint(3051, 3252, 0)), - PRINCE_ALI_RESCUE("Prince Ali Rescue", new WorldPoint(3301, 3163, 0)), - THE_RESTLESS_GHOST("The Restless Ghost", new WorldPoint(3240, 3210, 0)), - RUNE_MYSTERIES("Rune Mysteries", new WorldPoint(3210, 3220, 0)), - SHEEP_SHEARER("Sheep Shearer", new WorldPoint(3190, 3272, 0)), - SHIELD_OF_ARRAV_PHOENIX_GANG("Shield of Arrav (Phoenix Gang)", new WorldPoint(3208, 3495, 0)), - SHIELD_OF_ARRAV_BLACK_ARM_GANG("Shield of Arrav (Black Arm Gang)", new WorldPoint(3208, 3392, 0)), - VAMPIRE_SLAYER("Vampire Slayer", new WorldPoint(3096, 3266, 0)), - WITCHS_POTION("Witch's Potion", new WorldPoint(2967, 3203, 0)), - X_MARKS_THE_SPOT("X Marks the Spot", new WorldPoint(3227, 3242, 0)), + COOKS_ASSISTANT_RFD(Quest.COOKS_ASSISTANT, new WorldPoint(3211, 3216, 0)), + THE_CORSAIR_CURSE(Quest.THE_CORSAIR_CURSE, new WorldPoint(3029, 3273, 0)), + DEMON_SLAYER(Quest.DEMON_SLAYER, new WorldPoint(3204, 3424, 0)), + DORICS_QUEST(Quest.DORICS_QUEST, new WorldPoint(2952, 3450, 0)), + DRAGON_SLAYER(Quest.DRAGON_SLAYER, new WorldPoint(3190, 3362, 0)), + ERNEST_THE_CHICKEN(Quest.ERNEST_THE_CHICKEN, new WorldPoint(3109, 3330, 0)), + GOBLIN_DIPLOMACY(Quest.GOBLIN_DIPLOMACY, new WorldPoint(2957, 3509, 0)), + IMP_CATCHER(Quest.IMP_CATCHER, new WorldPoint(3108, 3160, 0)), + THE_KNIGHTS_SWORD(Quest.THE_KNIGHTS_SWORD, new WorldPoint(2976, 3342, 0)), + MISTHALIN_MYSTERY(Quest.MISTHALIN_MYSTERY, new WorldPoint(3234, 3155, 0)), + PIRATES_TREASURE(Quest.PIRATES_TREASURE, new WorldPoint(3051, 3252, 0)), + PRINCE_ALI_RESCUE(Quest.PRINCE_ALI_RESCUE, new WorldPoint(3301, 3163, 0)), + THE_RESTLESS_GHOST(Quest.THE_RESTLESS_GHOST, new WorldPoint(3240, 3210, 0)), + RUNE_MYSTERIES(Quest.RUNE_MYSTERIES, new WorldPoint(3210, 3220, 0)), + SHEEP_SHEARER(Quest.SHEEP_SHEARER, new WorldPoint(3190, 3272, 0)), + SHIELD_OF_ARRAV(Quest.SHIELD_OF_ARRAV, new WorldPoint(3208, 3495, 0)), + VAMPIRE_SLAYER(Quest.VAMPIRE_SLAYER, new WorldPoint(3096, 3266, 0)), + WITCHS_POTION(Quest.WITCHS_POTION, new WorldPoint(2967, 3203, 0)), + X_MARKS_THE_SPOT(Quest.X_MARKS_THE_SPOT, new WorldPoint(3227, 3242, 0)), //Members' Quests - ANIMAL_MAGNETISM("Animal Magnetism", new WorldPoint(3094, 3360, 0)), - ANOTHER_SLICE_OF_HAM("Another Slice of H.A.M.", new WorldPoint(2799, 5428, 0)), - THE_ASCENT_OF_ARCEUUS("The Ascent of Arceuus", new WorldPoint(1700, 3742, 0)), - BETWEEN_A_ROCK("Between a Rock...", new WorldPoint(2823, 10168, 0)), - BIG_CHOMPY_BIRD_HUNTING("Big Chompy Bird Hunting", new WorldPoint(2629, 2981, 0)), - BIOHAZARD("Biohazard", new WorldPoint(2591, 3335, 0)), - BONE_VOYAGE("Bone Voyage", new WorldPoint(3259, 3450, 0)), - CABIN_FEVER("Cabin Fever", new WorldPoint(3674, 3496, 0)), - CLIENT_OF_KOUREND("Client of Kourend", new WorldPoint(1823, 3690, 0)), - CLOCK_TOWER("Clock Tower", new WorldPoint(2568, 3249, 0)), - COLD_WAR("Cold War", new WorldPoint(2593, 3265, 0)), - CONTACT("Contact!", new WorldPoint(3280, 2770, 0)), - CREATURE_OF_FENKENSTRAIN("Creature of Fenkenstrain", new WorldPoint(3487, 3485, 0)), - DARKNESS_OF_HALLOWVALE("Darkness of Hallowvale", new WorldPoint(3494, 9628, 0)), - DEATH_PLATEAU_TROLL_STRONGHOLD("Death Plateau & Troll Stronghold", new WorldPoint(2895, 3528, 0)), - DEATH_TO_THE_DORGESHUUN("Death to the Dorgeshuun", new WorldPoint(3316, 9613, 0)), - THE_DEPTHS_OF_DESPAIR("The Depths of Despair", new WorldPoint(1846, 3556, 0)), - DESERT_TREASURE("Desert Treasure", new WorldPoint(3177, 3043, 0)), - DEVIOUS_MINDS("Devious Minds", new WorldPoint(3405, 3492, 0)), - THE_DIG_SITE("The Dig Site", new WorldPoint(3363, 3337, 0)), - DRAGON_SLAYER_II("Dragon Slayer II", new WorldPoint(2456, 2868, 0)), - DREAM_MENTOR("Dream Mentor", new WorldPoint(2144, 10346, 0)), - DRUIDIC_RITUAL("Druidic Ritual", new WorldPoint(2916, 3484, 0)), - DWARF_CANNON("Dwarf Cannon", new WorldPoint(2566, 3461, 0)), - EADGARS_RUSE("Eadgar's Ruse", new WorldPoint(2896, 3426, 0)), - EAGLES_PEAK("Eagles' Peak", new WorldPoint(2605, 3264, 0)), - ELEMENTAL_WORKSHOP("Elemental Workshop I & II", new WorldPoint(2714, 3482, 0)), - ENAKHRAS_LAMENT("Enakhra's Lament", new WorldPoint(3190, 2926, 0)), - ENLIGHTENED_JOURNEY("Enlightened Journey", new WorldPoint(2809, 3356, 0)), - THE_EYES_OF_GLOUPHRIE("The Eyes of Glouphrie", new WorldPoint(2400, 3419, 0)), - FAIRYTALE("Fairytale I & II", new WorldPoint(3077, 3258, 0)), - FAMILY_CREST("Family Crest", new WorldPoint(3278, 3404, 0)), - THE_FEUD("The Feud", new WorldPoint(3301, 3211, 0)), - FIGHT_ARENA("Fight Arena", new WorldPoint(2565, 3199, 0)), - FISHING_CONTEST_1("Fishing Contest", new WorldPoint(2875, 3483, 0)), - FISHING_CONTEST_2("Fishing Contest", new WorldPoint(2820, 3487, 0)), - FORGETTABLE_TALE("Forgettable Tale...", new WorldPoint(2826, 10215, 0)), - THE_FORSAKEN_TOWER("The Forsaken Tower", new WorldPoint(1484, 3747, 0)), - THE_FREMENNIK_ISLES("The Fremennik Isles", new WorldPoint(2645, 3711, 0)), - THE_FREMENNIK_TRIALS("The Fremennik Trials", new WorldPoint(2657, 3669, 0)), - GARDEN_OF_TRANQUILLITY("Garden of Tranquillity", new WorldPoint(3227, 3477, 0)), - GERTRUDES_CAT_RATCATCHERS("Gertrude's Cat & Ratcatchers", new WorldPoint(3150, 3411, 0)), - GHOSTS_AHOY("Ghosts Ahoy", new WorldPoint(3677, 3510, 0)), - THE_GIANT_DWARF("The Giant Dwarf", new WorldPoint(2841, 10129, 0)), - THE_GOLEM("The Golem", new WorldPoint(3487, 3089, 0)), - THE_GRAND_TREE_MONKEY_MADNESS("The Grand Tree & Monkey Madness I & II", new WorldPoint(2466, 3497, 0)), - THE_GREAT_BRAIN_ROBBERY("The Great Brain Robbery", new WorldPoint(3681, 2963, 0)), - GRIM_TALES("Grim Tales", new WorldPoint(2890, 3454, 0)), - THE_HAND_IN_THE_SAND("The Hand in the Sand", new WorldPoint(2552, 3101, 0)), - HAUNTED_MINE("Haunted Mine", new WorldPoint(3443, 3258, 0)), - HAZEEL_CULT("Hazeel Cult", new WorldPoint(2565, 3271, 0)), - HEROES_QUEST("Heroes' Quest", new WorldPoint(2903, 3511, 0)), - HOLY_GRAIL("Holy Grail & Merlin's Crystal", new WorldPoint(2763, 3515, 0)), - HORROR_FROM_THE_DEEP("Horror from the Deep", new WorldPoint(2507, 3635, 0)), - ICTHLARINS_LITTLE_HELPER("Icthlarin's Little Helper", new WorldPoint(3314, 2849, 0)), - IN_SEARCH_OF_THE_MYREQUE("In Search of the Myreque", new WorldPoint(3502, 3477, 0)), - JUNGLE_POTION("Jungle Potion", new WorldPoint(2809, 3086, 0)), - KINGS_RANSOM("King's Ransom", new WorldPoint(2741, 3554, 0)), - LEGENDS_QUEST("Legends' Quest", new WorldPoint(2725, 3367, 0)), - LOST_CITY("Lost City", new WorldPoint(3149, 3205, 0)), - THE_LOST_TRIBE("The Lost Tribe", new WorldPoint(3211, 3224, 0)), - LUNAR_DIPLOMACY("Lunar Diplomacy", new WorldPoint(2619, 3689, 0)), - MAKING_FRIENDS_WITH_MY_ARM("Making Friends with My Arm", new WorldPoint(2904, 10092, 0)), - MAKING_HISTORY("Making History", new WorldPoint(2435, 3346, 0)), - MONKS_FRIEND("Monk's Friend", new WorldPoint(2605, 3209, 0)), - MOUNTAIN_DAUGHTER("Mountain Daughter", new WorldPoint(2810, 3672, 0)), - MOURNINGS_ENDS_PART_I("Mourning's Ends Part I", new WorldPoint(2289, 3149, 0)), - MOURNINGS_ENDS_PART_II("Mourning's Ends Part II", new WorldPoint(2352, 3172, 0)), - MURDER_MYSTERY("Murder Mystery", new WorldPoint(2740, 3562, 0)), - MY_ARMS_BIG_ADVENTURE("My Arm's Big Adventure", new WorldPoint(2908, 10088, 0)), - NATURE_SPIRIT("Nature Spirit", new WorldPoint(3440, 9894, 0)), - OBSERVATORY_QUEST("Observatory Quest", new WorldPoint(2438, 3185, 0)), - OLAFS_QUEST("Olaf's Quest", new WorldPoint(2723, 3729, 0)), - ONE_SMALL_FAVOUR("One Small Favour", new WorldPoint(2834, 2985, 0)), - PLAGUE_CITY("Plague City", new WorldPoint(2567, 3334, 0)), - PRIEST_IN_PERIL("Priest in Peril", new WorldPoint(3219, 3473, 0)), - THE_QUEEN_OF_THIEVES("The Queen of Thieves", new WorldPoint(1795, 3782, 0)), - RAG_AND_BONE_MAN("Rag and Bone Man I & II", new WorldPoint(3359, 3504, 0)), - RECRUITMENT_DRIVE_BLACK_KNIGHTS_FORTRESS("Recruitment Drive & Black Knights' Fortress", new WorldPoint(2959, 3336, 0)), - ROVING_ELVES("Roving Elves", new WorldPoint(2289, 3146, 0)), - RUM_DEAL("Rum Deal", new WorldPoint(3679, 3535, 0)), - SCORPION_CATCHER("Scorpion Catcher", new WorldPoint(2701, 3399, 0)), - SEA_SLUG("Sea Slug", new WorldPoint(2715, 3302, 0)), - SHADES_OF_MORTTON("Shades of Mort'ton", new WorldPoint(3463, 3308, 0)), - SHADOW_OF_THE_STORM("Shadow of the Storm", new WorldPoint(3270, 3159, 0)), - SHEEP_HERDER("Sheep Herder", new WorldPoint(2616, 3299, 0)), - SHILO_VILLAGE("Shilo Village", new WorldPoint(2882, 2951, 0)), - A_SOULS_BANE("A Soul's Bane", new WorldPoint(3307, 3454, 0)), - SPIRITS_OF_THE_ELID("Spirits of the Elid", new WorldPoint(3441, 2911, 0)), - SWAN_SONG("Swan Song", new WorldPoint(2345, 3652, 0)), - TAI_BWO_WANNAI_TRIO("Tai Bwo Wannai Trio", new WorldPoint(2779, 3087, 0)), - A_TAIL_OF_TWO_CATS("A Tail of Two Cats", new WorldPoint(2917, 3557, 0)), - TALE_OF_THE_RIGHTEOUS("Tale of the Righteous", new WorldPoint(1511, 3631, 0)), - A_TASTE_OF_HOPE("A Taste of Hope", new WorldPoint(3668, 3216, 0)), - TEARS_OF_GUTHIX("Tears of Guthix", new WorldPoint(3251, 9517, 0)), - TEMPLE_OF_IKOV("Temple of Ikov", new WorldPoint(2574, 3320, 0)), - THRONE_OF_MISCELLANIA_ROYAL_TROUBLE("Throne of Miscellania & Royal Trouble", new WorldPoint(2497, 3859, 0)), - THE_TOURIST_TRAP("The Tourist Trap", new WorldPoint(3302, 3113, 0)), - TOWER_OF_LIFE("Tower of Life", new WorldPoint(2640, 3218, 0)), - TREE_GNOME_VILLAGE("Tree Gnome Village", new WorldPoint(2541, 3169, 0)), - TRIBAL_TOTEM("Tribal Totem", new WorldPoint(2790, 3182, 0)), - TROLL_ROMANCE("Troll Romance", new WorldPoint(2890, 10097, 0)), - UNDERGROUND_PASS_REGICIDE("Underground Pass & Regicide", new WorldPoint(2575, 3293, 0)), - WANTED_SLUG_MENACE("Wanted! & The Slug Menace", new WorldPoint(2996, 3373, 0)), - WATCHTOWER("Watchtower", new WorldPoint(2545, 3112, 0)), - WATERFALL_QUEST("Waterfall Quest", new WorldPoint(2521, 3498, 0)), - WHAT_LIES_BELOW("What Lies Below", new WorldPoint(3265, 3333, 0)), - WITCHS_HOUSE("Witch's House", new WorldPoint(2927, 3456, 0)), - ZOGRE_FLESH_EATERS("Zogre Flesh Eaters", new WorldPoint(2442, 3051, 0)); - - @Getter - private final String tooltip; + ANIMAL_MAGNETISM(Quest.ANIMAL_MAGNETISM, new WorldPoint(3094, 3360, 0)), + ANOTHER_SLICE_OF_HAM(Quest.ANOTHER_SLICE_OF_HAM, new WorldPoint(2799, 5428, 0)), + THE_ASCENT_OF_ARCEUUS(Quest.THE_ASCENT_OF_ARCEUUS, new WorldPoint(1700, 3742, 0)), + BETWEEN_A_ROCK(Quest.BETWEEN_A_ROCK, new WorldPoint(2823, 10168, 0)), + BIG_CHOMPY_BIRD_HUNTING(Quest.BIG_CHOMPY_BIRD_HUNTING, new WorldPoint(2629, 2981, 0)), + BIOHAZARD(Quest.BIOHAZARD, new WorldPoint(2591, 3335, 0)), + BONE_VOYAGE(Quest.BONE_VOYAGE, new WorldPoint(3259, 3450, 0)), + CABIN_FEVER(Quest.CABIN_FEVER, new WorldPoint(3674, 3496, 0)), + CLIENT_OF_KOUREND(Quest.CLIENT_OF_KOUREND, new WorldPoint(1823, 3690, 0)), + CLOCK_TOWER(Quest.CLOCK_TOWER, new WorldPoint(2568, 3249, 0)), + COLD_WAR(Quest.COLD_WAR, new WorldPoint(2593, 3265, 0)), + CONTACT(Quest.CONTACT, new WorldPoint(3280, 2770, 0)), + CREATURE_OF_FENKENSTRAIN(Quest.CREATURE_OF_FENKENSTRAIN, new WorldPoint(3487, 3485, 0)), + DARKNESS_OF_HALLOWVALE(Quest.DARKNESS_OF_HALLOWVALE, new WorldPoint(3494, 9628, 0)), + DEATH_PLATEAU_TROLL_STRONGHOLD(new Quest[]{Quest.DEATH_PLATEAU, Quest.TROLL_STRONGHOLD}, new WorldPoint(2895, 3528, 0)), + DEATH_TO_THE_DORGESHUUN(Quest.DEATH_TO_THE_DORGESHUUN, new WorldPoint(3316, 9613, 0)), + THE_DEPTHS_OF_DESPAIR(Quest.THE_DEPTHS_OF_DESPAIR, new WorldPoint(1846, 3556, 0)), + DESERT_TREASURE(Quest.DESERT_TREASURE, new WorldPoint(3177, 3043, 0)), + DEVIOUS_MINDS(Quest.DEVIOUS_MINDS, new WorldPoint(3405, 3492, 0)), + THE_DIG_SITE(Quest.THE_DIG_SITE, new WorldPoint(3363, 3337, 0)), + DRAGON_SLAYER_II(Quest.DRAGON_SLAYER_II, new WorldPoint(2456, 2868, 0)), + DREAM_MENTOR(Quest.DREAM_MENTOR, new WorldPoint(2144, 10346, 0)), + DRUIDIC_RITUAL(Quest.DRUIDIC_RITUAL, new WorldPoint(2916, 3484, 0)), + DWARF_CANNON(Quest.DWARF_CANNON, new WorldPoint(2566, 3461, 0)), + EADGARS_RUSE(Quest.EADGARS_RUSE, new WorldPoint(2896, 3426, 0)), + EAGLES_PEAK(Quest.EAGLES_PEAK, new WorldPoint(2605, 3264, 0)), + ELEMENTAL_WORKSHOP(new Quest[]{Quest.ELEMENTAL_WORKSHOP_I, Quest.ELEMENTAL_WORKSHOP_II}, new WorldPoint(2714, 3482, 0)), + ENAKHRAS_LAMENT(Quest.ENAKHRAS_LAMENT, new WorldPoint(3190, 2926, 0)), + ENLIGHTENED_JOURNEY(Quest.ENLIGHTENED_JOURNEY, new WorldPoint(2809, 3356, 0)), + THE_EYES_OF_GLOUPHRIE(Quest.THE_EYES_OF_GLOUPHRIE, new WorldPoint(2400, 3419, 0)), + FAIRYTALE(new Quest[]{Quest.FAIRYTALE_I__GROWING_PAINS, Quest.FAIRYTALE_II__CURE_A_QUEEN}, new WorldPoint(3077, 3258, 0)), + FAMILY_CREST(Quest.FAMILY_CREST, new WorldPoint(3278, 3404, 0)), + THE_FEUD(Quest.THE_FEUD, new WorldPoint(3301, 3211, 0)), + FIGHT_ARENA(Quest.FIGHT_ARENA, new WorldPoint(2565, 3199, 0)), + FISHING_CONTEST_1(Quest.FISHING_CONTEST, new WorldPoint(2875, 3483, 0)), + FISHING_CONTEST_2(Quest.FISHING_CONTEST, new WorldPoint(2820, 3487, 0)), + FORGETTABLE_TALE(Quest.FORGETTABLE_TALE, new WorldPoint(2826, 10215, 0)), + THE_FORSAKEN_TOWER(Quest.THE_FORSAKEN_TOWER, new WorldPoint(1484, 3747, 0)), + THE_FREMENNIK_ISLES(Quest.THE_FREMENNIK_ISLES, new WorldPoint(2645, 3711, 0)), + THE_FREMENNIK_TRIALS(Quest.THE_FREMENNIK_TRIALS, new WorldPoint(2657, 3669, 0)), + GARDEN_OF_TRANQUILLITY(Quest.GARDEN_OF_TRANQUILLITY, new WorldPoint(3227, 3477, 0)), + GERTRUDES_CAT_RATCATCHERS(Quest.GERTRUDES_CAT, new WorldPoint(3150, 3411, 0)), + GHOSTS_AHOY(Quest.GHOSTS_AHOY, new WorldPoint(3677, 3510, 0)), + THE_GIANT_DWARF(Quest.THE_GIANT_DWARF, new WorldPoint(2841, 10129, 0)), + THE_GOLEM(Quest.THE_GOLEM, new WorldPoint(3487, 3089, 0)), + THE_GRAND_TREE_MONKEY_MADNESS(new Quest[]{Quest.THE_GRAND_TREE, Quest.MONKEY_MADNESS_I, Quest.MONKEY_MADNESS_II}, new WorldPoint(2466, 3497, 0)), + THE_GREAT_BRAIN_ROBBERY(Quest.THE_GREAT_BRAIN_ROBBERY, new WorldPoint(3681, 2963, 0)), + GRIM_TALES(Quest.GRIM_TALES, new WorldPoint(2890, 3454, 0)), + THE_HAND_IN_THE_SAND(Quest.THE_HAND_IN_THE_SAND, new WorldPoint(2552, 3101, 0)), + HAUNTED_MINE(Quest.HAUNTED_MINE, new WorldPoint(3443, 3258, 0)), + HAZEEL_CULT(Quest.HAZEEL_CULT, new WorldPoint(2565, 3271, 0)), + HEROES_QUEST(Quest.HEROES_QUEST, new WorldPoint(2903, 3511, 0)), + HOLY_GRAIL(new Quest[]{Quest.MERLINS_CRYSTAL, Quest.HOLY_GRAIL}, new WorldPoint(2763, 3515, 0)), + HORROR_FROM_THE_DEEP(Quest.HORROR_FROM_THE_DEEP, new WorldPoint(2507, 3635, 0)), + ICTHLARINS_LITTLE_HELPER(Quest.ICTHLARINS_LITTLE_HELPER, new WorldPoint(3314, 2849, 0)), + IN_SEARCH_OF_THE_MYREQUE(Quest.IN_SEARCH_OF_THE_MYREQUE, new WorldPoint(3502, 3477, 0)), + JUNGLE_POTION(Quest.JUNGLE_POTION, new WorldPoint(2809, 3086, 0)), + KINGS_RANSOM(Quest.KINGS_RANSOM, new WorldPoint(2741, 3554, 0)), + LEGENDS_QUEST(Quest.LEGENDS_QUEST, new WorldPoint(2725, 3367, 0)), + LOST_CITY(Quest.LOST_CITY, new WorldPoint(3149, 3205, 0)), + THE_LOST_TRIBE(Quest.THE_LOST_TRIBE, new WorldPoint(3211, 3224, 0)), + LUNAR_DIPLOMACY(Quest.LUNAR_DIPLOMACY, new WorldPoint(2619, 3689, 0)), + MAKING_FRIENDS_WITH_MY_ARM(Quest.MAKING_FRIENDS_WITH_MY_ARM, new WorldPoint(2904, 10092, 0)), + MAKING_HISTORY(Quest.MAKING_HISTORY, new WorldPoint(2435, 3346, 0)), + MONKS_FRIEND(Quest.MONKS_FRIEND, new WorldPoint(2605, 3209, 0)), + MOUNTAIN_DAUGHTER(Quest.MOUNTAIN_DAUGHTER, new WorldPoint(2810, 3672, 0)), + MOURNINGS_ENDS_PART_I(Quest.MOURNINGS_ENDS_PART_I, new WorldPoint(2289, 3149, 0)), + MOURNINGS_ENDS_PART_II(Quest.MOURNINGS_ENDS_PART_II, new WorldPoint(2352, 3172, 0)), + MURDER_MYSTERY(Quest.MURDER_MYSTERY, new WorldPoint(2740, 3562, 0)), + MY_ARMS_BIG_ADVENTURE(Quest.MY_ARMS_BIG_ADVENTURE, new WorldPoint(2908, 10088, 0)), + NATURE_SPIRIT(Quest.NATURE_SPIRIT, new WorldPoint(3440, 9894, 0)), + OBSERVATORY_QUEST(Quest.OBSERVATORY_QUEST, new WorldPoint(2438, 3185, 0)), + OLAFS_QUEST(Quest.OLAFS_QUEST, new WorldPoint(2723, 3729, 0)), + ONE_SMALL_FAVOUR(Quest.ONE_SMALL_FAVOUR, new WorldPoint(2834, 2985, 0)), + PLAGUE_CITY(Quest.PLAGUE_CITY, new WorldPoint(2567, 3334, 0)), + PRIEST_IN_PERIL(Quest.PRIEST_IN_PERIL, new WorldPoint(3219, 3473, 0)), + THE_QUEEN_OF_THIEVES(Quest.THE_QUEEN_OF_THIEVES, new WorldPoint(1795, 3782, 0)), + RAG_AND_BONE_MAN(new Quest[]{Quest.RAG_AND_BONE_MAN, Quest.RAG_AND_BONE_MAN_II}, new WorldPoint(3359, 3504, 0)), + RECRUITMENT_DRIVE_BLACK_KNIGHTS_FORTRESS(new Quest[]{Quest.BLACK_KNIGHTS_FORTRESS, Quest.RECRUITMENT_DRIVE}, new WorldPoint(2959, 3336, 0)), + ROVING_ELVES(Quest.ROVING_ELVES, new WorldPoint(2289, 3146, 0)), + RUM_DEAL(Quest.RUM_DEAL, new WorldPoint(3679, 3535, 0)), + SCORPION_CATCHER(Quest.SCORPION_CATCHER, new WorldPoint(2701, 3399, 0)), + SEA_SLUG(Quest.SEA_SLUG, new WorldPoint(2715, 3302, 0)), + SHADES_OF_MORTTON(Quest.SHADES_OF_MORTTON, new WorldPoint(3463, 3308, 0)), + SHADOW_OF_THE_STORM(Quest.SHADOW_OF_THE_STORM, new WorldPoint(3270, 3159, 0)), + SHEEP_HERDER(Quest.SHEEP_HERDER, new WorldPoint(2616, 3299, 0)), + SHILO_VILLAGE(Quest.SHILO_VILLAGE, new WorldPoint(2882, 2951, 0)), + A_SOULS_BANE(Quest.A_SOULS_BANE, new WorldPoint(3307, 3454, 0)), + SPIRITS_OF_THE_ELID(Quest.SPIRITS_OF_THE_ELID, new WorldPoint(3441, 2911, 0)), + SWAN_SONG(Quest.SWAN_SONG, new WorldPoint(2345, 3652, 0)), + TAI_BWO_WANNAI_TRIO(Quest.TAI_BWO_WANNAI_TRIO, new WorldPoint(2779, 3087, 0)), + A_TAIL_OF_TWO_CATS(Quest.A_TAIL_OF_TWO_CATS, new WorldPoint(2917, 3557, 0)), + TALE_OF_THE_RIGHTEOUS(Quest.TALE_OF_THE_RIGHTEOUS, new WorldPoint(1511, 3631, 0)), + A_TASTE_OF_HOPE(Quest.A_TASTE_OF_HOPE, new WorldPoint(3668, 3216, 0)), + TEARS_OF_GUTHIX(Quest.TEARS_OF_GUTHIX, new WorldPoint(3251, 9517, 0)), + TEMPLE_OF_IKOV(Quest.TEMPLE_OF_IKOV, new WorldPoint(2574, 3320, 0)), + THRONE_OF_MISCELLANIA_ROYAL_TROUBLE(new Quest[]{Quest.THRONE_OF_MISCELLANIA, Quest.ROYAL_TROUBLE}, new WorldPoint(2497, 3859, 0)), + THE_TOURIST_TRAP(Quest.THE_TOURIST_TRAP, new WorldPoint(3302, 3113, 0)), + TOWER_OF_LIFE(Quest.TOWER_OF_LIFE, new WorldPoint(2640, 3218, 0)), + TREE_GNOME_VILLAGE(Quest.TREE_GNOME_VILLAGE, new WorldPoint(2541, 3169, 0)), + TRIBAL_TOTEM(Quest.TRIBAL_TOTEM, new WorldPoint(2790, 3182, 0)), + TROLL_ROMANCE(Quest.TROLL_ROMANCE, new WorldPoint(2890, 10097, 0)), + UNDERGROUND_PASS_REGICIDE(new Quest[]{Quest.REGICIDE, Quest.UNDERGROUND_PASS}, new WorldPoint(2575, 3293, 0)), + WANTED_SLUG_MENACE(new Quest[]{Quest.WANTED, Quest.THE_SLUG_MENACE}, new WorldPoint(2996, 3373, 0)), + WATCHTOWER(Quest.WATCHTOWER, new WorldPoint(2545, 3112, 0)), + WATERFALL_QUEST(Quest.WATERFALL_QUEST, new WorldPoint(2521, 3498, 0)), + WHAT_LIES_BELOW(Quest.WHAT_LIES_BELOW, new WorldPoint(3265, 3333, 0)), + WITCHS_HOUSE(Quest.WITCHS_HOUSE, new WorldPoint(2927, 3456, 0)), + ZOGRE_FLESH_EATERS(Quest.ZOGRE_FLESH_EATERS, new WorldPoint(2442, 3051, 0)); @Getter private final WorldPoint location; - QuestStartLocation(String description, WorldPoint location) + @Getter + private final Quest[] quests; + + QuestStartLocation(Quest[] quests, WorldPoint location) { - this.tooltip = "Quest Start - " + description; this.location = location; + this.quests = quests; + } + + QuestStartLocation(Quest quest, WorldPoint location) + { + this.location = location; + this.quests = new Quest[]{quest}; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartPoint.java index ad84a3aa5b..4bd778188c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartPoint.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartPoint.java @@ -25,15 +25,15 @@ */ package net.runelite.client.plugins.worldmap; +import net.runelite.api.coords.WorldPoint; import java.awt.image.BufferedImage; import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; class QuestStartPoint extends WorldMapPoint { - QuestStartPoint(QuestStartLocation data, BufferedImage icon) + QuestStartPoint(WorldPoint location, BufferedImage icon, String tooltip) { - super(data.getLocation(), icon); - - setTooltip(data.getTooltip()); + super(location, icon); + setTooltip(tooltip); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java index ca62df484d..7ebe417ef2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java @@ -166,8 +166,8 @@ public interface WorldMapConfig extends Config @ConfigItem( keyName = WorldMapPlugin.CONFIG_KEY_QUEST_START_TOOLTIPS, - name = "Show quest names", - description = "Indicates the names of quests and highlights incomplete ones", + name = "Show quest names and status", + description = "Indicates the names of quests and shows completion status", position = 13 ) default boolean questStartTooltips() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java index f936fd4bf1..d5be4c8591 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java @@ -31,9 +31,15 @@ import java.awt.image.BufferedImage; import java.util.Arrays; import net.runelite.api.Client; import net.runelite.api.Experience; +import net.runelite.api.GameState; import net.runelite.api.Skill; +import net.runelite.api.Quest; +import net.runelite.api.QuestState; import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.ExperienceChanged; +import net.runelite.api.events.WidgetLoaded; +import net.runelite.api.widgets.WidgetID; +import net.runelite.client.callback.ClientThread; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.game.AgilityShortcut; @@ -52,6 +58,9 @@ public class WorldMapPlugin extends Plugin static final BufferedImage BLANK_ICON; private static final BufferedImage FAIRY_TRAVEL_ICON; private static final BufferedImage NOPE_ICON; + private static final BufferedImage NOT_STARTED_ICON; + private static final BufferedImage STARTED_ICON; + private static final BufferedImage FINISHED_ICON; static final String CONFIG_KEY = "worldmap"; static final String CONFIG_KEY_FAIRY_RING_TOOLTIPS = "fairyRingTooltips"; @@ -77,6 +86,9 @@ public class WorldMapPlugin extends Plugin //A size of 17 gives us a buffer when triggering tooltips final int iconBufferSize = 17; + //Quest icons are a bit bigger. + final int questIconBufferSize = 22; + BLANK_ICON = new BufferedImage(iconBufferSize, iconBufferSize, BufferedImage.TYPE_INT_ARGB); FAIRY_TRAVEL_ICON = new BufferedImage(iconBufferSize, iconBufferSize, BufferedImage.TYPE_INT_ARGB); @@ -86,11 +98,26 @@ public class WorldMapPlugin extends Plugin NOPE_ICON = new BufferedImage(iconBufferSize, iconBufferSize, BufferedImage.TYPE_INT_ARGB); final BufferedImage nopeImage = ImageUtil.getResourceStreamFromClass(WorldMapPlugin.class, "nope_icon.png"); NOPE_ICON.getGraphics().drawImage(nopeImage, 1, 1, null); + + NOT_STARTED_ICON = new BufferedImage(questIconBufferSize, questIconBufferSize, BufferedImage.TYPE_INT_ARGB); + final BufferedImage notStartedIcon = ImageUtil.getResourceStreamFromClass(WorldMapPlugin.class, "quest_not_started_icon.png"); + NOT_STARTED_ICON.getGraphics().drawImage(notStartedIcon, 4, 4, null); + + STARTED_ICON = new BufferedImage(questIconBufferSize, questIconBufferSize, BufferedImage.TYPE_INT_ARGB); + final BufferedImage startedIcon = ImageUtil.getResourceStreamFromClass(WorldMapPlugin.class, "quest_started_icon.png"); + STARTED_ICON.getGraphics().drawImage(startedIcon, 4, 4, null); + + FINISHED_ICON = new BufferedImage(questIconBufferSize, questIconBufferSize, BufferedImage.TYPE_INT_ARGB); + final BufferedImage finishedIcon = ImageUtil.getResourceStreamFromClass(WorldMapPlugin.class, "quest_completed_icon.png"); + FINISHED_ICON.getGraphics().drawImage(finishedIcon, 4, 4, null); } @Inject private Client client; + @Inject + private ClientThread clientThread; + @Inject private WorldMapConfig config; @@ -164,6 +191,17 @@ public class WorldMapPlugin extends Plugin } } + @Subscribe + public void onWidgetLoaded(WidgetLoaded widgetLoaded) + { + if (widgetLoaded.getGroupId() == WidgetID.WORLD_MAP_GROUP_ID) + { + // Quest icons are per-account due to showing quest status, + // so we recreate them each time the map is loaded + updateQuestStartPointIcons(); + } + } + private void updateAgilityIcons() { worldMapPointManager.removeIf(AgilityShortcutPoint.class::isInstance); @@ -200,6 +238,7 @@ public class WorldMapPlugin extends Plugin { updateAgilityIcons(); updateRareTreeIcons(); + updateQuestStartPointIcons(); worldMapPointManager.removeIf(FairyRingPoint.class::isInstance); if (config.fairyRingIcon() || config.fairyRingTooltips()) @@ -219,14 +258,6 @@ public class WorldMapPlugin extends Plugin .forEach(worldMapPointManager::add); } - worldMapPointManager.removeIf(QuestStartPoint.class::isInstance); - if (config.questStartTooltips()) - { - Arrays.stream(QuestStartLocation.values()) - .map(value -> new QuestStartPoint(value, BLANK_ICON)) - .forEach(worldMapPointManager::add); - } - worldMapPointManager.removeIf(TransportationPoint.class::isInstance); if (config.transportationTeleportTooltips()) { @@ -271,4 +302,72 @@ public class WorldMapPlugin extends Plugin }).map(TeleportPoint::new) .forEach(worldMapPointManager::add); } + + private void updateQuestStartPointIcons() + { + worldMapPointManager.removeIf(QuestStartPoint.class::isInstance); + + if (!config.questStartTooltips()) + { + return; + } + + // Must setup the quest icons on the client thread, after the player has logged in. + clientThread.invokeLater(() -> + { + if (client.getGameState() != GameState.LOGGED_IN) + { + return false; + } + + Arrays.stream(QuestStartLocation.values()) + .map(this::createQuestStartPoint) + .forEach(worldMapPointManager::add); + return true; + }); + } + + private QuestStartPoint createQuestStartPoint(QuestStartLocation data) + { + Quest[] quests = data.getQuests(); + + // Get first uncompleted quest. Else, return the last quest. + Quest quest = null; + for (int i = 0; i < quests.length; i++) + { + if (quests[i].getState(client) != QuestState.FINISHED) + { + quest = quests[i]; + break; + } + } + if (quest == null) + { + quest = quests[quests.length - 1]; + } + + BufferedImage icon = BLANK_ICON; + String tooltip = ""; + if (quest != null) + { + tooltip = quest.getName(); + switch (quest.getState(client)) + { + case FINISHED: + icon = FINISHED_ICON; + tooltip += " - Finished"; + break; + case IN_PROGRESS: + icon = STARTED_ICON; + tooltip += " - Started"; + break; + case NOT_STARTED: + icon = NOT_STARTED_ICON; + tooltip += " - Not Started"; + break; + } + } + + return new QuestStartPoint(data.getLocation(), icon, tooltip); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xtea/XteaPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/xtea/XteaPlugin.java index 3393974613..e8e31dd0f2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xtea/XteaPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xtea/XteaPlugin.java @@ -81,6 +81,12 @@ public class XteaPlugin extends Plugin log.debug("Region {} keys {}, {}, {}, {}", region, keys[0], keys[1], keys[2], keys[3]); + //Don't post non encrypted regions + if (keys[0] == 0 && keys[1] == 0 && keys[2] == 0 && keys[3] == 0) + { + continue; + } + XteaKey xteaKey = new XteaKey(); xteaKey.setRegion(region); xteaKey.setKeys(keys); diff --git a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java index c13c821178..1024da016f 100644 --- a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java +++ b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java @@ -26,55 +26,27 @@ */ package net.runelite.client.rs; -import net.runelite.api.Client; +import java.net.URLClassLoader; import java.applet.Applet; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; -import java.net.HttpURLConnection; import java.net.URL; -import java.net.URLConnection; -import java.nio.channels.Channels; -import java.nio.channels.ReadableByteChannel; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.jar.Attributes; -import java.util.jar.JarEntry; -import java.util.jar.JarInputStream; -import java.util.jar.Manifest; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; import lombok.extern.slf4j.Slf4j; -import static net.runelite.client.RuneLite.RUNELITE_DIR; -import static net.runelite.client.rs.ClientUpdateCheckMode.AUTO; -import static net.runelite.client.rs.ClientUpdateCheckMode.CUSTOM; -import static net.runelite.client.rs.ClientUpdateCheckMode.VANILLA; -import net.runelite.http.api.RuneLiteAPI; -import okhttp3.Request; -import okhttp3.Response; @Slf4j @Singleton public class ClientLoader { - private static final File LOCAL_INJECTED_CLIENT = new File("./injected-client/target/injected-client-" + RuneLiteAPI.getVersion() + ".jar"); - private static final File INJECTED_CLIENT = new File(RUNELITE_DIR + "/injected-client.jar"); private final ClientConfigLoader clientConfigLoader; private ClientUpdateCheckMode updateCheckMode; public static boolean useLocalInjected = false; @Inject private ClientLoader( - @Named("updateCheckMode") final ClientUpdateCheckMode updateCheckMode, - final ClientConfigLoader clientConfigLoader) + @Named("updateCheckMode") final ClientUpdateCheckMode updateCheckMode, + final ClientConfigLoader clientConfigLoader) { this.updateCheckMode = updateCheckMode; this.clientConfigLoader = clientConfigLoader; @@ -84,126 +56,26 @@ public class ClientLoader { try { - Manifest manifest = new Manifest(); - manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0"); - RSConfig config = clientConfigLoader.fetch(); + final RSConfig config = clientConfigLoader.fetch(); - Map zipFile = new HashMap<>(); - - if (updateCheckMode == VANILLA) + switch (updateCheckMode) { - Certificate[] jagexCertificateChain = getJagexCertificateChain(); - String codebase = config.getCodeBase(); - String initialJar = config.getInitialJar(); - URL url = new URL(codebase + initialJar); - Request request = new Request.Builder() - .url(url) - .build(); - - try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute()) - { - JarInputStream jis; - - jis = new JarInputStream(response.body().byteStream()); - byte[] tmp = new byte[4096]; - ByteArrayOutputStream buffer = new ByteArrayOutputStream(756 * 1024); - for (; ; ) - { - JarEntry metadata = jis.getNextJarEntry(); - if (metadata == null) - { - break; - } - - buffer.reset(); - for (; ; ) - { - int n = jis.read(tmp); - if (n <= -1) - { - break; - } - buffer.write(tmp, 0, n); - } - - if (!Arrays.equals(metadata.getCertificates(), jagexCertificateChain)) - { - if (metadata.getName().startsWith("META-INF/")) - { - // META-INF/JAGEXLTD.SF and META-INF/JAGEXLTD.RSA are not signed, but we don't need - // anything in META-INF anyway. - continue; - } - else - { - throw new VerificationException("Unable to verify jar entry: " + metadata.getName()); - } - } - - zipFile.put(metadata.getName(), buffer.toByteArray()); - } - } + case AUTO: + default: + return loadRLPlus(config); + case VANILLA: + return loadVanilla(config); + case NONE: + return null; } - else if (updateCheckMode == CUSTOM || useLocalInjected) - { - log.info("Loading injected client from {}", LOCAL_INJECTED_CLIENT.getAbsolutePath()); - loadJar(zipFile, LOCAL_INJECTED_CLIENT); - } - else if (updateCheckMode == AUTO) - { - URL url = new URL("https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/injected-client.jar"); - ReadableByteChannel readableByteChannel = Channels.newChannel(url.openStream()); - INJECTED_CLIENT.mkdirs(); - - if (!INJECTED_CLIENT.exists() || getFileSize(INJECTED_CLIENT.toURI().toURL()) != getFileSize(url)) - { - log.info("{} injected client", INJECTED_CLIENT.exists() ? "Updating" : "Initializing"); - INJECTED_CLIENT.delete(); - INJECTED_CLIENT.createNewFile(); - updateInjectedClient(readableByteChannel); - } - - log.info("Loading injected client from {}", INJECTED_CLIENT.getAbsolutePath()); - loadJar(zipFile, INJECTED_CLIENT); - } - - String initialClass = config.getInitialClass(); - - ClassLoader rsClassLoader = new ClassLoader(ClientLoader.class.getClassLoader()) - { - @Override - protected Class findClass(String name) throws ClassNotFoundException - { - String path = name.replace('.', '/').concat(".class"); - byte[] data = zipFile.get(path); - if (data == null) - { - throw new ClassNotFoundException(name); - } - - return defineClass(name, data, 0, data.length); - } - }; - - Class clientClass = rsClassLoader.loadClass(initialClass); - - Applet rs = (Applet) clientClass.newInstance(); - rs.setStub(new RSAppletStub(config)); - - if (rs instanceof Client) - { - log.info("client-patch 420 blaze it RL pricks"); - } - - return rs; } - catch (IOException | ClassNotFoundException | InstantiationException | IllegalAccessException | SecurityException | VerificationException | CertificateException e) + catch (IOException | ClassNotFoundException | InstantiationException | IllegalAccessException e) { if (e instanceof ClassNotFoundException) { log.error("Unable to load client - class not found. This means you" - + " are not running RuneLite with Maven as the client patch" - + " is not in your classpath."); + + " are not running RuneLite with Maven as the injected client" + + " is not in your classpath."); } log.error("Error loading RS!", e); @@ -211,66 +83,31 @@ public class ClientLoader } } - private static int getFileSize(URL url) throws IOException + private static Applet loadRLPlus(final RSConfig config) throws ClassNotFoundException, InstantiationException, IllegalAccessException { - URLConnection conn = null; - try - { - conn = url.openConnection(); - if (conn instanceof HttpURLConnection) - { - ((HttpURLConnection) conn).setRequestMethod("HEAD"); - } - conn.getInputStream(); - return conn.getContentLength(); - } - finally - { - if (conn instanceof HttpURLConnection) - { - ((HttpURLConnection) conn).disconnect(); - } - } + // the injected client is a runtime scoped dependency + final Class clientClass = ClientLoader.class.getClassLoader().loadClass(config.getInitialClass()); + return loadFromClass(config, clientClass); } - private void updateInjectedClient(ReadableByteChannel readableByteChannel) throws IOException + private static Applet loadVanilla(final RSConfig config) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { - FileOutputStream fileOutputStream = new FileOutputStream(INJECTED_CLIENT); - fileOutputStream.getChannel() - .transferFrom(readableByteChannel, 0, Integer.MAX_VALUE); + final String codebase = config.getCodeBase(); + final String initialJar = config.getInitialJar(); + final String initialClass = config.getInitialClass(); + final URL url = new URL(codebase + initialJar); + + // Must set parent classloader to null, or it will pull from + // this class's classloader first + final URLClassLoader classloader = new URLClassLoader(new URL[]{url}, null); + final Class clientClass = classloader.loadClass(initialClass); + return loadFromClass(config, clientClass); } - private static Certificate[] getJagexCertificateChain() throws CertificateException + private static Applet loadFromClass(final RSConfig config, final Class clientClass) throws IllegalAccessException, InstantiationException { - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(ClientLoader.class.getResourceAsStream("jagex.crt")); - return certificates.toArray(new Certificate[0]); - } - - private static void loadJar(Map toMap, File fromFile) throws IOException - { - JarInputStream fis = new JarInputStream(new FileInputStream(fromFile)); - byte[] tmp = new byte[4096]; - ByteArrayOutputStream buffer = new ByteArrayOutputStream(756 * 1024); - for (; ; ) - { - JarEntry metadata = fis.getNextJarEntry(); - if (metadata == null) - { - break; - } - - buffer.reset(); - for (; ; ) - { - int n = fis.read(tmp); - if (n <= -1) - { - break; - } - buffer.write(tmp, 0, n); - } - toMap.put(metadata.getName(), buffer.toByteArray()); - } + final Applet rs = (Applet) clientClass.newInstance(); + rs.setStub(new RSAppletStub(config)); + return rs; } } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java index 8788886d87..d68a7acbc1 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java @@ -130,13 +130,13 @@ public class OverlayManager event.consume(); - Optional optionalOverlay = overlays.stream().filter(o -> overlays.indexOf(o) == event.getId()).findAny(); + Optional optionalOverlay = overlays.stream().filter(o -> overlays.indexOf(o) == event.getIdentifier()).findAny(); if (optionalOverlay.isPresent()) { Overlay overlay = optionalOverlay.get(); List menuEntries = overlay.getMenuEntries(); Optional optionalOverlayMenuEntry = menuEntries.stream() - .filter(me -> me.getOption().equals(event.getMenuOption())) + .filter(me -> me.getOption().equals(event.getOption())) .findAny(); if (optionalOverlayMenuEntry.isPresent()) { diff --git a/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Artifact.java b/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Artifact.java deleted file mode 100644 index 466dfbcf11..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Artifact.java +++ /dev/null @@ -1,9 +0,0 @@ -package net.runelite.client.util.bootstrap; - -public class Artifact -{ - String hash; - String name; - String path; - String size; -} diff --git a/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrap.java b/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrap.java index 6892d31f75..b8e6d60d94 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrap.java +++ b/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrap.java @@ -14,9 +14,16 @@ import net.runelite.http.api.RuneLiteAPI; public class Bootstrap { + class Artifact + { + String hash; + String name; + String path; + String size; + } - String buildCommit = "c554ab2400dc04a619b36695da2107648c9c87b3"; - Artifact[] artifacts = getArtifacts(); + String buildCommit = "2d0c2b8eb66a8088b41b29d42ec2a58ead460581"; + private Artifact[] artifacts = getArtifacts(); Client client = new Client(); String[] clientJvm9Arguments = new String[]{ "-XX:+DisableAttachMechanism", @@ -46,54 +53,32 @@ public class Bootstrap "-XX:+UseParNewGC", "-Djna.nosys=true"}; - public Bootstrap() + Bootstrap() { } public static String getChecksumObject(Serializable object) throws IOException, NoSuchAlgorithmException { - ByteArrayOutputStream baos = null; - ObjectOutputStream oos = null; - try + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos)) { - baos = new ByteArrayOutputStream(); - oos = new ObjectOutputStream(baos); oos.writeObject(object); MessageDigest md = MessageDigest.getInstance("MD5"); byte[] thedigest = md.digest(baos.toByteArray()); return DatatypeConverter.printHexBinary(thedigest); } - finally - { - oos.close(); - baos.close(); - } } - private static String getChecksumFile(String filepath) throws IOException + private static String getChecksumFile(String filepath) throws IOException, NoSuchAlgorithmException { System.out.println("Generating Hash for " + filepath); - MessageDigest md = null; - try - { - md = MessageDigest.getInstance("SHA-256"); - } - catch (Exception e) - { - e.printStackTrace(); - } + MessageDigest md = MessageDigest.getInstance("SHA-256"); + try (DigestInputStream dis = new DigestInputStream(new FileInputStream(filepath), md)) { - while (dis.read() != -1) - { - //empty loop to clear the data - } + //empty loop to clear the data + while (dis.read() != -1); md = dis.getMessageDigest(); } - catch (Exception e) - { - e.printStackTrace(); - } return bytesToHex(md.digest()); @@ -111,11 +96,11 @@ public class Bootstrap } - public Artifact[] getArtifacts() + private Artifact[] getArtifacts() { try { - artifacts = new Artifact[42]; + artifacts = new Artifact[43]; //Static artifacts artifacts[0] = new Artifact(); @@ -330,8 +315,13 @@ public class Bootstrap artifacts[37].hash = getChecksumFile("./http-api/target/" + artifacts[37].name); artifacts[37].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[37].name; artifacts[37].size = Long.toString(getFileSize("./http-api/target/" + artifacts[37].name)); + artifacts[42] = new Artifact(); + artifacts[42].name = "injected-client-" + RuneLiteAPI.getVersion() + ".jar"; + artifacts[42].hash = getChecksumFile("./injected-client/target/" + artifacts[42].name); + artifacts[42].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[42].name; + artifacts[42].size = Long.toString(getFileSize("./injected-client/target/" + artifacts[42].name)); } - catch (IOException e) + catch (IOException | NoSuchAlgorithmException e) { e.printStackTrace(); } diff --git a/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrapper.java b/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrapper.java index 3a124c0b71..b74b0453c2 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrapper.java +++ b/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrapper.java @@ -10,11 +10,9 @@ public class Bootstrapper public static void main(String[] args) { Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create(); - try + try (FileWriter fw = new FileWriter("./bootstrap.json")) { - FileWriter fw = new FileWriter("./bootstrap.json"); gson.toJson(new Bootstrap(), fw); - fw.close(); } catch (Exception e) { diff --git a/runelite-client/src/main/resources/item_variations.json b/runelite-client/src/main/resources/item_variations.json index 8105a02ee2..987169cb75 100644 --- a/runelite-client/src/main/resources/item_variations.json +++ b/runelite-client/src/main/resources/item_variations.json @@ -176,6 +176,10 @@ 237, 1487 ], + "wine of zamorak": [ + 245, + 23489 + ], "key": [ 275, 423, diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back.png b/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back_30px.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back.png rename to runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back_30px.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back_large.png b/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back_90px.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back_large.png rename to runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back_90px.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front.png b/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front_30px.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front.png rename to runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front_30px.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front_large.png b/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front_90px.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front_large.png rename to runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front_90px.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_crafting.json b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_crafting.json index 69a8d2d54f..0d098baf3a 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_crafting.json +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_crafting.json @@ -367,12 +367,30 @@ "name": "Topaz Amulet (U)", "xp": 80 }, + { + "level": 45, + "icon": 6328, + "name": "Snakeskin boots", + "xp": 30 + }, { "level": 46, "icon": 567, "name": "Unpowered Orb", "xp": 52.5 }, + { + "level": 47, + "icon": 6330, + "name": "Snakeskin vambraces", + "xp": 35 + }, + { + "level": 48, + "icon": 6326, + "name": "Snakeskin bandana", + "xp": 45 + }, { "level": 49, "icon": 4542, @@ -385,6 +403,18 @@ "name": "Ruby Amulet (U)", "xp": 85 }, + { + "level": 51, + "icon": 6324, + "name": "Snakeskin chaps", + "xp": 50 + }, + { + "level": 53, + "icon": 6322, + "name": "Snakeskin body", + "xp": 55 + }, { "level": 54, "icon": 1395, diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_completed_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_completed_icon.png new file mode 100644 index 0000000000..71193ddba2 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_completed_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_not_started_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_not_started_icon.png new file mode 100644 index 0000000000..c383d269ce Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_not_started_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_started_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_started_icon.png new file mode 100644 index 0000000000..bd23865486 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_started_icon.png differ diff --git a/runelite-client/src/main/resources/npc_stats.json b/runelite-client/src/main/resources/npc_stats.json index 9b820a41db..2542737c5e 100644 --- a/runelite-client/src/main/resources/npc_stats.json +++ b/runelite-client/src/main/resources/npc_stats.json @@ -3200,39 +3200,38 @@ "magicDef": 20, "bonusAttack": 30 }, + "472": { + "name": "Dark wizard", + "hitpoints": 24, + "combatLevel": 20, + "attackLevel": 5, + "strengthLevel": 2, + "defenceLevel": 5, + "rangeLevel": 1, + "magicLevel": 6, + "magicDef": 3 + }, "473": { - "name": "Zygomite", - "hitpoints": 65, - "combatLevel": 74, - "slayerLevel": 57, - "attackLevel": 65, - "strengthLevel": 65, - "defenceLevel": 65, - "rangeLevel": 65, - "magicLevel": 65, - "stabDef": 10, - "slashDef": 10, - "crushDef": 10, - "rangeDef": 20, - "magicDef": 20, - "bonusAttack": 30 + "name": "Invrigar the Necromancer", + "hitpoints": 24, + "combatLevel": 20, + "attackLevel": 17, + "strengthLevel": 17, + "defenceLevel": 14, + "rangeLevel": 1, + "magicLevel": 18, + "magicDef": 3 }, "474": { - "name": "Zygomite", - "hitpoints": 75, - "combatLevel": 86, - "slayerLevel": 57, - "attackLevel": 75, - "strengthLevel": 75, - "defenceLevel": 75, - "rangeLevel": 75, - "magicLevel": 75, - "stabDef": 10, - "slashDef": 10, - "crushDef": 10, - "rangeDef": 20, - "magicDef": 20, - "bonusAttack": 30 + "name": "Dark wizard", + "hitpoints": 12, + "combatLevel": 7, + "attackLevel": 5, + "strengthLevel": 2, + "defenceLevel": 5, + "rangeLevel": 1, + "magicLevel": 6, + "magicDef": 3 }, "475": { "name": "Hole in the wall", @@ -3445,6 +3444,194 @@ "poisonImmune": true, "venomImmune": true }, + "505": { + "name": "Mugger", + "hitpoints": 8, + "combatLevel": 6, + "attackLevel": 5, + "strengthLevel": 5, + "defenceLevel": 5, + "rangeLevel": 1, + "magicLevel": 1 + }, + "508": { + "name": "Black Knight", + "hitpoints": 42, + "combatLevel": 33, + "attackLevel": 25, + "strengthLevel": 25, + "defenceLevel": 25, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 73, + "slashDef": 76, + "crushDef": 70, + "rangeDef": 72, + "bonusAttack": 18, + "bonusStrength": 16 + }, + "509": { + "name": "Black Knight", + "hitpoints": 42, + "combatLevel": 33, + "attackLevel": 25, + "strengthLevel": 25, + "defenceLevel": 25, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 73, + "slashDef": 76, + "crushDef": 70, + "rangeDef": 72, + "bonusAttack": 18, + "bonusStrength": 16 + }, + "510": { + "name": "Highwayman", + "hitpoints": 13, + "combatLevel": 5, + "attackLevel": 2, + "strengthLevel": 2, + "defenceLevel": 4, + "rangeLevel": 1, + "magicLevel": 1, + "slashDef": 3, + "crushDef": 2, + "rangeDef": 2, + "bonusAttack": 6, + "bonusStrength": 7 + }, + "511": { + "name": "Highwayman", + "hitpoints": 13, + "combatLevel": 5, + "attackLevel": 2, + "strengthLevel": 2, + "defenceLevel": 4, + "rangeLevel": 1, + "magicLevel": 1, + "slashDef": 3, + "crushDef": 2, + "rangeDef": 2, + "bonusAttack": 6, + "bonusStrength": 7 + }, + "512": { + "name": "Chaos druid", + "hitpoints": 20, + "combatLevel": 13, + "slayerLevel": 1, + "attackLevel": 8, + "strengthLevel": 8, + "defenceLevel": 12, + "rangeLevel": 1, + "magicLevel": 10 + }, + "517": { + "name": "Thug", + "hitpoints": 18, + "combatLevel": 10, + "attackLevel": 7, + "strengthLevel": 5, + "defenceLevel": 9, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 2, + "slashDef": 3, + "crushDef": 3, + "bonusAttack": 5, + "bonusStrength": 5 + }, + "518": { + "name": "Rogue", + "hitpoints": 17, + "combatLevel": 15, + "slayerLevel": 1, + "attackLevel": 13, + "strengthLevel": 13, + "defenceLevel": 13, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 6, + "slashDef": 9, + "crushDef": 11, + "bonusAttack": 5, + "bonusStrength": 5 + }, + "522": { + "name": "Tribesman", + "hitpoints": 39, + "combatLevel": 32, + "attackLevel": 23, + "strengthLevel": 27, + "defenceLevel": 26, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 4, + "slashDef": 6, + "crushDef": 6, + "bonusAttack": 8, + "bonusStrength": 5 + }, + "523": { + "name": "Dark warrior", + "hitpoints": 17, + "combatLevel": 8, + "slayerLevel": 1, + "attackLevel": 5, + "strengthLevel": 5, + "defenceLevel": 5, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 96, + "slashDef": 79, + "crushDef": 59, + "bonusAttack": 20, + "bonusStrength": 16 + }, + "524": { + "name": "Chaos druid warrior", + "hitpoints": 40, + "combatLevel": 37, + "attackLevel": 32, + "strengthLevel": 34, + "defenceLevel": 25, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 13, + "slashDef": 17, + "crushDef": 14, + "rangeDef": 14, + "bonusAttack": 9, + "bonusStrength": 5 + }, + "525": { + "name": "Necromancer", + "hitpoints": 40, + "combatLevel": 26, + "attackLevel": 18, + "strengthLevel": 18, + "defenceLevel": 18, + "rangeLevel": 1, + "magicLevel": 18 + }, + "537": { + "name": "Zygomite", + "hitpoints": 65, + "combatLevel": 74, + "slayerLevel": 57, + "attackLevel": 65, + "strengthLevel": 65, + "defenceLevel": 65, + "rangeLevel": 65, + "magicLevel": 65, + "stabDef": 10, + "slashDef": 10, + "crushDef": 10, + "rangeDef": 20, + "magicDef": 20, + "bonusAttack": 30 + }, "561": { "name": "Sorebones", "hitpoints": 52, @@ -6241,6 +6428,179 @@ "magic": 8, "venomImmune": true }, + "1024": { + "name": "Zygomite", + "hitpoints": 75, + "combatLevel": 86, + "slayerLevel": 57, + "attackLevel": 75, + "strengthLevel": 75, + "defenceLevel": 75, + "rangeLevel": 75, + "magicLevel": 75, + "stabDef": 10, + "slashDef": 10, + "crushDef": 10, + "rangeDef": 20, + "magicDef": 20, + "bonusAttack": 30 + }, + "1037": { + "name": "Snake", + "hitpoints": 25, + "combatLevel": 35, + "attackLevel": 25, + "strengthLevel": 50, + "defenceLevel": 25, + "rangeLevel": 1, + "magicLevel": 1 + }, + "1038": { + "name": "Monkey", + "hitpoints": 6, + "combatLevel": 3, + "slayerLevel": 1, + "attackLevel": 2, + "strengthLevel": 3, + "defenceLevel": 2, + "rangeLevel": 1, + "magicLevel": 1 + }, + "1039": { + "name": "Albino bat", + "hitpoints": 33, + "combatLevel": 52, + "slayerLevel": 1, + "attackLevel": 57, + "strengthLevel": 57, + "defenceLevel": 30, + "rangeLevel": 1, + "magicLevel": 1 + }, + "1041": { + "name": "Giant mosquito", + "hitpoints": 3, + "combatLevel": 13, + "attackLevel": 5, + "strengthLevel": 1, + "defenceLevel": 45, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 2, + "slashDef": 2, + "crushDef": 5, + "magicDef": 2 + }, + "1042": { + "name": "Jungle horror", + "hitpoints": 45, + "combatLevel": 70, + "slayerLevel": 1, + "attackLevel": 70, + "strengthLevel": 70, + "defenceLevel": 55, + "rangeLevel": 1, + "magicLevel": 1 + }, + "1043": { + "name": "Jungle horror", + "hitpoints": 45, + "combatLevel": 70, + "slayerLevel": 1, + "attackLevel": 70, + "strengthLevel": 70, + "defenceLevel": 55, + "rangeLevel": 1, + "magicLevel": 1 + }, + "1044": { + "name": "Jungle horror", + "hitpoints": 45, + "combatLevel": 70, + "slayerLevel": 1, + "attackLevel": 70, + "strengthLevel": 70, + "defenceLevel": 55, + "rangeLevel": 1, + "magicLevel": 1 + }, + "1045": { + "name": "Jungle horror", + "hitpoints": 45, + "combatLevel": 70, + "slayerLevel": 1, + "attackLevel": 70, + "strengthLevel": 70, + "defenceLevel": 55, + "rangeLevel": 1, + "magicLevel": 1 + }, + "1046": { + "name": "Jungle horror", + "hitpoints": 45, + "combatLevel": 70, + "slayerLevel": 1, + "attackLevel": 70, + "strengthLevel": 70, + "defenceLevel": 55, + "rangeLevel": 1, + "magicLevel": 1 + }, + "1047": { + "name": "Cave horror", + "hitpoints": 55, + "combatLevel": 80, + "slayerLevel": 58, + "attackLevel": 80, + "strengthLevel": 77, + "defenceLevel": 62, + "rangeLevel": 1, + "magicLevel": 80 + }, + "1048": { + "name": "Cave horror", + "hitpoints": 55, + "combatLevel": 80, + "slayerLevel": 58, + "attackLevel": 80, + "strengthLevel": 77, + "defenceLevel": 62, + "rangeLevel": 1, + "magicLevel": 80 + }, + "1049": { + "name": "Cave horror", + "hitpoints": 55, + "combatLevel": 80, + "slayerLevel": 58, + "attackLevel": 80, + "strengthLevel": 77, + "defenceLevel": 62, + "rangeLevel": 1, + "magicLevel": 80 + }, + "1050": { + "name": "Cave horror", + "hitpoints": 55, + "combatLevel": 80, + "slayerLevel": 58, + "attackLevel": 80, + "strengthLevel": 77, + "defenceLevel": 62, + "rangeLevel": 1, + "magicLevel": 80 + }, + "1051": { + "name": "Cave horror", + "hitpoints": 55, + "combatLevel": 80, + "slayerLevel": 58, + "attackLevel": 80, + "strengthLevel": 77, + "defenceLevel": 62, + "rangeLevel": 1, + "magicLevel": 80 + }, "1060": { "name": "Angry bear", "combatLevel": 40 @@ -6733,6 +7093,28 @@ "rangeLevel": 1, "magicLevel": 1 }, + "1173": { + "name": "Chicken", + "hitpoints": 3, + "combatLevel": 1, + "slayerLevel": 1, + "attackLevel": 1, + "strengthLevel": 1, + "defenceLevel": 1, + "rangeLevel": 1, + "magicLevel": 1 + }, + "1174": { + "name": "Chicken", + "hitpoints": 3, + "combatLevel": 1, + "slayerLevel": 1, + "attackLevel": 1, + "strengthLevel": 1, + "defenceLevel": 1, + "rangeLevel": 1, + "magicLevel": 1 + }, "1204": { "name": "Alomone", "hitpoints": 25, @@ -7577,12 +7959,6 @@ "combatLevel": 6, "slayerLevel": 1 }, - "1476": { - "name": "Chompy bird", - "hitpoints": 10, - "combatLevel": 6, - "slayerLevel": 1 - }, "1494": { "name": "Kebbit", "hitpoints": 50, @@ -7692,7 +8068,7 @@ "magicDef": 20 }, "1545": { - "name": "Black Knight", + "name": "Black knight", "hitpoints": 42, "combatLevel": 33, "attackLevel": 25, @@ -12443,30 +12819,8 @@ "bonusAttack": 10, "bonusStrength": 10 }, - "2692": { - "name": "Chicken", - "hitpoints": 3, - "combatLevel": 1, - "slayerLevel": 1, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 1, - "rangeLevel": 1, - "magicLevel": 1 - }, - "2693": { - "name": "Chicken", - "hitpoints": 3, - "combatLevel": 1, - "slayerLevel": 1, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 1, - "rangeLevel": 1, - "magicLevel": 1 - }, "2694": { - "name": "Rooster", + "name": "Sheep", "hitpoints": 7, "combatLevel": 3, "slayerLevel": 1, @@ -12476,7 +12830,7 @@ "rangeLevel": 1, "magicLevel": 1 }, - "2805": { + "2790": { "name": "Cow", "hitpoints": 8, "combatLevel": 2, @@ -12487,95 +12841,95 @@ "rangeLevel": 1, "magicLevel": 1 }, + "2791": { + "name": "Cow", + "hitpoints": 8, + "combatLevel": 2, + "slayerLevel": 1, + "attackLevel": 1, + "strengthLevel": 1, + "defenceLevel": 1, + "rangeLevel": 1, + "magicLevel": 1 + }, + "2792": { + "name": "Cow calf", + "hitpoints": 6, + "combatLevel": 2, + "slayerLevel": 1, + "attackLevel": 1, + "strengthLevel": 1, + "defenceLevel": 1, + "rangeLevel": 1, + "magicLevel": 1 + }, + "2793": { + "name": "Cow", + "hitpoints": 8, + "combatLevel": 2, + "slayerLevel": 1, + "attackLevel": 1, + "strengthLevel": 1, + "defenceLevel": 1, + "rangeLevel": 1, + "magicLevel": 1 + }, + "2794": { + "name": "Cow calf", + "hitpoints": 6, + "combatLevel": 2, + "slayerLevel": 1, + "attackLevel": 1, + "strengthLevel": 1, + "defenceLevel": 1, + "rangeLevel": 1, + "magicLevel": 1 + }, + "2795": { + "name": "Cow", + "hitpoints": 8, + "combatLevel": 2, + "slayerLevel": 1, + "attackLevel": 1, + "strengthLevel": 1, + "defenceLevel": 1, + "rangeLevel": 1, + "magicLevel": 1 + }, + "2801": { + "name": "Cow calf", + "hitpoints": 6, + "combatLevel": 2, + "slayerLevel": 1, + "attackLevel": 1, + "strengthLevel": 1, + "defenceLevel": 1, + "rangeLevel": 1, + "magicLevel": 1 + }, + "2804": { + "name": "Chicken", + "hitpoints": 3, + "combatLevel": 1, + "slayerLevel": 1, + "attackLevel": 1, + "strengthLevel": 1, + "defenceLevel": 1, + "rangeLevel": 1, + "magicLevel": 1 + }, + "2805": { + "name": "Chicken", + "hitpoints": 3, + "combatLevel": 1, + "slayerLevel": 1, + "attackLevel": 1, + "strengthLevel": 1, + "defenceLevel": 1, + "rangeLevel": 1, + "magicLevel": 1 + }, "2806": { - "name": "Cow", - "hitpoints": 8, - "combatLevel": 2, - "slayerLevel": 1, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 1, - "rangeLevel": 1, - "magicLevel": 1 - }, - "2807": { - "name": "Cow calf", - "hitpoints": 6, - "combatLevel": 2, - "slayerLevel": 1, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 1, - "rangeLevel": 1, - "magicLevel": 1 - }, - "2808": { - "name": "Cow", - "hitpoints": 8, - "combatLevel": 2, - "slayerLevel": 1, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 1, - "rangeLevel": 1, - "magicLevel": 1 - }, - "2809": { - "name": "Cow calf", - "hitpoints": 6, - "combatLevel": 2, - "slayerLevel": 1, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 1, - "rangeLevel": 1, - "magicLevel": 1 - }, - "2810": { - "name": "Cow", - "hitpoints": 8, - "combatLevel": 2, - "slayerLevel": 1, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 1, - "rangeLevel": 1, - "magicLevel": 1 - }, - "2816": { - "name": "Cow calf", - "hitpoints": 6, - "combatLevel": 2, - "slayerLevel": 1, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 1, - "rangeLevel": 1, - "magicLevel": 1 - }, - "2819": { - "name": "Chicken", - "hitpoints": 3, - "combatLevel": 1, - "slayerLevel": 1, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 1, - "rangeLevel": 1, - "magicLevel": 1 - }, - "2820": { - "name": "Chicken", - "hitpoints": 3, - "combatLevel": 1, - "slayerLevel": 1, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 1, - "rangeLevel": 1, - "magicLevel": 1 - }, - "2821": { "name": "Chicken", "hitpoints": 3, "combatLevel": 1, @@ -12932,124 +13286,8 @@ "rangeLevel": 1, "magicLevel": 1 }, - "2868": { - "name": "Dark wizard", - "hitpoints": 24, - "combatLevel": 20, - "attackLevel": 5, - "strengthLevel": 2, - "defenceLevel": 5, - "rangeLevel": 1, - "magicLevel": 6, - "magicDef": 3 - }, - "2869": { - "name": "Invrigar the Necromancer", - "hitpoints": 24, - "combatLevel": 20, - "attackLevel": 17, - "strengthLevel": 17, - "defenceLevel": 14, - "rangeLevel": 1, - "magicLevel": 18, - "magicDef": 3 - }, - "2870": { - "name": "Dark wizard", - "hitpoints": 12, - "combatLevel": 7, - "attackLevel": 5, - "strengthLevel": 2, - "defenceLevel": 5, - "rangeLevel": 1, - "magicLevel": 6, - "magicDef": 3 - }, - "2871": { - "name": "Mugger", - "hitpoints": 8, - "combatLevel": 6, - "attackLevel": 5, - "strengthLevel": 5, - "defenceLevel": 5, - "rangeLevel": 1, - "magicLevel": 1 - }, - "2874": { - "name": "Black Knight", - "hitpoints": 42, - "combatLevel": 33, - "attackLevel": 25, - "strengthLevel": 25, - "defenceLevel": 25, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 73, - "slashDef": 76, - "crushDef": 70, - "rangeDef": 72, - "bonusAttack": 18, - "bonusStrength": 16 - }, - "2875": { - "name": "Black Knight", - "hitpoints": 42, - "combatLevel": 33, - "attackLevel": 25, - "strengthLevel": 25, - "defenceLevel": 25, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 73, - "slashDef": 76, - "crushDef": 70, - "rangeDef": 72, - "bonusAttack": 18, - "bonusStrength": 16 - }, - "2876": { - "name": "Highwayman", - "hitpoints": 13, - "combatLevel": 5, - "attackLevel": 2, - "strengthLevel": 2, - "defenceLevel": 4, - "rangeLevel": 1, - "magicLevel": 1, - "slashDef": 3, - "crushDef": 2, - "rangeDef": 2, - "bonusAttack": 6, - "bonusStrength": 7 - }, - "2877": { - "name": "Highwayman", - "hitpoints": 13, - "combatLevel": 5, - "attackLevel": 2, - "strengthLevel": 2, - "defenceLevel": 4, - "rangeLevel": 1, - "magicLevel": 1, - "slashDef": 3, - "crushDef": 2, - "rangeDef": 2, - "bonusAttack": 6, - "bonusStrength": 7 - }, - "2878": { - "name": "Chaos druid", - "hitpoints": 20, - "combatLevel": 13, - "slayerLevel": 1, - "attackLevel": 8, - "strengthLevel": 8, - "defenceLevel": 12, - "rangeLevel": 1, - "magicLevel": 10 - }, "2879": { - "name": "Pirate", + "name": "Dommik", "hitpoints": 20, "combatLevel": 23, "attackLevel": 20, @@ -13062,7 +13300,7 @@ "bonusStrength": 10 }, "2880": { - "name": "Pirate", + "name": "Zaff", "hitpoints": 20, "combatLevel": 23, "attackLevel": 21, @@ -13076,7 +13314,7 @@ "bonusStrength": 10 }, "2881": { - "name": "Pirate", + "name": "Baraek", "hitpoints": 23, "combatLevel": 26, "attackLevel": 23, @@ -13089,37 +13327,6 @@ "bonusAttack": 8, "bonusStrength": 10 }, - "2883": { - "name": "Thug", - "hitpoints": 18, - "combatLevel": 10, - "attackLevel": 7, - "strengthLevel": 5, - "defenceLevel": 9, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 2, - "slashDef": 3, - "crushDef": 3, - "bonusAttack": 5, - "bonusStrength": 5 - }, - "2884": { - "name": "Rogue", - "hitpoints": 17, - "combatLevel": 15, - "slayerLevel": 1, - "attackLevel": 13, - "strengthLevel": 13, - "defenceLevel": 13, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 6, - "slashDef": 9, - "crushDef": 11, - "bonusAttack": 5, - "bonusStrength": 5 - }, "2885": { "name": "Monk of Zamorak", "hitpoints": 20, @@ -13141,7 +13348,7 @@ "magicLevel": 25 }, "2887": { - "name": "Monk of Zamorak", + "name": "Fancy dress shop owner", "hitpoints": 40, "combatLevel": 45, "attackLevel": 38, @@ -13150,65 +13357,8 @@ "rangeLevel": 1, "magicLevel": 40 }, - "2888": { - "name": "Tribesman", - "hitpoints": 39, - "combatLevel": 32, - "attackLevel": 23, - "strengthLevel": 27, - "defenceLevel": 26, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 4, - "slashDef": 6, - "crushDef": 6, - "bonusAttack": 8, - "bonusStrength": 5 - }, - "2889": { - "name": "Dark warrior", - "hitpoints": 17, - "combatLevel": 8, - "slayerLevel": 1, - "attackLevel": 5, - "strengthLevel": 5, - "defenceLevel": 5, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 96, - "slashDef": 79, - "crushDef": 59, - "bonusAttack": 20, - "bonusStrength": 16 - }, - "2890": { - "name": "Chaos druid warrior", - "hitpoints": 40, - "combatLevel": 37, - "attackLevel": 32, - "strengthLevel": 34, - "defenceLevel": 25, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 13, - "slashDef": 17, - "crushDef": 14, - "rangeDef": 14, - "bonusAttack": 9, - "bonusStrength": 5 - }, - "2891": { - "name": "Necromancer", - "hitpoints": 40, - "combatLevel": 26, - "attackLevel": 18, - "strengthLevel": 18, - "defenceLevel": 18, - "rangeLevel": 1, - "magicLevel": 18 - }, "2892": { - "name": "Bandit", + "name": "Brian", "hitpoints": 27, "combatLevel": 22, "slayerLevel": 1, @@ -13222,24 +13372,6 @@ "crushDef": 2, "bonusStrength": 12 }, - "2893": { - "name": "Guard Bandit", - "hitpoints": 27, - "combatLevel": 22, - "slayerLevel": 1, - "attackLevel": 17, - "strengthLevel": 17, - "defenceLevel": 17, - "rangeLevel": 1, - "magicLevel": 1, - "stab": 11, - "stabDef": 4, - "slashDef": 8, - "crushDef": 5, - "rangeDef": 4, - "magicDef": 1, - "bonusStrength": 12 - }, "2916": { "name": "Waterfiend", "hitpoints": 130, @@ -14436,6 +14568,10 @@ "bonusAttack": 4, "bonusStrength": 5 }, + "3096": { + "name": "Barbarian", + "combatLevel": 7 + }, "3097": { "name": "Wizard", "hitpoints": 14, @@ -15270,162 +15406,6 @@ "bonusAttack": 50, "bonusStrength": 50 }, - "3199": { - "name": "Snake", - "hitpoints": 25, - "combatLevel": 35, - "attackLevel": 25, - "strengthLevel": 50, - "defenceLevel": 25, - "rangeLevel": 1, - "magicLevel": 1 - }, - "3200": { - "name": "Monkey", - "hitpoints": 6, - "combatLevel": 3, - "slayerLevel": 1, - "attackLevel": 2, - "strengthLevel": 3, - "defenceLevel": 2, - "rangeLevel": 1, - "magicLevel": 1 - }, - "3201": { - "name": "Albino bat", - "hitpoints": 33, - "combatLevel": 52, - "slayerLevel": 1, - "attackLevel": 57, - "strengthLevel": 57, - "defenceLevel": 30, - "rangeLevel": 1, - "magicLevel": 1 - }, - "3203": { - "name": "Giant mosquito", - "hitpoints": 3, - "combatLevel": 13, - "attackLevel": 5, - "strengthLevel": 1, - "defenceLevel": 45, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 2, - "slashDef": 2, - "crushDef": 5, - "magicDef": 2 - }, - "3204": { - "name": "Jungle horror", - "hitpoints": 45, - "combatLevel": 70, - "slayerLevel": 1, - "attackLevel": 70, - "strengthLevel": 70, - "defenceLevel": 55, - "rangeLevel": 1, - "magicLevel": 1 - }, - "3205": { - "name": "Jungle horror", - "hitpoints": 45, - "combatLevel": 70, - "slayerLevel": 1, - "attackLevel": 70, - "strengthLevel": 70, - "defenceLevel": 55, - "rangeLevel": 1, - "magicLevel": 1 - }, - "3206": { - "name": "Jungle horror", - "hitpoints": 45, - "combatLevel": 70, - "slayerLevel": 1, - "attackLevel": 70, - "strengthLevel": 70, - "defenceLevel": 55, - "rangeLevel": 1, - "magicLevel": 1 - }, - "3207": { - "name": "Jungle horror", - "hitpoints": 45, - "combatLevel": 70, - "slayerLevel": 1, - "attackLevel": 70, - "strengthLevel": 70, - "defenceLevel": 55, - "rangeLevel": 1, - "magicLevel": 1 - }, - "3208": { - "name": "Jungle horror", - "hitpoints": 45, - "combatLevel": 70, - "slayerLevel": 1, - "attackLevel": 70, - "strengthLevel": 70, - "defenceLevel": 55, - "rangeLevel": 1, - "magicLevel": 1 - }, - "3209": { - "name": "Cave horror", - "hitpoints": 55, - "combatLevel": 80, - "slayerLevel": 58, - "attackLevel": 80, - "strengthLevel": 77, - "defenceLevel": 62, - "rangeLevel": 1, - "magicLevel": 80 - }, - "3210": { - "name": "Cave horror", - "hitpoints": 55, - "combatLevel": 80, - "slayerLevel": 58, - "attackLevel": 80, - "strengthLevel": 77, - "defenceLevel": 62, - "rangeLevel": 1, - "magicLevel": 80 - }, - "3211": { - "name": "Cave horror", - "hitpoints": 55, - "combatLevel": 80, - "slayerLevel": 58, - "attackLevel": 80, - "strengthLevel": 77, - "defenceLevel": 62, - "rangeLevel": 1, - "magicLevel": 80 - }, - "3212": { - "name": "Cave horror", - "hitpoints": 55, - "combatLevel": 80, - "slayerLevel": 58, - "attackLevel": 80, - "strengthLevel": 77, - "defenceLevel": 62, - "rangeLevel": 1, - "magicLevel": 80 - }, - "3213": { - "name": "Cave horror", - "hitpoints": 55, - "combatLevel": 80, - "slayerLevel": 58, - "attackLevel": 80, - "strengthLevel": 77, - "defenceLevel": 62, - "rangeLevel": 1, - "magicLevel": 80 - }, "3233": { "name": "Leech", "hitpoints": 45, @@ -21162,6 +21142,11 @@ "name": "Solus Dellagar", "hitpoints": 40 }, + "4934": { + "name": "Black Knight", + "hitpoints": 42, + "combatLevel": 32 + }, "4958": { "name": "Woman", "hitpoints": 7, @@ -21172,6 +21157,16 @@ "rangeLevel": 1, "magicLevel": 1 }, + "4959": { + "name": "Black Knight", + "hitpoints": 42, + "combatLevel": 32 + }, + "4960": { + "name": "Black Knight", + "hitpoints": 42, + "combatLevel": 32 + }, "4962": { "name": "Solus Dellagar", "hitpoints": 40 @@ -34036,28 +34031,6 @@ "rangeLevel": 105, "magicLevel": 105 }, - "8338": { - "name": "Xarpus", - "hitpoints": 5080, - "combatLevel": 960, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 250, - "rangeLevel": 1, - "magicLevel": 220, - "rangeDef": 160 - }, - "8339": { - "name": "Xarpus", - "hitpoints": 5080, - "combatLevel": 960, - "attackLevel": 1, - "strengthLevel": 1, - "defenceLevel": 250, - "rangeLevel": 1, - "magicLevel": 220, - "rangeDef": 160 - }, "8340": { "name": "Xarpus", "hitpoints": 5080, @@ -34646,6 +34619,57 @@ "magicDef": 200, "bonusRangeStrength": 40 }, + "8474": { + "name": "Black Guard", + "hitpoints": 40, + "combatLevel": 48, + "slayerLevel": 1, + "attackLevel": 40, + "strengthLevel": 45, + "defenceLevel": 45, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 40, + "slashDef": 40, + "crushDef": 40, + "rangeDef": 40, + "bonusAttack": 30, + "bonusStrength": 30 + }, + "8475": { + "name": "Black Guard", + "hitpoints": 40, + "combatLevel": 48, + "slayerLevel": 1, + "attackLevel": 40, + "strengthLevel": 45, + "defenceLevel": 45, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 40, + "slashDef": 40, + "crushDef": 40, + "rangeDef": 40, + "bonusAttack": 30, + "bonusStrength": 30 + }, + "8476": { + "name": "Black Guard", + "hitpoints": 40, + "combatLevel": 48, + "slayerLevel": 1, + "attackLevel": 40, + "strengthLevel": 45, + "defenceLevel": 45, + "rangeLevel": 1, + "magicLevel": 1, + "stabDef": 40, + "slashDef": 40, + "crushDef": 40, + "rangeDef": 40, + "bonusAttack": 30, + "bonusStrength": 30 + }, "8496": { "name": "Dwarf", "hitpoints": 16, @@ -35141,5 +35165,15 @@ "defenceLevel": 65, "rangeLevel": 1, "magicLevel": 50 + }, + "8698": { + "name": "Monk of Zamorak", + "hitpoints": 16, + "combatLevel": 23, + "attackLevel": 15, + "strengthLevel": 13, + "defenceLevel": 18, + "rangeLevel": 1, + "magicLevel": 30 } -} +} \ No newline at end of file diff --git a/runelite-client/src/main/scripts/DeathkeepBuild.hash b/runelite-client/src/main/scripts/DeathkeepBuild.hash new file mode 100644 index 0000000000..18f92dce5c --- /dev/null +++ b/runelite-client/src/main/scripts/DeathkeepBuild.hash @@ -0,0 +1 @@ +15F58F5939D9311F3D76FA2F0F3441B7B0DA1E8EAE23C654948095A7D51E07F0 \ No newline at end of file diff --git a/runelite-client/src/main/scripts/DeathkeepBuild.rs2asm b/runelite-client/src/main/scripts/DeathkeepBuild.rs2asm new file mode 100644 index 0000000000..75ade43db2 --- /dev/null +++ b/runelite-client/src/main/scripts/DeathkeepBuild.rs2asm @@ -0,0 +1,634 @@ +.id 1601 +.int_stack_count 4 +.string_stack_count 2 +.int_var_count 14 +.string_var_count 3 +; callback "itemsKeptOnDeath" +; Used by the ItemsKepthOnDeath plugin to edit the interface +; Put a rune pouch in your inventory and it shouldn't have a white outline +; in the Items kept on death screen + sload 1 + iconst 262167 + if_settext + iconst 0 + istore 4 + iconst 0 + istore 5 + iconst -1 + istore 6 + iconst 0 + istore 7 + sconst "" + sstore 2 + iconst 0 + istore 8 + iconst 0 + istore 9 + iconst 0 + istore 10 + iconst 0 + istore 11 + iload 1 + define_array 111 + iconst 0 + istore 12 + iconst 0 + istore 13 + iload 0 + iconst 0 + if_icmpeq LABEL31 + jump LABEL525 +LABEL31: + iconst 93 + iconst 13190 + inv_total + iconst 0 + if_icmpgt LABEL42 + iconst 93 + iconst 13192 + inv_total + iconst 0 + if_icmpgt LABEL42 + jump LABEL44 +LABEL42: + iconst 1 + istore 9 +LABEL44: + iload 10 + iload 1 + if_icmplt LABEL48 + jump LABEL88 +LABEL48: + iconst 584 + iload 11 + inv_getobj + istore 6 + iload 6 + iconst -1 + if_icmpne LABEL56 + jump LABEL85 +LABEL56: + iconst 584 + iload 11 + inv_getnum + istore 7 +LABEL60: + iload 10 + iload 1 + if_icmplt LABEL64 + jump LABEL80 +LABEL64: + iload 7 + iconst 0 + if_icmpgt LABEL68 + jump LABEL80 +LABEL68: + iload 10 + iload 6 + set_array_int + iload 7 + iconst 1 + sub + istore 7 + iload 10 + iconst 1 + add + istore 10 + jump LABEL60 +LABEL80: + iload 11 + iconst 1 + add + istore 11 + jump LABEL87 +LABEL85: + iload 1 + istore 10 +LABEL87: + jump LABEL44 +LABEL88: + iload 4 + iload 1 + if_icmplt LABEL92 + jump LABEL147 +LABEL92: + iconst 262162 + iconst 5 + iload 4 + cc_create + iconst 36 + iconst 32 + iconst 0 + iconst 0 + cc_setsize + iconst 5 + iload 4 + iconst 40 + multiply + add + iconst 25 + iconst 0 + iconst 0 + cc_setposition + iload 4 + get_array_int + istore 6 + iload 6 + iconst -1 + if_icmpne LABEL117 + jump LABEL144 +LABEL117: + iload 6 + iconst 1 + cc_setobject + sconst "" + iload 6 + oc_name + join_string 2 + cc_setopbase + iconst 1 + sconst "Item:" + cc_setop + iconst 1603 + iconst 1 + iconst 1 + iload 6 + oc_name + sconst "1is" + cc_setonop + iconst 1118481 + cc_setgraphicshadow + iconst 1 + cc_setoutline + iload 4 + iconst 1 + add + istore 4 + jump LABEL146 +LABEL144: + iload 1 + istore 4 +LABEL146: + jump LABEL88 +LABEL147: + iconst 0 + istore 4 +LABEL149: + iload 4 + iconst 468 + inv_size + if_icmplt LABEL154 + jump LABEL350 +LABEL154: + iconst 468 + iload 4 + inv_getobj + istore 6 + iload 6 + iconst -1 + if_icmpne LABEL162 + jump LABEL345 +LABEL162: + iconst 262165 + iconst 5 + iload 5 + cc_create + iconst 36 + iconst 32 + iconst 0 + iconst 0 + cc_setsize + iconst 5 + iload 5 + iconst 8 + mod + iconst 38 + multiply + add + iconst 25 + iconst 38 + iload 5 + iconst 8 + div + multiply + add + iconst 0 + iconst 0 + cc_setposition + iload 6 + iconst 468 + iload 4 + inv_getnum + cc_setobject + sconst "" + iload 6 + oc_name + join_string 2 + cc_setopbase + iconst 1 + sconst "Item:" + cc_setop + iconst 1603 + iconst 0 + iconst 468 + iload 4 + inv_getnum + iload 6 + oc_name + sconst "1is" + cc_setonop + iconst 1118481 + cc_setgraphicshadow + iconst 111 + iconst 49 + iconst 879 + iload 6 + oc_uncert + enum + iconst 1 + if_icmpeq LABEL221 + jump LABEL226 +LABEL221: + iconst 2 + cc_setoutline + iconst 1 + istore 8 + jump LABEL228 +LABEL226: + iconst 1 + cc_setoutline +LABEL228: + iload 5 + iconst 1 + add + istore 5 + iload 6 + oc_stackable + iconst 1 + if_icmpeq LABEL237 + jump LABEL345 +LABEL237: + iconst 0 + istore 10 + iconst 0 + istore 13 +LABEL241: + iload 10 + iload 1 + if_icmplt LABEL245 + jump LABEL259 +LABEL245: + iload 10 + get_array_int + iload 6 + if_icmpeq LABEL250 + jump LABEL254 +LABEL250: + iload 13 + iconst 1 + add + istore 13 +LABEL254: + iload 10 + iconst 1 + add + istore 10 + jump LABEL241 +LABEL259: + iconst 2147483647 + iconst 94 + iload 6 + inv_total + sub + iconst 93 + iload 6 + inv_total + sub + iload 13 + add + istore 12 + iconst 0 + iload 12 + sub + istore 12 + iload 12 + iconst 0 + if_icmpgt LABEL279 + jump LABEL345 +LABEL279: + iconst 262165 + iconst 5 + iload 5 + cc_create + iconst 36 + iconst 32 + iconst 0 + iconst 0 + cc_setsize + iconst 5 + iload 5 + iconst 8 + mod + iconst 38 + multiply + add + iconst 25 + iconst 38 + iload 5 + iconst 8 + div + multiply + add + iconst 0 + iconst 0 + cc_setposition + iload 6 + iload 12 + cc_setobject + sconst "" + iload 6 + oc_name + join_string 2 + cc_setopbase + iconst 1 + sconst "Item:" + cc_setop + iconst 1603 + iconst 0 + iload 12 + iload 6 + oc_name + sconst "1is" + cc_setonop + iconst 1118481 + cc_setgraphicshadow + iconst 111 + iconst 49 + iconst 879 + iload 6 + oc_uncert + enum + iconst 1 + if_icmpeq LABEL334 + jump LABEL339 +LABEL334: + iconst 2 + cc_setoutline + iconst 1 + istore 8 + jump LABEL341 +LABEL339: + iconst 1 + cc_setoutline +LABEL341: + iload 5 + iconst 1 + add + istore 5 +LABEL345: + iload 4 + iconst 1 + add + istore 4 + jump LABEL149 +LABEL350: + sconst "The normal amount of items kept is " + sconst "three" + sconst "." + sconst "
    " + sconst "
    " + join_string 5 + sstore 2 + iload 3 + iconst 1 + if_icmpeq LABEL361 + jump LABEL371 +LABEL361: + sload 2 + sconst "You're an " + sconst "" + sconst "Ultimate Iron Man" + sconst "" + sconst ", so you will always keep zero items." + join_string 5 + append + sstore 2 + jump LABEL434 +LABEL371: + iload 1 + iconst 0 + if_icmpeq LABEL375 + jump LABEL387 +LABEL375: + sload 2 + sconst "You're marked with a " + sconst "" + sconst "PK skull" + sconst "" + sconst ". This reduces the items you keep from " + sconst "three" + sconst " to zero!" + join_string 7 + append + sstore 2 + jump LABEL434 +LABEL387: + iload 1 + iconst 1 + if_icmpeq LABEL391 + jump LABEL410 +LABEL391: + sload 2 + sconst "You're marked with a " + sconst "" + sconst "PK skull" + sconst "" + sconst ". This reduces the items you keep from " + sconst "three" + sconst " to zero!" + sconst "
    " + sconst "
    " + sconst "However, you also have the " + sconst "" + sconst "Protect Items" + sconst "" + sconst " prayer active, which saves you one extra item!" + join_string 14 + append + sstore 2 + jump LABEL434 +LABEL410: + iload 1 + iconst 3 + if_icmpeq LABEL414 + jump LABEL419 +LABEL414: + sload 2 + sconst "You have no factors affecting the items you keep." + append + sstore 2 + jump LABEL434 +LABEL419: + iload 1 + iconst 3 + iconst 1 + add + if_icmpeq LABEL425 + jump LABEL434 +LABEL425: + sload 2 + sconst "You have the " + sconst "" + sconst "Protect Items" + sconst "" + sconst " prayer active, which saves you one extra item!" + join_string 5 + append + sstore 2 +LABEL434: + iload 8 + iconst 1 + if_icmpeq LABEL441 + iload 9 + iconst 1 + if_icmpeq LABEL441 + jump LABEL492 +LABEL441: + iload 8 + iconst 1 + if_icmpeq LABEL445 + jump LABEL466 +LABEL445: + iload 9 + iconst 1 + if_icmpeq LABEL449 + jump LABEL466 +LABEL449: + sload 2 + sconst "
    " + sconst "
    " + sconst "Items with a " + sconst "" + sconst "white outline" + sconst "" + sconst " will always be lost." + sconst "
    " + sconst "" + sconst "Bonds" + sconst "" + sconst " are always protected." + join_string 12 + append + sstore 2 + jump LABEL492 +LABEL466: + iload 8 + iconst 1 + if_icmpeq LABEL470 + jump LABEL482 +LABEL470: + sload 2 + sconst "
    " + sconst "
    " + sconst "Items with a " + sconst "" + sconst "white outline" + sconst "" + sconst " will always be lost." + join_string 7 + append + sstore 2 + jump LABEL492 +LABEL482: + sload 2 + sconst "
    " + sconst "
    " + sconst "" + sconst "Bonds" + sconst "" + sconst " are always protected, so are not shown here." + join_string 6 + append + sstore 2 +LABEL492: + sload 2 + iconst 262173 + if_settext + sconst "" + sconst "Max items kept on death :" + sconst "
    " + sconst "
    " + sconst "" + sconst "~ " + iload 1 + tostring + sconst " ~" + join_string 8 + iconst 262174 + if_settext + iload 2 + iconst 0 + if_icmpgt LABEL511 + jump LABEL518 +LABEL511: + sconst "Items you will keep on death:" + iconst 262161 + if_settext + sconst "Items you will lose on death:" + iconst 262164 + if_settext + jump LABEL524 +LABEL518: + sconst "Items you will keep on death if not skulled:" + iconst 262161 + if_settext + sconst "Items you will lose on death if not skulled:" + iconst 262164 + if_settext +LABEL524: + jump LABEL565 +LABEL525: + iconst 1 + iconst 262165 + if_sethide + iconst 1 + iconst 262162 + if_sethide + iconst 0 + iconst 262175 + if_sethide + sload 0 + iconst 262176 + if_settext + sconst "The normal amount of items kept is " + sconst "three" + sconst "." + sconst "
    " + sconst "
    " + join_string 5 + sstore 2 + sload 2 + sconst "You're in a " + sconst "" + sconst "safe area" + sconst "" + sconst ". See information to the left for a more detailed description." + join_string 5 + append + sstore 2 + sload 2 + iconst 262173 + if_settext + sconst "" + sconst "Max items kept on death :" + sconst "
    " + sconst "
    " + sconst "" + sconst "All items!" + join_string 6 + iconst 262174 + if_settext +LABEL565: + sconst "itemsKeptOnDeath" ; push event name + runelite_callback ; invoke callback + return diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/emojis/EmojiPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/emojis/EmojiPluginTest.java new file mode 100644 index 0000000000..3427246946 --- /dev/null +++ b/runelite-client/src/test/java/net/runelite/client/plugins/emojis/EmojiPluginTest.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2019, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.emojis; + +import com.google.inject.Guice; +import com.google.inject.Inject; +import com.google.inject.testing.fieldbinder.Bind; +import com.google.inject.testing.fieldbinder.BoundFieldModule; +import net.runelite.api.ChatMessageType; +import net.runelite.api.Client; +import net.runelite.api.GameState; +import net.runelite.api.IndexedSprite; +import net.runelite.api.MessageNode; +import net.runelite.api.events.ChatMessage; +import net.runelite.api.events.GameStateChanged; +import net.runelite.client.chat.ChatMessageManager; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import org.mockito.runners.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class EmojiPluginTest +{ + @Mock + @Bind + private Client client; + + @Mock + @Bind + private ChatMessageManager chatMessageManager; + + @Inject + private EmojiPlugin emojiPlugin; + + @Before + public void before() + { + Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); + } + + @Test + public void testOnChatMessage() + { + when(client.getGameState()).thenReturn(GameState.LOGGED_IN); + when(client.getModIcons()).thenReturn(new IndexedSprite[0]); + when(client.createIndexedSprite()).thenReturn(mock(IndexedSprite.class)); + + // Trip emoji loading + GameStateChanged gameStateChanged = new GameStateChanged(); + gameStateChanged.setGameState(GameState.LOGGED_IN); + emojiPlugin.onGameStateChanged(gameStateChanged); + + MessageNode messageNode = mock(MessageNode.class); + // With chat recolor, message may be wrapped in col tags + when(messageNode.getValue()).thenReturn(":) :) :)"); + + ChatMessage chatMessage = new ChatMessage(); + chatMessage.setType(ChatMessageType.PUBLICCHAT); + chatMessage.setMessageNode(messageNode); + + emojiPlugin.onChatMessage(chatMessage); + + verify(messageNode).setRuneLiteFormatMessage(" "); + } + + @Test + public void testGtLt() + { + when(client.getGameState()).thenReturn(GameState.LOGGED_IN); + when(client.getModIcons()).thenReturn(new IndexedSprite[0]); + when(client.createIndexedSprite()).thenReturn(mock(IndexedSprite.class)); + + // Trip emoji loading + GameStateChanged gameStateChanged = new GameStateChanged(); + gameStateChanged.setGameState(GameState.LOGGED_IN); + emojiPlugin.onGameStateChanged(gameStateChanged); + + MessageNode messageNode = mock(MessageNode.class); + when(messageNode.getValue()).thenReturn(":D"); + + ChatMessage chatMessage = new ChatMessage(); + chatMessage.setType(ChatMessageType.PUBLICCHAT); + chatMessage.setMessageNode(messageNode); + + emojiPlugin.onChatMessage(chatMessage); + + verify(messageNode).setRuneLiteFormatMessage(""); + } +} \ No newline at end of file diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/examine/ExaminePluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/examine/ExaminePluginTest.java index 6e473fee55..8ba0b4253a 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/examine/ExaminePluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/examine/ExaminePluginTest.java @@ -33,6 +33,7 @@ import net.runelite.api.ChatMessageType; import net.runelite.api.Client; import net.runelite.api.ItemID; import net.runelite.api.MenuAction; +import net.runelite.api.MenuEntry; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.widgets.Widget; @@ -88,10 +89,15 @@ public class ExaminePluginTest { when(client.getWidget(anyInt(), anyInt())).thenReturn(mock(Widget.class)); - MenuOptionClicked menuOptionClicked = new MenuOptionClicked(); - menuOptionClicked.setMenuOption("Examine"); - menuOptionClicked.setMenuAction(MenuAction.EXAMINE_ITEM); - menuOptionClicked.setId(ItemID.ABYSSAL_WHIP); + MenuOptionClicked menuOptionClicked = new MenuOptionClicked(new MenuEntry( + "Examine", + "Something", + ItemID.ABYSSAL_WHIP, + MenuAction.EXAMINE_ITEM.getId(), + 123, + 456, + false + )); examinePlugin.onMenuOptionClicked(menuOptionClicked); ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.ITEM_EXAMINE, "", "A weapon from the abyss.", "", 0); @@ -106,10 +112,17 @@ public class ExaminePluginTest { when(client.getWidget(anyInt(), anyInt())).thenReturn(mock(Widget.class)); - MenuOptionClicked menuOptionClicked = new MenuOptionClicked(); - menuOptionClicked.setMenuOption("Examine"); - menuOptionClicked.setMenuAction(MenuAction.EXAMINE_ITEM); - menuOptionClicked.setId(ItemID.ABYSSAL_WHIP); + MenuOptionClicked menuOptionClicked = new MenuOptionClicked(new MenuEntry( + "Examine", + "Something", + ItemID.ABYSSAL_WHIP, + MenuAction.EXAMINE_ITEM.getId(), + 123, + 456, + false + )); + + examinePlugin.onMenuOptionClicked(menuOptionClicked); ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.ITEM_EXAMINE, "", "100000 x Abyssal whip", "", 0); diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPluginTest.java index 9b01640405..51dc7842e0 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPluginTest.java @@ -44,6 +44,7 @@ import net.runelite.api.events.GameTick; import net.runelite.api.events.HitsplatApplied; import net.runelite.api.events.InteractingChanged; import net.runelite.client.Notifier; +import net.runelite.client.game.SoundManager; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -70,6 +71,10 @@ public class IdleNotifierPluginTest @Bind private IdleNotifierConfig config; + @Mock + @Bind + private SoundManager soundManager; + @Mock @Bind private Notifier notifier; diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/EntityHiderMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/EntityHiderMixin.java index 851c1b5480..8f84b9d917 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/EntityHiderMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/EntityHiderMixin.java @@ -164,11 +164,17 @@ public abstract class EntityHiderMixin implements RSScene } } - for (String name: names) + for (String name : names) { - if (names.equals(npc.getName())) + if (name != null && !name.equals("")) { - return false; + if (npc.getName() != null) + { + if (npc.getName().startsWith(name)) + { + return false; + } + } } } diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/MenuMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/MenuMixin.java index 9cb9c68639..8857f785ca 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/MenuMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/MenuMixin.java @@ -109,4 +109,47 @@ public abstract class MenuMixin implements RSClient } } } + + @Inject + @Override + public void sortMenuEntries() + { + int count = getMenuOptionCount() - 1; + int[] menuOpcodes = getMenuTypes(); + String[] menuTargetNames = getMenuTargets(); + String[] menuActions = getMenuOptions(); + int[] menuArguments0 = getMenuIdentifiers(); + int[] menuArguments1 = getMenuActionParams0(); + int[] menuArguments2 = getMenuActionParams1(); + boolean[] menuShiftClick = getMenuForceLeftClick(); + + int tmp; + for (int i = 0; i < count; ++i) + { + if (menuOpcodes[i] < 1000 && menuOpcodes[i + 1] > 1000) + { + String var3 = menuTargetNames[i]; + menuTargetNames[i] = menuTargetNames[i + 1]; + menuTargetNames[i + 1] = var3; + String var4 = menuActions[i]; + menuActions[i] = menuActions[i + 1]; + menuActions[i + 1] = var4; + tmp = menuOpcodes[i]; + menuOpcodes[i] = menuOpcodes[i + 1]; + menuOpcodes[i + 1] = tmp; + tmp = menuArguments1[i]; + menuArguments1[i] = menuArguments1[i + 1]; + menuArguments1[i + 1] = tmp; + tmp = menuArguments2[i]; + menuArguments2[i] = menuArguments2[i + 1]; + menuArguments2[i + 1] = tmp; + tmp = menuArguments0[i]; + menuArguments0[i] = menuArguments0[i + 1]; + menuArguments0[i + 1] = tmp; + boolean var6 = menuShiftClick[i]; + menuShiftClick[i] = menuShiftClick[i + 1]; + menuShiftClick[i + 1] = var6; + } + } + } } diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java index 94b18b3dbf..7608f6d635 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java @@ -32,7 +32,6 @@ import net.runelite.api.GameState; import net.runelite.api.GrandExchangeOffer; import net.runelite.api.GraphicsObject; import net.runelite.api.HashTable; -import net.runelite.api.HealthBarOverride; import net.runelite.api.HintArrowType; import net.runelite.api.Ignore; import net.runelite.api.IndexDataBase; @@ -190,9 +189,6 @@ public abstract class RSClientMixin implements RSClient .maximumSize(64) .build(); - @Inject - private static HealthBarOverride healthBarOverride; - @Inject private static boolean printMenuActions; @@ -203,6 +199,16 @@ public abstract class RSClientMixin implements RSClient printMenuActions = yes; } + @Inject + private static boolean hideFriendAttackOptions; + + @Inject + @Override + public void setHideFriendAttackOptions(boolean yes) + { + hideFriendAttackOptions = yes; + } + @Inject public RSClientMixin() { @@ -649,12 +655,15 @@ public abstract class RSClientMixin implements RSClient if (newCount == oldCount + 1) { MenuEntryAdded event = new MenuEntryAdded( - client.getMenuOptions()[newCount - 1], - client.getMenuTargets()[newCount - 1], - client.getMenuTypes()[newCount - 1], - client.getMenuIdentifiers()[newCount - 1], - client.getMenuActionParams0()[newCount - 1], - client.getMenuActionParams1()[newCount - 1] + new MenuEntry( + client.getMenuOptions()[oldCount], + client.getMenuTargets()[oldCount], + client.getMenuTypes()[oldCount], + client.getMenuIdentifiers()[oldCount], + client.getMenuActionParams0()[oldCount], + client.getMenuActionParams1()[oldCount], + client.getMenuForceLeftClick()[oldCount] + ) ); client.getCallbacks().post(event); @@ -1244,13 +1253,18 @@ public abstract class RSClientMixin implements RSClient menuAction -= 2000; } - final MenuOptionClicked menuOptionClicked = new MenuOptionClicked(); - menuOptionClicked.setActionParam(actionParam); - menuOptionClicked.setMenuOption(menuOption); - menuOptionClicked.setMenuTarget(menuTarget); - menuOptionClicked.setMenuAction(MenuAction.of(menuAction)); - menuOptionClicked.setId(id); - menuOptionClicked.setWidgetId(widgetId); + final MenuOptionClicked menuOptionClicked = new MenuOptionClicked( + new MenuEntry( + menuOption, + menuTarget, + id, + menuAction, + actionParam, + widgetId, + false + ) + ); + client.getCallbacks().post(menuOptionClicked); if (menuOptionClicked.isConsumed()) @@ -1268,13 +1282,6 @@ public abstract class RSClientMixin implements RSClient client.getCallbacks().post(new UsernameChanged()); } - @Inject - @Override - public void setHealthBarOverride(HealthBarOverride override) - { - healthBarOverride = override; - } - @Override @Inject public int getTickCount() @@ -1565,4 +1572,18 @@ public abstract class RSClientMixin implements RSClient enumCache.put(id, rsEnumDefinition); return rsEnumDefinition; } + + @Inject + @Override + public void resetHealthBarCaches() + { + getHealthBarCache().reset(); + getHealthBarSpriteCache().reset(); + } + + @Inject + static boolean shouldHideAttackOptionFor(RSPlayer p) + { + return hideFriendAttackOptions && p.isFriended() || p.isClanMember(); + } } \ No newline at end of file diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSHealthBarDefinitionMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSHealthBarDefinitionMixin.java index 33337f3d79..f6f31abdf6 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSHealthBarDefinitionMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSHealthBarDefinitionMixin.java @@ -1,83 +1,20 @@ package net.runelite.mixins; -import net.runelite.api.HealthBarOverride; import net.runelite.api.events.PostHealthBar; -import net.runelite.api.mixins.Copy; import net.runelite.api.mixins.Inject; import net.runelite.api.mixins.MethodHook; import net.runelite.api.mixins.Mixin; -import net.runelite.api.mixins.Replace; import net.runelite.api.mixins.Shadow; import net.runelite.rs.api.RSBuffer; import net.runelite.rs.api.RSClient; import net.runelite.rs.api.RSHealthBarDefinition; -import net.runelite.rs.api.RSSprite; @Mixin(RSHealthBarDefinition.class) public abstract class RSHealthBarDefinitionMixin implements RSHealthBarDefinition { - // Larger values are used for bosses like Corporeal Beast - private static final int DEFAULT_HEALTH_SCALE = 30; - @Shadow("client") private static RSClient client; - @Shadow("healthBarOverride") - private static HealthBarOverride healthBarOverride; - - @Copy("getSprite2") - abstract RSSprite rs$getHealthBarBackSprite(); - - @Replace("getSprite2") - public RSSprite rl$getHealthBarBackSprite() - { - /* - * If this combat info already uses sprites for health bars, - * use those instead, and don't override. - */ - RSSprite pixels = rs$getHealthBarBackSprite(); - if (pixels != null) - { - return pixels; - } - - if (healthBarOverride == null) - { - return null; - } - - return getHealthScale() == DEFAULT_HEALTH_SCALE - ? (RSSprite) healthBarOverride.backSprite - : (RSSprite) healthBarOverride.backSpriteLarge; - } - - @Copy("getSprite1") - abstract RSSprite rs$getHealthBarFrontSprite(); - - @Replace("getSprite1") - public RSSprite rl$getHealthBarFrontSprite() - { - /* - * If this combat info already uses sprites for health bars, - * use those instead, and don't override. - */ - RSSprite pixels = rs$getHealthBarFrontSprite(); - if (pixels != null) - { - return pixels; - } - - if (healthBarOverride == null) - { - return null; - } - - // 30 is the default size, large is for bosses like Corporeal Beast - return getHealthScale() == DEFAULT_HEALTH_SCALE - ? (RSSprite) healthBarOverride.frontSprite - : (RSSprite) healthBarOverride.frontSpriteLarge; - } - @MethodHook(value = "read", end = true) @Inject public void onRead(RSBuffer buffer) diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSPlayerMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSPlayerMixin.java index 14db9f255d..e3e7920472 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSPlayerMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSPlayerMixin.java @@ -43,6 +43,7 @@ import static net.runelite.api.SkullIcon.DEAD_MAN_TWO; import static net.runelite.api.SkullIcon.SKULL; import static net.runelite.api.SkullIcon.SKULL_FIGHT_PIT; import net.runelite.api.coords.LocalPoint; +import net.runelite.api.mixins.MethodHook; import net.runelite.api.model.Triangle; import net.runelite.api.model.Vertex; import java.awt.Polygon; @@ -64,6 +65,9 @@ public abstract class RSPlayerMixin implements RSPlayer @Shadow("client") private static RSClient client; + @Inject + private boolean friended; + @Inject @Override public String getName() @@ -255,4 +259,17 @@ public abstract class RSPlayerMixin implements RSPlayer setSpotAnimationFrame(spotAnimFrame); } } + + @Inject + public boolean isFriended() + { + return isFriend() || friended; + } + + @Inject + @MethodHook(value = "checkIsFriend", end = true) + void updateFriended() + { + friended = client.getFriendManager().isFriended(getRsName(), false); + } } diff --git a/runelite-mixins/src/test/java/net/runelite/mixins/RSSceneMixinTest.java b/runelite-mixins/src/test/java/net/runelite/mixins/RSSceneMixinTest.java deleted file mode 100644 index 54097331eb..0000000000 --- a/runelite-mixins/src/test/java/net/runelite/mixins/RSSceneMixinTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2018, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.mixins; - -import net.runelite.api.coords.LocalPoint; -import net.runelite.rs.api.RSClient; -import net.runelite.rs.api.RSPlayer; -import org.junit.Test; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -public class RSSceneMixinTest -{ - @Test - public void testWalkDistance() - { - RSClient client = mock(RSClient.class); - RSPlayer localPlayer = mock(RSPlayer.class); - when(client.getLocalPlayer()).thenReturn(localPlayer); - - when(localPlayer.getLocalLocation()).thenReturn(new LocalPoint(0, 0)); - - RSSceneMixin.client = client; - RSSceneMixin.setTargetTile(90, 0); - - verify(client).setSelectedSceneTileX(eq(45)); - verify(client).setSelectedSceneTileY(eq(0)); - } -} \ No newline at end of file diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSClient.java b/runescape-api/src/main/java/net/runelite/rs/api/RSClient.java index 90d5abcec3..e2c5735923 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSClient.java +++ b/runescape-api/src/main/java/net/runelite/rs/api/RSClient.java @@ -143,6 +143,9 @@ public interface RSClient extends RSGameShell, Client @Import("gameState") int getRSGameState(); + @Import("updateGameState") + void setGameState(int gameState); + @Import("checkClick") @Override void setCheckClick(boolean checkClick); @@ -295,6 +298,7 @@ public interface RSClient extends RSGameShell, Client boolean isCheckClick(); @Import("menuOptionsCount") + @Override int getMenuOptionCount(); @Import("menuOptionsCount") @@ -986,9 +990,15 @@ public interface RSClient extends RSGameShell, Client void rasterizerDrawCircle(int x, int y, int r, int rgb); @Import("HealthBarDefinition_cached") - @Override RSEvictingDualNodeHashTable getHealthBarCache(); + @Import("HealthBarDefinition_cachedSprites") + RSEvictingDualNodeHashTable getHealthBarSpriteCache(); + + @Import("renderSelf") + @Override + boolean getRenderSelf(); + @Import("renderSelf") @Override void setRenderSelf(boolean enabled); @@ -1001,4 +1011,5 @@ public interface RSClient extends RSGameShell, Client @Import("isSpellSelected") boolean getIsSpellSelected(); + } diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSHealthBarDefinition.java b/runescape-api/src/main/java/net/runelite/rs/api/RSHealthBarDefinition.java index 377a0934a1..110ce49826 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSHealthBarDefinition.java +++ b/runescape-api/src/main/java/net/runelite/rs/api/RSHealthBarDefinition.java @@ -8,6 +8,10 @@ public interface RSHealthBarDefinition extends RSDualNode, HealthBar @Import("width") int getHealthScale(); + @Import("spriteId1") + @Override + int getHealthBarFrontSpriteId(); + @Import("getSprite1") RSSprite getHealthBarFrontSprite(); diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSPlayer.java b/runescape-api/src/main/java/net/runelite/rs/api/RSPlayer.java index 33b4c5e51a..8bfecef721 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSPlayer.java +++ b/runescape-api/src/main/java/net/runelite/rs/api/RSPlayer.java @@ -58,6 +58,8 @@ public interface RSPlayer extends RSActor, Player @Override boolean isFriend(); + boolean isFriended(); + @Import("headIconPrayer") int getRsOverheadIcon(); diff --git a/runescape-client/src/main/java/AbstractByteArrayCopier.java b/runescape-client/src/main/java/AbstractByteArrayCopier.java index 246ec924b4..43726e2638 100644 --- a/runescape-client/src/main/java/AbstractByteArrayCopier.java +++ b/runescape-client/src/main/java/AbstractByteArrayCopier.java @@ -41,8 +41,8 @@ public abstract class AbstractByteArrayCopier { signature = "(II)Liw;", garbageValue = "1102198559" ) - public static VarcInt method4021(int var0) { - VarcInt var1 = (VarcInt)VarcInt.__iw_f.get((long)var0); + public static VarcInt getVarcInt(int var0) { + VarcInt var1 = (VarcInt)VarcInt.cachedVarcInts.get((long)var0); if(var1 != null) { return var1; } else { @@ -52,7 +52,7 @@ public abstract class AbstractByteArrayCopier { var1.__q_411(new Buffer(var2)); } - VarcInt.__iw_f.put(var1, (long)var0); + VarcInt.cachedVarcInts.put(var1, (long)var0); return var1; } } @@ -62,7 +62,7 @@ public abstract class AbstractByteArrayCopier { signature = "(II)V", garbageValue = "-1941491045" ) - public static void method4023(int var0) { + public static void unloadWidgetGroup(int var0) { if(var0 != -1) { if(Widget.loadedWidgetGroups[var0]) { Widget.Widget_indexCache.__h_399(var0); diff --git a/runescape-client/src/main/java/AbstractFont.java b/runescape-client/src/main/java/AbstractFont.java index c78e90518f..967f2b291c 100644 --- a/runescape-client/src/main/java/AbstractFont.java +++ b/runescape-client/src/main/java/AbstractFont.java @@ -667,7 +667,7 @@ public abstract class AbstractFont extends Rasterizer2D { try { var9 = MouseHandler.method1085(var8.substring(4)); IndexedSprite var10 = AbstractFont_modIconSprites[var9]; - var10.__q_496(var2, var3 + this.ascent - var10.height); + var10.drawAt(var2, var3 + this.ascent - var10.height); var2 += var10.width; var5 = -1; } catch (Exception var14) { @@ -773,7 +773,7 @@ public abstract class AbstractFont extends Rasterizer2D { ++var8; var14 = MouseHandler.method1085(var11.substring(4)); IndexedSprite var15 = AbstractFont_modIconSprites[var14]; - var15.__q_496(var12 + var2, var13 + (var3 + this.ascent - var15.height)); + var15.drawAt(var12 + var2, var13 + (var3 + this.ascent - var15.height)); var2 += var15.width; var7 = -1; } catch (Exception var19) { diff --git a/runescape-client/src/main/java/AbstractRasterProvider.java b/runescape-client/src/main/java/AbstractRasterProvider.java index 7a487402b9..4d6fcf99ea 100644 --- a/runescape-client/src/main/java/AbstractRasterProvider.java +++ b/runescape-client/src/main/java/AbstractRasterProvider.java @@ -8,8 +8,8 @@ import net.runelite.mapping.ObfuscatedSignature; @Implements("AbstractRasterProvider") public abstract class AbstractRasterProvider { @ObfuscatedName("ca") - @Export("__lp_ca") - static boolean __lp_ca; + @Export("mouseCam") + static boolean mouseCam; @ObfuscatedName("q") @Export("pixels") public int[] pixels; diff --git a/runescape-client/src/main/java/AccessFile.java b/runescape-client/src/main/java/AccessFile.java index ad6fd753e6..304b83c20f 100644 --- a/runescape-client/src/main/java/AccessFile.java +++ b/runescape-client/src/main/java/AccessFile.java @@ -157,31 +157,31 @@ public final class AccessFile { signature = "(Lho;Ljv;IIZI)V", garbageValue = "-728558316" ) - static final void method2726(Widget var0, ItemDefinition var1, int var2, int var3, boolean var4) { - String[] var5 = var1.inventoryActions; - byte var6 = -1; - String var7 = null; - if(var5 != null && var5[var3] != null) { - if(var3 == 0) { - var6 = 33; - } else if(var3 == 1) { - var6 = 34; - } else if(var3 == 2) { - var6 = 35; - } else if(var3 == 3) { - var6 = 36; + static final void addWidgetItemMenuItem(Widget widget, ItemDefinition definition, int var2, int actionIndex, boolean shiftClick) { + String[] var5 = definition.inventoryActions; + byte opcode = -1; + String action = null; + if(var5 != null && var5[actionIndex] != null) { + if(actionIndex == 0) { + opcode = 33; + } else if(actionIndex == 1) { + opcode = 34; + } else if(actionIndex == 2) { + opcode = 35; + } else if(actionIndex == 3) { + opcode = 36; } else { - var6 = 37; + opcode = 37; } - var7 = var5[var3]; - } else if(var3 == 4) { - var6 = 37; - var7 = "Drop"; + action = var5[actionIndex]; + } else if(actionIndex == 4) { + opcode = 37; + action = "Drop"; } - if(var6 != -1 && var7 != null) { - class16.insertMenuItem(var7, BufferedFile.colorStartTag(16748608) + var1.name, var6, var1.id, var2, var0.id, var4); + if(opcode != -1 && action != null) { + class16.insertMenuItem(action, BufferedFile.colorStartTag(0xff9040) + definition.name, opcode, definition.id, var2, widget.id, shiftClick); } } diff --git a/runescape-client/src/main/java/Actor.java b/runescape-client/src/main/java/Actor.java index 4e6b943df3..2deeb4ef84 100644 --- a/runescape-client/src/main/java/Actor.java +++ b/runescape-client/src/main/java/Actor.java @@ -424,7 +424,7 @@ public abstract class Actor extends Entity { int var10 = -1; int var11 = 0; if(var1 >= 0) { - HitSplatDefinition var12 = class72.getHitSplatDefinition(var1); + HitSplatDefinition var12 = LoginScreenAnimation.getHitSplatDefinition(var1); var10 = var12.__c; var11 = var12.__i; } diff --git a/runescape-client/src/main/java/AttackOption.java b/runescape-client/src/main/java/AttackOption.java index 3395856851..699c61117b 100644 --- a/runescape-client/src/main/java/AttackOption.java +++ b/runescape-client/src/main/java/AttackOption.java @@ -43,8 +43,8 @@ public enum AttackOption implements Enumerated { @ObfuscatedSignature( signature = "[Llq;" ) - @Export("__cj_bo") - static IndexedSprite[] __cj_bo; + @Export("worldSelectArrows") + static IndexedSprite[] worldSelectArrows; @ObfuscatedName("o") @ObfuscatedGetter( intValue = -1461217963 diff --git a/runescape-client/src/main/java/BoundaryObject.java b/runescape-client/src/main/java/BoundaryObject.java index cb0e1ffa1e..659c924834 100644 --- a/runescape-client/src/main/java/BoundaryObject.java +++ b/runescape-client/src/main/java/BoundaryObject.java @@ -78,10 +78,10 @@ public final class BoundaryObject { signature = "(Ljava/lang/String;B)V", garbageValue = "103" ) - static final void method3235(String var0) { + static final void doCheat(String var0) { if(var0.equalsIgnoreCase("toggleroof")) { ReflectionCheck.clientPreferences.roofsHidden = !ReflectionCheck.clientPreferences.roofsHidden; - WorldMapSection0.method247(); + WorldMapSection0.savePreferences(); if(ReflectionCheck.clientPreferences.roofsHidden) { WorldMapIcon1.method219(99, "", "Roofs are now all hidden"); } else { diff --git a/runescape-client/src/main/java/Buddy.java b/runescape-client/src/main/java/Buddy.java index 12b1fe48b4..4e643dadd2 100644 --- a/runescape-client/src/main/java/Buddy.java +++ b/runescape-client/src/main/java/Buddy.java @@ -66,7 +66,7 @@ public class Buddy extends User { signature = "(I)V", garbageValue = "1868787018" ) - static final void method5554() { + static final void processOverheadText() { int[] var0 = Players.Players_indices; int var1; diff --git a/runescape-client/src/main/java/Buffer.java b/runescape-client/src/main/java/Buffer.java index a278f911ea..834f7c642d 100644 --- a/runescape-client/src/main/java/Buffer.java +++ b/runescape-client/src/main/java/Buffer.java @@ -1091,7 +1091,7 @@ public class Buffer extends Node { signature = "(B)V", garbageValue = "1" ) - public static void method3915() { + public static void clearHealthbarCaches() { HealthBarDefinition.HealthBarDefinition_cached.clear(); HealthBarDefinition.HealthBarDefinition_cachedSprites.clear(); } diff --git a/runescape-client/src/main/java/ByteArrayPool.java b/runescape-client/src/main/java/ByteArrayPool.java index 97268c74fd..edbac8c291 100644 --- a/runescape-client/src/main/java/ByteArrayPool.java +++ b/runescape-client/src/main/java/ByteArrayPool.java @@ -91,15 +91,15 @@ public class ByteArrayPool { return var2; } - if(class179.__fe_e != null) { + if(RouteStrategy.__fe_e != null) { for(int var4 = 0; var4 < __gi_g.length; ++var4) { if(__gi_g[var4] != var0) { if(var0 < __gi_g[var4]) { ; } } else if(WorldMapSection2.__ah_l[var4] > 0) { - byte[] var3 = class179.__fe_e[var4][--WorldMapSection2.__ah_l[var4]]; - class179.__fe_e[var4][WorldMapSection2.__ah_l[var4]] = null; + byte[] var3 = RouteStrategy.__fe_e[var4][--WorldMapSection2.__ah_l[var4]]; + RouteStrategy.__fe_e[var4][WorldMapSection2.__ah_l[var4]] = null; return var3; } } diff --git a/runescape-client/src/main/java/Canvas.java b/runescape-client/src/main/java/Canvas.java index 80de74600b..758b6637d0 100644 --- a/runescape-client/src/main/java/Canvas.java +++ b/runescape-client/src/main/java/Canvas.java @@ -120,10 +120,10 @@ public final class Canvas extends java.awt.Canvas { int var3; int var4; if(var0 == 100) { - class179.Interpreter_intStackSize -= 3; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - int var5 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; + RouteStrategy.Interpreter_intStackSize -= 3; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + int var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; if(var4 == 0) { throw new RuntimeException(); } else { @@ -170,22 +170,22 @@ public final class Canvas extends java.awt.Canvas { class22.method295(var10); return 1; } else if(var0 == 102) { - var9 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var9 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); var9.children = null; class22.method295(var9); return 1; } else if(var0 != 200) { if(var0 == 201) { - var9 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var9 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); if(var9 != null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 1; if(var2) { WorldMapIcon1.__t_i = var9; } else { class12.__n_n = var9; } } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; @@ -193,19 +193,19 @@ public final class Canvas extends java.awt.Canvas { return 2; } } else { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; Widget var11 = class204.getWidgetChild(var3, var4); if(var11 != null && var4 != -1) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 1; if(var2) { WorldMapIcon1.__t_i = var11; } else { class12.__n_n = var11; } } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; diff --git a/runescape-client/src/main/java/ChatChannel.java b/runescape-client/src/main/java/ChatChannel.java index 662bf6a8b3..66e6aaea2f 100644 --- a/runescape-client/src/main/java/ChatChannel.java +++ b/runescape-client/src/main/java/ChatChannel.java @@ -188,31 +188,31 @@ public class ChatChannel { ) static final void method2237(Widget var0, int var1, int var2) { if(var0.buttonType == 1) { - Tiles.method1106(var0.buttonText, "", 24, 0, 0, var0.id); + Tiles.insertMenuItemNoShift(var0.buttonText, "", 24, 0, 0, var0.id); } String var3; if(var0.buttonType == 2 && !Client.isSpellSelected) { var3 = class198.method3745(var0); if(var3 != null) { - Tiles.method1106(var3, BufferedFile.colorStartTag(65280) + var0.spellName, 25, 0, -1, var0.id); + Tiles.insertMenuItemNoShift(var3, BufferedFile.colorStartTag(65280) + var0.spellName, 25, 0, -1, var0.id); } } if(var0.buttonType == 3) { - Tiles.method1106("Close", "", 26, 0, 0, var0.id); + Tiles.insertMenuItemNoShift("Close", "", 26, 0, 0, var0.id); } if(var0.buttonType == 4) { - Tiles.method1106(var0.buttonText, "", 28, 0, 0, var0.id); + Tiles.insertMenuItemNoShift(var0.buttonText, "", 28, 0, 0, var0.id); } if(var0.buttonType == 5) { - Tiles.method1106(var0.buttonText, "", 29, 0, 0, var0.id); + Tiles.insertMenuItemNoShift(var0.buttonText, "", 29, 0, 0, var0.id); } if(var0.buttonType == 6 && Client.__client_mo == null) { - Tiles.method1106(var0.buttonText, "", 30, 0, -1, var0.id); + Tiles.insertMenuItemNoShift(var0.buttonText, "", 30, 0, -1, var0.id); } int var4; @@ -237,11 +237,11 @@ public class ChatChannel { ItemDefinition var8 = Skills.getItemDefinition(var0.itemIds[var13] - 1); if(Client.isItemSelected == 1 && WorldMapAreaData.method708(class1.getWidgetClickMask(var0))) { if(var0.id != ServerPacket.selectedItemWidget || var13 != HealthBarDefinition.selectedItemSlot) { - Tiles.method1106("Use", Client.selectedItemName + " " + "->" + " " + BufferedFile.colorStartTag(16748608) + var8.name, 31, var8.id, var13, var0.id); + Tiles.insertMenuItemNoShift("Use", Client.selectedItemName + " " + "->" + " " + BufferedFile.colorStartTag(16748608) + var8.name, 31, var8.id, var13, var0.id); } } else if(Client.isSpellSelected && WorldMapAreaData.method708(class1.getWidgetClickMask(var0))) { if((FloorDecoration.selectedSpellFlags & 16) == 16) { - Tiles.method1106(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + BufferedFile.colorStartTag(16748608) + var8.name, 32, var8.id, var13, var0.id); + Tiles.insertMenuItemNoShift(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + BufferedFile.colorStartTag(16748608) + var8.name, 32, var8.id, var13, var0.id); } } else { String[] var9 = var8.inventoryActions; @@ -254,24 +254,24 @@ public class ChatChannel { if(WorldMapAreaData.method708(class1.getWidgetClickMask(var0))) { for(var11 = 4; var11 >= 3; --var11) { if(var10 != var11) { - AccessFile.method2726(var0, var8, var13, var11, false); + AccessFile.addWidgetItemMenuItem(var0, var8, var13, var11, false); } } } if(SecureRandomFuture.method2101(class1.getWidgetClickMask(var0))) { - Tiles.method1106("Use", BufferedFile.colorStartTag(16748608) + var8.name, 38, var8.id, var13, var0.id); + Tiles.insertMenuItemNoShift("Use", BufferedFile.colorStartTag(16748608) + var8.name, 38, var8.id, var13, var0.id); } if(WorldMapAreaData.method708(class1.getWidgetClickMask(var0))) { for(var11 = 2; var11 >= 0; --var11) { if(var11 != var10) { - AccessFile.method2726(var0, var8, var13, var11, false); + AccessFile.addWidgetItemMenuItem(var0, var8, var13, var11, false); } } if(var10 >= 0) { - AccessFile.method2726(var0, var8, var13, var10, true); + AccessFile.addWidgetItemMenuItem(var0, var8, var13, var10, true); } } @@ -300,12 +300,12 @@ public class ChatChannel { var12 = 43; } - Tiles.method1106(var9[var11], BufferedFile.colorStartTag(16748608) + var8.name, var12, var8.id, var13, var0.id); + Tiles.insertMenuItemNoShift(var9[var11], BufferedFile.colorStartTag(0xff9040) + var8.name, var12, var8.id, var13, var0.id); } } } - Tiles.method1106("Examine", BufferedFile.colorStartTag(16748608) + var8.name, 1005, var8.id, var13, var0.id); + Tiles.insertMenuItemNoShift("Examine", BufferedFile.colorStartTag(0xff9040) + var8.name, 1005, var8.id, var13, var0.id); } } } @@ -318,19 +318,19 @@ public class ChatChannel { if(var0.isIf3) { if(Client.isSpellSelected) { if(WorldComparator.method58(class1.getWidgetClickMask(var0)) && (FloorDecoration.selectedSpellFlags & 32) == 32) { - Tiles.method1106(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + var0.dataText, 58, 0, var0.childIndex, var0.id); + Tiles.insertMenuItemNoShift(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + var0.dataText, 58, 0, var0.childIndex, var0.id); } } else { for(var13 = 9; var13 >= 5; --var13) { String var14 = GameShell.method1060(var0, var13); if(var14 != null) { - Tiles.method1106(var14, var0.dataText, 1007, var13 + 1, var0.childIndex, var0.id); + Tiles.insertMenuItemNoShift(var14, var0.dataText, 1007, var13 + 1, var0.childIndex, var0.id); } } var3 = class198.method3745(var0); if(var3 != null) { - Tiles.method1106(var3, var0.dataText, 25, 0, var0.childIndex, var0.id); + Tiles.insertMenuItemNoShift(var3, var0.dataText, 25, 0, var0.childIndex, var0.id); } for(var4 = 4; var4 >= 0; --var4) { @@ -343,7 +343,7 @@ public class ChatChannel { var5 = class1.getWidgetClickMask(var0); boolean var16 = (var5 & 1) != 0; if(var16) { - Tiles.method1106("Continue", "", 30, 0, var0.childIndex, var0.id); + Tiles.insertMenuItemNoShift("Continue", "", 30, 0, var0.childIndex, var0.id); } } } diff --git a/runescape-client/src/main/java/ClanChat.java b/runescape-client/src/main/java/ClanChat.java index a0871d5700..5b004c23d7 100644 --- a/runescape-client/src/main/java/ClanChat.java +++ b/runescape-client/src/main/java/ClanChat.java @@ -221,7 +221,7 @@ public class ClanChat extends UserList { ) @Export("__cp_475") final void __cp_475(ClanMate var1) { - if(var1.username().__equals_466(this.localUser.username())) { + if(var1.username().equals(this.localUser.username())) { this.rank = var1.rank; } diff --git a/runescape-client/src/main/java/Client.java b/runescape-client/src/main/java/Client.java index 4e37d7317f..983ef4e176 100644 --- a/runescape-client/src/main/java/Client.java +++ b/runescape-client/src/main/java/Client.java @@ -3641,7 +3641,7 @@ public final class Client extends GameShell implements Usernamed { switch(field658.field1984) { case 0: case 3: - var3.writeMedium(class13.__i_af); + var3.writeMedium(class13.otpInt); ++var3.index; break; case 1: @@ -3808,7 +3808,7 @@ public final class Client extends GameShell implements Usernamed { ReflectionCheck.clientPreferences.rememberedUsername = null; } - WorldMapSection0.method247(); + WorldMapSection0.savePreferences(); rights = ((AbstractSocket)var1).readUnsignedByte(); __client_mn = ((AbstractSocket)var1).readUnsignedByte() == 1; localPlayerIndex = ((AbstractSocket)var1).readUnsignedByte(); @@ -4127,7 +4127,7 @@ public final class Client extends GameShell implements Usernamed { } PacketBufferNode var18; - if(MouseHandler.MouseHandler_lastButton == 1 || !AbstractRasterProvider.__lp_ca && MouseHandler.MouseHandler_lastButton == 4 || MouseHandler.MouseHandler_lastButton == 2) { + if(MouseHandler.MouseHandler_lastButton == 1 || !AbstractRasterProvider.mouseCam && MouseHandler.MouseHandler_lastButton == 4 || MouseHandler.MouseHandler_lastButton == 2) { long var16 = (MouseHandler.MouseHandler_lastPressedTimeMillis - mouseLastLastPressedTimeMillis * -1L) / 50L; if(var16 > 4095L) { var16 = 4095L; @@ -4244,7 +4244,7 @@ public final class Client extends GameShell implements Usernamed { } } - Buddy.method5554(); + Buddy.processOverheadText(); ++__client_gy; if(mouseCrossColor != 0) { mouseCrossState += 20; @@ -5054,7 +5054,7 @@ public final class Client extends GameShell implements Usernamed { } } - PlayerType.method4547(var5); + PlayerType.clearItemContainer(var5); var7 = var3.__ag_302(); for(var8 = 0; var8 < var7; ++var8) { @@ -6269,7 +6269,7 @@ public final class Client extends GameShell implements Usernamed { int var13; if(isMenuOpen) { int var12; - if(var15 != 1 && (AbstractRasterProvider.__lp_ca || var15 != 4)) { + if(var15 != 1 && (AbstractRasterProvider.mouseCam || var15 != 4)) { var2 = MouseHandler.MouseHandler_x; var12 = MouseHandler.MouseHandler_y; if(var2 < class25.menuX - 10 || var2 > class25.menuX + class214.menuWidth + 10 || var12 < GameShell.menuY - 10 || var12 > AbstractWorldMapIcon.menuHeight + GameShell.menuY + 10) { @@ -6278,7 +6278,7 @@ public final class Client extends GameShell implements Usernamed { } } - if(var15 == 1 || !AbstractRasterProvider.__lp_ca && var15 == 4) { + if(var15 == 1 || !AbstractRasterProvider.mouseCam && var15 == 4) { var2 = class25.menuX; var12 = GameShell.menuY; var13 = class214.menuWidth; @@ -6302,7 +6302,7 @@ public final class Client extends GameShell implements Usernamed { } } else { var2 = menuOptionsCount - 1; - if((var15 == 1 || !AbstractRasterProvider.__lp_ca && var15 == 4) && var2 >= 0) { + if((var15 == 1 || !AbstractRasterProvider.mouseCam && var15 == 4) && var2 >= 0) { var13 = menuOpcodes[var2]; if(var13 == 39 || var13 == 40 || var13 == 41 || var13 == 42 || var13 == 43 || var13 == 33 || var13 == 34 || var13 == 35 || var13 == 36 || var13 == 37 || var13 == 38 || var13 == 1005) { var5 = menuArguments1[var2]; @@ -6321,11 +6321,11 @@ public final class Client extends GameShell implements Usernamed { } } - if((var15 == 1 || !AbstractRasterProvider.__lp_ca && var15 == 4) && this.shouldLeftClickOpenMenu()) { + if((var15 == 1 || !AbstractRasterProvider.mouseCam && var15 == 4) && this.shouldLeftClickOpenMenu()) { var15 = 2; } - if((var15 == 1 || !AbstractRasterProvider.__lp_ca && var15 == 4) && menuOptionsCount > 0) { + if((var15 == 1 || !AbstractRasterProvider.mouseCam && var15 == 4) && menuOptionsCount > 0) { WorldMapSection0.method245(var2); } diff --git a/runescape-client/src/main/java/ClientParameter.java b/runescape-client/src/main/java/ClientParameter.java index 2023de1536..6ca10198ab 100644 --- a/runescape-client/src/main/java/ClientParameter.java +++ b/runescape-client/src/main/java/ClientParameter.java @@ -190,7 +190,7 @@ public class ClientParameter { var3.population = var1.__aq_303(); } - MilliClock.method3400(ItemContainer.worlds, 0, ItemContainer.worlds.length - 1, World.__bt_e, World.__bt_l); + MilliClock.method3400(ItemContainer.worlds, 0, ItemContainer.worlds.length - 1, World.sortOption1, World.sortOption2); FriendLoginUpdate.__kn_x = null; return true; } diff --git a/runescape-client/src/main/java/Decimator.java b/runescape-client/src/main/java/Decimator.java index 339f08741d..1d376b3d10 100644 --- a/runescape-client/src/main/java/Decimator.java +++ b/runescape-client/src/main/java/Decimator.java @@ -189,23 +189,23 @@ public class Decimator { var6 = Scene.Scene_cameraPitchCosine; var7 = Scene.Scene_cameraYawSine; var8 = Scene.Scene_cameraYawCosine; - byte var9 = 50; - short var10 = 3500; - var11 = (ViewportMouse.ViewportMouse_x - Rasterizer3D.Rasterizer3D_clipMidX) * var9 / Rasterizer3D.Rasterizer3D_zoom; - var12 = (ViewportMouse.ViewportMouse_y - Rasterizer3D.Rasterizer3D_clipMidY) * var9 / Rasterizer3D.Rasterizer3D_zoom; - var13 = (ViewportMouse.ViewportMouse_x - Rasterizer3D.Rasterizer3D_clipMidX) * var10 / Rasterizer3D.Rasterizer3D_zoom; - int var14 = (ViewportMouse.ViewportMouse_y - Rasterizer3D.Rasterizer3D_clipMidY) * var10 / Rasterizer3D.Rasterizer3D_zoom; - int var15 = Rasterizer3D.method3007(var12, var9, var6, var5); - var16 = Rasterizer3D.method3008(var12, var9, var6, var5); + byte clickboxClose = 50; + short clickboxFar = 3500; + var11 = (ViewportMouse.ViewportMouse_x - Rasterizer3D.Rasterizer3D_clipMidX) * clickboxClose / Rasterizer3D.Rasterizer3D_zoom; + var12 = (ViewportMouse.ViewportMouse_y - Rasterizer3D.Rasterizer3D_clipMidY) * clickboxClose / Rasterizer3D.Rasterizer3D_zoom; + var13 = (ViewportMouse.ViewportMouse_x - Rasterizer3D.Rasterizer3D_clipMidX) * clickboxFar / Rasterizer3D.Rasterizer3D_zoom; + int var14 = (ViewportMouse.ViewportMouse_y - Rasterizer3D.Rasterizer3D_clipMidY) * clickboxFar / Rasterizer3D.Rasterizer3D_zoom; + int var15 = Rasterizer3D.rot1(var12, clickboxClose, var6, var5); + var16 = Rasterizer3D.rot2(var12, clickboxClose, var6, var5); var12 = var15; - var15 = Rasterizer3D.method3007(var14, var10, var6, var5); - var17 = Rasterizer3D.method3008(var14, var10, var6, var5); + var15 = Rasterizer3D.rot1(var14, clickboxFar, var6, var5); + var17 = Rasterizer3D.rot2(var14, clickboxFar, var6, var5); var14 = var15; - var15 = Rasterizer3D.method3005(var11, var16, var8, var7); - var16 = Rasterizer3D.method3006(var11, var16, var8, var7); + var15 = Rasterizer3D.rot3(var11, var16, var8, var7); + var16 = Rasterizer3D.rot4(var11, var16, var8, var7); var11 = var15; - var15 = Rasterizer3D.method3005(var13, var17, var8, var7); - var17 = Rasterizer3D.method3006(var13, var17, var8, var7); + var15 = Rasterizer3D.rot3(var13, var17, var8, var7); + var17 = Rasterizer3D.rot4(var13, var17, var8, var7); AccessFile.__dk_o = (var11 + var15) / 2; ViewportMouse.__dm_u = (var14 + var12) / 2; ViewportMouse.__dm_g = (var17 + var16) / 2; diff --git a/runescape-client/src/main/java/DevicePcmPlayerProvider.java b/runescape-client/src/main/java/DevicePcmPlayerProvider.java index dd7a71cf5d..35d3383bd7 100644 --- a/runescape-client/src/main/java/DevicePcmPlayerProvider.java +++ b/runescape-client/src/main/java/DevicePcmPlayerProvider.java @@ -308,7 +308,7 @@ public class DevicePcmPlayerProvider implements PcmPlayerProvider { } if(var10.contentType == 1402) { - class16.field85.method1782(var12, Client.cycle); + class16.loginScreenRunesAnimation.method1782(var12, Client.cycle); } } diff --git a/runescape-client/src/main/java/DynamicObject.java b/runescape-client/src/main/java/DynamicObject.java index 95d3a17dae..98cfafac12 100644 --- a/runescape-client/src/main/java/DynamicObject.java +++ b/runescape-client/src/main/java/DynamicObject.java @@ -208,17 +208,17 @@ public class DynamicObject extends Entity { ) static int method2223(int var0, Script var1, boolean var2) { if(var0 == 5000) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.publicChatMode; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.publicChatMode; return 1; } else if(var0 == 5001) { - class179.Interpreter_intStackSize -= 3; - Client.publicChatMode = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - IndexCacheLoader.field512 = WorldMapElement.method4783(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]); + RouteStrategy.Interpreter_intStackSize -= 3; + Client.publicChatMode = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + IndexCacheLoader.field512 = WorldMapElement.method4783(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]); if(IndexCacheLoader.field512 == null) { IndexCacheLoader.field512 = class310.field3805; } - Client.__client_pl = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; + Client.__client_pl = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; PacketBufferNode var18 = Interpreter.method1915(ClientPacket.__gs_z, Client.packetWriter.isaacCipher); var18.packetBuffer.writeByte(Client.publicChatMode); var18.packetBuffer.writeByte(IndexCacheLoader.field512.field3804); @@ -230,9 +230,9 @@ public class DynamicObject extends Entity { int var4; if(var0 == 5002) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - class179.Interpreter_intStackSize -= 2; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - int var5 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + int var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; PacketBufferNode var6 = Interpreter.method1915(ClientPacket.__gs_ae, Client.packetWriter.isaacCipher); var6.packetBuffer.writeByte(WorldMapRegion.method550(var3) + 2); var6.packetBuffer.writeStringCp1252NullTerminated(var3); @@ -243,58 +243,58 @@ public class DynamicObject extends Entity { } else { int var10; if(var0 == 5003) { - class179.Interpreter_intStackSize -= 2; - var10 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var10 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; Message var15 = Message.method1226(var10, var4); if(var15 != null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var15.count; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var15.cycle; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var15.count; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var15.cycle; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var15.sender != null?var15.sender:""; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var15.prefix != null?var15.prefix:""; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var15.text != null?var15.text:""; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var15.isFromFriend()?1:(var15.isFromIgnored()?2:0); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var15.isFromFriend()?1:(var15.isFromIgnored()?2:0); } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 5004) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; Message var16 = NetCache.method4708(var10); if(var16 != null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var16.type; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var16.cycle; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var16.type; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var16.cycle; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var16.sender != null?var16.sender:""; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var16.prefix != null?var16.prefix:""; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var16.text != null?var16.text:""; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var16.isFromFriend()?1:(var16.isFromIgnored()?2:0); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var16.isFromFriend()?1:(var16.isFromIgnored()?2:0); } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 5005) { if(IndexCacheLoader.field512 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = IndexCacheLoader.field512.field3804; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = IndexCacheLoader.field512.field3804; } return 1; } else if(var0 == 5008) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - var4 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; String var14 = var3.toLowerCase(); byte var17 = 0; if(var14.startsWith("yellow:")) { @@ -433,23 +433,23 @@ public class DynamicObject extends Entity { return 1; } else if(var0 != 5015) { if(var0 == 5016) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.__client_pl; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.__client_pl; return 1; } else if(var0 == 5017) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = WidgetGroupParent.method1174(var10); + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = WidgetGroupParent.method1174(var10); return 1; } else if(var0 == 5018) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class12.method161(var10); + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class12.method161(var10); return 1; } else if(var0 == 5019) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = SpriteMask.method4391(var10); + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = SpriteMask.method4391(var10); return 1; } else if(var0 == 5020) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - BoundaryObject.method3235(var3); + BoundaryObject.doCheat(var3); return 1; } else if(var0 == 5021) { Client.__client_pz = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize].toLowerCase().trim(); diff --git a/runescape-client/src/main/java/FontName.java b/runescape-client/src/main/java/FontName.java index 749e57c1b8..e6996f3685 100644 --- a/runescape-client/src/main/java/FontName.java +++ b/runescape-client/src/main/java/FontName.java @@ -78,11 +78,11 @@ public class FontName { signature = "(I)V", garbageValue = "-1587423260" ) - static void method5636() { - Login.__cu_bk = false; - Login.__cu_g.drawAt(Login.__cu_q, 0); - Fonts.__kz_l.drawAt(Login.__cu_q + 382, 0); - WorldMapSectionType.__h_e.__q_496(Login.__cu_q + 382 - WorldMapSectionType.__h_e.subWidth / 2, 18); + static void closeWorldSelect() { + Login.worldSelectOpen = false; + Login.leftTitleSprite.drawAt(Login.xPadding, 0); + Fonts.rightTitleSprite.drawAt(Login.xPadding + 382, 0); + WorldMapSectionType.logoSprite.drawAt(Login.xPadding + 382 - WorldMapSectionType.logoSprite.subWidth / 2, 18); } @ObfuscatedName("s") @@ -106,18 +106,18 @@ public class FontName { static int method5639(int var0, Script var1, boolean var2) { if(var0 == 3600) { if(WorldMapArea.friendSystem.__g == 0) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -2; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -2; } else if(WorldMapArea.friendSystem.__g == 1) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = WorldMapArea.friendSystem.friendsList.size(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = WorldMapArea.friendSystem.friendsList.size(); } return 1; } else { int var3; if(var0 == 3601) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(WorldMapArea.friendSystem.__m_151() && var3 >= 0 && var3 < WorldMapArea.friendSystem.friendsList.size()) { Friend var8 = (Friend)WorldMapArea.friendSystem.friendsList.get(var3); Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var8.name(); @@ -129,20 +129,20 @@ public class FontName { return 1; } else if(var0 == 3602) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(WorldMapArea.friendSystem.__m_151() && var3 >= 0 && var3 < WorldMapArea.friendSystem.friendsList.size()) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ((Buddy)WorldMapArea.friendSystem.friendsList.get(var3)).world0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ((Buddy)WorldMapArea.friendSystem.friendsList.get(var3)).world0; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 3603) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(WorldMapArea.friendSystem.__m_151() && var3 >= 0 && var3 < WorldMapArea.friendSystem.friendsList.size()) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ((Buddy)WorldMapArea.friendSystem.friendsList.get(var3)).rank; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ((Buddy)WorldMapArea.friendSystem.friendsList.get(var3)).rank; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; @@ -150,7 +150,7 @@ public class FontName { String var5; if(var0 == 3604) { var5 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - int var6 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + int var6 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; method5638(var5, var6); return 1; } else if(var0 == 3605) { @@ -172,7 +172,7 @@ public class FontName { } else if(var0 == 3609) { var5 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; var5 = NpcDefinition.method5161(var5); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = WorldMapArea.friendSystem.isFriended(new Username(var5, KeyHandler.loginType), false)?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = WorldMapArea.friendSystem.isFriended(new Username(var5, KeyHandler.loginType), false)?1:0; return 1; } else if(var0 == 3611) { if(PacketWriter.clanChat != null) { @@ -184,14 +184,14 @@ public class FontName { return 1; } else if(var0 == 3612) { if(PacketWriter.clanChat != null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = PacketWriter.clanChat.size(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = PacketWriter.clanChat.size(); } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 3613) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(PacketWriter.clanChat != null && var3 < PacketWriter.clanChat.size()) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = PacketWriter.clanChat.get(var3).username().getName(); } else { @@ -200,32 +200,32 @@ public class FontName { return 1; } else if(var0 == 3614) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(PacketWriter.clanChat != null && var3 < PacketWriter.clanChat.size()) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ((Buddy)PacketWriter.clanChat.get(var3)).world(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ((Buddy)PacketWriter.clanChat.get(var3)).world(); } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 3615) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(PacketWriter.clanChat != null && var3 < PacketWriter.clanChat.size()) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ((Buddy)PacketWriter.clanChat.get(var3)).rank; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ((Buddy)PacketWriter.clanChat.get(var3)).rank; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 3616) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = PacketWriter.clanChat != null?PacketWriter.clanChat.__k:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = PacketWriter.clanChat != null?PacketWriter.clanChat.__k:0; return 1; } else if(var0 == 3617) { var5 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; IndexStoreActionHandler.method4655(var5); return 1; } else if(var0 == 3618) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = PacketWriter.clanChat != null?PacketWriter.clanChat.rank:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = PacketWriter.clanChat != null?PacketWriter.clanChat.rank:0; return 1; } else if(var0 == 3619) { var5 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; @@ -236,14 +236,14 @@ public class FontName { return 1; } else if(var0 == 3621) { if(!WorldMapArea.friendSystem.__m_151()) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = WorldMapArea.friendSystem.ignoreList.size(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = WorldMapArea.friendSystem.ignoreList.size(); } return 1; } else if(var0 == 3622) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(WorldMapArea.friendSystem.__m_151() && var3 >= 0 && var3 < WorldMapArea.friendSystem.ignoreList.size()) { Ignored var4 = (Ignored)WorldMapArea.friendSystem.ignoreList.get(var3); Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var4.name(); @@ -257,14 +257,14 @@ public class FontName { } else if(var0 == 3623) { var5 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; var5 = NpcDefinition.method5161(var5); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = WorldMapArea.friendSystem.isIgnored(new Username(var5, KeyHandler.loginType))?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = WorldMapArea.friendSystem.isIgnored(new Username(var5, KeyHandler.loginType))?1:0; return 1; } else if(var0 == 3624) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - if(PacketWriter.clanChat != null && var3 < PacketWriter.clanChat.size() && PacketWriter.clanChat.get(var3).username().__equals_466(Canvas.localPlayer.username)) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 1; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + if(PacketWriter.clanChat != null && var3 < PacketWriter.clanChat.size() && PacketWriter.clanChat.get(var3).username().equals(Canvas.localPlayer.username)) { + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; @@ -277,11 +277,11 @@ public class FontName { return 1; } else if(var0 == 3626) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(PacketWriter.clanChat != null && var3 < PacketWriter.clanChat.size() && ((ClanMate)PacketWriter.clanChat.get(var3)).isFriend()) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; @@ -292,43 +292,43 @@ public class FontName { } else { boolean var7; if(var0 == 3629) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new UserComparator1(var7)); return 1; } else if(var0 == 3630) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new UserComparator2(var7)); return 1; } else if(var0 == 3631) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new UserComparator3(var7)); return 1; } else if(var0 == 3632) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new UserComparator4(var7)); return 1; } else if(var0 == 3633) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new UserComparator5(var7)); return 1; } else if(var0 == 3634) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new UserComparator6(var7)); return 1; } else if(var0 == 3635) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new UserComparator7(var7)); return 1; } else if(var0 == 3636) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new UserComparator8(var7)); return 1; } else if(var0 == 3637) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new UserComparator9(var7)); return 1; } else if(var0 == 3638) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new UserComparator10(var7)); return 1; } else if(var0 == 3639) { @@ -338,11 +338,11 @@ public class FontName { WorldMapArea.friendSystem.ignoreList.removeComparator(); return 1; } else if(var0 == 3641) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.ignoreList.addComparator(new UserComparator1(var7)); return 1; } else if(var0 == 3642) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.ignoreList.addComparator(new UserComparator2(var7)); return 1; } else if(var0 == 3643) { @@ -355,70 +355,70 @@ public class FontName { return 1; } else if(var0 == 3645) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new UserComparator1(var7)); } return 1; } else if(var0 == 3646) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new UserComparator2(var7)); } return 1; } else if(var0 == 3647) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new UserComparator3(var7)); } return 1; } else if(var0 == 3648) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new UserComparator4(var7)); } return 1; } else if(var0 == 3649) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new UserComparator5(var7)); } return 1; } else if(var0 == 3650) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new UserComparator6(var7)); } return 1; } else if(var0 == 3651) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new UserComparator7(var7)); } return 1; } else if(var0 == 3652) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new UserComparator8(var7)); } return 1; } else if(var0 == 3653) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new UserComparator9(var7)); } return 1; } else if(var0 == 3654) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new UserComparator10(var7)); } @@ -431,11 +431,11 @@ public class FontName { return 1; } else if(var0 == 3656) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapArea.friendSystem.friendsList.addComparator(new class157(var7)); return 1; } else if(var0 == 3657) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(PacketWriter.clanChat != null) { PacketWriter.clanChat.addComparator(new class157(var7)); } @@ -446,11 +446,11 @@ public class FontName { } } } else { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(PacketWriter.clanChat != null && var3 < PacketWriter.clanChat.size() && ((ClanMate)PacketWriter.clanChat.get(var3)).isIgnored()) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; @@ -470,14 +470,14 @@ public class FontName { DevicePcmPlayerProvider.method841(); WorldMapManager.method673(); WorldMapLabel.method440(); - class72.method1780(); + LoginScreenAnimation.method1780(); SequenceDefinition.SequenceDefinition_cached.clear(); SequenceDefinition.__jh_o.clear(); UserComparator3.method3379(); VarbitDefinition.VarbitDefinition_cached.clear(); VarpDefinition.VarpDefinition_cached.clear(); GrandExchangeEvents.method69(); - Buffer.method3915(); + Buffer.clearHealthbarCaches(); StructDefinition.__jq_f.clear(); InvDefinition.method4754(); Projectile.method2089(); diff --git a/runescape-client/src/main/java/Fonts.java b/runescape-client/src/main/java/Fonts.java index 0da8788136..fcb36dfb17 100644 --- a/runescape-client/src/main/java/Fonts.java +++ b/runescape-client/src/main/java/Fonts.java @@ -20,8 +20,8 @@ public class Fonts { @ObfuscatedSignature( signature = "Lln;" ) - @Export("__kz_l") - static Sprite __kz_l; + @Export("rightTitleSprite") + static Sprite rightTitleSprite; @ObfuscatedName("m") @ObfuscatedSignature( signature = "Lir;" diff --git a/runescape-client/src/main/java/Formatting.java b/runescape-client/src/main/java/Formatting.java index 7c021f1425..554a403061 100644 --- a/runescape-client/src/main/java/Formatting.java +++ b/runescape-client/src/main/java/Formatting.java @@ -24,18 +24,18 @@ public class Formatting { static int method2023(int var0, Script var1, boolean var2) { Widget var3 = var2?WorldMapIcon1.__t_i:class12.__n_n; if(var0 == 1700) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.itemId; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.itemId; return 1; } else if(var0 == 1701) { if(var3.itemId != -1) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.itemQuantity; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.itemQuantity; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 1702) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.childIndex; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.childIndex; return 1; } else { return 2; @@ -52,9 +52,9 @@ public class Formatting { int var4; int var6; if(var0 == 3400) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; EnumDefinition var5 = Interpreter.getEnum(var3); if(var5.valType != 's') { ; @@ -75,19 +75,19 @@ public class Formatting { return 1; } else if(var0 != 3408) { if(var0 == 3411) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; EnumDefinition var10 = Interpreter.getEnum(var3); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var10.size(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var10.size(); return 1; } else { return 2; } } else { - class179.Interpreter_intStackSize -= 4; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - int var9 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; - var6 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 3]; + RouteStrategy.Interpreter_intStackSize -= 4; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + int var9 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; + var6 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 3]; EnumDefinition var7 = Interpreter.getEnum(var9); if(var3 == var7.keyType && var4 == var7.valType) { for(int var8 = 0; var8 < var7.size0; ++var8) { @@ -95,7 +95,7 @@ public class Formatting { if(var4 == 115) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var7.stringVals[var8]; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var7.intVals[var8]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var7.intVals[var8]; } var7 = null; @@ -107,7 +107,7 @@ public class Formatting { if(var4 == 115) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var7.defaultString; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var7.defaultInt; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var7.defaultInt; } } @@ -116,7 +116,7 @@ public class Formatting { if(var4 == 115) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = "null"; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; diff --git a/runescape-client/src/main/java/Frames.java b/runescape-client/src/main/java/Frames.java index 30895668fb..cca71579cf 100644 --- a/runescape-client/src/main/java/Frames.java +++ b/runescape-client/src/main/java/Frames.java @@ -13,8 +13,8 @@ public class Frames extends DualNode { @ObfuscatedSignature( signature = "[Llq;" ) - @Export("__en_bc") - static IndexedSprite[] __en_bc; + @Export("worldSelectFlagSprites") + static IndexedSprite[] worldSelectFlagSprites; @ObfuscatedName("m") @ObfuscatedSignature( signature = "[Ldz;" diff --git a/runescape-client/src/main/java/FriendSystem.java b/runescape-client/src/main/java/FriendSystem.java index 00d9abd408..eddea33e3f 100644 --- a/runescape-client/src/main/java/FriendSystem.java +++ b/runescape-client/src/main/java/FriendSystem.java @@ -116,7 +116,7 @@ public class FriendSystem { ) @Export("isFriended") final boolean isFriended(Username var1, boolean var2) { - return var1 != null && (var1.__equals_466(Canvas.localPlayer.username) || this.friendsList.isFriended(var1, var2)); + return var1 != null && (var1.equals(Canvas.localPlayer.username) || this.friendsList.isFriended(var1, var2)); } @ObfuscatedName("g") @@ -145,7 +145,7 @@ public class FriendSystem { var10000 = null; var4 = "Your friend list is full. Max of 200 for free users, and 400 for members"; WorldMapIcon1.method219(30, "", var4); - } else if(Canvas.localPlayer.username.__equals_466(var2)) { + } else if(Canvas.localPlayer.username.equals(var2)) { var10000 = null; var4 = "You can\'t add yourself to your own friend list"; WorldMapIcon1.method219(30, "", var4); @@ -200,7 +200,7 @@ public class FriendSystem { var10000 = null; var4 = "Your ignore list is full. Max of 100 for free users, and 400 for members"; WorldMapIcon1.method219(30, "", var4); - } else if(Canvas.localPlayer.username.__equals_466(var2)) { + } else if(Canvas.localPlayer.username.equals(var2)) { var10000 = null; var4 = "You can\'t add yourself to your own ignore list"; WorldMapIcon1.method219(30, "", var4); @@ -284,8 +284,8 @@ public class FriendSystem { signature = "(Lkp;S)Z", garbageValue = "-543" ) - @Export("__t_161") - final boolean __t_161(Username var1) { + @Export("isFriendAndHasWorld") + final boolean isFriendAndHasWorld(Username var1) { Friend var2 = (Friend)this.friendsList.getByUsername(var1); return var2 != null && var2.hasWorld(); } @@ -299,7 +299,7 @@ public class FriendSystem { Widget var3; if(var0 >= 2000) { var0 -= 1000; - var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); } else { var3 = var2?WorldMapIcon1.__t_i:class12.__n_n; } diff --git a/runescape-client/src/main/java/FriendsList.java b/runescape-client/src/main/java/FriendsList.java index dd2ac0d342..e8832d1c43 100644 --- a/runescape-client/src/main/java/FriendsList.java +++ b/runescape-client/src/main/java/FriendsList.java @@ -108,7 +108,7 @@ public class FriendsList extends UserList { boolean var14 = true; for(FriendLoginUpdate var13 = (FriendLoginUpdate)this.friendLoginUpdates.__f_438(); var13 != null; var13 = (FriendLoginUpdate)this.friendLoginUpdates.__q_439()) { - if(var13.username.__equals_466(var4)) { + if(var13.username.equals(var4)) { if(var6 != 0 && var13.world == 0) { var13.remove(); var14 = false; diff --git a/runescape-client/src/main/java/GrandExchangeEvent.java b/runescape-client/src/main/java/GrandExchangeEvent.java index 77af9c38ae..023a265615 100644 --- a/runescape-client/src/main/java/GrandExchangeEvent.java +++ b/runescape-client/src/main/java/GrandExchangeEvent.java @@ -92,7 +92,7 @@ public class GrandExchangeEvent { } if(var3 != null) { - class179.Interpreter_intStackSize = 0; + RouteStrategy.Interpreter_intStackSize = 0; Interpreter.Interpreter_stringStackSize = 0; var17 = -1; int[] var5 = var3.opcodes; @@ -192,36 +192,36 @@ public class GrandExchangeEvent { throw new IllegalStateException(); } } else if(var29 == 0) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var6[var17]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var6[var17]; } else if(var29 == 1) { var11 = var6[var17]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Varps.Varps_main[var11]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Varps.Varps_main[var11]; } else if(var29 == 2) { var11 = var6[var17]; - Varps.Varps_main[var11] = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + Varps.Varps_main[var11] = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; IndexCache.method4703(var11); } else if(var29 == 3) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3.stringOperands[var17]; } else if(var29 == 6) { var17 += var6[var17]; } else if(var29 == 7) { - class179.Interpreter_intStackSize -= 2; - if(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] != Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]) { + RouteStrategy.Interpreter_intStackSize -= 2; + if(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] != Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]) { var17 += var6[var17]; } } else if(var29 == 8) { - class179.Interpreter_intStackSize -= 2; - if(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] == Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]) { + RouteStrategy.Interpreter_intStackSize -= 2; + if(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] == Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]) { var17 += var6[var17]; } } else if(var29 == 9) { - class179.Interpreter_intStackSize -= 2; - if(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] < Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]) { + RouteStrategy.Interpreter_intStackSize -= 2; + if(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] < Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]) { var17 += var6[var17]; } } else if(var29 == 10) { - class179.Interpreter_intStackSize -= 2; - if(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] > Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]) { + RouteStrategy.Interpreter_intStackSize -= 2; + if(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] > Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]) { var17 += var6[var17]; } } else if(var29 == 21) { @@ -238,24 +238,24 @@ public class GrandExchangeEvent { Interpreter.Interpreter_stringLocals = var34.stringLocals; } else if(var29 == 25) { var11 = var6[var17]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = WorldMapSection2.getVarbit(var11); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = WorldMapSection2.getVarbit(var11); } else if(var29 == 27) { var11 = var6[var17]; - class68.method1695(var11, Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + class68.method1695(var11, Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); } else if(var29 == 31) { - class179.Interpreter_intStackSize -= 2; - if(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] <= Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]) { + RouteStrategy.Interpreter_intStackSize -= 2; + if(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] <= Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]) { var17 += var6[var17]; } } else if(var29 == 32) { - class179.Interpreter_intStackSize -= 2; - if(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] >= Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]) { + RouteStrategy.Interpreter_intStackSize -= 2; + if(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] >= Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]) { var17 += var6[var17]; } } else if(var29 == 33) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Username.Interpreter_intLocals[var6[var17]]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Username.Interpreter_intLocals[var6[var17]]; } else if(var29 == 34) { - Username.Interpreter_intLocals[var6[var17]] = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + Username.Interpreter_intLocals[var6[var17]] = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; } else if(var29 == 35) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = Interpreter.Interpreter_stringLocals[var6[var17]]; } else if(var29 == 36) { @@ -266,20 +266,20 @@ public class GrandExchangeEvent { String var31 = class277.method5356(Interpreter.Interpreter_stringStack, Interpreter.Interpreter_stringStackSize, var11); Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var31; } else if(var29 == 38) { - --class179.Interpreter_intStackSize; + --RouteStrategy.Interpreter_intStackSize; } else if(var29 == 39) { --Interpreter.Interpreter_stringStackSize; } else { int var15; if(var29 != 40) { if(var29 == 42) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class196.varcs.getInt(var6[var17]); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class196.varcs.getInt(var6[var17]); } else if(var29 == 43) { - class196.varcs.setInt(var6[var17], Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + class196.varcs.setInt(var6[var17], Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); } else if(var29 == 44) { var11 = var6[var17] >> 16; var20 = var6[var17] & 65535; - int var21 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + int var21 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(var21 < 0 || var21 > 5000) { throw new RuntimeException(); } @@ -295,21 +295,21 @@ public class GrandExchangeEvent { } } else if(var29 == 45) { var11 = var6[var17]; - var20 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var20 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(var20 < 0 || var20 >= Interpreter.Interpreter_arrayLengths[var11]) { throw new RuntimeException(); } - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Interpreter.Interpreter_arrays[var11][var20]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Interpreter.Interpreter_arrays[var11][var20]; } else if(var29 == 46) { var11 = var6[var17]; - class179.Interpreter_intStackSize -= 2; - var20 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; + RouteStrategy.Interpreter_intStackSize -= 2; + var20 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; if(var20 < 0 || var20 >= Interpreter.Interpreter_arrayLengths[var11]) { throw new RuntimeException(); } - Interpreter.Interpreter_arrays[var11][var20] = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_arrays[var11][var20] = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; } else if(var29 == 47) { var18 = class196.varcs.getStringOld(var6[var17]); if(var18 == null) { @@ -330,7 +330,7 @@ public class GrandExchangeEvent { } IterableNodeHashTable var33 = var3.switches[var6[var17]]; - IntegerNode var30 = (IntegerNode)var33.get((long)Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + IntegerNode var30 = (IntegerNode)var33.get((long)Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); if(var30 != null) { var17 += var30.integer; } @@ -342,14 +342,14 @@ public class GrandExchangeEvent { String[] var14 = new String[var12.localStringCount]; for(var15 = 0; var15 < var12.intArgumentCount; ++var15) { - var13[var15] = Interpreter.Interpreter_intStack[var15 + (class179.Interpreter_intStackSize - var12.intArgumentCount)]; + var13[var15] = Interpreter.Interpreter_intStack[var15 + (RouteStrategy.Interpreter_intStackSize - var12.intArgumentCount)]; } for(var15 = 0; var15 < var12.stringArgumentCount; ++var15) { var14[var15] = Interpreter.Interpreter_stringStack[var15 + (Interpreter.Interpreter_stringStackSize - var12.stringArgumentCount)]; } - class179.Interpreter_intStackSize -= var12.intArgumentCount; + RouteStrategy.Interpreter_intStackSize -= var12.intArgumentCount; Interpreter.Interpreter_stringStackSize -= var12.stringArgumentCount; ScriptFrame var19 = new ScriptFrame(); var19.script = var3; diff --git a/runescape-client/src/main/java/GrandExchangeEvents.java b/runescape-client/src/main/java/GrandExchangeEvents.java index f23a12fa99..456dcb0691 100644 --- a/runescape-client/src/main/java/GrandExchangeEvents.java +++ b/runescape-client/src/main/java/GrandExchangeEvents.java @@ -121,51 +121,51 @@ public class GrandExchangeEvents { garbageValue = "620886402" ) static int method75(int var0, Script var1, boolean var2) { - Widget var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + Widget var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); if(var0 == 2600) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.scrollX; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.scrollX; return 1; } else if(var0 == 2601) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.scrollY; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.scrollY; return 1; } else if(var0 == 2602) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3.text; return 1; } else if(var0 == 2603) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.scrollWidth; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.scrollWidth; return 1; } else if(var0 == 2604) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.scrollHeight; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.scrollHeight; return 1; } else if(var0 == 2605) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.modelZoom; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.modelZoom; return 1; } else if(var0 == 2606) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.modelAngleX; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.modelAngleX; return 1; } else if(var0 == 2607) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.modelAngleZ; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.modelAngleZ; return 1; } else if(var0 == 2608) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.modelAngleY; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.modelAngleY; return 1; } else if(var0 == 2609) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.transparency; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.transparency; return 1; } else if(var0 == 2610) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.__af; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.__af; return 1; } else if(var0 == 2611) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.color; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.color; return 1; } else if(var0 == 2612) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.color2; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.color2; return 1; } else if(var0 == 2613) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.rectangleMode.rsOrdinal(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.rectangleMode.rsOrdinal(); return 1; } else if(var0 == 2614) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.__bv?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.__bv?1:0; return 1; } else { return 2; diff --git a/runescape-client/src/main/java/GraphicsObject.java b/runescape-client/src/main/java/GraphicsObject.java index a9152aa015..19433596b2 100644 --- a/runescape-client/src/main/java/GraphicsObject.java +++ b/runescape-client/src/main/java/GraphicsObject.java @@ -17,8 +17,8 @@ public final class GraphicsObject extends Entity { @ObfuscatedSignature( signature = "Llq;" ) - @Export("__bw_k") - static IndexedSprite __bw_k; + @Export("options_buttons_4Sprite") + static IndexedSprite options_buttons_4Sprite; @ObfuscatedName("fr") @ObfuscatedGetter( intValue = -438288575 diff --git a/runescape-client/src/main/java/GroundItemPile.java b/runescape-client/src/main/java/GroundItemPile.java index 1f5d488216..4b9c5708bd 100644 --- a/runescape-client/src/main/java/GroundItemPile.java +++ b/runescape-client/src/main/java/GroundItemPile.java @@ -11,8 +11,8 @@ public final class GroundItemPile { @ObfuscatedGetter( intValue = -704675849 ) - @Export("__dr_ao") - static int __dr_ao; + @Export("optionButtonSpriteSubHeight") + static int optionButtonSpriteSubHeight; @ObfuscatedName("m") @ObfuscatedSignature( signature = "Lex;" diff --git a/runescape-client/src/main/java/HitSplatDefinition.java b/runescape-client/src/main/java/HitSplatDefinition.java index 80ade46bc1..50370c62b4 100644 --- a/runescape-client/src/main/java/HitSplatDefinition.java +++ b/runescape-client/src/main/java/HitSplatDefinition.java @@ -265,7 +265,7 @@ public class HitSplatDefinition extends DualNode { var2 = this.transforms[this.transforms.length - 1]; } - return var2 != -1?class72.getHitSplatDefinition(var2):null; + return var2 != -1? LoginScreenAnimation.getHitSplatDefinition(var2):null; } @ObfuscatedName("u") diff --git a/runescape-client/src/main/java/IndexCacheLoader.java b/runescape-client/src/main/java/IndexCacheLoader.java index d623810bfd..9003278964 100644 --- a/runescape-client/src/main/java/IndexCacheLoader.java +++ b/runescape-client/src/main/java/IndexCacheLoader.java @@ -16,8 +16,8 @@ public class IndexCacheLoader { @ObfuscatedSignature( signature = "Llq;" ) - @Export("__bd_u") - static IndexedSprite __bd_u; + @Export("titlebuttonSprite") + static IndexedSprite titlebuttonSprite; @ObfuscatedName("x") @Export("__bd_x") public static short[][] __bd_x; @@ -83,9 +83,9 @@ public class IndexCacheLoader { ) @Export("drawTitle") static void drawTitle(Font var0, Font var1, Font var2) { - Login.__cu_q = (SoundCache.canvasWidth - 765) / 2; - Login.__cu_y = Login.__cu_q + 202; - Varps.__hv_h = Login.__cu_y + 180; + Login.xPadding = (SoundCache.canvasWidth - 765) / 2; + Login.loginBoxX = Login.xPadding + 202; + Varps.loginBoxCenter = Login.loginBoxX + 180; int var9; int var11; int var19; @@ -94,136 +94,136 @@ public class IndexCacheLoader { int var27; int var28; int var48; - if(Login.__cu_bk) { - if(class30.__ar_bd == null) { - class30.__ar_bd = class2.method20(WorldMapSection3.indexCache8, "sl_back", ""); + if(Login.worldSelectOpen) { + if(class30.worldSelectBackSprites == null) { + class30.worldSelectBackSprites = class2.method20(WorldMapSection3.indexCache8, "sl_back", ""); } IndexCache var36; int var37; int var39; IndexedSprite[] var40; - if(Frames.__en_bc == null) { + if(Frames.worldSelectFlagSprites == null) { var36 = WorldMapSection3.indexCache8; var39 = var36.getArchiveId("sl_flags"); var37 = var36.getRecordId(var39, ""); - if(!SpriteMask.method4392(var36, var39, var37)) { + if(!SpriteMask.loadSprite(var36, var39, var37)) { var40 = null; } else { - var40 = WorldMapLabel.method444(); + var40 = WorldMapLabel.createIndexedSpriteArray(); } - Frames.__en_bc = var40; + Frames.worldSelectFlagSprites = var40; } - if(AttackOption.__cj_bo == null) { + if(AttackOption.worldSelectArrows == null) { var36 = WorldMapSection3.indexCache8; var39 = var36.getArchiveId("sl_arrows"); var37 = var36.getRecordId(var39, ""); - if(!SpriteMask.method4392(var36, var39, var37)) { + if(!SpriteMask.loadSprite(var36, var39, var37)) { var40 = null; } else { - var40 = WorldMapLabel.method444(); + var40 = WorldMapLabel.createIndexedSpriteArray(); } - AttackOption.__cj_bo = var40; + AttackOption.worldSelectArrows = var40; } - if(UrlRequest.__ey_bx == null) { + if(UrlRequest.worldSelectStars == null) { var36 = WorldMapSection3.indexCache8; var39 = var36.getArchiveId("sl_stars"); var37 = var36.getRecordId(var39, ""); - if(!SpriteMask.method4392(var36, var39, var37)) { + if(!SpriteMask.loadSprite(var36, var39, var37)) { var40 = null; } else { - var40 = WorldMapLabel.method444(); + var40 = WorldMapLabel.createIndexedSpriteArray(); } - UrlRequest.__ey_bx = var40; + UrlRequest.worldSelectStars = var40; } - if(SecureRandomFuture.__cn_bu == null) { - SecureRandomFuture.__cn_bu = MenuAction.method2025(WorldMapSection3.indexCache8, "leftarrow", ""); + if(SecureRandomFuture.worldSelectLeftSprite == null) { + SecureRandomFuture.worldSelectLeftSprite = MenuAction.loadIndexedSpriteByName(WorldMapSection3.indexCache8, "leftarrow", ""); } - if(NetSocket.__fb_bm == null) { - NetSocket.__fb_bm = MenuAction.method2025(WorldMapSection3.indexCache8, "rightarrow", ""); + if(NetSocket.worldSelectRightSprite == null) { + NetSocket.worldSelectRightSprite = MenuAction.loadIndexedSpriteByName(WorldMapSection3.indexCache8, "rightarrow", ""); } - Rasterizer2D.Rasterizer2D_fillRectangle(Login.__cu_q, 23, 765, 480, 0); - Rasterizer2D.drawGradient(Login.__cu_q, 0, 125, 23, 12425273, 9135624); - Rasterizer2D.drawGradient(Login.__cu_q + 125, 0, 640, 23, 5197647, 2697513); - var0.drawCentered("Select a world", Login.__cu_q + 62, 15, 0, -1); - if(UrlRequest.__ey_bx != null) { - UrlRequest.__ey_bx[1].__q_496(Login.__cu_q + 140, 1); - var1.draw("Members only world", Login.__cu_q + 152, 10, 16777215, -1); - UrlRequest.__ey_bx[0].__q_496(Login.__cu_q + 140, 12); - var1.draw("Free world", Login.__cu_q + 152, 21, 16777215, -1); + Rasterizer2D.Rasterizer2D_fillRectangle(Login.xPadding, 23, 765, 480, 0); + Rasterizer2D.drawGradient(Login.xPadding, 0, 125, 23, 12425273, 9135624); + Rasterizer2D.drawGradient(Login.xPadding + 125, 0, 640, 23, 5197647, 2697513); + var0.drawCentered("Select a world", Login.xPadding + 62, 15, 0, -1); + if(UrlRequest.worldSelectStars != null) { + UrlRequest.worldSelectStars[1].drawAt(Login.xPadding + 140, 1); + var1.draw("Members only world", Login.xPadding + 152, 10, 16777215, -1); + UrlRequest.worldSelectStars[0].drawAt(Login.xPadding + 140, 12); + var1.draw("Free world", Login.xPadding + 152, 21, 16777215, -1); } - if(AttackOption.__cj_bo != null) { - var48 = Login.__cu_q + 280; - if(World.__bt_e[0] == 0 && World.__bt_l[0] == 0) { - AttackOption.__cj_bo[2].__q_496(var48, 4); + if(AttackOption.worldSelectArrows != null) { + var48 = Login.xPadding + 280; + if(World.sortOption1[0] == 0 && World.sortOption2[0] == 0) { + AttackOption.worldSelectArrows[2].drawAt(var48, 4); } else { - AttackOption.__cj_bo[0].__q_496(var48, 4); + AttackOption.worldSelectArrows[0].drawAt(var48, 4); } - if(World.__bt_e[0] == 0 && World.__bt_l[0] == 1) { - AttackOption.__cj_bo[3].__q_496(var48 + 15, 4); + if(World.sortOption1[0] == 0 && World.sortOption2[0] == 1) { + AttackOption.worldSelectArrows[3].drawAt(var48 + 15, 4); } else { - AttackOption.__cj_bo[1].__q_496(var48 + 15, 4); + AttackOption.worldSelectArrows[1].drawAt(var48 + 15, 4); } var0.draw("World", var48 + 32, 17, 16777215, -1); - var24 = Login.__cu_q + 390; - if(World.__bt_e[0] == 1 && World.__bt_l[0] == 0) { - AttackOption.__cj_bo[2].__q_496(var24, 4); + var24 = Login.xPadding + 390; + if(World.sortOption1[0] == 1 && World.sortOption2[0] == 0) { + AttackOption.worldSelectArrows[2].drawAt(var24, 4); } else { - AttackOption.__cj_bo[0].__q_496(var24, 4); + AttackOption.worldSelectArrows[0].drawAt(var24, 4); } - if(World.__bt_e[0] == 1 && World.__bt_l[0] == 1) { - AttackOption.__cj_bo[3].__q_496(var24 + 15, 4); + if(World.sortOption1[0] == 1 && World.sortOption2[0] == 1) { + AttackOption.worldSelectArrows[3].drawAt(var24 + 15, 4); } else { - AttackOption.__cj_bo[1].__q_496(var24 + 15, 4); + AttackOption.worldSelectArrows[1].drawAt(var24 + 15, 4); } var0.draw("Players", var24 + 32, 17, 16777215, -1); - var39 = Login.__cu_q + 500; - if(World.__bt_e[0] == 2 && World.__bt_l[0] == 0) { - AttackOption.__cj_bo[2].__q_496(var39, 4); + var39 = Login.xPadding + 500; + if(World.sortOption1[0] == 2 && World.sortOption2[0] == 0) { + AttackOption.worldSelectArrows[2].drawAt(var39, 4); } else { - AttackOption.__cj_bo[0].__q_496(var39, 4); + AttackOption.worldSelectArrows[0].drawAt(var39, 4); } - if(World.__bt_e[0] == 2 && World.__bt_l[0] == 1) { - AttackOption.__cj_bo[3].__q_496(var39 + 15, 4); + if(World.sortOption1[0] == 2 && World.sortOption2[0] == 1) { + AttackOption.worldSelectArrows[3].drawAt(var39 + 15, 4); } else { - AttackOption.__cj_bo[1].__q_496(var39 + 15, 4); + AttackOption.worldSelectArrows[1].drawAt(var39 + 15, 4); } var0.draw("Location", var39 + 32, 17, 16777215, -1); - var37 = Login.__cu_q + 610; - if(World.__bt_e[0] == 3 && World.__bt_l[0] == 0) { - AttackOption.__cj_bo[2].__q_496(var37, 4); + var37 = Login.xPadding + 610; + if(World.sortOption1[0] == 3 && World.sortOption2[0] == 0) { + AttackOption.worldSelectArrows[2].drawAt(var37, 4); } else { - AttackOption.__cj_bo[0].__q_496(var37, 4); + AttackOption.worldSelectArrows[0].drawAt(var37, 4); } - if(World.__bt_e[0] == 3 && World.__bt_l[0] == 1) { - AttackOption.__cj_bo[3].__q_496(var37 + 15, 4); + if(World.sortOption1[0] == 3 && World.sortOption2[0] == 1) { + AttackOption.worldSelectArrows[3].drawAt(var37 + 15, 4); } else { - AttackOption.__cj_bo[1].__q_496(var37 + 15, 4); + AttackOption.worldSelectArrows[1].drawAt(var37 + 15, 4); } var0.draw("Type", var37 + 32, 17, 16777215, -1); } - Rasterizer2D.Rasterizer2D_fillRectangle(Login.__cu_q + 708, 4, 50, 16, 0); - var1.drawCentered("Cancel", Login.__cu_q + 708 + 25, 16, 16777215, -1); - Login.__cu_bl = -1; - if(class30.__ar_bd != null) { + Rasterizer2D.Rasterizer2D_fillRectangle(Login.xPadding + 708, 4, 50, 16, 0); + var1.drawCentered("Cancel", Login.xPadding + 708 + 25, 16, 16777215, -1); + Login.hoveredWorldIndex = -1; + if(class30.worldSelectBackSprites != null) { var23 = 88; byte var51 = 19; var39 = 765 / (var23 + 1) - 1; @@ -258,23 +258,23 @@ public class IndexCacheLoader { var9 = (765 - var39 * var23 - var27 * (var39 - 1)) / 2; int var10 = (480 - var37 * var51 - var28 * (var37 - 1)) / 2; var11 = (var37 + World.worldsCount - 1) / var37; - Login.__cu_bj = var11 - var39; - if(SecureRandomFuture.__cn_bu != null && Login.__cu_br > 0) { - SecureRandomFuture.__cn_bu.__q_496(8, Huffman.canvasHeight / 2 - SecureRandomFuture.__cn_bu.subHeight / 2); + Login.worldSelectPagesCount = var11 - var39; + if(SecureRandomFuture.worldSelectLeftSprite != null && Login.worldSelectPage > 0) { + SecureRandomFuture.worldSelectLeftSprite.drawAt(8, Huffman.canvasHeight / 2 - SecureRandomFuture.worldSelectLeftSprite.subHeight / 2); } - if(NetSocket.__fb_bm != null && Login.__cu_br < Login.__cu_bj) { - NetSocket.__fb_bm.__q_496(SoundCache.canvasWidth - NetSocket.__fb_bm.subWidth - 8, Huffman.canvasHeight / 2 - NetSocket.__fb_bm.subHeight / 2); + if(NetSocket.worldSelectRightSprite != null && Login.worldSelectPage < Login.worldSelectPagesCount) { + NetSocket.worldSelectRightSprite.drawAt(SoundCache.canvasWidth - NetSocket.worldSelectRightSprite.subWidth - 8, Huffman.canvasHeight / 2 - NetSocket.worldSelectRightSprite.subHeight / 2); } int var41 = var10 + 23; - int var42 = var9 + Login.__cu_q; + int var42 = var9 + Login.xPadding; int var43 = 0; boolean var15 = false; - int var16 = Login.__cu_br; + int var16 = Login.worldSelectPage; int var44; - for(var44 = var37 * var16; var44 < World.worldsCount && var16 - Login.__cu_br < var39; ++var44) { + for(var44 = var37 * var16; var44 < World.worldsCount && var16 - Login.worldSelectPage < var39; ++var44) { World var29 = ItemContainer.worlds[var44]; boolean var46 = true; String var20 = Integer.toString(var29.population); @@ -288,41 +288,41 @@ public class IndexCacheLoader { int var22 = 0; byte var21; - if(var29.__j_149()) { - if(var29.__e_144()) { + if(var29.isBeta()) { + if(var29.isMembersOnly()) { var21 = 7; } else { var21 = 6; } - } else if(var29.__z_148()) { - var22 = 16711680; - if(var29.__e_144()) { + } else if(var29.isDeadman()) { + var22 = 0xff0000; + if(var29.isMembersOnly()) { var21 = 5; } else { var21 = 4; } - } else if(var29.__d_146()) { - if(var29.__e_144()) { + } else if(var29.isPvp()) { + if(var29.isMembersOnly()) { var21 = 3; } else { var21 = 2; } - } else if(var29.__e_144()) { + } else if(var29.isMembersOnly()) { var21 = 1; } else { var21 = 0; } if(MouseHandler.MouseHandler_x >= var42 && MouseHandler.MouseHandler_y >= var41 && MouseHandler.MouseHandler_x < var42 + var23 && MouseHandler.MouseHandler_y < var51 + var41 && var46) { - Login.__cu_bl = var44; - class30.__ar_bd[var21].__t_507(var42, var41, 128, 16777215); + Login.hoveredWorldIndex = var44; + class30.worldSelectBackSprites[var21].drawAtTransOverlay(var42, var41, 128, 0xffffff); var15 = true; } else { - class30.__ar_bd[var21].drawAt(var42, var41); + class30.worldSelectBackSprites[var21].drawAt(var42, var41); } - if(Frames.__en_bc != null) { - Frames.__en_bc[(var29.__e_144()?8:0) + var29.location].__q_496(var42 + 29, var41); + if(Frames.worldSelectFlagSprites != null) { + Frames.worldSelectFlagSprites[(var29.isMembersOnly()?8:0) + var29.location].drawAt(var42 + 29, var41); } var0.drawCentered(Integer.toString(var29.id), var42 + 15, var51 / 2 + var41 + 5, var22, -1); @@ -338,7 +338,7 @@ public class IndexCacheLoader { } if(var15) { - var44 = var1.stringWidth(ItemContainer.worlds[Login.__cu_bl].activity) + 6; + var44 = var1.stringWidth(ItemContainer.worlds[Login.hoveredWorldIndex].activity) + 6; int var45 = var1.ascent + 8; var19 = MouseHandler.MouseHandler_y + 25; if(var45 + var19 > 480) { @@ -347,24 +347,24 @@ public class IndexCacheLoader { Rasterizer2D.Rasterizer2D_fillRectangle(MouseHandler.MouseHandler_x - var44 / 2, var19, var44, var45, 16777120); Rasterizer2D.Rasterizer2D_drawRectangle(MouseHandler.MouseHandler_x - var44 / 2, var19, var44, var45, 0); - var1.drawCentered(ItemContainer.worlds[Login.__cu_bl].activity, MouseHandler.MouseHandler_x, var19 + var1.ascent + 4, 0, -1); + var1.drawCentered(ItemContainer.worlds[Login.hoveredWorldIndex].activity, MouseHandler.MouseHandler_x, var19 + var1.ascent + 4, 0, -1); } } class197.rasterProvider.drawFull(0, 0); } else { - Login.__cu_g.drawAt(Login.__cu_q, 0); - Fonts.__kz_l.drawAt(Login.__cu_q + 382, 0); - WorldMapSectionType.__h_e.__q_496(Login.__cu_q + 382 - WorldMapSectionType.__h_e.subWidth / 2, 18); + Login.leftTitleSprite.drawAt(Login.xPadding, 0); + Fonts.rightTitleSprite.drawAt(Login.xPadding + 382, 0); + WorldMapSectionType.logoSprite.drawAt(Login.xPadding + 382 - WorldMapSectionType.logoSprite.subWidth / 2, 18); if(Client.gameState == 0 || Client.gameState == 5) { var23 = 20; - var0.drawCentered("RuneScape is loading - please wait...", Login.__cu_y + 180, 245 - var23, 16777215, -1); + var0.drawCentered("RuneScape is loading - please wait...", Login.loginBoxX + 180, 245 - var23, 16777215, -1); var24 = 253 - var23; - Rasterizer2D.Rasterizer2D_drawRectangle(Login.__cu_y + 180 - 152, var24, 304, 34, 9179409); - Rasterizer2D.Rasterizer2D_drawRectangle(Login.__cu_y + 180 - 151, var24 + 1, 302, 32, 0); - Rasterizer2D.Rasterizer2D_fillRectangle(Login.__cu_y + 180 - 150, var24 + 2, Login.Login_loadingPercent * 3, 30, 9179409); - Rasterizer2D.Rasterizer2D_fillRectangle(Login.__cu_y + 180 - 150 + Login.Login_loadingPercent * 3, var24 + 2, 300 - Login.Login_loadingPercent * 3, 30, 0); - var0.drawCentered(Login.Login_loadingText, Login.__cu_y + 180, 276 - var23, 16777215, -1); + Rasterizer2D.Rasterizer2D_drawRectangle(Login.loginBoxX + 180 - 152, var24, 304, 34, 9179409); + Rasterizer2D.Rasterizer2D_drawRectangle(Login.loginBoxX + 180 - 151, var24 + 1, 302, 32, 0); + Rasterizer2D.Rasterizer2D_fillRectangle(Login.loginBoxX + 180 - 150, var24 + 2, Login.Login_loadingPercent * 3, 30, 9179409); + Rasterizer2D.Rasterizer2D_fillRectangle(Login.loginBoxX + 180 - 150 + Login.Login_loadingPercent * 3, var24 + 2, 300 - Login.Login_loadingPercent * 3, 30, 0); + var0.drawCentered(Login.Login_loadingText, Login.loginBoxX + 180, 276 - var23, 16777215, -1); } String var7; @@ -375,17 +375,17 @@ public class IndexCacheLoader { short var47; short var49; if(Client.gameState == 20) { - Login.__cu_o.__q_496(Login.__cu_y + 180 - Login.__cu_o.subWidth / 2, 271 - Login.__cu_o.subHeight / 2); + Login.titleboxSprite.drawAt(Login.loginBoxX + 180 - Login.titleboxSprite.subWidth / 2, 271 - Login.titleboxSprite.subHeight / 2); var47 = 201; - var0.drawCentered(Login.Login_response1, Login.__cu_y + 180, var47, 16776960, 0); + var0.drawCentered(Login.Login_response1, Login.loginBoxX + 180, var47, 16776960, 0); var48 = var47 + 15; - var0.drawCentered(Login.Login_response2, Login.__cu_y + 180, var48, 16776960, 0); + var0.drawCentered(Login.Login_response2, Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var0.drawCentered(Login.Login_response3, Login.__cu_y + 180, var48, 16776960, 0); + var0.drawCentered(Login.Login_response3, Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; var48 += 7; if(Login.loginIndex != 4) { - var0.draw("Login: ", Login.__cu_y + 180 - 110, var48, 16777215, 0); + var0.draw("Login: ", Login.loginBoxX + 180 - 110, var48, 16777215, 0); var49 = 200; if(ReflectionCheck.clientPreferences.hideUsername) { var8 = Login.Login_username; @@ -399,56 +399,56 @@ public class IndexCacheLoader { ; } - var0.draw(AbstractFont.escapeBrackets(var25), Login.__cu_y + 180 - 70, var48, 16777215, 0); + var0.draw(AbstractFont.escapeBrackets(var25), Login.loginBoxX + 180 - 70, var48, 16777215, 0); var48 += 15; var8 = "Password: "; var30 = Login.Login_password; var31 = class168.method3450('*', var30.length()); - var0.draw(var8 + var31, Login.__cu_y + 180 - 108, var48, 16777215, 0); + var0.draw(var8 + var31, Login.loginBoxX + 180 - 108, var48, 16777215, 0); var48 += 15; } } if(Client.gameState == 10 || Client.gameState == 11) { - Login.__cu_o.__q_496(Login.__cu_y, 171); + Login.titleboxSprite.drawAt(Login.loginBoxX, 171); short var5; if(Login.loginIndex == 0) { var47 = 251; - var0.drawCentered("Welcome to RuneScape", Login.__cu_y + 180, var47, 16776960, 0); + var0.drawCentered("Welcome to RuneScape", Login.loginBoxX + 180, var47, 16776960, 0); var48 = var47 + 30; - var24 = Login.__cu_y + 180 - 80; + var24 = Login.loginBoxX + 180 - 80; var5 = 291; - __bd_u.__q_496(var24 - 73, var5 - 20); + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var0.drawLines("New User", var24 - 73, var5 - 20, 144, 40, 16777215, 0, 1, 1, 0); - var24 = Login.__cu_y + 180 + 80; - __bd_u.__q_496(var24 - 73, var5 - 20); + var24 = Login.loginBoxX + 180 + 80; + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var0.drawLines("Existing User", var24 - 73, var5 - 20, 144, 40, 16777215, 0, 1, 1, 0); } else if(Login.loginIndex == 1) { - var0.drawCentered(Login.Login_response0, Login.__cu_y + 180, 201, 16776960, 0); + var0.drawCentered(Login.Login_response0, Login.loginBoxX + 180, 201, 16776960, 0); var47 = 236; - var0.drawCentered(Login.Login_response1, Login.__cu_y + 180, var47, 16777215, 0); + var0.drawCentered(Login.Login_response1, Login.loginBoxX + 180, var47, 16777215, 0); var48 = var47 + 15; - var0.drawCentered(Login.Login_response2, Login.__cu_y + 180, var48, 16777215, 0); + var0.drawCentered(Login.Login_response2, Login.loginBoxX + 180, var48, 16777215, 0); var48 += 15; - var0.drawCentered(Login.Login_response3, Login.__cu_y + 180, var48, 16777215, 0); + var0.drawCentered(Login.Login_response3, Login.loginBoxX + 180, var48, 16777215, 0); var48 += 15; - var24 = Login.__cu_y + 180 - 80; + var24 = Login.loginBoxX + 180 - 80; var5 = 321; - __bd_u.__q_496(var24 - 73, var5 - 20); + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var0.drawCentered("Continue", var24, var5 + 5, 16777215, 0); - var24 = Login.__cu_y + 180 + 80; - __bd_u.__q_496(var24 - 73, var5 - 20); + var24 = Login.loginBoxX + 180 + 80; + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var0.drawCentered("Cancel", var24, var5 + 5, 16777215, 0); } else if(Login.loginIndex == 2) { var47 = 201; - var0.drawCentered(Login.Login_response1, Varps.__hv_h, var47, 16776960, 0); + var0.drawCentered(Login.Login_response1, Varps.loginBoxCenter, var47, 16776960, 0); var48 = var47 + 15; - var0.drawCentered(Login.Login_response2, Varps.__hv_h, var48, 16776960, 0); + var0.drawCentered(Login.Login_response2, Varps.loginBoxCenter, var48, 16776960, 0); var48 += 15; - var0.drawCentered(Login.Login_response3, Varps.__hv_h, var48, 16776960, 0); + var0.drawCentered(Login.Login_response3, Varps.loginBoxCenter, var48, 16776960, 0); var48 += 15; var48 += 7; - var0.draw("Login: ", Varps.__hv_h - 110, var48, 16777215, 0); + var0.draw("Login: ", Varps.loginBoxCenter - 110, var48, 16777215, 0); var49 = 200; if(ReflectionCheck.clientPreferences.hideUsername) { var8 = Login.Login_username; @@ -462,35 +462,35 @@ public class IndexCacheLoader { ; } - var0.draw(AbstractFont.escapeBrackets(var25) + (Login.currentLoginField == 0 & Client.cycle % 40 < 20?BufferedFile.colorStartTag(16776960) + "|":""), Varps.__hv_h - 70, var48, 16777215, 0); + var0.draw(AbstractFont.escapeBrackets(var25) + (Login.currentLoginField == 0 & Client.cycle % 40 < 20?BufferedFile.colorStartTag(16776960) + "|":""), Varps.loginBoxCenter - 70, var48, 16777215, 0); var48 += 15; var8 = "Password: "; var30 = Login.Login_password; var31 = class168.method3450('*', var30.length()); - var0.draw(var8 + var31 + (Login.currentLoginField == 1 & Client.cycle % 40 < 20?BufferedFile.colorStartTag(16776960) + "|":""), Varps.__hv_h - 108, var48, 16777215, 0); + var0.draw(var8 + var31 + (Login.currentLoginField == 1 & Client.cycle % 40 < 20?BufferedFile.colorStartTag(16776960) + "|":""), Varps.loginBoxCenter - 108, var48, 16777215, 0); var48 += 15; var47 = 277; - var11 = Varps.__hv_h + -117; + var11 = Varps.loginBoxCenter + -117; boolean var13 = Client.Login_isUsernameRemembered; boolean var14 = Login.__cu_aa; - IndexedSprite var32 = var13?(var14?KeyHandler.__an_i:class308.__kw_n):(var14?GraphicsObject.__bw_k:Login.__cu_d); - var32.__q_496(var11, var47); + IndexedSprite var32 = var13?(var14?KeyHandler.options_buttons_6Sprite :class308.options_buttons_2Sprite):(var14?GraphicsObject.options_buttons_4Sprite :Login.options_buttons_0Sprite); + var32.drawAt(var11, var47); var11 = var11 + var32.subWidth + 5; var1.draw("Remember username", var11, var47 + 13, 16776960, 0); - var11 = Varps.__hv_h + 24; + var11 = Varps.loginBoxCenter + 24; boolean var17 = ReflectionCheck.clientPreferences.hideUsername; boolean var18 = Login.__cu_ax; - IndexedSprite var34 = var17?(var18?KeyHandler.__an_i:class308.__kw_n):(var18?GraphicsObject.__bw_k:Login.__cu_d); - var34.__q_496(var11, var47); + IndexedSprite var34 = var17?(var18?KeyHandler.options_buttons_6Sprite :class308.options_buttons_2Sprite):(var18?GraphicsObject.options_buttons_4Sprite :Login.options_buttons_0Sprite); + var34.drawAt(var11, var47); var11 = var11 + var34.subWidth + 5; var1.draw("Hide username", var11, var47 + 13, 16776960, 0); var48 = var47 + 15; - var19 = Varps.__hv_h - 80; + var19 = Varps.loginBoxCenter - 80; short var35 = 321; - __bd_u.__q_496(var19 - 73, var35 - 20); + titlebuttonSprite.drawAt(var19 - 73, var35 - 20); var0.drawCentered("Login", var19, var35 + 5, 16777215, 0); - var19 = Varps.__hv_h + 80; - __bd_u.__q_496(var19 - 73, var35 - 20); + var19 = Varps.loginBoxCenter + 80; + titlebuttonSprite.drawAt(var19 - 73, var35 - 20); var0.drawCentered("Cancel", var19, var35 + 5, 16777215, 0); var47 = 357; switch(Login.__cu_ac) { @@ -501,76 +501,76 @@ public class IndexCacheLoader { AttackOption.__cj_ay = "Can\'t login? Click here."; } - TilePaint.__eb_ah = new Bounds(Varps.__hv_h, var47, var1.stringWidth(AttackOption.__cj_ay), 11); - UrlRequester.__eo_ak = new Bounds(Varps.__hv_h, var47, var1.stringWidth("Still having trouble logging in?"), 11); - var1.drawCentered(AttackOption.__cj_ay, Varps.__hv_h, var47, 16777215, 0); + TilePaint.__eb_ah = new Bounds(Varps.loginBoxCenter, var47, var1.stringWidth(AttackOption.__cj_ay), 11); + UrlRequester.__eo_ak = new Bounds(Varps.loginBoxCenter, var47, var1.stringWidth("Still having trouble logging in?"), 11); + var1.drawCentered(AttackOption.__cj_ay, Varps.loginBoxCenter, var47, 16777215, 0); } else if(Login.loginIndex == 3) { var47 = 201; - var0.drawCentered("Invalid credentials.", Login.__cu_y + 180, var47, 16776960, 0); + var0.drawCentered("Invalid credentials.", Login.loginBoxX + 180, var47, 16776960, 0); var48 = var47 + 20; - var1.drawCentered("For accounts created after 24th November 2010, please use your", Login.__cu_y + 180, var48, 16776960, 0); + var1.drawCentered("For accounts created after 24th November 2010, please use your", Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var1.drawCentered("email address to login. Otherwise please login with your username.", Login.__cu_y + 180, var48, 16776960, 0); + var1.drawCentered("email address to login. Otherwise please login with your username.", Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var24 = Login.__cu_y + 180; + var24 = Login.loginBoxX + 180; var5 = 276; - __bd_u.__q_496(var24 - 73, var5 - 20); + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var2.drawCentered("Try again", var24, var5 + 5, 16777215, 0); - var24 = Login.__cu_y + 180; + var24 = Login.loginBoxX + 180; var5 = 326; - __bd_u.__q_496(var24 - 73, var5 - 20); + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var2.drawCentered("Forgotten password?", var24, var5 + 5, 16777215, 0); } else { String var26; if(Login.loginIndex == 4) { - var0.drawCentered("Authenticator", Login.__cu_y + 180, 201, 16776960, 0); + var0.drawCentered("Authenticator", Login.loginBoxX + 180, 201, 16776960, 0); var47 = 236; - var0.drawCentered(Login.Login_response1, Login.__cu_y + 180, var47, 16777215, 0); + var0.drawCentered(Login.Login_response1, Login.loginBoxX + 180, var47, 16777215, 0); var48 = var47 + 15; - var0.drawCentered(Login.Login_response2, Login.__cu_y + 180, var48, 16777215, 0); + var0.drawCentered(Login.Login_response2, Login.loginBoxX + 180, var48, 16777215, 0); var48 += 15; - var0.drawCentered(Login.Login_response3, Login.__cu_y + 180, var48, 16777215, 0); + var0.drawCentered(Login.Login_response3, Login.loginBoxX + 180, var48, 16777215, 0); var48 += 15; var26 = "PIN: "; var7 = Login.otp; var25 = class168.method3450('*', var7.length()); - var0.draw(var26 + var25 + (Client.cycle % 40 < 20?BufferedFile.colorStartTag(16776960) + "|":""), Login.__cu_y + 180 - 108, var48, 16777215, 0); + var0.draw(var26 + var25 + (Client.cycle % 40 < 20?BufferedFile.colorStartTag(16776960) + "|":""), Login.loginBoxX + 180 - 108, var48, 16777215, 0); var48 -= 8; - var0.draw("Trust this computer", Login.__cu_y + 180 - 9, var48, 16776960, 0); + var0.draw("Trust this computer", Login.loginBoxX + 180 - 9, var48, 16776960, 0); var48 += 15; - var0.draw("for 30 days: ", Login.__cu_y + 180 - 9, var48, 16776960, 0); - var28 = Login.__cu_y + 180 - 9 + var0.stringWidth("for 30 days: ") + 15; + var0.draw("for 30 days: ", Login.loginBoxX + 180 - 9, var48, 16776960, 0); + var28 = Login.loginBoxX + 180 - 9 + var0.stringWidth("for 30 days: ") + 15; var9 = var48 - var0.ascent; IndexedSprite var52; if(Login.__cu_ba) { - var52 = class308.__kw_n; + var52 = class308.options_buttons_2Sprite; } else { - var52 = Login.__cu_d; + var52 = Login.options_buttons_0Sprite; } - var52.__q_496(var28, var9); + var52.drawAt(var28, var9); var48 += 15; - var11 = Login.__cu_y + 180 - 80; + var11 = Login.loginBoxX + 180 - 80; short var12 = 321; - __bd_u.__q_496(var11 - 73, var12 - 20); + titlebuttonSprite.drawAt(var11 - 73, var12 - 20); var0.drawCentered("Continue", var11, var12 + 5, 16777215, 0); - var11 = Login.__cu_y + 180 + 80; - __bd_u.__q_496(var11 - 73, var12 - 20); + var11 = Login.loginBoxX + 180 + 80; + titlebuttonSprite.drawAt(var11 - 73, var12 - 20); var0.drawCentered("Cancel", var11, var12 + 5, 16777215, 0); - var1.drawCentered("Can\'t Log In?", Login.__cu_y + 180, var12 + 36, 255, 0); + var1.drawCentered("Can\'t Log In?", Login.loginBoxX + 180, var12 + 36, 255, 0); } else { short var50; if(Login.loginIndex == 5) { - var0.drawCentered("Forgotten your password?", Login.__cu_y + 180, 201, 16776960, 0); + var0.drawCentered("Forgotten your password?", Login.loginBoxX + 180, 201, 16776960, 0); var47 = 221; - var2.drawCentered(Login.Login_response1, Login.__cu_y + 180, var47, 16776960, 0); + var2.drawCentered(Login.Login_response1, Login.loginBoxX + 180, var47, 16776960, 0); var48 = var47 + 15; - var2.drawCentered(Login.Login_response2, Login.__cu_y + 180, var48, 16776960, 0); + var2.drawCentered(Login.Login_response2, Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var2.drawCentered(Login.Login_response3, Login.__cu_y + 180, var48, 16776960, 0); + var2.drawCentered(Login.Login_response3, Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; var48 += 14; - var0.draw("Username/email: ", Login.__cu_y + 180 - 145, var48, 16777215, 0); + var0.draw("Username/email: ", Login.loginBoxX + 180 - 145, var48, 16777215, 0); var49 = 174; if(ReflectionCheck.clientPreferences.hideUsername) { var8 = Login.Login_username; @@ -584,58 +584,58 @@ public class IndexCacheLoader { ; } - var0.draw(AbstractFont.escapeBrackets(var25) + (Client.cycle % 40 < 20?BufferedFile.colorStartTag(16776960) + "|":""), Login.__cu_y + 180 - 34, var48, 16777215, 0); + var0.draw(AbstractFont.escapeBrackets(var25) + (Client.cycle % 40 < 20?BufferedFile.colorStartTag(16776960) + "|":""), Login.loginBoxX + 180 - 34, var48, 16777215, 0); var48 += 15; - var27 = Login.__cu_y + 180 - 80; + var27 = Login.loginBoxX + 180 - 80; var50 = 321; - __bd_u.__q_496(var27 - 73, var50 - 20); + titlebuttonSprite.drawAt(var27 - 73, var50 - 20); var0.drawCentered("Recover", var27, var50 + 5, 16777215, 0); - var27 = Login.__cu_y + 180 + 80; - __bd_u.__q_496(var27 - 73, var50 - 20); + var27 = Login.loginBoxX + 180 + 80; + titlebuttonSprite.drawAt(var27 - 73, var50 - 20); var0.drawCentered("Back", var27, var50 + 5, 16777215, 0); var50 = 356; - var1.drawCentered("Still having trouble logging in?", Varps.__hv_h, var50, 268435455, 0); + var1.drawCentered("Still having trouble logging in?", Varps.loginBoxCenter, var50, 268435455, 0); } else if(Login.loginIndex == 6) { var47 = 201; - var0.drawCentered(Login.Login_response1, Login.__cu_y + 180, var47, 16776960, 0); + var0.drawCentered(Login.Login_response1, Login.loginBoxX + 180, var47, 16776960, 0); var48 = var47 + 15; - var0.drawCentered(Login.Login_response2, Login.__cu_y + 180, var48, 16776960, 0); + var0.drawCentered(Login.Login_response2, Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var0.drawCentered(Login.Login_response3, Login.__cu_y + 180, var48, 16776960, 0); + var0.drawCentered(Login.Login_response3, Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var24 = Login.__cu_y + 180; + var24 = Login.loginBoxX + 180; var5 = 321; - __bd_u.__q_496(var24 - 73, var5 - 20); + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var0.drawCentered("Back", var24, var5 + 5, 16777215, 0); } else if(Login.loginIndex == 7) { var47 = 216; - var0.drawCentered("Your date of birth isn\'t set.", Login.__cu_y + 180, var47, 16776960, 0); + var0.drawCentered("Your date of birth isn\'t set.", Login.loginBoxX + 180, var47, 16776960, 0); var48 = var47 + 15; - var2.drawCentered("Please verify your account status by", Login.__cu_y + 180, var48, 16776960, 0); + var2.drawCentered("Please verify your account status by", Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var2.drawCentered("setting your date of birth.", Login.__cu_y + 180, var48, 16776960, 0); + var2.drawCentered("setting your date of birth.", Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var24 = Login.__cu_y + 180 - 80; + var24 = Login.loginBoxX + 180 - 80; var5 = 321; - __bd_u.__q_496(var24 - 73, var5 - 20); + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var0.drawCentered("Set Date of Birth", var24, var5 + 5, 16777215, 0); - var24 = Login.__cu_y + 180 + 80; - __bd_u.__q_496(var24 - 73, var5 - 20); + var24 = Login.loginBoxX + 180 + 80; + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var0.drawCentered("Back", var24, var5 + 5, 16777215, 0); } else if(Login.loginIndex == 8) { var47 = 216; - var0.drawCentered("Sorry, but your account is not eligible to play.", Login.__cu_y + 180, var47, 16776960, 0); + var0.drawCentered("Sorry, but your account is not eligible to play.", Login.loginBoxX + 180, var47, 16776960, 0); var48 = var47 + 15; - var2.drawCentered("For more information, please take a look at", Login.__cu_y + 180, var48, 16776960, 0); + var2.drawCentered("For more information, please take a look at", Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var2.drawCentered("our privacy policy.", Login.__cu_y + 180, var48, 16776960, 0); + var2.drawCentered("our privacy policy.", Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var24 = Login.__cu_y + 180 - 80; + var24 = Login.loginBoxX + 180 - 80; var5 = 321; - __bd_u.__q_496(var24 - 73, var5 - 20); + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var0.drawCentered("Privacy Policy", var24, var5 + 5, 16777215, 0); - var24 = Login.__cu_y + 180 + 80; - __bd_u.__q_496(var24 - 73, var5 - 20); + var24 = Login.loginBoxX + 180 + 80; + titlebuttonSprite.drawAt(var24 - 73, var5 - 20); var0.drawCentered("Back", var24, var5 + 5, 16777215, 0); } else if(Login.loginIndex == 12) { var47 = 201; @@ -657,19 +657,19 @@ public class IndexCacheLoader { MouseHandler.method1084(false); } - var0.drawCentered(var4, Login.__cu_y + 180, var47, 16776960, 0); + var0.drawCentered(var4, Login.loginBoxX + 180, var47, 16776960, 0); var48 = var47 + 15; - var2.drawCentered(var26, Login.__cu_y + 180, var48, 16776960, 0); + var2.drawCentered(var26, Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var2.drawCentered(var25, Login.__cu_y + 180, var48, 16776960, 0); + var2.drawCentered(var25, Login.loginBoxX + 180, var48, 16776960, 0); var48 += 15; - var27 = Login.__cu_y + 180; + var27 = Login.loginBoxX + 180; var50 = 276; - __bd_u.__q_496(var27 - 73, var50 - 20); + titlebuttonSprite.drawAt(var27 - 73, var50 - 20); var0.drawCentered("Support Page", var27, var50 + 5, 16777215, 0); - var27 = Login.__cu_y + 180; + var27 = Login.loginBoxX + 180; var50 = 326; - __bd_u.__q_496(var27 - 73, var50 - 20); + titlebuttonSprite.drawAt(var27 - 73, var50 - 20); var0.drawCentered("Back", var27, var50 + 5, 16777215, 0); } } @@ -679,20 +679,20 @@ public class IndexCacheLoader { if(Client.gameState >= 10) { int[] var3 = new int[4]; Rasterizer2D.Rasterizer2D_getClipArray(var3); - Rasterizer2D.Rasterizer2D_setClip(Login.__cu_q, 0, Login.__cu_q + 765, Huffman.canvasHeight); - class16.field85.method1782(Login.__cu_q - 22, Client.cycle); - class16.field85.method1782(Login.__cu_q + 22 + 765 - 128, Client.cycle); + Rasterizer2D.Rasterizer2D_setClip(Login.xPadding, 0, Login.xPadding + 765, Huffman.canvasHeight); + class16.loginScreenRunesAnimation.method1782(Login.xPadding - 22, Client.cycle); + class16.loginScreenRunesAnimation.method1782(Login.xPadding + 22 + 765 - 128, Client.cycle); Rasterizer2D.Rasterizer2D_setClipArray(var3); } - KeyHandler.__an_x[ReflectionCheck.clientPreferences.titleMusicDisabled?1:0].__q_496(Login.__cu_q + 765 - 40, 463); + KeyHandler.title_muteSprite[ReflectionCheck.clientPreferences.titleMusicDisabled?1:0].drawAt(Login.xPadding + 765 - 40, 463); if(Client.gameState > 5 && Client.language == 0) { if(class277.__jn_by != null) { - var48 = Login.__cu_q + 5; + var48 = Login.xPadding + 5; var49 = 463; byte var38 = 100; byte var6 = 35; - class277.__jn_by.__q_496(var48, var49); + class277.__jn_by.drawAt(var48, var49); var0.drawCentered("World" + " " + Client.worldId, var38 / 2 + var48, var6 / 2 + var49 - 2, 16777215, 0); if(FriendLoginUpdate.__kn_x != null) { var1.drawCentered("Loading...", var38 / 2 + var48, var6 / 2 + var49 + 12, 16777215, 0); @@ -700,7 +700,7 @@ public class IndexCacheLoader { var1.drawCentered("Click to switch", var38 / 2 + var48, var6 / 2 + var49 + 12, 16777215, 0); } } else { - class277.__jn_by = MenuAction.method2025(WorldMapSection3.indexCache8, "sl_button", ""); + class277.__jn_by = MenuAction.loadIndexedSpriteByName(WorldMapSection3.indexCache8, "sl_button", ""); } } diff --git a/runescape-client/src/main/java/IndexStore.java b/runescape-client/src/main/java/IndexStore.java index ab9552b2f2..c17efeb20a 100644 --- a/runescape-client/src/main/java/IndexStore.java +++ b/runescape-client/src/main/java/IndexStore.java @@ -277,20 +277,20 @@ public final class IndexStore { signature = "(IIILfe;Lfy;B)Z", garbageValue = "1" ) - static final boolean method3585(int var0, int var1, int var2, class179 var3, CollisionMap var4) { + static final boolean method3585(int var0, int var1, int var2, RouteStrategy var3, CollisionMap var4) { int var5 = var0; int var6 = var1; byte var7 = 64; byte var8 = 64; int var9 = var0 - var7; int var10 = var1 - var8; - class178.__fi_q[var7][var8] = 99; - class178.__fi_w[var7][var8] = 0; + class178.directions[var7][var8] = 99; + class178.distances[var7][var8] = 0; byte var11 = 0; int var12 = 0; - class178.__fi_l[var11] = var0; + class178.bufferX[var11] = var0; int var20 = var11 + 1; - class178.__fi_e[var11] = var1; + class178.bufferY[var11] = var1; int[][] var13 = var4.flags; while(true) { @@ -313,8 +313,8 @@ public final class IndexStore { return false; } - var5 = class178.__fi_l[var12]; - var6 = class178.__fi_e[var12]; + var5 = class178.bufferX[var12]; + var6 = class178.bufferY[var12]; var12 = var12 + 1 & 4095; var18 = var5 - var9; var19 = var6 - var10; @@ -326,17 +326,17 @@ public final class IndexStore { return true; } - var16 = class178.__fi_w[var18][var19] + 1; - if(var18 > 0 && class178.__fi_q[var18 - 1][var19] == 0 && (var13[var14 - 1][var15] & 19136782) == 0 && (var13[var14 - 1][var15 + var2 - 1] & 19136824) == 0) { + var16 = class178.distances[var18][var19] + 1; + if(var18 > 0 && class178.directions[var18 - 1][var19] == 0 && (var13[var14 - 1][var15] & 19136782) == 0 && (var13[var14 - 1][var15 + var2 - 1] & 19136824) == 0) { var17 = 1; while(true) { if(var17 >= var2 - 1) { - class178.__fi_l[var20] = var5 - 1; - class178.__fi_e[var20] = var6; + class178.bufferX[var20] = var5 - 1; + class178.bufferY[var20] = var6; var20 = var20 + 1 & 4095; - class178.__fi_q[var18 - 1][var19] = 2; - class178.__fi_w[var18 - 1][var19] = var16; + class178.directions[var18 - 1][var19] = 2; + class178.distances[var18 - 1][var19] = var16; break; } @@ -348,16 +348,16 @@ public final class IndexStore { } } - if(var18 < 128 - var2 && class178.__fi_q[var18 + 1][var19] == 0 && (var13[var14 + var2][var15] & 19136899) == 0 && (var13[var14 + var2][var15 + var2 - 1] & 19136992) == 0) { + if(var18 < 128 - var2 && class178.directions[var18 + 1][var19] == 0 && (var13[var14 + var2][var15] & 19136899) == 0 && (var13[var14 + var2][var15 + var2 - 1] & 19136992) == 0) { var17 = 1; while(true) { if(var17 >= var2 - 1) { - class178.__fi_l[var20] = var5 + 1; - class178.__fi_e[var20] = var6; + class178.bufferX[var20] = var5 + 1; + class178.bufferY[var20] = var6; var20 = var20 + 1 & 4095; - class178.__fi_q[var18 + 1][var19] = 8; - class178.__fi_w[var18 + 1][var19] = var16; + class178.directions[var18 + 1][var19] = 8; + class178.distances[var18 + 1][var19] = var16; break; } @@ -369,16 +369,16 @@ public final class IndexStore { } } - if(var19 > 0 && class178.__fi_q[var18][var19 - 1] == 0 && (var13[var14][var15 - 1] & 19136782) == 0 && (var13[var14 + var2 - 1][var15 - 1] & 19136899) == 0) { + if(var19 > 0 && class178.directions[var18][var19 - 1] == 0 && (var13[var14][var15 - 1] & 19136782) == 0 && (var13[var14 + var2 - 1][var15 - 1] & 19136899) == 0) { var17 = 1; while(true) { if(var17 >= var2 - 1) { - class178.__fi_l[var20] = var5; - class178.__fi_e[var20] = var6 - 1; + class178.bufferX[var20] = var5; + class178.bufferY[var20] = var6 - 1; var20 = var20 + 1 & 4095; - class178.__fi_q[var18][var19 - 1] = 1; - class178.__fi_w[var18][var19 - 1] = var16; + class178.directions[var18][var19 - 1] = 1; + class178.distances[var18][var19 - 1] = var16; break; } @@ -390,16 +390,16 @@ public final class IndexStore { } } - if(var19 < 128 - var2 && class178.__fi_q[var18][var19 + 1] == 0 && (var13[var14][var15 + var2] & 19136824) == 0 && (var13[var14 + var2 - 1][var15 + var2] & 19136992) == 0) { + if(var19 < 128 - var2 && class178.directions[var18][var19 + 1] == 0 && (var13[var14][var15 + var2] & 19136824) == 0 && (var13[var14 + var2 - 1][var15 + var2] & 19136992) == 0) { var17 = 1; while(true) { if(var17 >= var2 - 1) { - class178.__fi_l[var20] = var5; - class178.__fi_e[var20] = var6 + 1; + class178.bufferX[var20] = var5; + class178.bufferY[var20] = var6 + 1; var20 = var20 + 1 & 4095; - class178.__fi_q[var18][var19 + 1] = 4; - class178.__fi_w[var18][var19 + 1] = var16; + class178.directions[var18][var19 + 1] = 4; + class178.distances[var18][var19 + 1] = var16; break; } @@ -411,16 +411,16 @@ public final class IndexStore { } } - if(var18 > 0 && var19 > 0 && class178.__fi_q[var18 - 1][var19 - 1] == 0 && (var13[var14 - 1][var15 - 1] & 19136782) == 0) { + if(var18 > 0 && var19 > 0 && class178.directions[var18 - 1][var19 - 1] == 0 && (var13[var14 - 1][var15 - 1] & 19136782) == 0) { var17 = 1; while(true) { if(var17 >= var2) { - class178.__fi_l[var20] = var5 - 1; - class178.__fi_e[var20] = var6 - 1; + class178.bufferX[var20] = var5 - 1; + class178.bufferY[var20] = var6 - 1; var20 = var20 + 1 & 4095; - class178.__fi_q[var18 - 1][var19 - 1] = 3; - class178.__fi_w[var18 - 1][var19 - 1] = var16; + class178.directions[var18 - 1][var19 - 1] = 3; + class178.distances[var18 - 1][var19 - 1] = var16; break; } @@ -432,16 +432,16 @@ public final class IndexStore { } } - if(var18 < 128 - var2 && var19 > 0 && class178.__fi_q[var18 + 1][var19 - 1] == 0 && (var13[var14 + var2][var15 - 1] & 19136899) == 0) { + if(var18 < 128 - var2 && var19 > 0 && class178.directions[var18 + 1][var19 - 1] == 0 && (var13[var14 + var2][var15 - 1] & 19136899) == 0) { var17 = 1; while(true) { if(var17 >= var2) { - class178.__fi_l[var20] = var5 + 1; - class178.__fi_e[var20] = var6 - 1; + class178.bufferX[var20] = var5 + 1; + class178.bufferY[var20] = var6 - 1; var20 = var20 + 1 & 4095; - class178.__fi_q[var18 + 1][var19 - 1] = 9; - class178.__fi_w[var18 + 1][var19 - 1] = var16; + class178.directions[var18 + 1][var19 - 1] = 9; + class178.distances[var18 + 1][var19 - 1] = var16; break; } @@ -453,22 +453,22 @@ public final class IndexStore { } } - if(var18 > 0 && var19 < 128 - var2 && class178.__fi_q[var18 - 1][var19 + 1] == 0 && (var13[var14 - 1][var15 + var2] & 19136824) == 0) { + if(var18 > 0 && var19 < 128 - var2 && class178.directions[var18 - 1][var19 + 1] == 0 && (var13[var14 - 1][var15 + var2] & 19136824) == 0) { for(var17 = 1; var17 < var2; ++var17) { if((var13[var14 - 1][var15 + var17] & 19136830) != 0 || (var13[var17 + (var14 - 1)][var15 + var2] & 19137016) != 0) { continue label277; } } - class178.__fi_l[var20] = var5 - 1; - class178.__fi_e[var20] = var6 + 1; + class178.bufferX[var20] = var5 - 1; + class178.bufferY[var20] = var6 + 1; var20 = var20 + 1 & 4095; - class178.__fi_q[var18 - 1][var19 + 1] = 6; - class178.__fi_w[var18 - 1][var19 + 1] = var16; + class178.directions[var18 - 1][var19 + 1] = 6; + class178.distances[var18 - 1][var19 + 1] = var16; } } while(var18 >= 128 - var2); } while(var19 >= 128 - var2); - } while(class178.__fi_q[var18 + 1][var19 + 1] != 0); + } while(class178.directions[var18 + 1][var19 + 1] != 0); } while((var13[var14 + var2][var15 + var2] & 19136992) != 0); for(var17 = 1; var17 < var2; ++var17) { @@ -477,11 +477,11 @@ public final class IndexStore { } } - class178.__fi_l[var20] = var5 + 1; - class178.__fi_e[var20] = var6 + 1; + class178.bufferX[var20] = var5 + 1; + class178.bufferY[var20] = var6 + 1; var20 = var20 + 1 & 4095; - class178.__fi_q[var18 + 1][var19 + 1] = 12; - class178.__fi_w[var18 + 1][var19 + 1] = var16; + class178.directions[var18 + 1][var19 + 1] = 12; + class178.distances[var18 + 1][var19 + 1] = var16; } } } diff --git a/runescape-client/src/main/java/IndexedSprite.java b/runescape-client/src/main/java/IndexedSprite.java index e85171962f..67fb180a08 100644 --- a/runescape-client/src/main/java/IndexedSprite.java +++ b/runescape-client/src/main/java/IndexedSprite.java @@ -85,41 +85,41 @@ public final class IndexedSprite extends Rasterizer2D { } @ObfuscatedName("q") - @Export("__q_496") - public void __q_496(int var1, int var2) { - var1 += this.xOffset; - var2 += this.yOffset; - int var3 = var1 + var2 * Rasterizer2D.Rasterizer2D_width; + @Export("drawAt") + public void drawAt(int x, int y) { + x += this.xOffset; + y += this.yOffset; + int var3 = x + y * Rasterizer2D.Rasterizer2D_width; int var4 = 0; int var5 = this.subHeight; int var6 = this.subWidth; int var7 = Rasterizer2D.Rasterizer2D_width - var6; int var8 = 0; int var9; - if(var2 < Rasterizer2D.Rasterizer2D_yClipStart) { - var9 = Rasterizer2D.Rasterizer2D_yClipStart - var2; + if(y < Rasterizer2D.Rasterizer2D_yClipStart) { + var9 = Rasterizer2D.Rasterizer2D_yClipStart - y; var5 -= var9; - var2 = Rasterizer2D.Rasterizer2D_yClipStart; + y = Rasterizer2D.Rasterizer2D_yClipStart; var4 += var9 * var6; var3 += var9 * Rasterizer2D.Rasterizer2D_width; } - if(var5 + var2 > Rasterizer2D.Rasterizer2D_yClipEnd) { - var5 -= var5 + var2 - Rasterizer2D.Rasterizer2D_yClipEnd; + if(var5 + y > Rasterizer2D.Rasterizer2D_yClipEnd) { + var5 -= var5 + y - Rasterizer2D.Rasterizer2D_yClipEnd; } - if(var1 < Rasterizer2D.Rasterizer2D_xClipStart) { - var9 = Rasterizer2D.Rasterizer2D_xClipStart - var1; + if(x < Rasterizer2D.Rasterizer2D_xClipStart) { + var9 = Rasterizer2D.Rasterizer2D_xClipStart - x; var6 -= var9; - var1 = Rasterizer2D.Rasterizer2D_xClipStart; + x = Rasterizer2D.Rasterizer2D_xClipStart; var4 += var9; var3 += var9; var8 += var9; var7 += var9; } - if(var6 + var1 > Rasterizer2D.Rasterizer2D_xClipEnd) { - var9 = var6 + var1 - Rasterizer2D.Rasterizer2D_xClipEnd; + if(var6 + x > Rasterizer2D.Rasterizer2D_xClipEnd) { + var9 = var6 + x - Rasterizer2D.Rasterizer2D_xClipEnd; var6 -= var9; var8 += var9; var7 += var9; diff --git a/runescape-client/src/main/java/Interpreter.java b/runescape-client/src/main/java/Interpreter.java index 126aba22f8..20baed429f 100644 --- a/runescape-client/src/main/java/Interpreter.java +++ b/runescape-client/src/main/java/Interpreter.java @@ -141,7 +141,7 @@ public class Interpreter { signature = "(IIB)V", garbageValue = "76" ) - static void method1975(int var0, int var1) { + static void changeWorldSelectSorting(int var0, int var1) { int[] var2 = new int[4]; int[] var3 = new int[4]; var2[0] = var0; @@ -149,16 +149,16 @@ public class Interpreter { int var4 = 1; for(int var5 = 0; var5 < 4; ++var5) { - if(World.__bt_e[var5] != var0) { - var2[var4] = World.__bt_e[var5]; - var3[var4] = World.__bt_l[var5]; + if(World.sortOption1[var5] != var0) { + var2[var4] = World.sortOption1[var5]; + var3[var4] = World.sortOption2[var5]; ++var4; } } - World.__bt_e = var2; - World.__bt_l = var3; - MilliClock.method3400(ItemContainer.worlds, 0, ItemContainer.worlds.length - 1, World.__bt_e, World.__bt_l); + World.sortOption1 = var2; + World.sortOption2 = var3; + MilliClock.method3400(ItemContainer.worlds, 0, ItemContainer.worlds.length - 1, World.sortOption1, World.sortOption2); } @ObfuscatedName("w") diff --git a/runescape-client/src/main/java/KeyHandler.java b/runescape-client/src/main/java/KeyHandler.java index e7322e5206..48c3679ba0 100644 --- a/runescape-client/src/main/java/KeyHandler.java +++ b/runescape-client/src/main/java/KeyHandler.java @@ -28,14 +28,14 @@ public final class KeyHandler implements KeyListener, FocusListener { @ObfuscatedSignature( signature = "[Llq;" ) - @Export("__an_x") - static IndexedSprite[] __an_x; + @Export("title_muteSprite") + static IndexedSprite[] title_muteSprite; @ObfuscatedName("i") @ObfuscatedSignature( signature = "Llq;" ) - @Export("__an_i") - static IndexedSprite __an_i; + @Export("options_buttons_6Sprite") + static IndexedSprite options_buttons_6Sprite; @ObfuscatedName("bk") @ObfuscatedSignature( signature = "Llx;" diff --git a/runescape-client/src/main/java/Login.java b/runescape-client/src/main/java/Login.java index ea3111c177..33c3638dcf 100644 --- a/runescape-client/src/main/java/Login.java +++ b/runescape-client/src/main/java/Login.java @@ -15,20 +15,20 @@ public class Login { @ObfuscatedGetter( intValue = 1606541885 ) - @Export("__cu_q") - static int __cu_q; + @Export("xPadding") + static int xPadding; @ObfuscatedName("o") @ObfuscatedSignature( signature = "Llq;" ) - @Export("__cu_o") - static IndexedSprite __cu_o; + @Export("titleboxSprite") + static IndexedSprite titleboxSprite; @ObfuscatedName("g") @ObfuscatedSignature( signature = "Lln;" ) - @Export("__cu_g") - static Sprite __cu_g; + @Export("leftTitleSprite") + static Sprite leftTitleSprite; @ObfuscatedName("e") @ObfuscatedGetter( intValue = -184301597 @@ -39,14 +39,14 @@ public class Login { @ObfuscatedSignature( signature = "Llq;" ) - @Export("__cu_d") - static IndexedSprite __cu_d; + @Export("options_buttons_0Sprite") + static IndexedSprite options_buttons_0Sprite; @ObfuscatedName("y") @ObfuscatedGetter( intValue = 932541923 ) - @Export("__cu_y") - static int __cu_y; + @Export("loginBoxX") + static int loginBoxX; @ObfuscatedName("b") @ObfuscatedGetter( intValue = -504870061 @@ -111,26 +111,26 @@ public class Login { @Export("currentLoginField") static int currentLoginField; @ObfuscatedName("bk") - @Export("__cu_bk") - static boolean __cu_bk; + @Export("worldSelectOpen") + static boolean worldSelectOpen; @ObfuscatedName("bl") @ObfuscatedGetter( intValue = 1431381579 ) - @Export("__cu_bl") - static int __cu_bl; + @Export("hoveredWorldIndex") + static int hoveredWorldIndex; @ObfuscatedName("br") @ObfuscatedGetter( intValue = -376233039 ) - @Export("__cu_br") - static int __cu_br; + @Export("worldSelectPage") + static int worldSelectPage; @ObfuscatedName("bj") @ObfuscatedGetter( intValue = 1548722671 ) - @Export("__cu_bj") - static int __cu_bj; + @Export("worldSelectPagesCount") + static int worldSelectPagesCount; @ObfuscatedName("bi") @ObfuscatedGetter( longValue = 803647694904294325L @@ -151,8 +151,8 @@ public class Login { static IndexCache indexCache11; static { - __cu_q = 0; - __cu_y = __cu_q + 202; + xPadding = 0; + loginBoxX = xPadding + 202; Login_loadingPercent = 10; Login_loadingText = ""; __cu_aj = -1; @@ -168,10 +168,10 @@ public class Login { __cu_ax = false; __cu_ba = true; currentLoginField = 0; - __cu_bk = false; - __cu_bl = -1; - __cu_br = 0; - __cu_bj = 0; + worldSelectOpen = false; + hoveredWorldIndex = -1; + worldSelectPage = 0; + worldSelectPagesCount = 0; new DecimalFormat("##0.00"); new class161(); __cu_bi = -1L; diff --git a/runescape-client/src/main/java/class72.java b/runescape-client/src/main/java/LoginScreenAnimation.java similarity index 92% rename from runescape-client/src/main/java/class72.java rename to runescape-client/src/main/java/LoginScreenAnimation.java index e93de12f7d..5d2dae8ae1 100644 --- a/runescape-client/src/main/java/class72.java +++ b/runescape-client/src/main/java/LoginScreenAnimation.java @@ -9,12 +9,13 @@ import net.runelite.mapping.ObfuscatedName; import net.runelite.mapping.ObfuscatedSignature; @ObfuscatedName("bp") -public class class72 { +public class LoginScreenAnimation +{ @ObfuscatedName("m") @ObfuscatedSignature( signature = "[Llq;" ) - IndexedSprite[] field998; + IndexedSprite[] sprites; @ObfuscatedName("g") int[] field1015; @ObfuscatedName("l") @@ -67,7 +68,7 @@ public class class72 { @ObfuscatedSignature( signature = "([Llq;)V" ) - class72(IndexedSprite[] var1) { + LoginScreenAnimation(IndexedSprite[] var1) { this.field1015 = new int[256]; this.field1008 = 0; this.field1009 = 0; @@ -75,7 +76,7 @@ public class class72 { this.field1010 = 0; this.field1016 = 0; this.field1017 = 0; - this.field998 = var1; + this.sprites = var1; this.method1772(); } @@ -89,55 +90,55 @@ public class class72 { int var1; for(var1 = 0; var1 < 64; ++var1) { - this.field1006[var1] = var1 * 262144; + this.field1006[var1] = var1 * 0x40000; } for(var1 = 0; var1 < 64; ++var1) { - this.field1006[var1 + 64] = var1 * 1024 + 16711680; + this.field1006[var1 + 64] = var1 * 0x400 + 0xff0000; } for(var1 = 0; var1 < 64; ++var1) { - this.field1006[var1 + 128] = var1 * 4 + 16776960; + this.field1006[var1 + 128] = var1 * 0x4 + 0xffff00; } for(var1 = 0; var1 < 64; ++var1) { - this.field1006[var1 + 192] = 16777215; + this.field1006[var1 + 192] = 0xffffff; } this.field1007 = new int[256]; for(var1 = 0; var1 < 64; ++var1) { - this.field1007[var1] = var1 * 1024; + this.field1007[var1] = var1 * 0x400; } for(var1 = 0; var1 < 64; ++var1) { - this.field1007[var1 + 64] = var1 * 4 + 65280; + this.field1007[var1 + 64] = var1 * 0x4 + 0xff00; } for(var1 = 0; var1 < 64; ++var1) { - this.field1007[var1 + 128] = var1 * 262144 + 65535; + this.field1007[var1 + 128] = var1 * 0x40000 + 0xffff; } for(var1 = 0; var1 < 64; ++var1) { - this.field1007[var1 + 192] = 16777215; + this.field1007[var1 + 192] = 0xffffff; } this.field1014 = new int[256]; for(var1 = 0; var1 < 64; ++var1) { - this.field1014[var1] = var1 * 4; + this.field1014[var1] = var1 * 0x4; } for(var1 = 0; var1 < 64; ++var1) { - this.field1014[var1 + 64] = var1 * 262144 + 255; + this.field1014[var1 + 64] = var1 * 0x40000 + 0xff; } for(var1 = 0; var1 < 64; ++var1) { - this.field1014[var1 + 128] = var1 * 1024 + 16711935; + this.field1014[var1 + 128] = var1 * 0x400 + 0xff00ff; } for(var1 = 0; var1 < 64; ++var1) { - this.field1014[var1 + 192] = 16777215; + this.field1014[var1 + 192] = 0xffffff; } this.field1013 = new int[256]; @@ -172,26 +173,26 @@ public class class72 { signature = "(III)V", garbageValue = "-1684910110" ) - void method1782(int var1, int var2) { + void method1782(int x, int cycle) { if(this.field1011 == null) { this.method1772(); } if(this.field1017 == 0) { - this.field1017 = var2; + this.field1017 = cycle; } - int var3 = var2 - this.field1017; + int var3 = cycle - this.field1017; if(var3 >= 256) { var3 = 0; } - this.field1017 = var2; + this.field1017 = cycle; if(var3 > 0) { this.method1791(var3); } - this.method1787(var1); + this.method1787(x); } @ObfuscatedName("w") @@ -205,7 +206,7 @@ public class class72 { if(this.field1010 > this.field1004.length) { this.field1010 -= this.field1004.length; var2 = (int)(Math.random() * 12.0D); - this.method1779(this.field998[var2]); + this.method1779(this.sprites[var2]); } var2 = 0; @@ -335,7 +336,7 @@ public class class72 { ) final int method1765(int var1, int var2, int var3) { int var4 = 256 - var3; - return (var4 * (var1 & 65280) + var3 * (var2 & 65280) & 16711680) + (var4 * (var1 & 16711935) + var3 * (var2 & 16711935) & -16711936) >> 8; + return (var4 * (var1 & 0xff00) + var3 * (var2 & 0xff00) & 0xff0000) + (var4 * (var1 & 0xff00ff) + var3 * (var2 & 0xff00ff) & 0xff00ff00) >> 8; } @ObfuscatedName("u") @@ -411,7 +412,7 @@ public class class72 { int var13 = 256 - var10; var10 = this.field1013[var10]; int var14 = class197.rasterProvider.pixels[var8]; - class197.rasterProvider.pixels[var8++] = -16777216 | ((var10 & 16711935) * var12 + (var14 & 16711935) * var13 & -16711936) + (var12 * (var10 & 65280) + var13 * (var14 & 65280) & 16711680) >> 8; + class197.rasterProvider.pixels[var8++] = 0xff000000 | ((var10 & 0xff00ff) * var12 + (var14 & 0xff00ff) * var13 & 0xff00ff00) + (var12 * (var10 & 0xff00) + var13 * (var14 & 0xff00) & 0xff0000) >> 8; } else { ++var8; } diff --git a/runescape-client/src/main/java/MenuAction.java b/runescape-client/src/main/java/MenuAction.java index 8ac8a24a9d..657f52fcbb 100644 --- a/runescape-client/src/main/java/MenuAction.java +++ b/runescape-client/src/main/java/MenuAction.java @@ -46,14 +46,14 @@ public class MenuAction { signature = "(Lir;Ljava/lang/String;Ljava/lang/String;B)Llq;", garbageValue = "0" ) - public static IndexedSprite method2025(AbstractIndexCache var0, String var1, String var2) { + public static IndexedSprite loadIndexedSpriteByName(AbstractIndexCache var0, String var1, String var2) { int var3 = var0.getArchiveId(var1); int var4 = var0.getRecordId(var3, var2); IndexedSprite var5; - if(!SpriteMask.method4392(var0, var3, var4)) { + if(!SpriteMask.loadSprite(var0, var3, var4)) { var5 = null; } else { - var5 = ServerPacket.method3663(); + var5 = ServerPacket.createIndexedSprite(); } return var5; @@ -70,7 +70,7 @@ public class MenuAction { int var3 = (int)var0.key; var0.remove(); if(var1) { - AbstractByteArrayCopier.method4023(var2); + AbstractByteArrayCopier.unloadWidgetGroup(var2); } for(IntegerNode var4 = (IntegerNode)Client.widgetClickMasks.first(); var4 != null; var4 = (IntegerNode)Client.widgetClickMasks.next()) { @@ -87,7 +87,7 @@ public class MenuAction { int var5; int var6; for(var5 = 0; var5 < Client.menuOptionsCount; ++var5) { - if(WorldMapManager.method672(Client.menuOpcodes[var5])) { + if(WorldMapManager.isWidgetMenuOpcode(Client.menuOpcodes[var5])) { if(var5 < Client.menuOptionsCount - 1) { for(var6 = var5; var6 < Client.menuOptionsCount - 1; ++var6) { Client.menuActions[var6] = Client.menuActions[var6 + 1]; diff --git a/runescape-client/src/main/java/Message.java b/runescape-client/src/main/java/Message.java index 5b875921da..d4992e3b60 100644 --- a/runescape-client/src/main/java/Message.java +++ b/runescape-client/src/main/java/Message.java @@ -219,7 +219,7 @@ public class Message extends DualNode { boolean var8; if(Character.isISOControl(var7)) { var8 = false; - } else if(VarcInt.method4807(var7)) { + } else if(VarcInt.isAlphaNumeric(var7)) { var8 = true; } else { char[] var13 = class305.__kb_q; diff --git a/runescape-client/src/main/java/MilliClock.java b/runescape-client/src/main/java/MilliClock.java index 146e626362..256c297e67 100644 --- a/runescape-client/src/main/java/MilliClock.java +++ b/runescape-client/src/main/java/MilliClock.java @@ -166,8 +166,8 @@ public class MilliClock extends Clock { var12 = 2001; } } else if(var3[var10] == 3) { - var11 = var0[var6].__e_144()?1:0; - var12 = var8.__e_144()?1:0; + var11 = var0[var6].isMembersOnly()?1:0; + var12 = var8.isMembersOnly()?1:0; } else { var11 = var0[var6].id; var12 = var8.id; @@ -206,8 +206,8 @@ public class MilliClock extends Clock { var12 = 2001; } } else if(var3[var10] == 3) { - var11 = var0[var5].__e_144()?1:0; - var12 = var8.__e_144()?1:0; + var11 = var0[var5].isMembersOnly()?1:0; + var12 = var8.isMembersOnly()?1:0; } else { var11 = var0[var5].id; var12 = var8.id; diff --git a/runescape-client/src/main/java/MouseRecorder.java b/runescape-client/src/main/java/MouseRecorder.java index 24c1743159..c5860d85e0 100644 --- a/runescape-client/src/main/java/MouseRecorder.java +++ b/runescape-client/src/main/java/MouseRecorder.java @@ -105,7 +105,7 @@ public class MouseRecorder implements Runnable { if(var16 != null) { int var17 = (var15.sizeX * 4 - var16.subWidth) / 2; int var18 = (var15.sizeY * 4 - var16.subHeight) / 2; - var16.__q_496(var1 * 4 + var17 + 48, (104 - var2 - var15.sizeY) * 4 + var18 + 48); + var16.drawAt(var1 * 4 + var17 + 48, (104 - var2 - var15.sizeY) * 4 + var18 + 48); } } else { if(var9 == 0 || var9 == 2) { @@ -182,7 +182,7 @@ public class MouseRecorder implements Runnable { if(var28 != null) { var26 = (var20.sizeX * 4 - var28.subWidth) / 2; var14 = (var20.sizeY * 4 - var28.subHeight) / 2; - var28.__q_496(var26 + var1 * 4 + 48, (104 - var2 - var20.sizeY) * 4 + var14 + 48); + var28.drawAt(var26 + var1 * 4 + 48, (104 - var2 - var20.sizeY) * 4 + var14 + 48); } } else if(var9 == 9) { int var25 = 15658734; @@ -221,7 +221,7 @@ public class MouseRecorder implements Runnable { if(var22 != null) { var10 = (var21.sizeX * 4 - var22.subWidth) / 2; int var11 = (var21.sizeY * 4 - var22.subHeight) / 2; - var22.__q_496(var10 + var1 * 4 + 48, var11 + (104 - var2 - var21.sizeY) * 4 + 48); + var22.drawAt(var10 + var1 * 4 + 48, var11 + (104 - var2 - var21.sizeY) * 4 + 48); } } } diff --git a/runescape-client/src/main/java/NetSocket.java b/runescape-client/src/main/java/NetSocket.java index 14900a4d47..fa0ad800ee 100644 --- a/runescape-client/src/main/java/NetSocket.java +++ b/runescape-client/src/main/java/NetSocket.java @@ -16,8 +16,8 @@ public final class NetSocket extends AbstractSocket implements Runnable { @ObfuscatedSignature( signature = "Llq;" ) - @Export("__fb_bm") - static IndexedSprite __fb_bm; + @Export("worldSelectRightSprite") + static IndexedSprite worldSelectRightSprite; @ObfuscatedName("m") @Export("inputStream") InputStream inputStream; @@ -305,227 +305,227 @@ public final class NetSocket extends AbstractSocket implements Runnable { signature = "(IIILfe;Lfy;Z[I[IB)I", garbageValue = "-98" ) - public static int method3571(int var0, int var1, int var2, class179 var3, CollisionMap var4, boolean var5, int[] var6, int[] var7) { - int var9; + public static int calculateRoute(int srcX, int srcY, int srcSize, RouteStrategy strategy, CollisionMap collisionMap, boolean var5, int[] bufferX, int[] bufferY) { + int graphBaseX; for(int var8 = 0; var8 < 128; ++var8) { - for(var9 = 0; var9 < 128; ++var9) { - class178.__fi_q[var8][var9] = 0; - class178.__fi_w[var8][var9] = 99999999; + for(graphBaseX = 0; graphBaseX < 128; ++graphBaseX) { + class178.directions[var8][graphBaseX] = 0; + class178.distances[var8][graphBaseX] = 99999999; } } - int var10; - int var11; + int graphBaseY; + int endX; byte var13; - int var14; + int lowestDistance; int var15; - int var17; - int var19; - int var20; - int var21; - boolean var28; - int var30; - int var31; - int var33; - if(var2 == 1) { - var10 = var0; - var11 = var1; + int approxDestY; + int approxDestSizeY; + int checkX; + int checkY; + boolean found; + int endY; + int lowestCost; + int approxDestX; + if(srcSize == 1) { + graphBaseY = srcX; + endX = srcY; byte var12 = 64; var13 = 64; - var14 = var0 - var12; - var15 = var1 - var13; - class178.__fi_q[var12][var13] = 99; - class178.__fi_w[var12][var13] = 0; + lowestDistance = srcX - var12; + var15 = srcY - var13; + class178.directions[var12][var13] = 99; + class178.distances[var12][var13] = 0; byte var16 = 0; - var17 = 0; - class178.__fi_l[var16] = var0; - var33 = var16 + 1; - class178.__fi_e[var16] = var1; - int[][] var18 = var4.flags; + approxDestY = 0; + class178.bufferX[var16] = srcX; + approxDestX = var16 + 1; + class178.bufferY[var16] = srcY; + int[][] var18 = collisionMap.flags; boolean var29; while(true) { - if(var33 == var17) { - WidgetGroupParent.__bx_o = var10; - UrlRequester.__eo_u = var11; + if(approxDestX == approxDestY) { + WidgetGroupParent.__bx_o = graphBaseY; + UrlRequester.__eo_u = endX; var29 = false; break; } - var10 = class178.__fi_l[var17]; - var11 = class178.__fi_e[var17]; - var17 = var17 + 1 & 4095; - var30 = var10 - var14; - var31 = var11 - var15; - var19 = var10 - var4.xInset; - var20 = var11 - var4.yInset; - if(var3.vmethod3644(1, var10, var11, var4)) { - WidgetGroupParent.__bx_o = var10; - UrlRequester.__eo_u = var11; + graphBaseY = class178.bufferX[approxDestY]; + endX = class178.bufferY[approxDestY]; + approxDestY = approxDestY + 1 & 4095; + endY = graphBaseY - lowestDistance; + lowestCost = endX - var15; + approxDestSizeY = graphBaseY - collisionMap.xInset; + checkX = endX - collisionMap.yInset; + if(strategy.vmethod3644(1, graphBaseY, endX, collisionMap)) { + WidgetGroupParent.__bx_o = graphBaseY; + UrlRequester.__eo_u = endX; var29 = true; break; } - var21 = class178.__fi_w[var30][var31] + 1; - if(var30 > 0 && class178.__fi_q[var30 - 1][var31] == 0 && (var18[var19 - 1][var20] & 19136776) == 0) { - class178.__fi_l[var33] = var10 - 1; - class178.__fi_e[var33] = var11; - var33 = var33 + 1 & 4095; - class178.__fi_q[var30 - 1][var31] = 2; - class178.__fi_w[var30 - 1][var31] = var21; + checkY = class178.distances[endY][lowestCost] + 1; + if(endY > 0 && class178.directions[endY - 1][lowestCost] == 0 && (var18[approxDestSizeY - 1][checkX] & 19136776) == 0) { + class178.bufferX[approxDestX] = graphBaseY - 1; + class178.bufferY[approxDestX] = endX; + approxDestX = approxDestX + 1 & 4095; + class178.directions[endY - 1][lowestCost] = 2; + class178.distances[endY - 1][lowestCost] = checkY; } - if(var30 < 127 && class178.__fi_q[var30 + 1][var31] == 0 && (var18[var19 + 1][var20] & 19136896) == 0) { - class178.__fi_l[var33] = var10 + 1; - class178.__fi_e[var33] = var11; - var33 = var33 + 1 & 4095; - class178.__fi_q[var30 + 1][var31] = 8; - class178.__fi_w[var30 + 1][var31] = var21; + if(endY < 127 && class178.directions[endY + 1][lowestCost] == 0 && (var18[approxDestSizeY + 1][checkX] & 19136896) == 0) { + class178.bufferX[approxDestX] = graphBaseY + 1; + class178.bufferY[approxDestX] = endX; + approxDestX = approxDestX + 1 & 4095; + class178.directions[endY + 1][lowestCost] = 8; + class178.distances[endY + 1][lowestCost] = checkY; } - if(var31 > 0 && class178.__fi_q[var30][var31 - 1] == 0 && (var18[var19][var20 - 1] & 19136770) == 0) { - class178.__fi_l[var33] = var10; - class178.__fi_e[var33] = var11 - 1; - var33 = var33 + 1 & 4095; - class178.__fi_q[var30][var31 - 1] = 1; - class178.__fi_w[var30][var31 - 1] = var21; + if(lowestCost > 0 && class178.directions[endY][lowestCost - 1] == 0 && (var18[approxDestSizeY][checkX - 1] & 19136770) == 0) { + class178.bufferX[approxDestX] = graphBaseY; + class178.bufferY[approxDestX] = endX - 1; + approxDestX = approxDestX + 1 & 4095; + class178.directions[endY][lowestCost - 1] = 1; + class178.distances[endY][lowestCost - 1] = checkY; } - if(var31 < 127 && class178.__fi_q[var30][var31 + 1] == 0 && (var18[var19][var20 + 1] & 19136800) == 0) { - class178.__fi_l[var33] = var10; - class178.__fi_e[var33] = var11 + 1; - var33 = var33 + 1 & 4095; - class178.__fi_q[var30][var31 + 1] = 4; - class178.__fi_w[var30][var31 + 1] = var21; + if(lowestCost < 127 && class178.directions[endY][lowestCost + 1] == 0 && (var18[approxDestSizeY][checkX + 1] & 19136800) == 0) { + class178.bufferX[approxDestX] = graphBaseY; + class178.bufferY[approxDestX] = endX + 1; + approxDestX = approxDestX + 1 & 4095; + class178.directions[endY][lowestCost + 1] = 4; + class178.distances[endY][lowestCost + 1] = checkY; } - if(var30 > 0 && var31 > 0 && class178.__fi_q[var30 - 1][var31 - 1] == 0 && (var18[var19 - 1][var20 - 1] & 19136782) == 0 && (var18[var19 - 1][var20] & 19136776) == 0 && (var18[var19][var20 - 1] & 19136770) == 0) { - class178.__fi_l[var33] = var10 - 1; - class178.__fi_e[var33] = var11 - 1; - var33 = var33 + 1 & 4095; - class178.__fi_q[var30 - 1][var31 - 1] = 3; - class178.__fi_w[var30 - 1][var31 - 1] = var21; + if(endY > 0 && lowestCost > 0 && class178.directions[endY - 1][lowestCost - 1] == 0 && (var18[approxDestSizeY - 1][checkX - 1] & 19136782) == 0 && (var18[approxDestSizeY - 1][checkX] & 19136776) == 0 && (var18[approxDestSizeY][checkX - 1] & 19136770) == 0) { + class178.bufferX[approxDestX] = graphBaseY - 1; + class178.bufferY[approxDestX] = endX - 1; + approxDestX = approxDestX + 1 & 4095; + class178.directions[endY - 1][lowestCost - 1] = 3; + class178.distances[endY - 1][lowestCost - 1] = checkY; } - if(var30 < 127 && var31 > 0 && class178.__fi_q[var30 + 1][var31 - 1] == 0 && (var18[var19 + 1][var20 - 1] & 19136899) == 0 && (var18[var19 + 1][var20] & 19136896) == 0 && (var18[var19][var20 - 1] & 19136770) == 0) { - class178.__fi_l[var33] = var10 + 1; - class178.__fi_e[var33] = var11 - 1; - var33 = var33 + 1 & 4095; - class178.__fi_q[var30 + 1][var31 - 1] = 9; - class178.__fi_w[var30 + 1][var31 - 1] = var21; + if(endY < 127 && lowestCost > 0 && class178.directions[endY + 1][lowestCost - 1] == 0 && (var18[approxDestSizeY + 1][checkX - 1] & 19136899) == 0 && (var18[approxDestSizeY + 1][checkX] & 19136896) == 0 && (var18[approxDestSizeY][checkX - 1] & 19136770) == 0) { + class178.bufferX[approxDestX] = graphBaseY + 1; + class178.bufferY[approxDestX] = endX - 1; + approxDestX = approxDestX + 1 & 4095; + class178.directions[endY + 1][lowestCost - 1] = 9; + class178.distances[endY + 1][lowestCost - 1] = checkY; } - if(var30 > 0 && var31 < 127 && class178.__fi_q[var30 - 1][var31 + 1] == 0 && (var18[var19 - 1][var20 + 1] & 19136824) == 0 && (var18[var19 - 1][var20] & 19136776) == 0 && (var18[var19][var20 + 1] & 19136800) == 0) { - class178.__fi_l[var33] = var10 - 1; - class178.__fi_e[var33] = var11 + 1; - var33 = var33 + 1 & 4095; - class178.__fi_q[var30 - 1][var31 + 1] = 6; - class178.__fi_w[var30 - 1][var31 + 1] = var21; + if(endY > 0 && lowestCost < 127 && class178.directions[endY - 1][lowestCost + 1] == 0 && (var18[approxDestSizeY - 1][checkX + 1] & 19136824) == 0 && (var18[approxDestSizeY - 1][checkX] & 19136776) == 0 && (var18[approxDestSizeY][checkX + 1] & 19136800) == 0) { + class178.bufferX[approxDestX] = graphBaseY - 1; + class178.bufferY[approxDestX] = endX + 1; + approxDestX = approxDestX + 1 & 4095; + class178.directions[endY - 1][lowestCost + 1] = 6; + class178.distances[endY - 1][lowestCost + 1] = checkY; } - if(var30 < 127 && var31 < 127 && class178.__fi_q[var30 + 1][var31 + 1] == 0 && (var18[var19 + 1][var20 + 1] & 19136992) == 0 && (var18[var19 + 1][var20] & 19136896) == 0 && (var18[var19][var20 + 1] & 19136800) == 0) { - class178.__fi_l[var33] = var10 + 1; - class178.__fi_e[var33] = var11 + 1; - var33 = var33 + 1 & 4095; - class178.__fi_q[var30 + 1][var31 + 1] = 12; - class178.__fi_w[var30 + 1][var31 + 1] = var21; + if(endY < 127 && lowestCost < 127 && class178.directions[endY + 1][lowestCost + 1] == 0 && (var18[approxDestSizeY + 1][checkX + 1] & 19136992) == 0 && (var18[approxDestSizeY + 1][checkX] & 19136896) == 0 && (var18[approxDestSizeY][checkX + 1] & 19136800) == 0) { + class178.bufferX[approxDestX] = graphBaseY + 1; + class178.bufferY[approxDestX] = endX + 1; + approxDestX = approxDestX + 1 & 4095; + class178.directions[endY + 1][lowestCost + 1] = 12; + class178.distances[endY + 1][lowestCost + 1] = checkY; } } - var28 = var29; - } else if(var2 == 2) { - var28 = WorldMapSection2.method593(var0, var1, var3, var4); + found = var29; // Vars are weird above here cause that's an inlined method + } else if(srcSize == 2) { + found = WorldMapSection2.method593(srcX, srcY, strategy, collisionMap); } else { - var28 = IndexStore.method3585(var0, var1, var2, var3, var4); + found = IndexStore.method3585(srcX, srcY, srcSize, strategy, collisionMap); } - var9 = var0 - 64; - var10 = var1 - 64; - var11 = WidgetGroupParent.__bx_o; - var30 = UrlRequester.__eo_u; - if(!var28) { - var31 = Integer.MAX_VALUE; - var14 = Integer.MAX_VALUE; - byte var32 = 10; - var33 = var3.field2120; - var17 = var3.field2121; - int var27 = var3.field2122; - var19 = var3.field2123; + graphBaseX = srcX - 64; + graphBaseY = srcY - 64; + endX = WidgetGroupParent.__bx_o; + endY = UrlRequester.__eo_u; + if(!found) { + lowestCost = Integer.MAX_VALUE; + lowestDistance = Integer.MAX_VALUE; + byte alternativeRouteRange = 10; + approxDestX = strategy.approxDestinationX; + approxDestY = strategy.approxDestinationY; + int approxDestSizeX = strategy.approxDestinationSizeX; + approxDestSizeY = strategy.approxDestinationSizeY; - for(var20 = var33 - var32; var20 <= var32 + var33; ++var20) { - for(var21 = var17 - var32; var21 <= var17 + var32; ++var21) { - int var22 = var20 - var9; - int var23 = var21 - var10; - if(var22 >= 0 && var23 >= 0 && var22 < 128 && var23 < 128 && class178.__fi_w[var22][var23] < 100) { - int var24 = 0; - if(var20 < var33) { - var24 = var33 - var20; - } else if(var20 > var27 + var33 - 1) { - var24 = var20 - (var27 + var33 - 1); + for(checkX = approxDestX - alternativeRouteRange; checkX <= alternativeRouteRange + approxDestX; ++checkX) { + for(checkY = approxDestY - alternativeRouteRange; checkY <= approxDestY + alternativeRouteRange; ++checkY) { + int graphX = checkX - graphBaseX; + int graphY = checkY - graphBaseY; + if(graphX >= 0 && graphY >= 0 && graphX < 128 && graphY < 128 && class178.distances[graphX][graphY] < 100) { + int deltaX = 0; + if(checkX < approxDestX) { + deltaX = approxDestX - checkX; + } else if(checkX > approxDestSizeX + approxDestX - 1) { + deltaX = checkX - (approxDestSizeX + approxDestX - 1); } - int var25 = 0; - if(var21 < var17) { - var25 = var17 - var21; - } else if(var21 > var19 + var17 - 1) { - var25 = var21 - (var19 + var17 - 1); + int deltaY = 0; + if(checkY < approxDestY) { + deltaY = approxDestY - checkY; + } else if(checkY > approxDestSizeY + approxDestY - 1) { + deltaY = checkY - (approxDestSizeY + approxDestY - 1); } - int var26 = var25 * var25 + var24 * var24; - if(var26 < var31 || var26 == var31 && class178.__fi_w[var22][var23] < var14) { - var31 = var26; - var14 = class178.__fi_w[var22][var23]; - var11 = var20; - var30 = var21; + int cost = deltaY * deltaY + deltaX * deltaX; + if(cost < lowestCost || cost == lowestCost && class178.distances[graphX][graphY] < lowestDistance) { + lowestCost = cost; + lowestDistance = class178.distances[graphX][graphY]; + endX = checkX; + endY = checkY; } } } } - if(var31 == Integer.MAX_VALUE) { + if(lowestCost == Integer.MAX_VALUE) { return -1; } } - if(var0 == var11 && var30 == var1) { + if(srcX == endX && endY == srcY) { return 0; - } else { + } else { // Inlined again after this I think var13 = 0; - class178.__fi_l[var13] = var11; - var31 = var13 + 1; - class178.__fi_e[var13] = var30; + class178.bufferX[var13] = endX; + lowestCost = var13 + 1; + class178.bufferY[var13] = endY; - for(var14 = var15 = class178.__fi_q[var11 - var9][var30 - var10]; var0 != var11 || var30 != var1; var14 = class178.__fi_q[var11 - var9][var30 - var10]) { - if(var14 != var15) { - var15 = var14; - class178.__fi_l[var31] = var11; - class178.__fi_e[var31++] = var30; + for(lowestDistance = var15 = class178.directions[endX - graphBaseX][endY - graphBaseY]; srcX != endX || endY != srcY; lowestDistance = class178.directions[endX - graphBaseX][endY - graphBaseY]) { + if(lowestDistance != var15) { + var15 = lowestDistance; + class178.bufferX[lowestCost] = endX; + class178.bufferY[lowestCost++] = endY; } - if((var14 & 2) != 0) { - ++var11; - } else if((var14 & 8) != 0) { - --var11; + if((lowestDistance & 2) != 0) { + ++endX; + } else if((lowestDistance & 8) != 0) { + --endX; } - if((var14 & 1) != 0) { - ++var30; - } else if((var14 & 4) != 0) { - --var30; + if((lowestDistance & 1) != 0) { + ++endY; + } else if((lowestDistance & 4) != 0) { + --endY; } } - var33 = 0; + approxDestX = 0; - while(var31-- > 0) { - var6[var33] = class178.__fi_l[var31]; - var7[var33++] = class178.__fi_e[var31]; - if(var33 >= var6.length) { + while(lowestCost-- > 0) { + bufferX[approxDestX] = class178.bufferX[lowestCost]; + bufferY[approxDestX++] = class178.bufferY[lowestCost]; + if(approxDestX >= bufferX.length) { break; } } - return var33; + return approxDestX; } } diff --git a/runescape-client/src/main/java/NpcDefinition.java b/runescape-client/src/main/java/NpcDefinition.java index 3a2e339a5b..244c978e2b 100644 --- a/runescape-client/src/main/java/NpcDefinition.java +++ b/runescape-client/src/main/java/NpcDefinition.java @@ -699,7 +699,7 @@ public class NpcDefinition extends DualNode { if(var1 == 0L) { var0 = 5; } else { - var0 = class72.method1778(var1, Login.Login_username); + var0 = LoginScreenAnimation.method1778(var1, Login.Login_username); } switch(var0) { diff --git a/runescape-client/src/main/java/OwnWorldComparator.java b/runescape-client/src/main/java/OwnWorldComparator.java index c5853cefcd..00cc8d8ca5 100644 --- a/runescape-client/src/main/java/OwnWorldComparator.java +++ b/runescape-client/src/main/java/OwnWorldComparator.java @@ -55,9 +55,9 @@ public class OwnWorldComparator implements Comparator { static int method1285(int var0, Script var1, boolean var2) { int var3; if(var0 == 5504) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - int var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + int var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; if(!Client.isCameraLocked) { Client.cameraPitchTarget = var3; Client.minimapOrientation = var4; @@ -65,13 +65,13 @@ public class OwnWorldComparator implements Comparator { return 1; } else if(var0 == 5505) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.cameraPitchTarget; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.cameraPitchTarget; return 1; } else if(var0 == 5506) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.minimapOrientation; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.minimapOrientation; return 1; } else if(var0 == 5530) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(var3 < 0) { var3 = 0; } @@ -79,7 +79,7 @@ public class OwnWorldComparator implements Comparator { Client.cameraFollowHeight = var3; return 1; } else if(var0 == 5531) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.cameraFollowHeight; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.cameraFollowHeight; return 1; } else { return 2; diff --git a/runescape-client/src/main/java/Player.java b/runescape-client/src/main/java/Player.java index 155afecb84..d242931c4b 100644 --- a/runescape-client/src/main/java/Player.java +++ b/runescape-client/src/main/java/Player.java @@ -328,7 +328,7 @@ public final class Player extends Actor { ) @Export("checkIsFriend") void checkIsFriend() { - this.isFriendTriBool = WorldMapArea.friendSystem.__t_161(this.username)?TriBool.TriBool_true:TriBool.TriBool_false; + this.isFriendTriBool = WorldMapArea.friendSystem.isFriendAndHasWorld(this.username)?TriBool.TriBool_true:TriBool.TriBool_false; } @ObfuscatedName("o") diff --git a/runescape-client/src/main/java/PlayerType.java b/runescape-client/src/main/java/PlayerType.java index 93f6790cab..2cf176aa29 100644 --- a/runescape-client/src/main/java/PlayerType.java +++ b/runescape-client/src/main/java/PlayerType.java @@ -87,7 +87,7 @@ public enum PlayerType implements Enumerated { signature = "(II)V", garbageValue = "300731074" ) - static void method4547(int var0) { + static void clearItemContainer(int var0) { ItemContainer var1 = (ItemContainer)ItemContainer.itemContainers.get((long)var0); if(var1 != null) { for(int var2 = 0; var2 < var1.ids.length; ++var2) { diff --git a/runescape-client/src/main/java/Rasterizer3D.java b/runescape-client/src/main/java/Rasterizer3D.java index bde438c83e..1bdd13aad5 100644 --- a/runescape-client/src/main/java/Rasterizer3D.java +++ b/runescape-client/src/main/java/Rasterizer3D.java @@ -3428,22 +3428,22 @@ public class Rasterizer3D extends Rasterizer2D { } @ObfuscatedName("p") - static final int method3005(int var0, int var1, int var2, int var3) { + static final int rot3(int var0, int var1, int var2, int var3) { return var0 * var2 - var3 * var1 >> 16; } @ObfuscatedName("v") - static final int method3006(int var0, int var1, int var2, int var3) { + static final int rot4(int var0, int var1, int var2, int var3) { return var3 * var0 + var2 * var1 >> 16; } @ObfuscatedName("ag") - static final int method3007(int var0, int var1, int var2, int var3) { + static final int rot1(int var0, int var1, int var2, int var3) { return var0 * var2 + var3 * var1 >> 16; } @ObfuscatedName("aq") - static final int method3008(int var0, int var1, int var2, int var3) { + static final int rot2(int var0, int var1, int var2, int var3) { return var2 * var1 - var3 * var0 >> 16; } } diff --git a/runescape-client/src/main/java/class179.java b/runescape-client/src/main/java/RouteStrategy.java similarity index 87% rename from runescape-client/src/main/java/class179.java rename to runescape-client/src/main/java/RouteStrategy.java index 5b0bec30cc..7e8bfe3ebd 100644 --- a/runescape-client/src/main/java/class179.java +++ b/runescape-client/src/main/java/RouteStrategy.java @@ -4,7 +4,8 @@ import net.runelite.mapping.ObfuscatedName; import net.runelite.mapping.ObfuscatedSignature; @ObfuscatedName("fe") -public abstract class class179 { +public abstract class RouteStrategy +{ @ObfuscatedName("l") @ObfuscatedGetter( intValue = -1237576843 @@ -18,22 +19,22 @@ public abstract class class179 { @ObfuscatedGetter( intValue = 123677543 ) - public int field2120; + public int approxDestinationX; @ObfuscatedName("f") @ObfuscatedGetter( intValue = -2126454535 ) - public int field2121; + public int approxDestinationY; @ObfuscatedName("q") @ObfuscatedGetter( intValue = -1566880917 ) - public int field2122; + public int approxDestinationSizeX; @ObfuscatedName("w") @ObfuscatedGetter( intValue = -2126101601 ) - public int field2123; + public int approxDestinationSizeY; @ObfuscatedName("m") @ObfuscatedSignature( @@ -69,7 +70,7 @@ public abstract class class179 { signature = "(Lir;II)Z", garbageValue = "-602741260" ) - static boolean method3643(AbstractIndexCache var0, int var1) { + static boolean loadSpriteFlat(AbstractIndexCache var0, int var1) { byte[] var2 = var0.takeRecordFlat(var1); if(var2 == null) { return false; diff --git a/runescape-client/src/main/java/Scene.java b/runescape-client/src/main/java/Scene.java index 2f474a0fc0..c4158ec348 100644 --- a/runescape-client/src/main/java/Scene.java +++ b/runescape-client/src/main/java/Scene.java @@ -85,8 +85,8 @@ public class Scene { @Export("__em_ab") static boolean __em_ab; @ObfuscatedName("ad") - @Export("__em_ad") - static int __em_ad; + @Export("Scene_planesCount") + static int Scene_planesCount; @ObfuscatedName("ap") @Export("Scene_planeOccluderCounts") static int[] Scene_planeOccluderCounts; @@ -208,9 +208,9 @@ public class Scene { Scene_selectedX = -1; Scene_selectedY = -1; __em_ab = false; - __em_ad = 4; - Scene_planeOccluderCounts = new int[__em_ad]; - Scene_planeOccluders = new Occluder[__em_ad][500]; + Scene_planesCount = 4; + Scene_planeOccluderCounts = new int[Scene_planesCount]; + Scene_planeOccluders = new Occluder[Scene_planesCount][500]; Scene_currentOccludersCount = 0; Scene_currentOccluders = new Occluder[500]; Scene_tilesDeque = new NodeDeque(); @@ -252,7 +252,7 @@ public class Scene { } } - for(var1 = 0; var1 < __em_ad; ++var1) { + for(var1 = 0; var1 < Scene_planesCount; ++var1) { for(var2 = 0; var2 < Scene_planeOccluderCounts[var1]; ++var2) { Scene_planeOccluders[var1][var2] = null; } diff --git a/runescape-client/src/main/java/ScriptEvent.java b/runescape-client/src/main/java/ScriptEvent.java index 664404b3ce..2ba2514916 100644 --- a/runescape-client/src/main/java/ScriptEvent.java +++ b/runescape-client/src/main/java/ScriptEvent.java @@ -115,49 +115,49 @@ public class ScriptEvent extends Node { static int method1185(int var0, Script var1, boolean var2) { Widget var3 = var2?WorldMapIcon1.__t_i:class12.__n_n; if(var0 == 1600) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.scrollX; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.scrollX; return 1; } else if(var0 == 1601) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.scrollY; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.scrollY; return 1; } else if(var0 == 1602) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3.text; return 1; } else if(var0 == 1603) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.scrollWidth; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.scrollWidth; return 1; } else if(var0 == 1604) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.scrollHeight; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.scrollHeight; return 1; } else if(var0 == 1605) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.modelZoom; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.modelZoom; return 1; } else if(var0 == 1606) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.modelAngleX; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.modelAngleX; return 1; } else if(var0 == 1607) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.modelAngleZ; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.modelAngleZ; return 1; } else if(var0 == 1608) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.modelAngleY; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.modelAngleY; return 1; } else if(var0 == 1609) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.transparency; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.transparency; return 1; } else if(var0 == 1610) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.__af; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.__af; return 1; } else if(var0 == 1611) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.color; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.color; return 1; } else if(var0 == 1612) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.color2; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.color2; return 1; } else if(var0 == 1613) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.rectangleMode.rsOrdinal(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.rectangleMode.rsOrdinal(); return 1; } else if(var0 == 1614) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.__bv?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.__bv?1:0; return 1; } else { return 2; @@ -171,44 +171,44 @@ public class ScriptEvent extends Node { ) static int method1187(int var0, Script var1, boolean var2) { if(var0 == 3300) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.cycle; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.cycle; return 1; } else { int var3; int var4; if(var0 == 3301) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class83.method2027(var3, var4); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class83.method2027(var3, var4); return 1; } else if(var0 == 3302) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = WorldMapLabel.method442(var3, var4); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = WorldMapLabel.method442(var3, var4); return 1; } else if(var0 == 3303) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class1.method18(var3, var4); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class1.method18(var3, var4); return 1; } else if(var0 == 3304) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class231.method4523(var3).size; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class231.method4523(var3).size; return 1; } else if(var0 == 3305) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.currentLevels[var3]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.currentLevels[var3]; return 1; } else if(var0 == 3306) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.levels[var3]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.levels[var3]; return 1; } else if(var0 == 3307) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.experience[var3]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.experience[var3]; return 1; } else { int var5; @@ -216,82 +216,82 @@ public class ScriptEvent extends Node { var3 = SoundSystem.plane; var4 = (Canvas.localPlayer.x >> 7) + class50.baseX; var5 = (Canvas.localPlayer.y >> 7) + GraphicsObject.baseY; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (var4 << 14) + var5 + (var3 << 28); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (var4 << 14) + var5 + (var3 << 28); return 1; } else if(var0 == 3309) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 >> 14 & 16383; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 >> 14 & 16383; return 1; } else if(var0 == 3310) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 >> 28; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 >> 28; return 1; } else if(var0 == 3311) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 & 16383; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 & 16383; return 1; } else if(var0 == 3312) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.isMembersWorld?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.isMembersWorld?1:0; return 1; } else if(var0 == 3313) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] + 32768; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class83.method2027(var3, var4); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] + 32768; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class83.method2027(var3, var4); return 1; } else if(var0 == 3314) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] + 32768; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = WorldMapLabel.method442(var3, var4); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] + 32768; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = WorldMapLabel.method442(var3, var4); return 1; } else if(var0 == 3315) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] + 32768; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class1.method18(var3, var4); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] + 32768; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class1.method18(var3, var4); return 1; } else if(var0 == 3316) { if(Client.rights >= 2) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.rights; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.rights; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 3317) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.rebootTimer; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.rebootTimer; return 1; } else if(var0 == 3318) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.worldId; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.worldId; return 1; } else if(var0 == 3321) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.runEnergy; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.runEnergy; return 1; } else if(var0 == 3322) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.weight; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.weight; return 1; } else if(var0 == 3323) { if(Client.__client_mn) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 3324) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.worldProperties; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.worldProperties; return 1; } else if(var0 == 3325) { - class179.Interpreter_intStackSize -= 4; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - var5 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; - int var6 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 3]; + RouteStrategy.Interpreter_intStackSize -= 4; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; + int var6 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 3]; var3 += var4 << 14; var3 += var5 << 28; var3 += var6; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3; return 1; } else { return 2; diff --git a/runescape-client/src/main/java/SecureRandomCallable.java b/runescape-client/src/main/java/SecureRandomCallable.java index f81565e721..fcfe23f2ec 100644 --- a/runescape-client/src/main/java/SecureRandomCallable.java +++ b/runescape-client/src/main/java/SecureRandomCallable.java @@ -23,7 +23,7 @@ public class SecureRandomCallable implements Callable { garbageValue = "64" ) static class27 method1145(byte[] var0) { - return var0 == null?new class27():new class27(class27.method438(var0).pixels); + return var0 == null?new class27():new class27(class27.convertJpgToSprite(var0).pixels); } @ObfuscatedName("m") @@ -68,7 +68,7 @@ public class SecureRandomCallable implements Callable { int var5; int var6; for(var5 = 0; var5 < Client.menuOptionsCount; ++var5) { - if(WorldMapManager.method672(Client.menuOpcodes[var5])) { + if(WorldMapManager.isWidgetMenuOpcode(Client.menuOpcodes[var5])) { if(var5 < Client.menuOptionsCount - 1) { for(var6 = var5; var6 < Client.menuOptionsCount - 1; ++var6) { Client.menuActions[var6] = Client.menuActions[var6 + 1]; diff --git a/runescape-client/src/main/java/SecureRandomFuture.java b/runescape-client/src/main/java/SecureRandomFuture.java index 3f526b4e34..d9cf7aab24 100644 --- a/runescape-client/src/main/java/SecureRandomFuture.java +++ b/runescape-client/src/main/java/SecureRandomFuture.java @@ -15,8 +15,8 @@ public class SecureRandomFuture { @ObfuscatedSignature( signature = "Llq;" ) - @Export("__cn_bu") - static IndexedSprite __cn_bu; + @Export("worldSelectLeftSprite") + static IndexedSprite worldSelectLeftSprite; @ObfuscatedName("dy") @ObfuscatedSignature( signature = "Lit;" diff --git a/runescape-client/src/main/java/ServerPacket.java b/runescape-client/src/main/java/ServerPacket.java index ec2fe9dc64..27740a02bf 100644 --- a/runescape-client/src/main/java/ServerPacket.java +++ b/runescape-client/src/main/java/ServerPacket.java @@ -634,7 +634,7 @@ public class ServerPacket { signature = "(I)Llq;", garbageValue = "2048918805" ) - static IndexedSprite method3663() { + static IndexedSprite createIndexedSprite() { IndexedSprite var0 = new IndexedSprite(); var0.width = class328.indexedSpriteWidth; var0.height = class328.indexedSpriteHeight; diff --git a/runescape-client/src/main/java/Sprite.java b/runescape-client/src/main/java/Sprite.java index a416d44c18..5a94baf1d4 100644 --- a/runescape-client/src/main/java/Sprite.java +++ b/runescape-client/src/main/java/Sprite.java @@ -382,8 +382,8 @@ public final class Sprite extends Rasterizer2D { } @ObfuscatedName("t") - @Export("__t_507") - public void __t_507(int var1, int var2, int var3, int var4) { + @Export("drawAtTransOverlay") + public void drawAtTransOverlay(int var1, int var2, int var3, int var4) { if(var3 == 256) { this.drawAt2(var1, var2); } else { diff --git a/runescape-client/src/main/java/SpriteIds.java b/runescape-client/src/main/java/SpriteIds.java index e621c81af8..2fba5062e2 100644 --- a/runescape-client/src/main/java/SpriteIds.java +++ b/runescape-client/src/main/java/SpriteIds.java @@ -130,7 +130,7 @@ public class SpriteIds { garbageValue = "195396240" ) public static Font method5823(AbstractIndexCache var0, AbstractIndexCache var1, int var2, int var3) { - if(!SpriteMask.method4392(var0, var2, var3)) { + if(!SpriteMask.loadSprite(var0, var2, var3)) { return null; } else { byte[] var5 = var1.takeRecord(var2, var3); diff --git a/runescape-client/src/main/java/SpriteMask.java b/runescape-client/src/main/java/SpriteMask.java index 856c8ea133..f6e81e2c1b 100644 --- a/runescape-client/src/main/java/SpriteMask.java +++ b/runescape-client/src/main/java/SpriteMask.java @@ -95,7 +95,7 @@ public class SpriteMask extends DualNode { signature = "(Lir;IIB)Z", garbageValue = "1" ) - public static boolean method4392(AbstractIndexCache var0, int var1, int var2) { + public static boolean loadSprite(AbstractIndexCache var0, int var1, int var2) { byte[] var3 = var0.takeRecord(var1, var2); if(var3 == null) { return false; diff --git a/runescape-client/src/main/java/StructDefinition.java b/runescape-client/src/main/java/StructDefinition.java index 57bbe957ab..21848a13cd 100644 --- a/runescape-client/src/main/java/StructDefinition.java +++ b/runescape-client/src/main/java/StructDefinition.java @@ -111,15 +111,15 @@ public class StructDefinition extends DualNode { Widget var3; if(var0 >= 2000) { var0 -= 1000; - var4 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var3 = Huffman.getWidget(var4); } else { var3 = var2?WorldMapIcon1.__t_i:class12.__n_n; } if(var0 == 1100) { - class179.Interpreter_intStackSize -= 2; - var3.scrollX = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; + RouteStrategy.Interpreter_intStackSize -= 2; + var3.scrollX = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; if(var3.scrollX > var3.scrollWidth - var3.width) { var3.scrollX = var3.scrollWidth - var3.width; } @@ -128,7 +128,7 @@ public class StructDefinition extends DualNode { var3.scrollX = 0; } - var3.scrollY = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + var3.scrollY = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; if(var3.scrollY > var3.scrollHeight - var3.height) { var3.scrollY = var3.scrollHeight - var3.height; } @@ -140,52 +140,52 @@ public class StructDefinition extends DualNode { class22.method295(var3); return 1; } else if(var0 == 1101) { - var3.color = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.color = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1102) { - var3.fill = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var3.fill = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; class22.method295(var3); return 1; } else if(var0 == 1103) { - var3.transparency = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.transparency = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1104) { - var3.lineWid = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.lineWid = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1105) { - var3.spriteId2 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.spriteId2 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1106) { - var3.spriteAngle = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.spriteAngle = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1107) { - var3.spriteTiling = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var3.spriteTiling = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; class22.method295(var3); return 1; } else if(var0 == 1108) { var3.modelType = 1; - var3.modelId = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.modelId = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1109) { - class179.Interpreter_intStackSize -= 6; - var3.modelOffsetX = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var3.modelOffsetY = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - var3.modelAngleX = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; - var3.modelAngleY = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 3]; - var3.modelAngleZ = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 4]; - var3.modelZoom = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 5]; + RouteStrategy.Interpreter_intStackSize -= 6; + var3.modelOffsetX = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var3.modelOffsetY = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + var3.modelAngleX = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; + var3.modelAngleY = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 3]; + var3.modelAngleZ = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 4]; + var3.modelZoom = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 5]; class22.method295(var3); return 1; } else { int var8; if(var0 == 1110) { - var8 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var8 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(var8 != var3.sequenceId) { var3.sequenceId = var8; var3.modelFrame = 0; @@ -195,7 +195,7 @@ public class StructDefinition extends DualNode { return 1; } else if(var0 == 1111) { - var3.modelOrthog = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var3.modelOrthog = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; class22.method295(var3); return 1; } else if(var0 == 1112) { @@ -207,40 +207,40 @@ public class StructDefinition extends DualNode { return 1; } else if(var0 == 1113) { - var3.fontId = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.fontId = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1114) { - class179.Interpreter_intStackSize -= 3; - var3.textXAlignment = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var3.textYAlignment = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - var3.textLineHeight = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; + RouteStrategy.Interpreter_intStackSize -= 3; + var3.textXAlignment = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var3.textYAlignment = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + var3.textLineHeight = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; class22.method295(var3); return 1; } else if(var0 == 1115) { - var3.textShadowed = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var3.textShadowed = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; class22.method295(var3); return 1; } else if(var0 == 1116) { - var3.outline = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.outline = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1117) { - var3.spriteShadow = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.spriteShadow = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1118) { - var3.spriteFlipV = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var3.spriteFlipV = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; class22.method295(var3); return 1; } else if(var0 == 1119) { - var3.spriteFlipH = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var3.spriteFlipH = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; class22.method295(var3); return 1; } else if(var0 == 1120) { - class179.Interpreter_intStackSize -= 2; - var3.scrollWidth = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var3.scrollHeight = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var3.scrollWidth = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var3.scrollHeight = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; class22.method295(var3); if(var4 != -1 && var3.type == 0) { class39.revalidateWidgetScroll(Widget.widgets[var4 >> 16], var3, false); @@ -253,19 +253,19 @@ public class StructDefinition extends DualNode { class22.method295(var3); return 1; } else if(var0 == 1122) { - var3.spriteId = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.spriteId = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1123) { - var3.color2 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.color2 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1124) { - var3.__af = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.__af = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class22.method295(var3); return 1; } else if(var0 == 1125) { - var8 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var8 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; RectangleMode var6 = (RectangleMode)ScriptFrame.findEnumerated(class311.method5822(), var8); if(var6 != null) { var3.rectangleMode = var6; @@ -276,11 +276,11 @@ public class StructDefinition extends DualNode { } else { boolean var5; if(var0 == 1126) { - var5 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var5 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; var3.__ba = var5; return 1; } else if(var0 == 1127) { - var5 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var5 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; var3.__bv = var5; return 1; } else { diff --git a/runescape-client/src/main/java/TextureProvider.java b/runescape-client/src/main/java/TextureProvider.java index 07bb12eef5..ace01a418a 100644 --- a/runescape-client/src/main/java/TextureProvider.java +++ b/runescape-client/src/main/java/TextureProvider.java @@ -321,135 +321,135 @@ public class TextureProvider implements TextureLoader { int var3; int var4; if(var0 == 4000) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 + var4; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 + var4; return 1; } else if(var0 == 4001) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 - var4; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 - var4; return 1; } else if(var0 == 4002) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var4 * var3; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var4 * var3; return 1; } else if(var0 == 4003) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 / var4; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 / var4; return 1; } else if(var0 == 4004) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (int)(Math.random() * (double)var3); + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (int)(Math.random() * (double)var3); return 1; } else if(var0 == 4005) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (int)(Math.random() * (double)(var3 + 1)); + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (int)(Math.random() * (double)(var3 + 1)); return 1; } else if(var0 == 4006) { - class179.Interpreter_intStackSize -= 5; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - int var5 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; - int var6 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 3]; - int var7 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 4]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 + (var7 - var5) * (var4 - var3) / (var6 - var5); + RouteStrategy.Interpreter_intStackSize -= 5; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + int var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; + int var6 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 3]; + int var7 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 4]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 + (var7 - var5) * (var4 - var3) / (var6 - var5); return 1; } else if(var0 == 4007) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 + var3 * var4 / 100; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 + var3 * var4 / 100; return 1; } else if(var0 == 4008) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 | 1 << var4; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 | 1 << var4; return 1; } else if(var0 == 4009) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 & -1 - (1 << var4); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 & -1 - (1 << var4); return 1; } else if(var0 == 4010) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (var3 & 1 << var4) != 0?1:0; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (var3 & 1 << var4) != 0?1:0; return 1; } else if(var0 == 4011) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 % var4; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 % var4; return 1; } else if(var0 == 4012) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; if(var3 == 0) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (int)Math.pow((double)var3, (double)var4); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (int)Math.pow((double)var3, (double)var4); } return 1; } else if(var0 == 4013) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; if(var3 == 0) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; return 1; } else { switch(var4) { case 0: - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Integer.MAX_VALUE; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Integer.MAX_VALUE; break; case 1: - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3; break; case 2: - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (int)Math.sqrt((double)var3); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (int)Math.sqrt((double)var3); break; case 3: - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (int)Math.cbrt((double)var3); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (int)Math.cbrt((double)var3); break; case 4: - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (int)Math.sqrt(Math.sqrt((double)var3)); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (int)Math.sqrt(Math.sqrt((double)var3)); break; default: - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (int)Math.pow((double)var3, 1.0D / (double)var4); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (int)Math.pow((double)var3, 1.0D / (double)var4); } return 1; } } else if(var0 == 4014) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 & var4; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 & var4; return 1; } else if(var0 == 4015) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3 | var4; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3 | var4; return 1; } else if(var0 == 4018) { - class179.Interpreter_intStackSize -= 3; - long var9 = (long)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - long var11 = (long)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - long var13 = (long)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (int)(var13 * var9 / var11); + RouteStrategy.Interpreter_intStackSize -= 3; + long var9 = (long)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + long var11 = (long)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + long var13 = (long)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (int)(var13 * var9 / var11); return 1; } else { return 2; diff --git a/runescape-client/src/main/java/Tile.java b/runescape-client/src/main/java/Tile.java index f4bff62ad3..267f110068 100644 --- a/runescape-client/src/main/java/Tile.java +++ b/runescape-client/src/main/java/Tile.java @@ -199,14 +199,14 @@ public final class Tile extends Node { } if(var0.isFollower && Client.followerOpsLowPriority) { - Tiles.method1106("Examine", BufferedFile.colorStartTag(16776960) + var4, 1003, var1, var2, var3); + Tiles.insertMenuItemNoShift("Examine", BufferedFile.colorStartTag(16776960) + var4, 1003, var1, var2, var3); } if(Client.isItemSelected == 1) { - Tiles.method1106("Use", Client.selectedItemName + " " + "->" + " " + BufferedFile.colorStartTag(16776960) + var4, 7, var1, var2, var3); + Tiles.insertMenuItemNoShift("Use", Client.selectedItemName + " " + "->" + " " + BufferedFile.colorStartTag(16776960) + var4, 7, var1, var2, var3); } else if(Client.isSpellSelected) { if((FloorDecoration.selectedSpellFlags & 2) == 2) { - Tiles.method1106(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + BufferedFile.colorStartTag(16776960) + var4, 8, var1, var2, var3); + Tiles.insertMenuItemNoShift(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + BufferedFile.colorStartTag(16776960) + var4, 8, var1, var2, var3); } } else { int var10 = var0.isFollower && Client.followerOpsLowPriority?2000:0; @@ -235,7 +235,7 @@ public final class Tile extends Node { var8 = var10 + 13; } - Tiles.method1106(var11[var7], BufferedFile.colorStartTag(16776960) + var4, var8, var1, var2, var3); + Tiles.insertMenuItemNoShift(var11[var7], BufferedFile.colorStartTag(16776960) + var4, var8, var1, var2, var3); } } } @@ -270,14 +270,14 @@ public final class Tile extends Node { var8 = var12 + 13; } - Tiles.method1106(var11[var7], BufferedFile.colorStartTag(16776960) + var4, var8, var1, var2, var3); + Tiles.insertMenuItemNoShift(var11[var7], BufferedFile.colorStartTag(16776960) + var4, var8, var1, var2, var3); } } } } if(!var0.isFollower || !Client.followerOpsLowPriority) { - Tiles.method1106("Examine", BufferedFile.colorStartTag(16776960) + var4, 1003, var1, var2, var3); + Tiles.insertMenuItemNoShift("Examine", BufferedFile.colorStartTag(16776960) + var4, 1003, var1, var2, var3); } } diff --git a/runescape-client/src/main/java/Tiles.java b/runescape-client/src/main/java/Tiles.java index cd80b832f6..4800cf2d76 100644 --- a/runescape-client/src/main/java/Tiles.java +++ b/runescape-client/src/main/java/Tiles.java @@ -93,7 +93,7 @@ public final class Tiles { signature = "(Ljava/lang/String;Ljava/lang/String;IIIII)V", garbageValue = "-1525245246" ) - public static final void method1106(String var0, String var1, int var2, int var3, int var4, int var5) { + public static final void insertMenuItemNoShift(String var0, String var1, int var2, int var3, int var4, int var5) { class16.insertMenuItem(var0, var1, var2, var3, var4, var5, false); } } diff --git a/runescape-client/src/main/java/TotalQuantityComparator.java b/runescape-client/src/main/java/TotalQuantityComparator.java index 5043399310..2d67699986 100644 --- a/runescape-client/src/main/java/TotalQuantityComparator.java +++ b/runescape-client/src/main/java/TotalQuantityComparator.java @@ -164,10 +164,10 @@ final class TotalQuantityComparator implements Comparator { int var10; if(Client.isItemSelected == 1) { - Tiles.method1106("Use", Client.selectedItemName + " " + "->" + " " + BufferedFile.colorStartTag(16777215) + var4, 14, var1, var2, var3); + Tiles.insertMenuItemNoShift("Use", Client.selectedItemName + " " + "->" + " " + BufferedFile.colorStartTag(16777215) + var4, 14, var1, var2, var3); } else if(Client.isSpellSelected) { if((FloorDecoration.selectedSpellFlags & 8) == 8) { - Tiles.method1106(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + BufferedFile.colorStartTag(16777215) + var4, 15, var1, var2, var3); + Tiles.insertMenuItemNoShift(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + BufferedFile.colorStartTag(16777215) + var4, 15, var1, var2, var3); } } else { for(var10 = 7; var10 >= 0; --var10) { @@ -195,7 +195,7 @@ final class TotalQuantityComparator implements Comparator { boolean var12 = false; var7 = Client.playerMenuOpcodes[var10] + var11; - Tiles.method1106(Client.playerMenuActions[var10], BufferedFile.colorStartTag(16777215) + var4, var7, var1, var2, var3); + Tiles.insertMenuItemNoShift(Client.playerMenuActions[var10], BufferedFile.colorStartTag(16777215) + var4, var7, var1, var2, var3); } } } diff --git a/runescape-client/src/main/java/UrlRequest.java b/runescape-client/src/main/java/UrlRequest.java index 9244a34c4f..c911d6c9be 100644 --- a/runescape-client/src/main/java/UrlRequest.java +++ b/runescape-client/src/main/java/UrlRequest.java @@ -11,8 +11,8 @@ public class UrlRequest { @ObfuscatedSignature( signature = "[Llq;" ) - @Export("__ey_bx") - static IndexedSprite[] __ey_bx; + @Export("worldSelectStars") + static IndexedSprite[] worldSelectStars; @ObfuscatedName("m") @Export("url") final URL url; diff --git a/runescape-client/src/main/java/UserComparator4.java b/runescape-client/src/main/java/UserComparator4.java index 7384424adb..54977070b0 100644 --- a/runescape-client/src/main/java/UserComparator4.java +++ b/runescape-client/src/main/java/UserComparator4.java @@ -60,32 +60,32 @@ public class UserComparator4 implements Comparator { ) static int method3335(int var0, Script var1, boolean var2) { if(var0 == 5306) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = SpotAnimationDefinition.method4822(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = SpotAnimationDefinition.method4822(); return 1; } else { int var3; if(var0 == 5307) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(var3 == 1 || var3 == 2) { GroundItem.method2095(var3); } return 1; } else if(var0 == 5308) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ReflectionCheck.clientPreferences.windowMode; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ReflectionCheck.clientPreferences.windowMode; return 1; } else if(var0 != 5309) { if(var0 == 5310) { - --class179.Interpreter_intStackSize; + --RouteStrategy.Interpreter_intStackSize; return 1; } else { return 2; } } else { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(var3 == 1 || var3 == 2) { ReflectionCheck.clientPreferences.windowMode = var3; - WorldMapSection0.method247(); + WorldMapSection0.savePreferences(); } return 1; diff --git a/runescape-client/src/main/java/UserComparator9.java b/runescape-client/src/main/java/UserComparator9.java index 561e9e45aa..dc1f5654ff 100644 --- a/runescape-client/src/main/java/UserComparator9.java +++ b/runescape-client/src/main/java/UserComparator9.java @@ -62,7 +62,7 @@ public class UserComparator9 extends AbstractUserComparator { signature = "(I)[Lln;", garbageValue = "-1724028611" ) - public static Sprite[] method3344() { + public static Sprite[] createSpriteArray() { Sprite[] var0 = new Sprite[class328.indexedSpriteCount]; for(int var1 = 0; var1 < class328.indexedSpriteCount; ++var1) { diff --git a/runescape-client/src/main/java/Username.java b/runescape-client/src/main/java/Username.java index 190036bd6c..30871f2254 100644 --- a/runescape-client/src/main/java/Username.java +++ b/runescape-client/src/main/java/Username.java @@ -54,9 +54,9 @@ public class Username implements Comparable { return this.cleanName == null?(var1.cleanName == null?0:1):(var1.cleanName == null?-1:this.cleanName.compareTo(var1.cleanName)); } - @Export("__equals_466") + @Export("equals") @ObfuscatedName("equals") - public boolean __equals_466(Object var1) { + public boolean equals(Object var1) { if(var1 instanceof Username) { Username var2 = (Username)var1; if (this.cleanName == null) diff --git a/runescape-client/src/main/java/VarcInt.java b/runescape-client/src/main/java/VarcInt.java index aa107f00f7..14b5f1d557 100644 --- a/runescape-client/src/main/java/VarcInt.java +++ b/runescape-client/src/main/java/VarcInt.java @@ -17,14 +17,14 @@ public class VarcInt extends DualNode { @ObfuscatedSignature( signature = "Ler;" ) - @Export("__iw_f") - static EvictingDualNodeHashTable __iw_f; + @Export("cachedVarcInts") + static EvictingDualNodeHashTable cachedVarcInts; @ObfuscatedName("q") @Export("persist") public boolean persist; static { - __iw_f = new EvictingDualNodeHashTable(64); + cachedVarcInts = new EvictingDualNodeHashTable(64); } VarcInt() { @@ -76,7 +76,7 @@ public class VarcInt extends DualNode { signature = "(CI)Z", garbageValue = "1367119425" ) - public static boolean method4807(char var0) { + public static boolean isAlphaNumeric(char var0) { return var0 >= '0' && var0 <= '9' || var0 >= 'A' && var0 <= 'Z' || var0 >= 'a' && var0 <= 'z'; } } diff --git a/runescape-client/src/main/java/Varcs.java b/runescape-client/src/main/java/Varcs.java index c9a3e7e62e..8efa66c2e2 100644 --- a/runescape-client/src/main/java/Varcs.java +++ b/runescape-client/src/main/java/Varcs.java @@ -39,7 +39,7 @@ public class Varcs { int var2; for(var2 = 0; var2 < var1; ++var2) { - VarcInt var3 = AbstractByteArrayCopier.method4021(var2); + VarcInt var3 = AbstractByteArrayCopier.getVarcInt(var2); this.intsPersistence[var2] = var3.persist; } @@ -219,7 +219,7 @@ public class Varcs { ++var12; } - var32.writeByte(var9.field17); + var32.writeByte(var9.id); Class var34 = var8.getClass(); class3[] var15 = class3.method34(); int var16 = 0; diff --git a/runescape-client/src/main/java/Varps.java b/runescape-client/src/main/java/Varps.java index 44e172eeb8..9e064f5004 100644 --- a/runescape-client/src/main/java/Varps.java +++ b/runescape-client/src/main/java/Varps.java @@ -20,8 +20,8 @@ public class Varps { @ObfuscatedGetter( intValue = 120772859 ) - @Export("__hv_h") - static int __hv_h; + @Export("loginBoxCenter") + static int loginBoxCenter; static { Varps_masks = new int[32]; diff --git a/runescape-client/src/main/java/VertexNormal.java b/runescape-client/src/main/java/VertexNormal.java index 96659bd75e..bcd9172342 100644 --- a/runescape-client/src/main/java/VertexNormal.java +++ b/runescape-client/src/main/java/VertexNormal.java @@ -67,10 +67,10 @@ public class VertexNormal { } else if(var0.length == 30000 && ByteArrayPool.ByteArrayPool_largeCount < 50) { ByteArrayPool.ByteArrayPool_large[++ByteArrayPool.ByteArrayPool_largeCount - 1] = var0; } else { - if(class179.__fe_e != null) { + if(RouteStrategy.__fe_e != null) { for(int var1 = 0; var1 < ByteArrayPool.__gi_g.length; ++var1) { - if(var0.length == ByteArrayPool.__gi_g[var1] && WorldMapSection2.__ah_l[var1] < class179.__fe_e[var1].length) { - class179.__fe_e[var1][WorldMapSection2.__ah_l[var1]++] = var0; + if(var0.length == ByteArrayPool.__gi_g[var1] && WorldMapSection2.__ah_l[var1] < RouteStrategy.__fe_e[var1].length) { + RouteStrategy.__fe_e[var1][WorldMapSection2.__ah_l[var1]++] = var0; return; } } diff --git a/runescape-client/src/main/java/ViewportMouse.java b/runescape-client/src/main/java/ViewportMouse.java index 5bd207bddf..67bde74f63 100644 --- a/runescape-client/src/main/java/ViewportMouse.java +++ b/runescape-client/src/main/java/ViewportMouse.java @@ -84,24 +84,24 @@ public class ViewportMouse { garbageValue = "2128573585" ) static int method2983(int var0, Script var1, boolean var2) { - Widget var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + Widget var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); if(var0 == 2500) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.x; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.x; return 1; } else if(var0 == 2501) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.y; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.y; return 1; } else if(var0 == 2502) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.width; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.width; return 1; } else if(var0 == 2503) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.height; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.height; return 1; } else if(var0 == 2504) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.isHidden?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.isHidden?1:0; return 1; } else if(var0 == 2505) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.parentId; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.parentId; return 1; } else { return 2; diff --git a/runescape-client/src/main/java/World.java b/runescape-client/src/main/java/World.java index 9035ee1dac..f34c1ef220 100644 --- a/runescape-client/src/main/java/World.java +++ b/runescape-client/src/main/java/World.java @@ -20,11 +20,11 @@ public class World { @Export("__bt_g") static int __bt_g; @ObfuscatedName("l") - @Export("__bt_l") - static int[] __bt_l; + @Export("sortOption2") + static int[] sortOption2; @ObfuscatedName("e") - @Export("__bt_e") - static int[] __bt_e; + @Export("sortOption1") + static int[] sortOption1; @ObfuscatedName("d") @ObfuscatedGetter( intValue = -144265493 @@ -65,8 +65,8 @@ public class World { static { worldsCount = 0; __bt_g = 0; - __bt_l = new int[]{1, 1, 1, 1}; - __bt_e = new int[]{0, 1, 2, 3}; + sortOption2 = new int[]{1, 1, 1, 1}; + sortOption1 = new int[]{0, 1, 2, 3}; } @ObfuscatedName("e") @@ -74,8 +74,8 @@ public class World { signature = "(I)Z", garbageValue = "-1059414592" ) - @Export("__e_144") - boolean __e_144() { + @Export("isMembersOnly") + boolean isMembersOnly() { return (1 & this.properties) != 0; } @@ -94,8 +94,8 @@ public class World { signature = "(I)Z", garbageValue = "-354931924" ) - @Export("__d_146") - boolean __d_146() { + @Export("isPvp") + boolean isPvp() { return (4 & this.properties) != 0; } @@ -114,9 +114,9 @@ public class World { signature = "(B)Z", garbageValue = "-1" ) - @Export("__z_148") - boolean __z_148() { - return (536870912 & this.properties) != 0; + @Export("isDeadman") + boolean isDeadman() { + return (0x20000000 & this.properties) != 0; // 1 << 29 } @ObfuscatedName("j") @@ -124,9 +124,9 @@ public class World { signature = "(I)Z", garbageValue = "2033779841" ) - @Export("__j_149") - boolean __j_149() { - return (33554432 & this.properties) != 0; + @Export("isBeta") + boolean isBeta() { + return (0x2000000 & this.properties) != 0; // 1 << 25 } @ObfuscatedName("f") diff --git a/runescape-client/src/main/java/WorldComparator.java b/runescape-client/src/main/java/WorldComparator.java index e1c685e25d..77538cc0e7 100644 --- a/runescape-client/src/main/java/WorldComparator.java +++ b/runescape-client/src/main/java/WorldComparator.java @@ -49,15 +49,15 @@ final class WorldComparator implements Comparator { ) static int method68(int var0, Script var1, boolean var2) { if(var0 == 3200) { - class179.Interpreter_intStackSize -= 3; - Ignored.queueSoundEffect(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize], Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1], Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]); + RouteStrategy.Interpreter_intStackSize -= 3; + Ignored.queueSoundEffect(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize], Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1], Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]); return 1; } else if(var0 == 3201) { - AbstractUserComparator.method5437(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + AbstractUserComparator.method5437(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); return 1; } else if(var0 == 3202) { - class179.Interpreter_intStackSize -= 2; - HealthBar.method1994(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize], Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]); + RouteStrategy.Interpreter_intStackSize -= 2; + HealthBar.method1994(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize], Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]); return 1; } else { return 2; diff --git a/runescape-client/src/main/java/WorldMap.java b/runescape-client/src/main/java/WorldMap.java index 618e8a698e..abff754e79 100644 --- a/runescape-client/src/main/java/WorldMap.java +++ b/runescape-client/src/main/java/WorldMap.java @@ -1301,7 +1301,7 @@ public class WorldMap { for(int var14 = this.__bs.length - 1; var14 >= 0; --var14) { if(var12.strings[var14] != null) { - Tiles.method1106(var12.strings[var14], var12.string1, this.__bs[var14], var11.__m_15(), var11.coord1.packed(), var11.coord2.packed()); + Tiles.insertMenuItemNoShift(var12.strings[var14], var12.string1, this.__bs[var14], var11.__m_15(), var11.coord1.packed(), var11.coord2.packed()); var13 = true; } } diff --git a/runescape-client/src/main/java/WorldMapAreaData.java b/runescape-client/src/main/java/WorldMapAreaData.java index fbec90b7d0..96db746df5 100644 --- a/runescape-client/src/main/java/WorldMapAreaData.java +++ b/runescape-client/src/main/java/WorldMapAreaData.java @@ -133,7 +133,7 @@ public class WorldMapAreaData extends WorldMapArea { Widget var4; if(var0 >= 2000) { var0 -= 1000; - var4 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var4 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); var3 = false; } else { var4 = var2?WorldMapIcon1.__t_i:class12.__n_n; @@ -141,7 +141,7 @@ public class WorldMapAreaData extends WorldMapArea { int var11; if(var0 == 1300) { - var11 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] - 1; + var11 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] - 1; if(var11 >= 0 && var11 <= 9) { var4.setAction(var11, Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]); return 1; @@ -152,19 +152,19 @@ public class WorldMapAreaData extends WorldMapArea { } else { int var6; if(var0 == 1301) { - class179.Interpreter_intStackSize -= 2; - var11 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var6 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var11 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var6 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; var4.parent = class204.getWidgetChild(var11, var6); return 1; } else if(var0 == 1302) { - var4.isScrollBar = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var4.isScrollBar = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else if(var0 == 1303) { - var4.dragZoneSize = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var4.dragZoneSize = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; return 1; } else if(var0 == 1304) { - var4.dragThreshold = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var4.dragThreshold = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; return 1; } else if(var0 == 1305) { var4.dataText = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; @@ -176,7 +176,7 @@ public class WorldMapAreaData extends WorldMapArea { var4.actions = null; return 1; } else if(var0 == 1308) { - var4.__fz = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var4.__fz = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else { int var7; @@ -184,17 +184,17 @@ public class WorldMapAreaData extends WorldMapArea { if(var0 != 1350) { byte var5; if(var0 == 1351) { - class179.Interpreter_intStackSize -= 2; + RouteStrategy.Interpreter_intStackSize -= 2; var5 = 10; - var9 = new byte[]{(byte)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]}; - byte[] var10 = new byte[]{(byte)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]}; + var9 = new byte[]{(byte)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]}; + byte[] var10 = new byte[]{(byte)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]}; BufferedSink.method3595(var4, var5, var9, var10); return 1; } else if(var0 == 1352) { - class179.Interpreter_intStackSize -= 3; - var11 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] - 1; - var6 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - var7 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; + RouteStrategy.Interpreter_intStackSize -= 3; + var11 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] - 1; + var6 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + var7 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; if(var11 >= 0 && var11 <= 9) { Varcs.method2168(var4, var11, var6, var7); return 1; @@ -203,13 +203,13 @@ public class WorldMapAreaData extends WorldMapArea { } } else if(var0 == 1353) { var5 = 10; - var6 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var6 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; Varcs.method2168(var4, var5, var6, var7); return 1; } else if(var0 == 1354) { - --class179.Interpreter_intStackSize; - var11 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] - 1; + --RouteStrategy.Interpreter_intStackSize; + var11 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] - 1; if(var11 >= 0 && var11 <= 9) { WorldMapSection3.method345(var4, var11); return 1; @@ -227,9 +227,9 @@ public class WorldMapAreaData extends WorldMapArea { byte[] var8 = null; var9 = null; if(var3) { - class179.Interpreter_intStackSize -= 10; + RouteStrategy.Interpreter_intStackSize -= 10; - for(var7 = 0; var7 < 10 && Interpreter.Interpreter_intStack[var7 + class179.Interpreter_intStackSize] >= 0; var7 += 2) { + for(var7 = 0; var7 < 10 && Interpreter.Interpreter_intStack[var7 + RouteStrategy.Interpreter_intStackSize] >= 0; var7 += 2) { ; } @@ -238,17 +238,17 @@ public class WorldMapAreaData extends WorldMapArea { var9 = new byte[var7 / 2]; for(var7 -= 2; var7 >= 0; var7 -= 2) { - var8[var7 / 2] = (byte)Interpreter.Interpreter_intStack[var7 + class179.Interpreter_intStackSize]; - var9[var7 / 2] = (byte)Interpreter.Interpreter_intStack[var7 + class179.Interpreter_intStackSize + 1]; + var8[var7 / 2] = (byte)Interpreter.Interpreter_intStack[var7 + RouteStrategy.Interpreter_intStackSize]; + var9[var7 / 2] = (byte)Interpreter.Interpreter_intStack[var7 + RouteStrategy.Interpreter_intStackSize + 1]; } } } else { - class179.Interpreter_intStackSize -= 2; - var8 = new byte[]{(byte)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]}; - var9 = new byte[]{(byte)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]}; + RouteStrategy.Interpreter_intStackSize -= 2; + var8 = new byte[]{(byte)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]}; + var9 = new byte[]{(byte)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]}; } - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] - 1; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] - 1; if(var7 >= 0 && var7 <= 9) { BufferedSink.method3595(var4, var7, var8, var9); return 1; diff --git a/runescape-client/src/main/java/WorldMapCacheName.java b/runescape-client/src/main/java/WorldMapCacheName.java index 8a0dfcdb3d..705477fe2c 100644 --- a/runescape-client/src/main/java/WorldMapCacheName.java +++ b/runescape-client/src/main/java/WorldMapCacheName.java @@ -70,16 +70,16 @@ public class WorldMapCacheName { if(var0 != null && var1 != null) { ByteArrayPool.__gi_g = var0; WorldMapSection2.__ah_l = new int[var0.length]; - class179.__fe_e = new byte[var0.length][][]; + RouteStrategy.__fe_e = new byte[var0.length][][]; for(int var2 = 0; var2 < ByteArrayPool.__gi_g.length; ++var2) { - class179.__fe_e[var2] = new byte[var1[var2]][]; + RouteStrategy.__fe_e[var2] = new byte[var1[var2]][]; } } else { ByteArrayPool.__gi_g = null; WorldMapSection2.__ah_l = null; - class179.__fe_e = null; + RouteStrategy.__fe_e = null; } } diff --git a/runescape-client/src/main/java/WorldMapEvent.java b/runescape-client/src/main/java/WorldMapEvent.java index e264324840..258935c48c 100644 --- a/runescape-client/src/main/java/WorldMapEvent.java +++ b/runescape-client/src/main/java/WorldMapEvent.java @@ -11,8 +11,8 @@ public class WorldMapEvent { @ObfuscatedSignature( signature = "[Llq;" ) - @Export("__ap_w") - static IndexedSprite[] __ap_w; + @Export("runesSprite") + static IndexedSprite[] runesSprite; @ObfuscatedName("m") @ObfuscatedGetter( intValue = 264384233 @@ -57,7 +57,7 @@ public class WorldMapEvent { ) static final void method781(int var0, int var1, int var2, int var3) { if(Client.isItemSelected == 0 && !Client.isSpellSelected) { - Tiles.method1106("Walk here", "", 23, 0, var0 - var2, var1 - var3); + Tiles.insertMenuItemNoShift("Walk here", "", 23, 0, var0 - var2, var1 - var3); } long var4 = -1L; @@ -98,10 +98,10 @@ public class WorldMapEvent { } if(Client.isItemSelected == 1) { - Tiles.method1106("Use", Client.selectedItemName + " " + "->" + " " + BufferedFile.colorStartTag(65535) + var20.name, 1, var19, var15, var17); + Tiles.insertMenuItemNoShift("Use", Client.selectedItemName + " " + "->" + " " + BufferedFile.colorStartTag(65535) + var20.name, 1, var19, var15, var17); } else if(Client.isSpellSelected) { if((FloorDecoration.selectedSpellFlags & 4) == 4) { - Tiles.method1106(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + BufferedFile.colorStartTag(65535) + var20.name, 2, var19, var15, var17); + Tiles.insertMenuItemNoShift(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + BufferedFile.colorStartTag(65535) + var20.name, 2, var19, var15, var17); } } else { String[] var29 = var20.actions; @@ -129,12 +129,12 @@ public class WorldMapEvent { var23 = 1001; } - Tiles.method1106(var29[var30], BufferedFile.colorStartTag(65535) + var20.name, var23, var19, var15, var17); + Tiles.insertMenuItemNoShift(var29[var30], BufferedFile.colorStartTag(65535) + var20.name, var23, var19, var15, var17); } } } - Tiles.method1106("Examine", BufferedFile.colorStartTag(65535) + var20.name, 1002, var20.id, var15, var17); + Tiles.insertMenuItemNoShift("Examine", BufferedFile.colorStartTag(65535) + var20.name, 1002, var20.id, var15, var17); } } @@ -209,10 +209,10 @@ public class WorldMapEvent { for(GroundItem var39 = (GroundItem)var35.first(); var39 != null; var39 = (GroundItem)var35.next()) { ItemDefinition var37 = Skills.getItemDefinition(var39.id); if(Client.isItemSelected == 1) { - Tiles.method1106("Use", Client.selectedItemName + " " + "->" + " " + BufferedFile.colorStartTag(16748608) + var37.name, 16, var39.id, var15, var17); + Tiles.insertMenuItemNoShift("Use", Client.selectedItemName + " " + "->" + " " + BufferedFile.colorStartTag(16748608) + var37.name, 16, var39.id, var15, var17); } else if(Client.isSpellSelected) { if((FloorDecoration.selectedSpellFlags & 1) == 1) { - Tiles.method1106(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + BufferedFile.colorStartTag(16748608) + var37.name, 17, var39.id, var15, var17); + Tiles.insertMenuItemNoShift(Client.selectedSpellActionName, Client.selectedSpellName + " " + "->" + " " + BufferedFile.colorStartTag(16748608) + var37.name, 17, var39.id, var15, var17); } } else { String[] var31 = var37.groundActions; @@ -240,13 +240,13 @@ public class WorldMapEvent { var25 = 22; } - Tiles.method1106(var31[var32], BufferedFile.colorStartTag(16748608) + var37.name, var25, var39.id, var15, var17); + Tiles.insertMenuItemNoShift(var31[var32], BufferedFile.colorStartTag(16748608) + var37.name, var25, var39.id, var15, var17); } else if(var32 == 2) { - Tiles.method1106("Take", BufferedFile.colorStartTag(16748608) + var37.name, 20, var39.id, var15, var17); + Tiles.insertMenuItemNoShift("Take", BufferedFile.colorStartTag(16748608) + var37.name, 20, var39.id, var15, var17); } } - Tiles.method1106("Examine", BufferedFile.colorStartTag(16748608) + var37.name, 1004, var39.id, var15, var17); + Tiles.insertMenuItemNoShift("Examine", BufferedFile.colorStartTag(16748608) + var37.name, 1004, var39.id, var15, var17); } } } diff --git a/runescape-client/src/main/java/WorldMapIcon2.java b/runescape-client/src/main/java/WorldMapIcon2.java index 46ab9b277f..5a6b13156c 100644 --- a/runescape-client/src/main/java/WorldMapIcon2.java +++ b/runescape-client/src/main/java/WorldMapIcon2.java @@ -180,12 +180,12 @@ public class WorldMapIcon2 extends AbstractWorldMapIcon { if(var4 >= var6 && var4 < 104 - var6 && var5 >= var6 && var5 < 104 - var6) { if(var1 >= var6 && var1 < 104 - var6 && var2 >= var6 && var2 < 104 - var6) { int var9 = var0.transformedSize(); - Client.field895.field2120 = var1; - Client.field895.field2121 = var2; - Client.field895.field2122 = 1; - Client.field895.field2123 = 1; + Client.field895.approxDestinationX = var1; + Client.field895.approxDestinationY = var2; + Client.field895.approxDestinationSizeX = 1; + Client.field895.approxDestinationSizeY = 1; class65 var10 = Client.field895; - int var11 = NetSocket.method3571(var4, var5, var9, var10, Client.collisionMaps[var0.plane], true, Client.__client_tp, Client.__client_th); + int var11 = NetSocket.calculateRoute(var4, var5, var9, var10, Client.collisionMaps[var0.plane], true, Client.__client_tp, Client.__client_th); if(var11 >= 1) { for(int var12 = 0; var12 < var11 - 1; ++var12) { var0.__a_131(Client.__client_tp[var12], Client.__client_th[var12], var3); diff --git a/runescape-client/src/main/java/WorldMapLabel.java b/runescape-client/src/main/java/WorldMapLabel.java index f73b839a03..01bb187020 100644 --- a/runescape-client/src/main/java/WorldMapLabel.java +++ b/runescape-client/src/main/java/WorldMapLabel.java @@ -169,7 +169,7 @@ public class WorldMapLabel { signature = "(I)[Llq;", garbageValue = "-1374541046" ) - public static IndexedSprite[] method444() { + public static IndexedSprite[] createIndexedSpriteArray() { IndexedSprite[] var0 = new IndexedSprite[class328.indexedSpriteCount]; for(int var1 = 0; var1 < class328.indexedSpriteCount; ++var1) { @@ -215,7 +215,7 @@ public class WorldMapLabel { return var4 - var5; } else { - return var2 == 2?var0.location - var1.location:(var2 == 3?(var0.activity.equals("-")?(var1.activity.equals("-")?0:(var3?-1:1)):(var1.activity.equals("-")?(var3?1:-1):var0.activity.compareTo(var1.activity))):(var2 == 4?(var0.__a_147()?(var1.__a_147()?0:1):(var1.__a_147()?-1:0)):(var2 == 5?(var0.__x_145()?(var1.__x_145()?0:1):(var1.__x_145()?-1:0)):(var2 == 6?(var0.__d_146()?(var1.__d_146()?0:1):(var1.__d_146()?-1:0)):(var2 == 7?(var0.__e_144()?(var1.__e_144()?0:1):(var1.__e_144()?-1:0)):var0.id - var1.id))))); + return var2 == 2?var0.location - var1.location:(var2 == 3?(var0.activity.equals("-")?(var1.activity.equals("-")?0:(var3?-1:1)):(var1.activity.equals("-")?(var3?1:-1):var0.activity.compareTo(var1.activity))):(var2 == 4?(var0.__a_147()?(var1.__a_147()?0:1):(var1.__a_147()?-1:0)):(var2 == 5?(var0.__x_145()?(var1.__x_145()?0:1):(var1.__x_145()?-1:0)):(var2 == 6?(var0.isPvp()?(var1.isPvp()?0:1):(var1.isPvp()?-1:0)):(var2 == 7?(var0.isMembersOnly()?(var1.isMembersOnly()?0:1):(var1.isMembersOnly()?-1:0)):var0.id - var1.id))))); } } diff --git a/runescape-client/src/main/java/WorldMapManager.java b/runescape-client/src/main/java/WorldMapManager.java index ea2c6a1ec9..cab85b879f 100644 --- a/runescape-client/src/main/java/WorldMapManager.java +++ b/runescape-client/src/main/java/WorldMapManager.java @@ -171,7 +171,7 @@ public final class WorldMapManager { System.nanoTime(); if(var1.__ag_401(WorldMapCacheName.WorldMapCacheName_compositeTexture.name, var2)) { byte[] var20 = var1.takeRecordByNames(WorldMapCacheName.WorldMapCacheName_compositeTexture.name, var2); - this.overviewSprite = class27.method438(var20); + this.overviewSprite = class27.convertJpgToSprite(var20); } System.nanoTime(); @@ -514,7 +514,7 @@ public final class WorldMapManager { signature = "(II)Z", garbageValue = "-1344882321" ) - static boolean method672(int var0) { + static boolean isWidgetMenuOpcode(int var0) { return var0 == 57 || var0 == 58 || var0 == 1007 || var0 == 25 || var0 == 30; } diff --git a/runescape-client/src/main/java/WorldMapRegion.java b/runescape-client/src/main/java/WorldMapRegion.java index 161d5fa665..12258d07ae 100644 --- a/runescape-client/src/main/java/WorldMapRegion.java +++ b/runescape-client/src/main/java/WorldMapRegion.java @@ -1073,7 +1073,7 @@ public class WorldMapRegion { ) static final void method567(Widget var0, int var1, int var2) { if(Client.minimapState == 0 || Client.minimapState == 3) { - if(!Client.isMenuOpen && (MouseHandler.MouseHandler_lastButton == 1 || !AbstractRasterProvider.__lp_ca && MouseHandler.MouseHandler_lastButton == 4)) { + if(!Client.isMenuOpen && (MouseHandler.MouseHandler_lastButton == 1 || !AbstractRasterProvider.mouseCam && MouseHandler.MouseHandler_lastButton == 4)) { SpriteMask var3 = var0.getSpriteMask(true); if(var3 == null) { return; diff --git a/runescape-client/src/main/java/WorldMapSection0.java b/runescape-client/src/main/java/WorldMapSection0.java index 1d42429f3e..da7aa7b568 100644 --- a/runescape-client/src/main/java/WorldMapSection0.java +++ b/runescape-client/src/main/java/WorldMapSection0.java @@ -209,7 +209,7 @@ public class WorldMapSection0 implements WorldMapSection { signature = "(I)V", garbageValue = "-2102591569" ) - static void method247() { + static void savePreferences() { AccessFile var0 = null; try { @@ -261,7 +261,7 @@ public class WorldMapSection0 implements WorldMapSection { Client.__client_hh = false; int var7; - if(MouseHandler.MouseHandler_currentButton == 1 || !AbstractRasterProvider.__lp_ca && MouseHandler.MouseHandler_currentButton == 4) { + if(MouseHandler.MouseHandler_currentButton == 1 || !AbstractRasterProvider.mouseCam && MouseHandler.MouseHandler_currentButton == 4) { if(var5 >= var1 && var5 < var1 + 16 && var6 >= var2 && var6 < var2 + 16) { var0.scrollY -= 4; class22.method295(var0); diff --git a/runescape-client/src/main/java/WorldMapSection1.java b/runescape-client/src/main/java/WorldMapSection1.java index 6cab7970dc..5e531807a7 100644 --- a/runescape-client/src/main/java/WorldMapSection1.java +++ b/runescape-client/src/main/java/WorldMapSection1.java @@ -292,7 +292,7 @@ public class WorldMapSection1 implements WorldMapSection { class196.varcs.clearTransient(); Client.followerIndex = -1; if(Client.rootWidgetGroup != -1) { - AbstractByteArrayCopier.method4023(Client.rootWidgetGroup); + AbstractByteArrayCopier.unloadWidgetGroup(Client.rootWidgetGroup); } for(WidgetGroupParent var4 = (WidgetGroupParent)Client.widgetGroupParents.first(); var4 != null; var4 = (WidgetGroupParent)Client.widgetGroupParents.next()) { diff --git a/runescape-client/src/main/java/WorldMapSection2.java b/runescape-client/src/main/java/WorldMapSection2.java index 759a22446e..63347180aa 100644 --- a/runescape-client/src/main/java/WorldMapSection2.java +++ b/runescape-client/src/main/java/WorldMapSection2.java @@ -165,100 +165,100 @@ public class WorldMapSection2 implements WorldMapSection { signature = "(IILfe;Lfy;I)Z", garbageValue = "-2025028346" ) - static final boolean method593(int var0, int var1, class179 var2, CollisionMap var3) { - int var4 = var0; - int var5 = var1; + static final boolean method593(int srcX, int srcY, RouteStrategy strategy, CollisionMap collisionMap) { + int var4 = srcX; + int var5 = srcY; byte var6 = 64; byte var7 = 64; - int var8 = var0 - var6; - int var9 = var1 - var7; - class178.__fi_q[var6][var7] = 99; - class178.__fi_w[var6][var7] = 0; + int graphBaseX = srcX - var6; + int graphBaseY = srcY - var7; + class178.directions[var6][var7] = 99; + class178.distances[var6][var7] = 0; byte var10 = 0; int var11 = 0; - class178.__fi_l[var10] = var0; + class178.bufferX[var10] = srcX; byte var10001 = var10; int var18 = var10 + 1; - class178.__fi_e[var10001] = var1; - int[][] var12 = var3.flags; + class178.bufferY[var10001] = srcY; + int[][] var12 = collisionMap.flags; while(var18 != var11) { - var4 = class178.__fi_l[var11]; - var5 = class178.__fi_e[var11]; + var4 = class178.bufferX[var11]; + var5 = class178.bufferY[var11]; var11 = var11 + 1 & 4095; - int var16 = var4 - var8; - int var17 = var5 - var9; - int var13 = var4 - var3.xInset; - int var14 = var5 - var3.yInset; - if(var2.vmethod3644(2, var4, var5, var3)) { + int var16 = var4 - graphBaseX; + int var17 = var5 - graphBaseY; + int var13 = var4 - collisionMap.xInset; + int var14 = var5 - collisionMap.yInset; + if(strategy.vmethod3644(2, var4, var5, collisionMap)) { WidgetGroupParent.__bx_o = var4; UrlRequester.__eo_u = var5; return true; } - int var15 = class178.__fi_w[var16][var17] + 1; - if(var16 > 0 && class178.__fi_q[var16 - 1][var17] == 0 && (var12[var13 - 1][var14] & 19136782) == 0 && (var12[var13 - 1][var14 + 1] & 19136824) == 0) { - class178.__fi_l[var18] = var4 - 1; - class178.__fi_e[var18] = var5; + int var15 = class178.distances[var16][var17] + 1; + if(var16 > 0 && class178.directions[var16 - 1][var17] == 0 && (var12[var13 - 1][var14] & 19136782) == 0 && (var12[var13 - 1][var14 + 1] & 19136824) == 0) { + class178.bufferX[var18] = var4 - 1; + class178.bufferY[var18] = var5; var18 = var18 + 1 & 4095; - class178.__fi_q[var16 - 1][var17] = 2; - class178.__fi_w[var16 - 1][var17] = var15; + class178.directions[var16 - 1][var17] = 2; + class178.distances[var16 - 1][var17] = var15; } - if(var16 < 126 && class178.__fi_q[var16 + 1][var17] == 0 && (var12[var13 + 2][var14] & 19136899) == 0 && (var12[var13 + 2][var14 + 1] & 19136992) == 0) { - class178.__fi_l[var18] = var4 + 1; - class178.__fi_e[var18] = var5; + if(var16 < 126 && class178.directions[var16 + 1][var17] == 0 && (var12[var13 + 2][var14] & 19136899) == 0 && (var12[var13 + 2][var14 + 1] & 19136992) == 0) { + class178.bufferX[var18] = var4 + 1; + class178.bufferY[var18] = var5; var18 = var18 + 1 & 4095; - class178.__fi_q[var16 + 1][var17] = 8; - class178.__fi_w[var16 + 1][var17] = var15; + class178.directions[var16 + 1][var17] = 8; + class178.distances[var16 + 1][var17] = var15; } - if(var17 > 0 && class178.__fi_q[var16][var17 - 1] == 0 && (var12[var13][var14 - 1] & 19136782) == 0 && (var12[var13 + 1][var14 - 1] & 19136899) == 0) { - class178.__fi_l[var18] = var4; - class178.__fi_e[var18] = var5 - 1; + if(var17 > 0 && class178.directions[var16][var17 - 1] == 0 && (var12[var13][var14 - 1] & 19136782) == 0 && (var12[var13 + 1][var14 - 1] & 19136899) == 0) { + class178.bufferX[var18] = var4; + class178.bufferY[var18] = var5 - 1; var18 = var18 + 1 & 4095; - class178.__fi_q[var16][var17 - 1] = 1; - class178.__fi_w[var16][var17 - 1] = var15; + class178.directions[var16][var17 - 1] = 1; + class178.distances[var16][var17 - 1] = var15; } - if(var17 < 126 && class178.__fi_q[var16][var17 + 1] == 0 && (var12[var13][var14 + 2] & 19136824) == 0 && (var12[var13 + 1][var14 + 2] & 19136992) == 0) { - class178.__fi_l[var18] = var4; - class178.__fi_e[var18] = var5 + 1; + if(var17 < 126 && class178.directions[var16][var17 + 1] == 0 && (var12[var13][var14 + 2] & 19136824) == 0 && (var12[var13 + 1][var14 + 2] & 19136992) == 0) { + class178.bufferX[var18] = var4; + class178.bufferY[var18] = var5 + 1; var18 = var18 + 1 & 4095; - class178.__fi_q[var16][var17 + 1] = 4; - class178.__fi_w[var16][var17 + 1] = var15; + class178.directions[var16][var17 + 1] = 4; + class178.distances[var16][var17 + 1] = var15; } - if(var16 > 0 && var17 > 0 && class178.__fi_q[var16 - 1][var17 - 1] == 0 && (var12[var13 - 1][var14] & 19136830) == 0 && (var12[var13 - 1][var14 - 1] & 19136782) == 0 && (var12[var13][var14 - 1] & 19136911) == 0) { - class178.__fi_l[var18] = var4 - 1; - class178.__fi_e[var18] = var5 - 1; + if(var16 > 0 && var17 > 0 && class178.directions[var16 - 1][var17 - 1] == 0 && (var12[var13 - 1][var14] & 19136830) == 0 && (var12[var13 - 1][var14 - 1] & 19136782) == 0 && (var12[var13][var14 - 1] & 19136911) == 0) { + class178.bufferX[var18] = var4 - 1; + class178.bufferY[var18] = var5 - 1; var18 = var18 + 1 & 4095; - class178.__fi_q[var16 - 1][var17 - 1] = 3; - class178.__fi_w[var16 - 1][var17 - 1] = var15; + class178.directions[var16 - 1][var17 - 1] = 3; + class178.distances[var16 - 1][var17 - 1] = var15; } - if(var16 < 126 && var17 > 0 && class178.__fi_q[var16 + 1][var17 - 1] == 0 && (var12[var13 + 1][var14 - 1] & 19136911) == 0 && (var12[var13 + 2][var14 - 1] & 19136899) == 0 && (var12[var13 + 2][var14] & 19136995) == 0) { - class178.__fi_l[var18] = var4 + 1; - class178.__fi_e[var18] = var5 - 1; + if(var16 < 126 && var17 > 0 && class178.directions[var16 + 1][var17 - 1] == 0 && (var12[var13 + 1][var14 - 1] & 19136911) == 0 && (var12[var13 + 2][var14 - 1] & 19136899) == 0 && (var12[var13 + 2][var14] & 19136995) == 0) { + class178.bufferX[var18] = var4 + 1; + class178.bufferY[var18] = var5 - 1; var18 = var18 + 1 & 4095; - class178.__fi_q[var16 + 1][var17 - 1] = 9; - class178.__fi_w[var16 + 1][var17 - 1] = var15; + class178.directions[var16 + 1][var17 - 1] = 9; + class178.distances[var16 + 1][var17 - 1] = var15; } - if(var16 > 0 && var17 < 126 && class178.__fi_q[var16 - 1][var17 + 1] == 0 && (var12[var13 - 1][var14 + 1] & 19136830) == 0 && (var12[var13 - 1][var14 + 2] & 19136824) == 0 && (var12[var13][var14 + 2] & 19137016) == 0) { - class178.__fi_l[var18] = var4 - 1; - class178.__fi_e[var18] = var5 + 1; + if(var16 > 0 && var17 < 126 && class178.directions[var16 - 1][var17 + 1] == 0 && (var12[var13 - 1][var14 + 1] & 19136830) == 0 && (var12[var13 - 1][var14 + 2] & 19136824) == 0 && (var12[var13][var14 + 2] & 19137016) == 0) { + class178.bufferX[var18] = var4 - 1; + class178.bufferY[var18] = var5 + 1; var18 = var18 + 1 & 4095; - class178.__fi_q[var16 - 1][var17 + 1] = 6; - class178.__fi_w[var16 - 1][var17 + 1] = var15; + class178.directions[var16 - 1][var17 + 1] = 6; + class178.distances[var16 - 1][var17 + 1] = var15; } - if(var16 < 126 && var17 < 126 && class178.__fi_q[var16 + 1][var17 + 1] == 0 && (var12[var13 + 1][var14 + 2] & 19137016) == 0 && (var12[var13 + 2][var14 + 2] & 19136992) == 0 && (var12[var13 + 2][var14 + 1] & 19136995) == 0) { - class178.__fi_l[var18] = var4 + 1; - class178.__fi_e[var18] = var5 + 1; + if(var16 < 126 && var17 < 126 && class178.directions[var16 + 1][var17 + 1] == 0 && (var12[var13 + 1][var14 + 2] & 19137016) == 0 && (var12[var13 + 2][var14 + 2] & 19136992) == 0 && (var12[var13 + 2][var14 + 1] & 19136995) == 0) { + class178.bufferX[var18] = var4 + 1; + class178.bufferY[var18] = var5 + 1; var18 = var18 + 1 & 4095; - class178.__fi_q[var16 + 1][var17 + 1] = 12; - class178.__fi_w[var16 + 1][var17 + 1] = var15; + class178.directions[var16 + 1][var17 + 1] = 12; + class178.distances[var16 + 1][var17 + 1] = var15; } } @@ -280,7 +280,7 @@ public class WorldMapSection2 implements WorldMapSection { for(int var6 = 0; var6 < var2; ++var6) { Player var7 = Client.players[var3[var6]]; - if(var7 != null && var7 != Canvas.localPlayer && var7.username != null && var7.username.__equals_466(var5)) { + if(var7 != null && var7 != Canvas.localPlayer && var7.username != null && var7.username.equals(var5)) { PacketBufferNode var8; if(var0 == 1) { var8 = Interpreter.method1915(ClientPacket.__gs_ao, Client.packetWriter.isaacCipher); diff --git a/runescape-client/src/main/java/WorldMapSectionType.java b/runescape-client/src/main/java/WorldMapSectionType.java index 4c5e3bc70d..1a2ecc9c35 100644 --- a/runescape-client/src/main/java/WorldMapSectionType.java +++ b/runescape-client/src/main/java/WorldMapSectionType.java @@ -36,8 +36,8 @@ public enum WorldMapSectionType implements Enumerated { @ObfuscatedSignature( signature = "Llq;" ) - @Export("__h_e") - static IndexedSprite __h_e; + @Export("logoSprite") + static IndexedSprite logoSprite; @ObfuscatedName("n") @Export("__h_n") static int[] __h_n; @@ -104,22 +104,22 @@ public enum WorldMapSectionType implements Enumerated { static int method253(int var0, Script var1, boolean var2) { Widget var3 = var2?WorldMapIcon1.__t_i:class12.__n_n; if(var0 == 1500) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.x; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.x; return 1; } else if(var0 == 1501) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.y; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.y; return 1; } else if(var0 == 1502) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.width; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.width; return 1; } else if(var0 == 1503) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.height; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.height; return 1; } else if(var0 == 1504) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.isHidden?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.isHidden?1:0; return 1; } else if(var0 == 1505) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.parentId; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.parentId; return 1; } else { return 2; diff --git a/runescape-client/src/main/java/class1.java b/runescape-client/src/main/java/class1.java index 289c3ea18f..9a5afd50a3 100644 --- a/runescape-client/src/main/java/class1.java +++ b/runescape-client/src/main/java/class1.java @@ -81,18 +81,18 @@ final class class1 implements class0 { Widget var4; if(var0 >= 2000) { var0 -= 1000; - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var4 = Huffman.getWidget(var3); } else { var4 = var2?WorldMapIcon1.__t_i:class12.__n_n; } if(var0 == 1000) { - class179.Interpreter_intStackSize -= 4; - var4.rawX = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4.rawY = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - var4.xAlignment = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; - var4.yAlignment = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 3]; + RouteStrategy.Interpreter_intStackSize -= 4; + var4.rawX = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4.rawY = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + var4.xAlignment = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; + var4.yAlignment = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 3]; class22.method295(var4); TextureProvider.client.alignWidget(var4); if(var3 != -1 && var4.type == 0) { @@ -101,11 +101,11 @@ final class class1 implements class0 { return 1; } else if(var0 == 1001) { - class179.Interpreter_intStackSize -= 4; - var4.rawWidth = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4.rawHeight = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - var4.widthAlignment = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; - var4.heightAlignment = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 3]; + RouteStrategy.Interpreter_intStackSize -= 4; + var4.rawWidth = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4.rawHeight = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + var4.widthAlignment = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; + var4.heightAlignment = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 3]; class22.method295(var4); TextureProvider.client.alignWidget(var4); if(var3 != -1 && var4.type == 0) { @@ -114,7 +114,7 @@ final class class1 implements class0 { return 1; } else if(var0 == 1003) { - boolean var5 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + boolean var5 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(var5 != var4.isHidden) { var4.isHidden = var5; class22.method295(var4); @@ -122,10 +122,10 @@ final class class1 implements class0 { return 1; } else if(var0 == 1005) { - var4.noClickThrough = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var4.noClickThrough = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else if(var0 == 1006) { - var4.noScrollThrough = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var4.noScrollThrough = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else { return 2; @@ -140,16 +140,16 @@ final class class1 implements class0 { static int method16(int var0, Script var1, boolean var2) { int var3; if(var0 == 4200) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = Skills.getItemDefinition(var3).name; return 1; } else { int var4; ItemDefinition var5; if(var0 == 4201) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; var5 = Skills.getItemDefinition(var3); if(var4 >= 1 && var4 <= 5 && var5.groundActions[var4 - 1] != null) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var5.groundActions[var4 - 1]; @@ -159,9 +159,9 @@ final class class1 implements class0 { return 1; } else if(var0 == 4202) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; var5 = Skills.getItemDefinition(var3); if(var4 >= 1 && var4 <= 5 && var5.inventoryActions[var4 - 1] != null) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var5.inventoryActions[var4 - 1]; @@ -171,64 +171,64 @@ final class class1 implements class0 { return 1; } else if(var0 == 4203) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Skills.getItemDefinition(var3).price; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Skills.getItemDefinition(var3).price; return 1; } else if(var0 == 4204) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Skills.getItemDefinition(var3).isStackable == 1?1:0; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Skills.getItemDefinition(var3).isStackable == 1?1:0; return 1; } else { ItemDefinition var6; if(var0 == 4205) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var6 = Skills.getItemDefinition(var3); if(var6.noteTemplate == -1 && var6.note >= 0) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var6.note; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var6.note; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3; } return 1; } else if(var0 == 4206) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var6 = Skills.getItemDefinition(var3); if(var6.noteTemplate >= 0 && var6.note >= 0) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var6.note; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var6.note; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3; } return 1; } else if(var0 == 4207) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Skills.getItemDefinition(var3).isMembersOnly?1:0; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Skills.getItemDefinition(var3).isMembersOnly?1:0; return 1; } else if(var0 == 4208) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var6 = Skills.getItemDefinition(var3); if(var6.placeholderTemplate == -1 && var6.placeholder >= 0) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var6.placeholder; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var6.placeholder; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3; } return 1; } else if(var0 == 4209) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var6 = Skills.getItemDefinition(var3); if(var6.placeholderTemplate >= 0 && var6.placeholder >= 0) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var6.placeholder; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var6.placeholder; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3; } return 1; } else if(var0 == 4210) { String var7 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - var4 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; class50.method900(var7, var4 == 1); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = WorldMapSection0.__y_sn; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = WorldMapSection0.__y_sn; return 1; } else if(var0 != 4211) { if(var0 == 4212) { @@ -239,9 +239,9 @@ final class class1 implements class0 { } } else { if(AttackOption.__cj_sp != null && class231.__hb_sg < WorldMapSection0.__y_sn) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = AttackOption.__cj_sp[++class231.__hb_sg - 1] & '\uffff'; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = AttackOption.__cj_sp[++class231.__hb_sg - 1] & '\uffff'; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } return 1; diff --git a/runescape-client/src/main/java/class11.java b/runescape-client/src/main/java/class11.java index a8a3033982..48df6ff7e3 100644 --- a/runescape-client/src/main/java/class11.java +++ b/runescape-client/src/main/java/class11.java @@ -85,7 +85,7 @@ final class class11 implements Comparator { Widget var3; if(var0 >= 2000) { var0 -= 1000; - var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); } else { var3 = var2?WorldMapIcon1.__t_i:class12.__n_n; } @@ -93,9 +93,9 @@ final class class11 implements Comparator { String var4 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; int[] var5 = null; if(var4.length() > 0 && var4.charAt(var4.length() - 1) == 'Y') { - int var6 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + int var6 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(var6 > 0) { - for(var5 = new int[var6]; var6-- > 0; var5[var6] = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]) { + for(var5 = new int[var6]; var6-- > 0; var5[var6] = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]) { ; } } @@ -110,11 +110,11 @@ final class class11 implements Comparator { if(var4.charAt(var7 - 1) == 's') { var8[var7] = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; } else { - var8[var7] = new Integer(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var8[var7] = new Integer(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); } } - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(var7 != -1) { var8[0] = new Integer(var7); } else { @@ -196,30 +196,30 @@ final class class11 implements Comparator { static int method146(int var0, Script var1, boolean var2) { Widget var3; if(var0 == 2700) { - var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.itemId; + var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.itemId; return 1; } else if(var0 == 2701) { - var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); if(var3.itemId != -1) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.itemQuantity; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.itemQuantity; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 2702) { - int var5 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + int var5 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; WidgetGroupParent var4 = (WidgetGroupParent)Client.widgetGroupParents.get((long)var5); if(var4 != null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 2706) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.rootWidgetGroup; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.rootWidgetGroup; return 1; } else { return 2; @@ -252,8 +252,8 @@ final class class11 implements Comparator { garbageValue = "-1292134247" ) static final void method148(int var0, int var1, int var2, int var3, int var4) { - class32.scrollBarSprites[0].__q_496(var0, var1); - class32.scrollBarSprites[1].__q_496(var0, var3 + var1 - 16); + class32.scrollBarSprites[0].drawAt(var0, var1); + class32.scrollBarSprites[1].drawAt(var0, var3 + var1 - 16); Rasterizer2D.Rasterizer2D_fillRectangle(var0, var1 + 16, 16, var3 - 32, Client.__client_hx); int var5 = var3 * (var3 - 32) / var4; if(var5 < 8) { diff --git a/runescape-client/src/main/java/class13.java b/runescape-client/src/main/java/class13.java index 67e7d98362..4b67531628 100644 --- a/runescape-client/src/main/java/class13.java +++ b/runescape-client/src/main/java/class13.java @@ -18,8 +18,8 @@ public class class13 { @ObfuscatedGetter( intValue = -1810047523 ) - @Export("__i_af") - static int __i_af; + @Export("otpInt") + static int otpInt; @ObfuscatedName("f") @ObfuscatedSignature( diff --git a/runescape-client/src/main/java/class15.java b/runescape-client/src/main/java/class15.java index 6ef8c64f1f..5bb42bfc02 100644 --- a/runescape-client/src/main/java/class15.java +++ b/runescape-client/src/main/java/class15.java @@ -121,9 +121,9 @@ public class class15 extends class21 { garbageValue = "2139921057" ) static int method182(int var0, Script var1, boolean var2) { - Widget var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + Widget var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); if(var0 == 2800) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class211.method4107(class1.getWidgetClickMask(var3)); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class211.method4107(class1.getWidgetClickMask(var3)); return 1; } else if(var0 != 2801) { if(var0 == 2802) { @@ -138,7 +138,7 @@ public class class15 extends class21 { return 2; } } else { - int var4 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + int var4 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; --var4; if(var3.actions != null && var4 < var3.actions.length && var3.actions[var4] != null) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3.actions[var4]; diff --git a/runescape-client/src/main/java/class16.java b/runescape-client/src/main/java/class16.java index c9eeee21fa..7557082153 100644 --- a/runescape-client/src/main/java/class16.java +++ b/runescape-client/src/main/java/class16.java @@ -14,7 +14,7 @@ public class class16 { @ObfuscatedSignature( signature = "Lbp;" ) - static class72 field85; + static LoginScreenAnimation loginScreenRunesAnimation; @ObfuscatedName("dv") @ObfuscatedSignature( signature = "Lit;" @@ -62,7 +62,7 @@ public class class16 { static int method188(int var0, Script var1, boolean var2) { Widget var3 = var2?WorldMapIcon1.__t_i:class12.__n_n; if(var0 == 1800) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class211.method4107(class1.getWidgetClickMask(var3)); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class211.method4107(class1.getWidgetClickMask(var3)); return 1; } else if(var0 != 1801) { if(var0 == 1802) { @@ -77,7 +77,7 @@ public class class16 { return 2; } } else { - int var4 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + int var4 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; --var4; if(var3.actions != null && var4 < var3.actions.length && var3.actions[var4] != null) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3.actions[var4]; diff --git a/runescape-client/src/main/java/class168.java b/runescape-client/src/main/java/class168.java index 6a3f422952..a5fe73d5bc 100644 --- a/runescape-client/src/main/java/class168.java +++ b/runescape-client/src/main/java/class168.java @@ -37,8 +37,8 @@ public class class168 { @ObfuscatedGetter( intValue = 1181569415 ) - @Export("__fs_au") - static int __fs_au; + @Export("optionButtonSpriteSubWidth") + static int optionButtonSpriteSubWidth; static { randomDat = null; diff --git a/runescape-client/src/main/java/class171.java b/runescape-client/src/main/java/class171.java index b05c100bf3..fb214f2738 100644 --- a/runescape-client/src/main/java/class171.java +++ b/runescape-client/src/main/java/class171.java @@ -331,10 +331,10 @@ public class class171 { if(class192.mapSceneSprites == null) { var2 = WorldMapSection3.indexCache8; var28 = class211.spriteIds.mapScenes; - if(!SpriteMask.method4392(var2, var28, 0)) { + if(!SpriteMask.loadSprite(var2, var28, 0)) { var27 = null; } else { - var27 = WorldMapLabel.method444(); + var27 = WorldMapLabel.createIndexedSpriteArray(); } class192.mapSceneSprites = var27; @@ -346,10 +346,10 @@ public class class171 { if(class15.headIconPkSprites == null) { var2 = WorldMapSection3.indexCache8; var28 = class211.spriteIds.headIconsPk; - if(!SpriteMask.method4392(var2, var28, 0)) { + if(!SpriteMask.loadSprite(var2, var28, 0)) { var37 = null; } else { - var37 = UserComparator9.method3344(); + var37 = UserComparator9.createSpriteArray(); } class15.headIconPkSprites = var37; @@ -360,10 +360,10 @@ public class class171 { if(ClientPreferences.headIconPrayerSprites == null) { var2 = WorldMapSection3.indexCache8; var28 = class211.spriteIds.headIconsPrayer; - if(!SpriteMask.method4392(var2, var28, 0)) { + if(!SpriteMask.loadSprite(var2, var28, 0)) { var37 = null; } else { - var37 = UserComparator9.method3344(); + var37 = UserComparator9.createSpriteArray(); } ClientPreferences.headIconPrayerSprites = var37; @@ -374,10 +374,10 @@ public class class171 { if(Player.headIconHintSprites == null) { var2 = WorldMapSection3.indexCache8; var28 = class211.spriteIds.headIconsHint; - if(!SpriteMask.method4392(var2, var28, 0)) { + if(!SpriteMask.loadSprite(var2, var28, 0)) { var37 = null; } else { - var37 = UserComparator9.method3344(); + var37 = UserComparator9.createSpriteArray(); } Player.headIconHintSprites = var37; @@ -388,10 +388,10 @@ public class class171 { if(class16.mapMarkerSprites == null) { var2 = WorldMapSection3.indexCache8; var28 = class211.spriteIds.mapMarkers; - if(!SpriteMask.method4392(var2, var28, 0)) { + if(!SpriteMask.loadSprite(var2, var28, 0)) { var37 = null; } else { - var37 = UserComparator9.method3344(); + var37 = UserComparator9.createSpriteArray(); } class16.mapMarkerSprites = var37; @@ -402,10 +402,10 @@ public class class171 { if(KeyHandler.crossSprites == null) { var2 = WorldMapSection3.indexCache8; var28 = class211.spriteIds.crosses; - if(!SpriteMask.method4392(var2, var28, 0)) { + if(!SpriteMask.loadSprite(var2, var28, 0)) { var37 = null; } else { - var37 = UserComparator9.method3344(); + var37 = UserComparator9.createSpriteArray(); } KeyHandler.crossSprites = var37; @@ -416,10 +416,10 @@ public class class171 { if(class39.mapDotSprites == null) { var2 = WorldMapSection3.indexCache8; var28 = class211.spriteIds.mapDots; - if(!SpriteMask.method4392(var2, var28, 0)) { + if(!SpriteMask.loadSprite(var2, var28, 0)) { var37 = null; } else { - var37 = UserComparator9.method3344(); + var37 = UserComparator9.createSpriteArray(); } class39.mapDotSprites = var37; @@ -430,10 +430,10 @@ public class class171 { if(class32.scrollBarSprites == null) { var2 = WorldMapSection3.indexCache8; var28 = class211.spriteIds.scrollBars; - if(!SpriteMask.method4392(var2, var28, 0)) { + if(!SpriteMask.loadSprite(var2, var28, 0)) { var27 = null; } else { - var27 = WorldMapLabel.method444(); + var27 = WorldMapLabel.createIndexedSpriteArray(); } class32.scrollBarSprites = var27; @@ -444,10 +444,10 @@ public class class171 { if(WorldMapSectionType.modIconSprites == null) { var2 = WorldMapSection3.indexCache8; var28 = class211.spriteIds.modIcons; - if(!SpriteMask.method4392(var2, var28, 0)) { + if(!SpriteMask.loadSprite(var2, var28, 0)) { var27 = null; } else { - var27 = WorldMapLabel.method444(); + var27 = WorldMapLabel.createIndexedSpriteArray(); } WorldMapSectionType.modIconSprites = var27; diff --git a/runescape-client/src/main/java/class178.java b/runescape-client/src/main/java/class178.java index 39a0c68d25..1079c412b8 100644 --- a/runescape-client/src/main/java/class178.java +++ b/runescape-client/src/main/java/class178.java @@ -4,22 +4,22 @@ import net.runelite.mapping.ObfuscatedName; @ObfuscatedName("fi") public class class178 { @ObfuscatedName("q") - @Export("__fi_q") - static int[][] __fi_q; + @Export("directions") + static int[][] directions; @ObfuscatedName("w") - @Export("__fi_w") - static int[][] __fi_w; + @Export("distances") + static int[][] distances; @ObfuscatedName("l") - @Export("__fi_l") - static int[] __fi_l; + @Export("bufferX") + static int[] bufferX; @ObfuscatedName("e") - @Export("__fi_e") - static int[] __fi_e; + @Export("bufferY") + static int[] bufferY; static { - __fi_q = new int[128][128]; - __fi_w = new int[128][128]; - __fi_l = new int[4096]; - __fi_e = new int[4096]; + directions = new int[128][128]; + distances = new int[128][128]; + bufferX = new int[4096]; + bufferY = new int[4096]; } } diff --git a/runescape-client/src/main/java/class2.java b/runescape-client/src/main/java/class2.java index 9b9c0e10ea..7c697769f4 100644 --- a/runescape-client/src/main/java/class2.java +++ b/runescape-client/src/main/java/class2.java @@ -66,52 +66,52 @@ final class class2 implements class0 { Login.loginIndex = var3; Rasterizer2D.Rasterizer2D_clear(); byte[] var4 = var0.takeRecordByNames("title.jpg", ""); - Login.__cu_g = class27.method438(var4); - Fonts.__kz_l = Login.__cu_g.copy(); - if((Client.worldProperties & 536870912) != 0) { - WorldMapSectionType.__h_e = MenuAction.method2025(var1, "logo_deadman_mode", ""); + Login.leftTitleSprite = class27.convertJpgToSprite(var4); + Fonts.rightTitleSprite = Login.leftTitleSprite.copy(); + if((Client.worldProperties & 0x20000000) != 0) { + WorldMapSectionType.logoSprite = MenuAction.loadIndexedSpriteByName(var1, "logo_deadman_mode", ""); } else { - WorldMapSectionType.__h_e = MenuAction.method2025(var1, "logo", ""); + WorldMapSectionType.logoSprite = MenuAction.loadIndexedSpriteByName(var1, "logo", ""); } - Login.__cu_o = MenuAction.method2025(var1, "titlebox", ""); - IndexCacheLoader.__bd_u = MenuAction.method2025(var1, "titlebutton", ""); + Login.titleboxSprite = MenuAction.loadIndexedSpriteByName(var1, "titlebox", ""); + IndexCacheLoader.titlebuttonSprite = MenuAction.loadIndexedSpriteByName(var1, "titlebutton", ""); int var6 = var1.getArchiveId("runes"); int var7 = var1.getRecordId(var6, ""); IndexedSprite[] var8; - if(!SpriteMask.method4392(var1, var6, var7)) { + if(!SpriteMask.loadSprite(var1, var6, var7)) { var8 = null; } else { - var8 = WorldMapLabel.method444(); + var8 = WorldMapLabel.createIndexedSpriteArray(); } - WorldMapEvent.__ap_w = var8; + WorldMapEvent.runesSprite = var8; var7 = var1.getArchiveId("title_mute"); int var10 = var1.getRecordId(var7, ""); IndexedSprite[] var9; - if(!SpriteMask.method4392(var1, var7, var10)) { + if(!SpriteMask.loadSprite(var1, var7, var10)) { var9 = null; } else { - var9 = WorldMapLabel.method444(); + var9 = WorldMapLabel.createIndexedSpriteArray(); } - KeyHandler.__an_x = var9; - Login.__cu_d = MenuAction.method2025(var1, "options_radio_buttons,0", ""); - GraphicsObject.__bw_k = MenuAction.method2025(var1, "options_radio_buttons,4", ""); - class308.__kw_n = MenuAction.method2025(var1, "options_radio_buttons,2", ""); - KeyHandler.__an_i = MenuAction.method2025(var1, "options_radio_buttons,6", ""); - class168.__fs_au = Login.__cu_d.subWidth; - GroundItemPile.__dr_ao = Login.__cu_d.subHeight; - class16.field85 = new class72(WorldMapEvent.__ap_w); + KeyHandler.title_muteSprite = var9; + Login.options_buttons_0Sprite = MenuAction.loadIndexedSpriteByName(var1, "options_radio_buttons,0", ""); + GraphicsObject.options_buttons_4Sprite = MenuAction.loadIndexedSpriteByName(var1, "options_radio_buttons,4", ""); + class308.options_buttons_2Sprite = MenuAction.loadIndexedSpriteByName(var1, "options_radio_buttons,2", ""); + KeyHandler.options_buttons_6Sprite = MenuAction.loadIndexedSpriteByName(var1, "options_radio_buttons,6", ""); + class168.optionButtonSpriteSubWidth = Login.options_buttons_0Sprite.subWidth; + GroundItemPile.optionButtonSpriteSubHeight = Login.options_buttons_0Sprite.subHeight; + class16.loginScreenRunesAnimation = new LoginScreenAnimation(WorldMapEvent.runesSprite); if(var2) { Login.Login_username = ""; Login.Login_password = ""; } - class13.__i_af = 0; + class13.otpInt = 0; Login.otp = ""; Login.__cu_ba = true; - Login.__cu_bk = false; + Login.worldSelectOpen = false; if(!ReflectionCheck.clientPreferences.titleMusicDisabled) { Canvas.method858(2, UserComparator3.indexCache6, "scape main", "", 255, false); } else { @@ -120,12 +120,12 @@ final class class2 implements class0 { UserComparator9.method3343(false); Login.__cu_f = true; - Login.__cu_q = (SoundCache.canvasWidth - 765) / 2; - Login.__cu_y = Login.__cu_q + 202; - Varps.__hv_h = Login.__cu_y + 180; - Login.__cu_g.drawAt(Login.__cu_q, 0); - Fonts.__kz_l.drawAt(Login.__cu_q + 382, 0); - WorldMapSectionType.__h_e.__q_496(Login.__cu_q + 382 - WorldMapSectionType.__h_e.subWidth / 2, 18); + Login.xPadding = (SoundCache.canvasWidth - 765) / 2; + Login.loginBoxX = Login.xPadding + 202; + Varps.loginBoxCenter = Login.loginBoxX + 180; + Login.leftTitleSprite.drawAt(Login.xPadding, 0); + Fonts.rightTitleSprite.drawAt(Login.xPadding + 382, 0); + WorldMapSectionType.logoSprite.drawAt(Login.xPadding + 382 - WorldMapSectionType.logoSprite.subWidth / 2, 18); } } @@ -138,10 +138,10 @@ final class class2 implements class0 { int var3 = var0.getArchiveId(var1); int var4 = var0.getRecordId(var3, var2); Sprite[] var5; - if(!SpriteMask.method4392(var0, var3, var4)) { + if(!SpriteMask.loadSprite(var0, var3, var4)) { var5 = null; } else { - var5 = UserComparator9.method3344(); + var5 = UserComparator9.createSpriteArray(); } return var5; diff --git a/runescape-client/src/main/java/class211.java b/runescape-client/src/main/java/class211.java index 14dd76547b..8840cdf5b5 100644 --- a/runescape-client/src/main/java/class211.java +++ b/runescape-client/src/main/java/class211.java @@ -49,7 +49,7 @@ public class class211 { int var4; if(var0 == 4100) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - var4 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3 + var4; return 1; } else { @@ -62,7 +62,7 @@ public class class211 { return 1; } else if(var0 == 4102) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - var4 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3 + ByteArrayPool.method4001(var4, true); return 1; } else if(var0 == 4103) { @@ -73,7 +73,7 @@ public class class211 { int var6; int var10; if(var0 == 4104) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; long var11 = ((long)var10 + 11745L) * 86400000L; Interpreter.Interpreter_calendar.setTime(new Date(var11)); var6 = Interpreter.Interpreter_calendar.get(5); @@ -83,12 +83,12 @@ public class class211 { return 1; } else if(var0 != 4105) { if(var0 == 4106) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = Integer.toString(var10); return 1; } else if(var0 == 4107) { Interpreter.Interpreter_stringStackSize -= 2; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = WallDecoration.method3256(AttackOption.method2033(Interpreter.Interpreter_stringStack[Interpreter.Interpreter_stringStackSize], Interpreter.Interpreter_stringStack[Interpreter.Interpreter_stringStackSize + 1], Client.language)); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = WallDecoration.method3256(AttackOption.method2033(Interpreter.Interpreter_stringStack[Interpreter.Interpreter_stringStackSize], Interpreter.Interpreter_stringStack[Interpreter.Interpreter_stringStackSize + 1], Client.language)); return 1; } else { int var5; @@ -96,27 +96,27 @@ public class class211 { Font var14; if(var0 == 4108) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - class179.Interpreter_intStackSize -= 2; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var5 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; var13 = ByteArrayPool.indexCache13.takeRecord(var5, 0); var14 = new Font(var13); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var14.lineCount(var3, var4); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var14.lineCount(var3, var4); return 1; } else if(var0 == 4109) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - class179.Interpreter_intStackSize -= 2; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var5 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; var13 = ByteArrayPool.indexCache13.takeRecord(var5, 0); var14 = new Font(var13); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var14.lineWidth(var3, var4); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var14.lineWidth(var3, var4); return 1; } else if(var0 == 4110) { Interpreter.Interpreter_stringStackSize -= 2; var3 = Interpreter.Interpreter_stringStack[Interpreter.Interpreter_stringStackSize]; var9 = Interpreter.Interpreter_stringStack[Interpreter.Interpreter_stringStackSize + 1]; - if(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1) { + if(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3; } else { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var9; @@ -129,39 +129,39 @@ public class class211 { return 1; } else if(var0 == 4112) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - var4 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3 + (char)var4; return 1; } else if(var0 == 4113) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ChatChannel.method2238((char)var10)?1:0; + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ChatChannel.method2238((char)var10)?1:0; return 1; } else if(var0 == 4114) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = VarcInt.method4807((char)var10)?1:0; + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = VarcInt.isAlphaNumeric((char)var10)?1:0; return 1; } else if(var0 == 4115) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = UrlRequest.method3271((char)var10)?1:0; + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = UrlRequest.method3271((char)var10)?1:0; return 1; } else if(var0 == 4116) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class159.method3394((char)var10)?1:0; + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class159.method3394((char)var10)?1:0; return 1; } else if(var0 == 4117) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; if(var3 != null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.length(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.length(); } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } return 1; } else if(var0 == 4118) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - class179.Interpreter_intStackSize -= 2; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var5 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3.substring(var4, var5); return 1; } else if(var0 == 4119) { @@ -184,15 +184,15 @@ public class class211 { return 1; } else if(var0 == 4120) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - var4 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.indexOf(var4); + var4 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.indexOf(var4); return 1; } else if(var0 == 4121) { Interpreter.Interpreter_stringStackSize -= 2; var3 = Interpreter.Interpreter_stringStack[Interpreter.Interpreter_stringStackSize]; var9 = Interpreter.Interpreter_stringStack[Interpreter.Interpreter_stringStackSize + 1]; - var5 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.indexOf(var9, var5); + var5 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.indexOf(var9, var5); return 1; } else if(var0 == 4122) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; diff --git a/runescape-client/src/main/java/class229.java b/runescape-client/src/main/java/class229.java index c7b24610fd..a3db606284 100644 --- a/runescape-client/src/main/java/class229.java +++ b/runescape-client/src/main/java/class229.java @@ -38,51 +38,51 @@ public class class229 { ) static int method4513(int var0, Script var1, boolean var2) { if(var0 == 6200) { - class179.Interpreter_intStackSize -= 2; - Client.__client_rw = (short)class161.method3395(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]); + RouteStrategy.Interpreter_intStackSize -= 2; + Client.__client_rw = (short)class161.method3395(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]); if(Client.__client_rw <= 0) { Client.__client_rw = 256; } - Client.__client_rm = (short)class161.method3395(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]); + Client.__client_rm = (short)class161.method3395(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]); if(Client.__client_rm <= 0) { Client.__client_rm = 256; } return 1; } else if(var0 == 6201) { - class179.Interpreter_intStackSize -= 2; - Client.__client_re = (short)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; + RouteStrategy.Interpreter_intStackSize -= 2; + Client.__client_re = (short)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; if(Client.__client_re <= 0) { Client.__client_re = 256; } - Client.__client_rb = (short)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + Client.__client_rb = (short)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; if(Client.__client_rb <= 0) { Client.__client_rb = 320; } return 1; } else if(var0 == 6202) { - class179.Interpreter_intStackSize -= 4; - Client.__client_rv = (short)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; + RouteStrategy.Interpreter_intStackSize -= 4; + Client.__client_rv = (short)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; if(Client.__client_rv <= 0) { Client.__client_rv = 1; } - Client.__client_ri = (short)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + Client.__client_ri = (short)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; if(Client.__client_ri <= 0) { Client.__client_ri = 32767; } else if(Client.__client_ri < Client.__client_rv) { Client.__client_ri = Client.__client_rv; } - Client.__client_rs = (short)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; + Client.__client_rs = (short)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; if(Client.__client_rs <= 0) { Client.__client_rs = 1; } - Client.__client_rp = (short)Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 3]; + Client.__client_rp = (short)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 3]; if(Client.__client_rp <= 0) { Client.__client_rp = 32767; } else if(Client.__client_rp < Client.__client_rs) { @@ -93,21 +93,21 @@ public class class229 { } else if(var0 == 6203) { if(Client.viewportWidget != null) { FontName.setViewportShape(0, 0, Client.viewportWidget.width, Client.viewportWidget.height, false); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.viewportWidth; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.viewportHeight; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.viewportWidth; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.viewportHeight; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } return 1; } else if(var0 == 6204) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.__client_re; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.__client_rb; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.__client_re; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.__client_rb; return 1; } else if(var0 == 6205) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class30.method571(Client.__client_rw); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class30.method571(Client.__client_rm); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class30.method571(Client.__client_rw); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class30.method571(Client.__client_rm); return 1; } else { return 2; diff --git a/runescape-client/src/main/java/class238.java b/runescape-client/src/main/java/class238.java index 1c72b1dcbf..aa5ea9e654 100644 --- a/runescape-client/src/main/java/class238.java +++ b/runescape-client/src/main/java/class238.java @@ -268,12 +268,12 @@ public final class class238 { } boolean var34 = false; - if((MouseHandler.MouseHandler_currentButton == 1 || !AbstractRasterProvider.__lp_ca && MouseHandler.MouseHandler_currentButton == 4) && var33) { + if((MouseHandler.MouseHandler_currentButton == 1 || !AbstractRasterProvider.mouseCam && MouseHandler.MouseHandler_currentButton == 4) && var33) { var34 = true; } var21 = false; - if((MouseHandler.MouseHandler_lastButton == 1 || !AbstractRasterProvider.__lp_ca && MouseHandler.MouseHandler_lastButton == 4) && MouseHandler.MouseHandler_lastPressedX >= var12 && MouseHandler.MouseHandler_lastPressedY >= var13 && MouseHandler.MouseHandler_lastPressedX < var14 && MouseHandler.MouseHandler_lastPressedY < var15) { + if((MouseHandler.MouseHandler_lastButton == 1 || !AbstractRasterProvider.mouseCam && MouseHandler.MouseHandler_lastButton == 4) && MouseHandler.MouseHandler_lastPressedX >= var12 && MouseHandler.MouseHandler_lastPressedY >= var13 && MouseHandler.MouseHandler_lastPressedX < var14 && MouseHandler.MouseHandler_lastPressedY < var15) { var21 = true; } diff --git a/runescape-client/src/main/java/class248.java b/runescape-client/src/main/java/class248.java index 272be7ca32..4e6b7a3c66 100644 --- a/runescape-client/src/main/java/class248.java +++ b/runescape-client/src/main/java/class248.java @@ -193,71 +193,71 @@ public class class248 { static int method4741(int var0, Script var1, boolean var2) { int var3; if(var0 == 3903) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].type(); + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].type(); return 1; } else if(var0 == 3904) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].id; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].id; return 1; } else if(var0 == 3905) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].unitPrice; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].unitPrice; return 1; } else if(var0 == 3906) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].totalQuantity; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].totalQuantity; return 1; } else if(var0 == 3907) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].currentQuantity; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].currentQuantity; return 1; } else if(var0 == 3908) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].currentPrice; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].currentPrice; return 1; } else { int var12; if(var0 == 3910) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var12 = Client.grandExchangeOffers[var3].status(); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var12 == 0?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var12 == 0?1:0; return 1; } else if(var0 == 3911) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var12 = Client.grandExchangeOffers[var3].status(); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var12 == 2?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var12 == 2?1:0; return 1; } else if(var0 == 3912) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var12 = Client.grandExchangeOffers[var3].status(); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var12 == 5?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var12 == 5?1:0; return 1; } else if(var0 == 3913) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var12 = Client.grandExchangeOffers[var3].status(); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var12 == 1?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var12 == 1?1:0; return 1; } else { boolean var13; if(var0 == 3914) { - var13 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var13 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(FloorDecoration.grandExchangeEvents != null) { FloorDecoration.grandExchangeEvents.sort(GrandExchangeEvents.__g_w, var13); } return 1; } else if(var0 == 3915) { - var13 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var13 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(FloorDecoration.grandExchangeEvents != null) { FloorDecoration.grandExchangeEvents.sort(GrandExchangeEvents.__g_q, var13); } return 1; } else if(var0 == 3916) { - class179.Interpreter_intStackSize -= 2; - var13 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize] == 1; - boolean var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1] == 1; + RouteStrategy.Interpreter_intStackSize -= 2; + var13 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] == 1; + boolean var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1] == 1; if(FloorDecoration.grandExchangeEvents != null) { Client.__client_sj.__m = var4; FloorDecoration.grandExchangeEvents.sort(Client.__client_sj, var13); @@ -265,41 +265,41 @@ public class class248 { return 1; } else if(var0 == 3917) { - var13 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var13 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(FloorDecoration.grandExchangeEvents != null) { FloorDecoration.grandExchangeEvents.sort(GrandExchangeEvents.__g_f, var13); } return 1; } else if(var0 == 3918) { - var13 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var13 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(FloorDecoration.grandExchangeEvents != null) { FloorDecoration.grandExchangeEvents.sort(GrandExchangeEvents.__g_o, var13); } return 1; } else if(var0 == 3919) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = FloorDecoration.grandExchangeEvents == null?0:FloorDecoration.grandExchangeEvents.events.size(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = FloorDecoration.grandExchangeEvents == null?0:FloorDecoration.grandExchangeEvents.events.size(); return 1; } else { GrandExchangeEvent var11; if(var0 == 3920) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var11 = (GrandExchangeEvent)FloorDecoration.grandExchangeEvents.events.get(var3); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var11.world; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var11.world; return 1; } else if(var0 == 3921) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var11 = (GrandExchangeEvent)FloorDecoration.grandExchangeEvents.events.get(var3); Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var11.__m_3(); return 1; } else if(var0 == 3922) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var11 = (GrandExchangeEvent)FloorDecoration.grandExchangeEvents.events.get(var3); Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var11.__f_4(); return 1; } else if(var0 == 3923) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var11 = (GrandExchangeEvent)FloorDecoration.grandExchangeEvents.events.get(var3); long var5 = class203.currentTimeMs() - class15.__z_si - var11.__f; int var7 = (int)(var5 / 3600000L); @@ -309,19 +309,19 @@ public class class248 { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var10; return 1; } else if(var0 == 3924) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var11 = (GrandExchangeEvent)FloorDecoration.grandExchangeEvents.events.get(var3); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var11.grandExchangeOffer.totalQuantity; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var11.grandExchangeOffer.totalQuantity; return 1; } else if(var0 == 3925) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var11 = (GrandExchangeEvent)FloorDecoration.grandExchangeEvents.events.get(var3); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var11.grandExchangeOffer.unitPrice; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var11.grandExchangeOffer.unitPrice; return 1; } else if(var0 == 3926) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var11 = (GrandExchangeEvent)FloorDecoration.grandExchangeEvents.events.get(var3); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var11.grandExchangeOffer.id; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var11.grandExchangeOffer.id; return 1; } else { return 2; diff --git a/runescape-client/src/main/java/class27.java b/runescape-client/src/main/java/class27.java index 7acd856783..b752bea56b 100644 --- a/runescape-client/src/main/java/class27.java +++ b/runescape-client/src/main/java/class27.java @@ -49,7 +49,7 @@ public final class class27 { signature = "([BI)Lln;", garbageValue = "-143338910" ) - public static final Sprite method438(byte[] var0) { + public static final Sprite convertJpgToSprite(byte[] var0) { BufferedImage var1 = null; try { diff --git a/runescape-client/src/main/java/class3.java b/runescape-client/src/main/java/class3.java index 826ab81db7..65dabeb01f 100644 --- a/runescape-client/src/main/java/class3.java +++ b/runescape-client/src/main/java/class3.java @@ -35,7 +35,7 @@ public class class3 implements Enumerated { @ObfuscatedGetter( intValue = -393250053 ) - public final int field17; + public final int id; @ObfuscatedName("u") public final Class field18; @ObfuscatedName("g") @@ -55,7 +55,7 @@ public class class3 implements Enumerated { ) class3(int var1, int var2, Class var3, class0 var4) { this.field13 = var1; - this.field17 = var2; + this.id = var2; this.field18 = var3; this.field19 = var4; } @@ -66,7 +66,7 @@ public class class3 implements Enumerated { garbageValue = "83" ) public int rsOrdinal() { - return this.field17; + return this.id; } @ObfuscatedName("q") diff --git a/runescape-client/src/main/java/class30.java b/runescape-client/src/main/java/class30.java index a6511f8f8c..04ce1a6141 100644 --- a/runescape-client/src/main/java/class30.java +++ b/runescape-client/src/main/java/class30.java @@ -34,8 +34,8 @@ public class class30 { @ObfuscatedSignature( signature = "[Lln;" ) - @Export("__ar_bd") - static Sprite[] __ar_bd; + @Export("worldSelectBackSprites") + static Sprite[] worldSelectBackSprites; @ObfuscatedName("q") @ObfuscatedGetter( intValue = -1474464623 diff --git a/runescape-client/src/main/java/class308.java b/runescape-client/src/main/java/class308.java index bd4b8675ff..61d093b669 100644 --- a/runescape-client/src/main/java/class308.java +++ b/runescape-client/src/main/java/class308.java @@ -8,8 +8,8 @@ public final class class308 { @ObfuscatedSignature( signature = "Llq;" ) - @Export("__kw_n") - static IndexedSprite __kw_n; + @Export("options_buttons_2Sprite") + static IndexedSprite options_buttons_2Sprite; @ObfuscatedName("gn") @Export("regions") static int[] regions; diff --git a/runescape-client/src/main/java/class31.java b/runescape-client/src/main/java/class31.java index 58fb9b20d4..ac2e2a8f2f 100644 --- a/runescape-client/src/main/java/class31.java +++ b/runescape-client/src/main/java/class31.java @@ -37,11 +37,11 @@ public class class31 { ) @Export("changeWorld") static void changeWorld(World var0) { - if(var0.__e_144() != Client.isMembersWorld) { - Client.isMembersWorld = var0.__e_144(); - boolean var1 = var0.__e_144(); + if(var0.isMembersOnly() != Client.isMembersWorld) { + Client.isMembersWorld = var0.isMembersOnly(); + boolean var1 = var0.isMembersOnly(); if(var1 != class30.inMembersWorld) { - class72.method1780(); + LoginScreenAnimation.method1780(); class30.inMembersWorld = var1; } } @@ -61,25 +61,25 @@ public class class31 { ) static int method573(int var0, Script var1, boolean var2) { if(var0 == 6500) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ClientParameter.loadWorlds()?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ClientParameter.loadWorlds()?1:0; return 1; } else { World var3; if(var0 == 6501) { var3 = class190.method3672(); if(var3 != null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.id; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.properties; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.id; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.properties; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3.activity; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.location; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.population; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.location; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.population; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3.host; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; } @@ -87,18 +87,18 @@ public class class31 { } else if(var0 == 6502) { var3 = Fonts.method5647(); if(var3 != null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.id; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.properties; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.id; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.properties; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3.activity; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.location; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var3.population; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.location; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.population; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var3.host; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; } @@ -108,7 +108,7 @@ public class class31 { int var5; int var7; if(var0 == 6506) { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var4 = null; for(var5 = 0; var5 < World.worldsCount; ++var5) { @@ -119,90 +119,90 @@ public class class31 { } if(var4 != null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var4.id; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var4.properties; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var4.id; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var4.properties; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var4.activity; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var4.location; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var4.population; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var4.location; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var4.population; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var4.host; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; } return 1; } else if(var0 == 6507) { - class179.Interpreter_intStackSize -= 4; - var7 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - boolean var10 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1] == 1; - var5 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; - boolean var6 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 3] == 1; + RouteStrategy.Interpreter_intStackSize -= 4; + var7 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + boolean var10 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1] == 1; + var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; + boolean var6 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 3] == 1; WorldMapSectionType.method248(var7, var10, var5, var6); return 1; } else if(var0 != 6511) { if(var0 == 6512) { - Client.followerOpsLowPriority = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + Client.followerOpsLowPriority = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else { int var8; ParamKeyDefinition var9; if(var0 == 6513) { - class179.Interpreter_intStackSize -= 2; - var7 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var8 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var7 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var8 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; var9 = class229.getParamKeyDefinition(var8); if(var9.isString()) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ObjectDefinition.getNpcDefinition(var7).getStringParam(var8, var9.keyString); } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ObjectDefinition.getNpcDefinition(var7).getIntParam(var8, var9.keyInt); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ObjectDefinition.getNpcDefinition(var7).getIntParam(var8, var9.keyInt); } return 1; } else if(var0 == 6514) { - class179.Interpreter_intStackSize -= 2; - var7 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var8 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var7 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var8 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; var9 = class229.getParamKeyDefinition(var8); if(var9.isString()) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = class50.getObjectDefinition(var7).getStringParam(var8, var9.keyString); } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class50.getObjectDefinition(var7).getIntParam(var8, var9.keyInt); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class50.getObjectDefinition(var7).getIntParam(var8, var9.keyInt); } return 1; } else if(var0 == 6515) { - class179.Interpreter_intStackSize -= 2; - var7 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var8 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var7 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var8 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; var9 = class229.getParamKeyDefinition(var8); if(var9.isString()) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = Skills.getItemDefinition(var7).getStringParam(var8, var9.keyString); } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Skills.getItemDefinition(var7).getIntParam(var8, var9.keyInt); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Skills.getItemDefinition(var7).getIntParam(var8, var9.keyInt); } return 1; } else if(var0 == 6516) { - class179.Interpreter_intStackSize -= 2; - var7 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var8 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var7 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var8 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; var9 = class229.getParamKeyDefinition(var8); if(var9.isString()) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = GzipDecompressor.method3702(var7).getStringParam(var8, var9.keyString); } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = GzipDecompressor.method3702(var7).getIntParam(var8, var9.keyInt); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = GzipDecompressor.method3702(var7).getIntParam(var8, var9.keyInt); } return 1; } else if(var0 == 6518) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.__client_bl?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.__client_bl?1:0; return 1; } else if(var0 == 6519) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.clientType & 3; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.clientType & 3; return 1; } else if(var0 == 6520) { return 1; @@ -210,41 +210,41 @@ public class class31 { return 1; } else if(var0 == 6522) { --Interpreter.Interpreter_stringStackSize; - --class179.Interpreter_intStackSize; + --RouteStrategy.Interpreter_intStackSize; return 1; } else if(var0 == 6523) { --Interpreter.Interpreter_stringStackSize; - --class179.Interpreter_intStackSize; + --RouteStrategy.Interpreter_intStackSize; return 1; } else if(var0 == 6524) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; return 1; } else if(var0 == 6525) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 1; return 1; } else if(var0 == 6526) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 1; return 1; } else { return 2; } } } else { - var7 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; if(var7 >= 0 && var7 < World.worldsCount) { var4 = ItemContainer.worlds[var7]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var4.id; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var4.properties; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var4.id; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var4.properties; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var4.activity; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var4.location; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var4.population; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var4.location; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var4.population; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var4.host; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; } diff --git a/runescape-client/src/main/java/class32.java b/runescape-client/src/main/java/class32.java index d43fd91322..a5b80e69af 100644 --- a/runescape-client/src/main/java/class32.java +++ b/runescape-client/src/main/java/class32.java @@ -23,7 +23,7 @@ public class class32 { Widget var3; if(var0 >= 2000) { var0 -= 1000; - var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var3 = Huffman.getWidget(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); } else { var3 = var2?WorldMapIcon1.__t_i:class12.__n_n; } @@ -32,7 +32,7 @@ public class class32 { if(var0 != 1200 && var0 != 1205 && var0 != 1212) { if(var0 == 1201) { var3.modelType = 2; - var3.modelId = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3.modelId = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; return 1; } else if(var0 == 1202) { var3.modelType = 3; @@ -42,9 +42,9 @@ public class class32 { return 2; } } else { - class179.Interpreter_intStackSize -= 2; - int var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - int var5 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + int var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + int var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; var3.itemId = var4; var3.itemQuantity = var5; ItemDefinition var6 = Skills.getItemDefinition(var4); diff --git a/runescape-client/src/main/java/class322.java b/runescape-client/src/main/java/class322.java index 7b7f01256e..b73ed654bb 100644 --- a/runescape-client/src/main/java/class322.java +++ b/runescape-client/src/main/java/class322.java @@ -22,6 +22,6 @@ public class class322 { ) @Export("readSprite") public static Sprite readSprite(AbstractIndexCache var0, int var1, int var2) { - return !SpriteMask.method4392(var0, var1, var2)?null:class258.method4900(); + return !SpriteMask.loadSprite(var0, var1, var2)?null:class258.method4900(); } } diff --git a/runescape-client/src/main/java/class39.java b/runescape-client/src/main/java/class39.java index d9e1f40ec8..98926a8e6f 100644 --- a/runescape-client/src/main/java/class39.java +++ b/runescape-client/src/main/java/class39.java @@ -278,8 +278,8 @@ public class class39 extends class21 { if(Client.viewportTempX > -1) { var21 = var2 + Client.viewportTempX - (var15 >> 1); var22 = var3 + Client.viewportTempY - var87; - Rasterizer2D.Rasterizer2D_fillRectangle(var21, var22, var93, 5, 65280); - Rasterizer2D.Rasterizer2D_fillRectangle(var21 + var93, var22, var15 - var93, 5, 16711680); + Rasterizer2D.Rasterizer2D_fillRectangle(var21, var22, var93, 5, 0xff00); + Rasterizer2D.Rasterizer2D_fillRectangle(var21 + var93, var22, var15 - var93, 5, 0xff0000); } var87 += 2; @@ -367,7 +367,7 @@ public class class39 extends class21 { continue; } - var95 = class72.getHitSplatDefinition(var0.hitSplatTypes[var80]); + var95 = LoginScreenAnimation.getHitSplatDefinition(var0.hitSplatTypes[var80]); var98 = var95.__i; if(var95 != null && var95.transforms != null) { var95 = var95.transform(); @@ -383,7 +383,7 @@ public class class39 extends class21 { var15 = var0.hitSplatTypes2[var80]; HitSplatDefinition var81 = null; if(var15 >= 0) { - var81 = class72.getHitSplatDefinition(var15); + var81 = LoginScreenAnimation.getHitSplatDefinition(var15); if(var81 != null && var81.transforms != null) { var81 = var81.transform(); } diff --git a/runescape-client/src/main/java/class4.java b/runescape-client/src/main/java/class4.java index a52dce6aa4..325b6bbf36 100644 --- a/runescape-client/src/main/java/class4.java +++ b/runescape-client/src/main/java/class4.java @@ -68,8 +68,8 @@ final class class4 implements class0 { WorldMapIcon1.method219(0, "", var3); return 1; } else if(var0 == 3101) { - class179.Interpreter_intStackSize -= 2; - class234.method4534(Canvas.localPlayer, Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize], Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]); + RouteStrategy.Interpreter_intStackSize -= 2; + class234.method4534(Canvas.localPlayer, Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize], Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]); return 1; } else if(var0 == 3103) { if(!Interpreter.__bv_t) { @@ -110,48 +110,48 @@ final class class4 implements class0 { String var7; int var15; if(var0 == 3107) { - var15 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var15 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var7 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; WorldMapSection2.method583(var15, var7); return 1; } else if(var0 == 3108) { - class179.Interpreter_intStackSize -= 3; - var15 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var10 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; - int var9 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 2]; + RouteStrategy.Interpreter_intStackSize -= 3; + var15 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var10 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; + int var9 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 2]; Widget var13 = Huffman.getWidget(var9); Players.clickWidget(var13, var15, var10); return 1; } else if(var0 == 3109) { - class179.Interpreter_intStackSize -= 2; - var15 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var10 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + var15 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var10 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; Widget var11 = var2?WorldMapIcon1.__t_i:class12.__n_n; Players.clickWidget(var11, var15, var10); return 1; } else if(var0 == 3110) { - AbstractRasterProvider.__lp_ca = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + AbstractRasterProvider.mouseCam = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else if(var0 == 3111) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ReflectionCheck.clientPreferences.roofsHidden?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ReflectionCheck.clientPreferences.roofsHidden?1:0; return 1; } else if(var0 == 3112) { - ReflectionCheck.clientPreferences.roofsHidden = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; - WorldMapSection0.method247(); + ReflectionCheck.clientPreferences.roofsHidden = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; + WorldMapSection0.savePreferences(); return 1; } else if(var0 == 3113) { var3 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize]; - boolean var4 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + boolean var4 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; WorldMapCacheName.method635(var3, var4, false); return 1; } else if(var0 == 3115) { - var15 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var15 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var14 = Interpreter.method1915(ClientPacket.__gs_as, Client.packetWriter.isaacCipher); var14.packetBuffer.writeShort(var15); Client.packetWriter.__q_167(var14); return 1; } else if(var0 == 3116) { - var15 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var15 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; Interpreter.Interpreter_stringStackSize -= 2; var7 = Interpreter.Interpreter_stringStack[Interpreter.Interpreter_stringStackSize]; String var5 = Interpreter.Interpreter_stringStack[Interpreter.Interpreter_stringStackSize + 1]; @@ -169,16 +169,16 @@ final class class4 implements class0 { return 1; } } else if(var0 == 3117) { - Client.shiftClickDrop = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + Client.shiftClickDrop = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else if(var0 == 3118) { - Client.showMouseOverText = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + Client.showMouseOverText = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else if(var0 == 3119) { - Client.renderSelf = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + Client.renderSelf = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else if(var0 == 3120) { - if(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1) { + if(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1) { Client.__client_ke |= 1; } else { Client.__client_ke &= -2; @@ -186,7 +186,7 @@ final class class4 implements class0 { return 1; } else if(var0 == 3121) { - if(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1) { + if(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1) { Client.__client_ke |= 2; } else { Client.__client_ke &= -3; @@ -194,7 +194,7 @@ final class class4 implements class0 { return 1; } else if(var0 == 3122) { - if(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1) { + if(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1) { Client.__client_ke |= 4; } else { Client.__client_ke &= -5; @@ -202,7 +202,7 @@ final class class4 implements class0 { return 1; } else if(var0 == 3123) { - if(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1) { + if(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1) { Client.__client_ke |= 8; } else { Client.__client_ke &= -9; @@ -213,47 +213,47 @@ final class class4 implements class0 { Client.__client_ke = 0; return 1; } else if(var0 == 3125) { - Client.showMouseCross = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + Client.showMouseCross = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else if(var0 == 3126) { - Client.showLoadingMessages = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + Client.showLoadingMessages = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; return 1; } else if(var0 == 3127) { - WorldMapAreaData.method705(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1); + WorldMapAreaData.method705(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1); return 1; } else if(var0 == 3128) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class206.method4028()?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class206.method4028()?1:0; return 1; } else if(var0 == 3129) { - class179.Interpreter_intStackSize -= 2; - Client.oculusOrbNormalSpeed = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - Client.__client_in = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]; + RouteStrategy.Interpreter_intStackSize -= 2; + Client.oculusOrbNormalSpeed = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + Client.__client_in = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]; return 1; } else if(var0 == 3130) { - class179.Interpreter_intStackSize -= 2; + RouteStrategy.Interpreter_intStackSize -= 2; return 1; } else if(var0 == 3131) { - --class179.Interpreter_intStackSize; + --RouteStrategy.Interpreter_intStackSize; return 1; } else if(var0 == 3132) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = SoundCache.canvasWidth; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Huffman.canvasHeight; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = SoundCache.canvasWidth; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Huffman.canvasHeight; return 1; } else if(var0 == 3133) { - --class179.Interpreter_intStackSize; + --RouteStrategy.Interpreter_intStackSize; return 1; } else if(var0 == 3134) { return 1; } else if(var0 == 3135) { - class179.Interpreter_intStackSize -= 2; + RouteStrategy.Interpreter_intStackSize -= 2; return 1; } else if(var0 == 3136) { Client.__client_mf = 3; - Client.__client_ms = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + Client.__client_ms = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; return 1; } else if(var0 == 3137) { Client.__client_mf = 2; - Client.__client_ms = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + Client.__client_ms = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; return 1; } else if(var0 == 3138) { Client.__client_mf = 0; @@ -268,57 +268,57 @@ final class class4 implements class0 { } else { boolean var8; if(var0 == 3141) { - var8 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var8 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; ReflectionCheck.clientPreferences.hideUsername = var8; - WorldMapSection0.method247(); + WorldMapSection0.savePreferences(); return 1; } else if(var0 == 3142) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ReflectionCheck.clientPreferences.hideUsername?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ReflectionCheck.clientPreferences.hideUsername?1:0; return 1; } else if(var0 == 3143) { - var8 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var8 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; Client.Login_isUsernameRemembered = var8; if(!var8) { ReflectionCheck.clientPreferences.rememberedUsername = ""; - WorldMapSection0.method247(); + WorldMapSection0.savePreferences(); } return 1; } else if(var0 == 3144) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Client.Login_isUsernameRemembered?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Client.Login_isUsernameRemembered?1:0; return 1; } else if(var0 == 3145) { return 1; } else if(var0 == 3146) { - var8 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var8 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; if(var8 == ReflectionCheck.clientPreferences.titleMusicDisabled) { ReflectionCheck.clientPreferences.titleMusicDisabled = !var8; - WorldMapSection0.method247(); + WorldMapSection0.savePreferences(); } return 1; } else if(var0 == 3147) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = ReflectionCheck.clientPreferences.titleMusicDisabled?0:1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = ReflectionCheck.clientPreferences.titleMusicDisabled?0:1; return 1; } else if(var0 == 3148) { return 1; } else if(var0 == 3149) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; return 1; } else if(var0 == 3150) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; return 1; } else if(var0 == 3151) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; return 1; } else if(var0 == 3152) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; return 1; } else if(var0 == 3153) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = Login.Login_loadingPercent; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Login.Login_loadingPercent; return 1; } else if(var0 == 3154) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = GrandExchangeOffer.method101(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = GrandExchangeOffer.method101(); return 1; } else { return 2; diff --git a/runescape-client/src/main/java/class54.java b/runescape-client/src/main/java/class54.java index 3f50d0a947..7f70234cea 100644 --- a/runescape-client/src/main/java/class54.java +++ b/runescape-client/src/main/java/class54.java @@ -39,96 +39,96 @@ public final class class54 { static void method1092(GameShell var0) { int var3; int var15; - if(Login.__cu_bk) { + if(Login.worldSelectOpen) { while(true) { if(!Decimator.method2490()) { - if(MouseHandler.MouseHandler_lastButton != 1 && (AbstractRasterProvider.__lp_ca || MouseHandler.MouseHandler_lastButton != 4)) { + if(MouseHandler.MouseHandler_lastButton != 1 && (AbstractRasterProvider.mouseCam || MouseHandler.MouseHandler_lastButton != 4)) { break; } - int var1 = Login.__cu_q + 280; + int var1 = Login.xPadding + 280; if(MouseHandler.MouseHandler_lastPressedX >= var1 && MouseHandler.MouseHandler_lastPressedX <= var1 + 14 && MouseHandler.MouseHandler_lastPressedY >= 4 && MouseHandler.MouseHandler_lastPressedY <= 18) { - Interpreter.method1975(0, 0); + Interpreter.changeWorldSelectSorting(0, 0); break; } if(MouseHandler.MouseHandler_lastPressedX >= var1 + 15 && MouseHandler.MouseHandler_lastPressedX <= var1 + 80 && MouseHandler.MouseHandler_lastPressedY >= 4 && MouseHandler.MouseHandler_lastPressedY <= 18) { - Interpreter.method1975(0, 1); + Interpreter.changeWorldSelectSorting(0, 1); break; } - int var2 = Login.__cu_q + 390; + int var2 = Login.xPadding + 390; if(MouseHandler.MouseHandler_lastPressedX >= var2 && MouseHandler.MouseHandler_lastPressedX <= var2 + 14 && MouseHandler.MouseHandler_lastPressedY >= 4 && MouseHandler.MouseHandler_lastPressedY <= 18) { - Interpreter.method1975(1, 0); + Interpreter.changeWorldSelectSorting(1, 0); break; } if(MouseHandler.MouseHandler_lastPressedX >= var2 + 15 && MouseHandler.MouseHandler_lastPressedX <= var2 + 80 && MouseHandler.MouseHandler_lastPressedY >= 4 && MouseHandler.MouseHandler_lastPressedY <= 18) { - Interpreter.method1975(1, 1); + Interpreter.changeWorldSelectSorting(1, 1); break; } - var3 = Login.__cu_q + 500; + var3 = Login.xPadding + 500; if(MouseHandler.MouseHandler_lastPressedX >= var3 && MouseHandler.MouseHandler_lastPressedX <= var3 + 14 && MouseHandler.MouseHandler_lastPressedY >= 4 && MouseHandler.MouseHandler_lastPressedY <= 18) { - Interpreter.method1975(2, 0); + Interpreter.changeWorldSelectSorting(2, 0); break; } if(MouseHandler.MouseHandler_lastPressedX >= var3 + 15 && MouseHandler.MouseHandler_lastPressedX <= var3 + 80 && MouseHandler.MouseHandler_lastPressedY >= 4 && MouseHandler.MouseHandler_lastPressedY <= 18) { - Interpreter.method1975(2, 1); + Interpreter.changeWorldSelectSorting(2, 1); break; } - var15 = Login.__cu_q + 610; + var15 = Login.xPadding + 610; if(MouseHandler.MouseHandler_lastPressedX >= var15 && MouseHandler.MouseHandler_lastPressedX <= var15 + 14 && MouseHandler.MouseHandler_lastPressedY >= 4 && MouseHandler.MouseHandler_lastPressedY <= 18) { - Interpreter.method1975(3, 0); + Interpreter.changeWorldSelectSorting(3, 0); break; } if(MouseHandler.MouseHandler_lastPressedX >= var15 + 15 && MouseHandler.MouseHandler_lastPressedX <= var15 + 80 && MouseHandler.MouseHandler_lastPressedY >= 4 && MouseHandler.MouseHandler_lastPressedY <= 18) { - Interpreter.method1975(3, 1); + Interpreter.changeWorldSelectSorting(3, 1); break; } - if(MouseHandler.MouseHandler_lastPressedX >= Login.__cu_q + 708 && MouseHandler.MouseHandler_lastPressedY >= 4 && MouseHandler.MouseHandler_lastPressedX <= Login.__cu_q + 708 + 50 && MouseHandler.MouseHandler_lastPressedY <= 20) { - FontName.method5636(); + if(MouseHandler.MouseHandler_lastPressedX >= Login.xPadding + 708 && MouseHandler.MouseHandler_lastPressedY >= 4 && MouseHandler.MouseHandler_lastPressedX <= Login.xPadding + 708 + 50 && MouseHandler.MouseHandler_lastPressedY <= 20) { + FontName.closeWorldSelect(); break; } - if(Login.__cu_bl != -1) { - World var13 = ItemContainer.worlds[Login.__cu_bl]; + if(Login.hoveredWorldIndex != -1) { + World var13 = ItemContainer.worlds[Login.hoveredWorldIndex]; class31.changeWorld(var13); - FontName.method5636(); + FontName.closeWorldSelect(); } else { - if(Login.__cu_br > 0 && SecureRandomFuture.__cn_bu != null && MouseHandler.MouseHandler_lastPressedX >= 0 && MouseHandler.MouseHandler_lastPressedX <= SecureRandomFuture.__cn_bu.subWidth && MouseHandler.MouseHandler_lastPressedY >= Huffman.canvasHeight / 2 - 50 && MouseHandler.MouseHandler_lastPressedY <= Huffman.canvasHeight / 2 + 50) { - --Login.__cu_br; + if(Login.worldSelectPage > 0 && SecureRandomFuture.worldSelectLeftSprite != null && MouseHandler.MouseHandler_lastPressedX >= 0 && MouseHandler.MouseHandler_lastPressedX <= SecureRandomFuture.worldSelectLeftSprite.subWidth && MouseHandler.MouseHandler_lastPressedY >= Huffman.canvasHeight / 2 - 50 && MouseHandler.MouseHandler_lastPressedY <= Huffman.canvasHeight / 2 + 50) { + --Login.worldSelectPage; } - if(Login.__cu_br < Login.__cu_bj && NetSocket.__fb_bm != null && MouseHandler.MouseHandler_lastPressedX >= SoundCache.canvasWidth - NetSocket.__fb_bm.subWidth - 5 && MouseHandler.MouseHandler_lastPressedX <= SoundCache.canvasWidth && MouseHandler.MouseHandler_lastPressedY >= Huffman.canvasHeight / 2 - 50 && MouseHandler.MouseHandler_lastPressedY <= Huffman.canvasHeight / 2 + 50) { - ++Login.__cu_br; + if(Login.worldSelectPage < Login.worldSelectPagesCount && NetSocket.worldSelectRightSprite != null && MouseHandler.MouseHandler_lastPressedX >= SoundCache.canvasWidth - NetSocket.worldSelectRightSprite.subWidth - 5 && MouseHandler.MouseHandler_lastPressedX <= SoundCache.canvasWidth && MouseHandler.MouseHandler_lastPressedY >= Huffman.canvasHeight / 2 - 50 && MouseHandler.MouseHandler_lastPressedY <= Huffman.canvasHeight / 2 + 50) { + ++Login.worldSelectPage; } } break; } if(IndexStoreAction.__ik_cn == 13) { - FontName.method5636(); + FontName.closeWorldSelect(); break; } if(IndexStoreAction.__ik_cn == 96) { - if(Login.__cu_br > 0 && SecureRandomFuture.__cn_bu != null) { - --Login.__cu_br; + if(Login.worldSelectPage > 0 && SecureRandomFuture.worldSelectLeftSprite != null) { + --Login.worldSelectPage; } - } else if(IndexStoreAction.__ik_cn == 97 && Login.__cu_br < Login.__cu_bj && NetSocket.__fb_bm != null) { - ++Login.__cu_br; + } else if(IndexStoreAction.__ik_cn == 97 && Login.worldSelectPage < Login.worldSelectPagesCount && NetSocket.worldSelectRightSprite != null) { + ++Login.worldSelectPage; } } } else { - if((MouseHandler.MouseHandler_lastButton == 1 || !AbstractRasterProvider.__lp_ca && MouseHandler.MouseHandler_lastButton == 4) && MouseHandler.MouseHandler_lastPressedX >= Login.__cu_q + 765 - 50 && MouseHandler.MouseHandler_lastPressedY >= 453) { + if((MouseHandler.MouseHandler_lastButton == 1 || !AbstractRasterProvider.mouseCam && MouseHandler.MouseHandler_lastButton == 4) && MouseHandler.MouseHandler_lastPressedX >= Login.xPadding + 765 - 50 && MouseHandler.MouseHandler_lastPressedY >= 453) { ReflectionCheck.clientPreferences.titleMusicDisabled = !ReflectionCheck.clientPreferences.titleMusicDisabled; - WorldMapSection0.method247(); + WorldMapSection0.savePreferences(); if(!ReflectionCheck.clientPreferences.titleMusicDisabled) { class204.method4011(UserComparator3.indexCache6, "scape main", "", 255, false); } else { @@ -153,16 +153,16 @@ public final class class54 { if(Client.gameState == 10 || Client.gameState == 11) { if(Client.language == 0) { - if(MouseHandler.MouseHandler_lastButton == 1 || !AbstractRasterProvider.__lp_ca && MouseHandler.MouseHandler_lastButton == 4) { - var3 = Login.__cu_q + 5; + if(MouseHandler.MouseHandler_lastButton == 1 || !AbstractRasterProvider.mouseCam && MouseHandler.MouseHandler_lastButton == 4) { + var3 = Login.xPadding + 5; short var4 = 463; byte var5 = 100; byte var6 = 35; if(MouseHandler.MouseHandler_lastPressedX >= var3 && MouseHandler.MouseHandler_lastPressedX <= var3 + var5 && MouseHandler.MouseHandler_lastPressedY >= var4 && MouseHandler.MouseHandler_lastPressedY <= var6 + var4) { if(ClientParameter.loadWorlds()) { - Login.__cu_bk = true; - Login.__cu_br = 0; - Login.__cu_bj = 0; + Login.worldSelectOpen = true; + Login.worldSelectPage = 0; + Login.worldSelectPagesCount = 0; } return; @@ -170,9 +170,9 @@ public final class class54 { } if(FriendLoginUpdate.__kn_x != null && ClientParameter.loadWorlds()) { - Login.__cu_bk = true; - Login.__cu_br = 0; - Login.__cu_bj = 0; + Login.worldSelectOpen = true; + Login.worldSelectPage = 0; + Login.worldSelectPagesCount = 0; } } @@ -184,7 +184,7 @@ public final class class54 { var16 = MouseHandler.MouseHandler_y; } - if(!AbstractRasterProvider.__lp_ca && var3 == 4) { + if(!AbstractRasterProvider.mouseCam && var3 == 4) { var3 = 1; } @@ -199,15 +199,15 @@ public final class class54 { } } - var7 = Varps.__hv_h - 80; + var7 = Varps.loginBoxCenter - 80; var8 = 291; if(var3 == 1 && var15 >= var7 - 75 && var15 <= var7 + 75 && var16 >= var8 - 20 && var16 <= var8 + 20) { WorldMapCacheName.method635(Message.method1227("secure", true) + "m=account-creation/g=oldscape/create_account_funnel.ws", true, false); } - var7 = Varps.__hv_h + 80; + var7 = Varps.loginBoxCenter + 80; if(var3 == 1 && var15 >= var7 - 75 && var15 <= var7 + 75 && var16 >= var8 - 20 && var16 <= var8 + 20 || var17) { - if((Client.worldProperties & 33554432) != 0) { + if((Client.worldProperties & 0x2000000) != 0) { Login.Login_response0 = ""; Login.Login_response1 = "This is a Beta world."; Login.Login_response2 = "Your normal account will not be affected."; @@ -274,7 +274,7 @@ public final class class54 { } } - var7 = Varps.__hv_h - 80; + var7 = Varps.loginBoxCenter - 80; var8 = 321; if(var3 == 1 && var15 >= var7 - 75 && var15 <= var7 + 75 && var16 >= var8 - 20 && var16 <= var8 + 20) { Login.Login_username = Login.Login_username.trim(); @@ -294,30 +294,30 @@ public final class class54 { return; } - var7 = Login.__cu_y + 180 + 80; + var7 = Login.loginBoxX + 180 + 80; if(var3 == 1 && var15 >= var7 - 75 && var15 <= var7 + 75 && var16 >= var8 - 20 && var16 <= var8 + 20) { Login.loginIndex = 0; Login.Login_username = ""; Login.Login_password = ""; - class13.__i_af = 0; + class13.otpInt = 0; Login.otp = ""; Login.__cu_ba = true; } - var7 = Varps.__hv_h + -117; + var7 = Varps.loginBoxCenter + -117; var8 = 277; - Login.__cu_aa = var15 >= var7 && var15 < var7 + class168.__fs_au && var16 >= var8 && var16 < var8 + GroundItemPile.__dr_ao; + Login.__cu_aa = var15 >= var7 && var15 < var7 + class168.optionButtonSpriteSubWidth && var16 >= var8 && var16 < var8 + GroundItemPile.optionButtonSpriteSubHeight; if(var3 == 1 && Login.__cu_aa) { Client.Login_isUsernameRemembered = !Client.Login_isUsernameRemembered; if(!Client.Login_isUsernameRemembered && ReflectionCheck.clientPreferences.rememberedUsername != null) { ReflectionCheck.clientPreferences.rememberedUsername = null; - WorldMapSection0.method247(); + WorldMapSection0.savePreferences(); } } - var7 = Varps.__hv_h + 24; + var7 = Varps.loginBoxCenter + 24; var8 = 277; - Login.__cu_ax = var15 >= var7 && var15 < var7 + class168.__fs_au && var16 >= var8 && var16 < var8 + GroundItemPile.__dr_ao; + Login.__cu_ax = var15 >= var7 && var15 < var7 + class168.optionButtonSpriteSubWidth && var16 >= var8 && var16 < var8 + GroundItemPile.optionButtonSpriteSubHeight; if(var3 == 1 && Login.__cu_ax) { ReflectionCheck.clientPreferences.hideUsername = !ReflectionCheck.clientPreferences.hideUsername; if(!ReflectionCheck.clientPreferences.hideUsername) { @@ -326,7 +326,7 @@ public final class class54 { class196.method3740(); } - WorldMapSection0.method247(); + WorldMapSection0.savePreferences(); } while(true) { @@ -344,7 +344,7 @@ public final class class54 { Login.loginIndex = 0; Login.Login_username = ""; Login.Login_password = ""; - class13.__i_af = 0; + class13.otpInt = 0; Login.otp = ""; Login.__cu_ba = true; } else if(Login.currentLoginField == 0) { @@ -395,13 +395,13 @@ public final class class54 { return; } } else if(Login.loginIndex == 3) { - var18 = Login.__cu_y + 180; + var18 = Login.loginBoxX + 180; var20 = 276; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { MouseHandler.method1084(false); } - var18 = Login.__cu_y + 180; + var18 = Login.loginBoxX + 180; var20 = 326; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { method1089("Please enter your username.", "If you created your account after November", "2010, this will be the creation email address."); @@ -411,7 +411,7 @@ public final class class54 { } else { int var22; if(Login.loginIndex == 4) { - var18 = Login.__cu_y + 180 - 80; + var18 = Login.loginBoxX + 180 - 80; var20 = 321; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { Login.otp.trim(); @@ -420,7 +420,7 @@ public final class class54 { return; } - class13.__i_af = Integer.parseInt(Login.otp); + class13.otpInt = Integer.parseInt(Login.otp); Login.otp = ""; class15.method184(true); method1089("", "Connecting to server...", ""); @@ -428,20 +428,20 @@ public final class class54 { return; } - if(var3 == 1 && var15 >= Login.__cu_y + 180 - 9 && var15 <= Login.__cu_y + 180 + 130 && var16 >= 263 && var16 <= 296) { + if(var3 == 1 && var15 >= Login.loginBoxX + 180 - 9 && var15 <= Login.loginBoxX + 180 + 130 && var16 >= 263 && var16 <= 296) { Login.__cu_ba = !Login.__cu_ba; } - if(var3 == 1 && var15 >= Login.__cu_y + 180 - 34 && var15 <= Login.__cu_y + 34 + 180 && var16 >= 351 && var16 <= 363) { + if(var3 == 1 && var15 >= Login.loginBoxX + 180 - 34 && var15 <= Login.loginBoxX + 34 + 180 && var16 >= 351 && var16 <= 363) { WorldMapCacheName.method635(Message.method1227("secure", true) + "m=totp-authenticator/disableTOTPRequest", true, false); } - var18 = Login.__cu_y + 180 + 80; + var18 = Login.loginBoxX + 180 + 80; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { Login.loginIndex = 0; Login.Login_username = ""; Login.Login_password = ""; - class13.__i_af = 0; + class13.otpInt = 0; Login.otp = ""; } @@ -459,7 +459,7 @@ public final class class54 { Login.loginIndex = 0; Login.Login_username = ""; Login.Login_password = ""; - class13.__i_af = 0; + class13.otpInt = 0; Login.otp = ""; } else { if(IndexStoreAction.__ik_cn == 85 && Login.otp.length() > 0) { @@ -473,7 +473,7 @@ public final class class54 { return; } - class13.__i_af = Integer.parseInt(Login.otp); + class13.otpInt = Integer.parseInt(Login.otp); Login.otp = ""; class15.method184(true); method1089("", "Connecting to server...", ""); @@ -487,14 +487,14 @@ public final class class54 { } } } else if(Login.loginIndex == 5) { - var18 = Login.__cu_y + 180 - 80; + var18 = Login.loginBoxX + 180 - 80; var20 = 321; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { NpcDefinition.method5162(); return; } - var18 = Login.__cu_y + 180 + 80; + var18 = Login.loginBoxX + 180 + 80; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { MouseHandler.method1084(true); } @@ -550,7 +550,7 @@ public final class class54 { MouseHandler.method1084(true); } } else if(Login.loginIndex == 7) { - var18 = Login.__cu_y + 180 - 80; + var18 = Login.loginBoxX + 180 - 80; var20 = 321; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { WorldMapCacheName.method635(Message.method1227("secure", true) + "m=dob/set_dob.ws", true, false); @@ -559,12 +559,12 @@ public final class class54 { return; } - var18 = Login.__cu_y + 180 + 80; + var18 = Login.loginBoxX + 180 + 80; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { MouseHandler.method1084(true); } } else if(Login.loginIndex == 8) { - var18 = Login.__cu_y + 180 - 80; + var18 = Login.loginBoxX + 180 - 80; var20 = 321; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { WorldMapCacheName.method635("https://www.jagex.com/terms/privacy/#eight", true, false); @@ -573,7 +573,7 @@ public final class class54 { return; } - var18 = Login.__cu_y + 180 + 80; + var18 = Login.loginBoxX + 180 + 80; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { MouseHandler.method1084(true); } @@ -590,7 +590,7 @@ public final class class54 { MouseHandler.method1084(false); } - var7 = Login.__cu_y + 180; + var7 = Login.loginBoxX + 180; var8 = 276; if(var3 == 1 && var15 >= var7 - 75 && var15 <= var7 + 75 && var16 >= var8 - 20 && var16 <= var8 + 20) { WorldMapCacheName.method635(var14, true, false); @@ -599,7 +599,7 @@ public final class class54 { return; } - var7 = Login.__cu_y + 180; + var7 = Login.loginBoxX + 180; var8 = 326; if(var3 == 1 && var15 >= var7 - 75 && var15 <= var7 + 75 && var16 >= var8 - 20 && var16 <= var8 + 20) { MouseHandler.method1084(false); @@ -615,13 +615,13 @@ public final class class54 { } } - var18 = Varps.__hv_h - 80; + var18 = Varps.loginBoxCenter - 80; var20 = 321; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { MouseHandler.method1084(false); } - var18 = Varps.__hv_h + 80; + var18 = Varps.loginBoxCenter + 80; if(var3 == 1 && var15 >= var18 - 75 && var15 <= var18 + 75 && var16 >= var20 - 20 && var16 <= var20 + 20) { Login.loginIndex = 0; } @@ -660,7 +660,7 @@ public final class class54 { } else { WorldMapArea var11; if(var0 == 6601) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; String var16 = ""; var11 = BufferedFile.worldMap().getMapArea(var3); if(var11 != null) { @@ -670,120 +670,120 @@ public final class class54 { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var16; return 1; } else if(var0 == 6602) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; BufferedFile.worldMap().setCurrentMapAreaId(var3); return 1; } else if(var0 == 6603) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = BufferedFile.worldMap().getZoomLevel(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = BufferedFile.worldMap().getZoomLevel(); return 1; } else if(var0 == 6604) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; BufferedFile.worldMap().setZoomLevel(var3); return 1; } else if(var0 == 6605) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = BufferedFile.worldMap().isCacheLoaded()?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = BufferedFile.worldMap().isCacheLoaded()?1:0; return 1; } else { TileLocation var15; if(var0 == 6606) { - var15 = new TileLocation(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var15 = new TileLocation(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); BufferedFile.worldMap().setWorldMapPositionTarget(var15.x, var15.y); return 1; } else if(var0 == 6607) { - var15 = new TileLocation(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var15 = new TileLocation(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); BufferedFile.worldMap().__aw_531(var15.x, var15.y); return 1; } else if(var0 == 6608) { - var15 = new TileLocation(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var15 = new TileLocation(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); BufferedFile.worldMap().__al_532(var15.plane, var15.x, var15.y); return 1; } else if(var0 == 6609) { - var15 = new TileLocation(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var15 = new TileLocation(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); BufferedFile.worldMap().__ab_533(var15.plane, var15.x, var15.y); return 1; } else if(var0 == 6610) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = BufferedFile.worldMap().__ae_534(); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = BufferedFile.worldMap().__at_535(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = BufferedFile.worldMap().__ae_534(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = BufferedFile.worldMap().__at_535(); return 1; } else { WorldMapArea var13; if(var0 == 6611) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var13 = BufferedFile.worldMap().getMapArea(var3); if(var13 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var13.origin().packed(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var13.origin().packed(); } return 1; } else if(var0 == 6612) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var13 = BufferedFile.worldMap().getMapArea(var3); if(var13 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (var13.maxX() - var13.minX() + 1) * 64; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = (var13.maxY() - var13.minY() + 1) * 64; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (var13.maxX() - var13.minX() + 1) * 64; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = (var13.maxY() - var13.minY() + 1) * 64; } return 1; } else if(var0 == 6613) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var13 = BufferedFile.worldMap().getMapArea(var3); if(var13 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var13.minX() * 64; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var13.minY() * 64; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var13.maxX() * 64 + 64 - 1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var13.maxY() * 64 + 64 - 1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var13.minX() * 64; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var13.minY() * 64; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var13.maxX() * 64 + 64 - 1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var13.maxY() * 64 + 64 - 1; } return 1; } else if(var0 == 6614) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var13 = BufferedFile.worldMap().getMapArea(var3); if(var13 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var13.zoom(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var13.zoom(); } return 1; } else if(var0 == 6615) { var15 = BufferedFile.worldMap().__ad_536(); if(var15 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var15.x; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var15.y; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var15.x; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var15.y; } return 1; } else if(var0 == 6616) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = BufferedFile.worldMap().currentMapAreaId(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = BufferedFile.worldMap().currentMapAreaId(); return 1; } else if(var0 == 6617) { - var15 = new TileLocation(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var15 = new TileLocation(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); var13 = BufferedFile.worldMap().getCurrentMapArea(); if(var13 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; return 1; } else { int[] var14 = var13.position(var15.plane, var15.x, var15.y); if(var14 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var14[0]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var14[1]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var14[0]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var14[1]; } return 1; @@ -791,18 +791,18 @@ public final class class54 { } else { TileLocation var7; if(var0 == 6618) { - var15 = new TileLocation(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var15 = new TileLocation(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); var13 = BufferedFile.worldMap().getCurrentMapArea(); if(var13 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; return 1; } else { var7 = var13.coord(var15.x, var15.y); if(var7 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var7.packed(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var7.packed(); } return 1; @@ -810,51 +810,51 @@ public final class class54 { } else { TileLocation var12; if(var0 == 6619) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var12 = new TileLocation(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var12 = new TileLocation(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]); TotalQuantityComparator.method96(var3, var12, false); return 1; } else if(var0 == 6620) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var12 = new TileLocation(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var12 = new TileLocation(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]); TotalQuantityComparator.method96(var3, var12, true); return 1; } else if(var0 == 6621) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var12 = new TileLocation(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var12 = new TileLocation(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]); var11 = BufferedFile.worldMap().getMapArea(var3); if(var11 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = 0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = 0; return 1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var11.containsCoord(var12.plane, var12.x, var12.y)?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var11.containsCoord(var12.plane, var12.x, var12.y)?1:0; return 1; } } else if(var0 == 6622) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = BufferedFile.worldMap().__ap_537(); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = BufferedFile.worldMap().__as_538(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = BufferedFile.worldMap().__ap_537(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = BufferedFile.worldMap().__as_538(); return 1; } else if(var0 == 6623) { - var15 = new TileLocation(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + var15 = new TileLocation(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); var13 = BufferedFile.worldMap().mapAreaAtCoord(var15.plane, var15.x, var15.y); if(var13 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var13.id(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var13.id(); } return 1; } else if(var0 == 6624) { - BufferedFile.worldMap().__am_539(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + BufferedFile.worldMap().__am_539(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); return 1; } else if(var0 == 6625) { BufferedFile.worldMap().__an_540(); return 1; } else if(var0 == 6626) { - BufferedFile.worldMap().__az_541(Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]); + BufferedFile.worldMap().__az_541(Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]); return 1; } else if(var0 == 6627) { BufferedFile.worldMap().__au_542(); @@ -862,58 +862,58 @@ public final class class54 { } else { boolean var10; if(var0 == 6628) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; BufferedFile.worldMap().perpetualFlash(var10); return 1; } else if(var0 == 6629) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; BufferedFile.worldMap().flashElement(var3); return 1; } else if(var0 == 6630) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; BufferedFile.worldMap().flashCategory(var3); return 1; } else if(var0 == 6631) { BufferedFile.worldMap().stopCurrentFlashes(); return 1; } else if(var0 == 6632) { - var10 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize] == 1; + var10 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1; BufferedFile.worldMap().setElementsEnabled(var10); return 1; } else { boolean var4; if(var0 == 6633) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1] == 1; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1] == 1; BufferedFile.worldMap().disableElement(var3, var4); return 1; } else if(var0 == 6634) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var4 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1] == 1; + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var4 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1] == 1; BufferedFile.worldMap().disableCategory(var3, var4); return 1; } else if(var0 == 6635) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = BufferedFile.worldMap().getElementsEnabled()?1:0; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = BufferedFile.worldMap().getElementsEnabled()?1:0; return 1; } else if(var0 == 6636) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = BufferedFile.worldMap().isElementDisabled(var3)?1:0; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = BufferedFile.worldMap().isElementDisabled(var3)?1:0; return 1; } else if(var0 == 6637) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = BufferedFile.worldMap().isCategoryDisabled(var3)?1:0; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = BufferedFile.worldMap().isCategoryDisabled(var3)?1:0; return 1; } else if(var0 == 6638) { - class179.Interpreter_intStackSize -= 2; - var3 = Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize]; - var12 = new TileLocation(Interpreter.Interpreter_intStack[class179.Interpreter_intStackSize + 1]); + RouteStrategy.Interpreter_intStackSize -= 2; + var3 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]; + var12 = new TileLocation(Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]); var7 = BufferedFile.worldMap().__bc_545(var3, var12); if(var7 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var7.packed(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var7.packed(); } return 1; @@ -922,29 +922,29 @@ public final class class54 { if(var0 == 6639) { var8 = BufferedFile.worldMap().iconStart(); if(var8 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var8.__m_15(); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var8.coord2.packed(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var8.__m_15(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var8.coord2.packed(); } return 1; } else if(var0 == 6640) { var8 = BufferedFile.worldMap().iconNext(); if(var8 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var8.__m_15(); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var8.coord2.packed(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var8.__m_15(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var8.coord2.packed(); } return 1; } else { WorldMapElement var6; if(var0 == 6693) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var6 = ViewportMouse.getWorldMapElement(var3); if(var6.__l == null) { Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = ""; @@ -954,38 +954,38 @@ public final class class54 { return 1; } else if(var0 == 6694) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var6 = ViewportMouse.getWorldMapElement(var3); - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var6.textSize; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var6.textSize; return 1; } else if(var0 == 6695) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var6 = ViewportMouse.getWorldMapElement(var3); if(var6 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var6.category; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var6.category; } return 1; } else if(var0 == 6696) { - var3 = Interpreter.Interpreter_intStack[--class179.Interpreter_intStackSize]; + var3 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize]; var6 = ViewportMouse.getWorldMapElement(var3); if(var6 == null) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = -1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = -1; } else { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = var6.sprite1; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var6.sprite1; } return 1; } else if(var0 == 6697) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class15.worldMapEvent.mapElement; + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class15.worldMapEvent.mapElement; return 1; } else if(var0 == 6698) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class15.worldMapEvent.coord1.packed(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class15.worldMapEvent.coord1.packed(); return 1; } else if(var0 == 6699) { - Interpreter.Interpreter_intStack[++class179.Interpreter_intStackSize - 1] = class15.worldMapEvent.coord2.packed(); + Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class15.worldMapEvent.coord2.packed(); return 1; } else { return 2; @@ -1158,7 +1158,7 @@ public final class class54 { } } - if(MouseHandler.MouseHandler_currentButton == 4 && AbstractRasterProvider.__lp_ca) { + if(MouseHandler.MouseHandler_currentButton == 4 && AbstractRasterProvider.mouseCam) { var0 = MouseHandler.MouseHandler_y - Client.__client_ht; Client.__client_hu = var0 * 2; Client.__client_ht = var0 != -1 && var0 != 1?(MouseHandler.MouseHandler_y + Client.__client_ht) / 2:MouseHandler.MouseHandler_y; diff --git a/runescape-client/src/main/java/class65.java b/runescape-client/src/main/java/class65.java index d42b1a1296..9f33160c98 100644 --- a/runescape-client/src/main/java/class65.java +++ b/runescape-client/src/main/java/class65.java @@ -3,7 +3,8 @@ import net.runelite.mapping.ObfuscatedName; import net.runelite.mapping.ObfuscatedSignature; @ObfuscatedName("bl") -public class class65 extends class179 { +public class class65 extends RouteStrategy +{ @ObfuscatedName("n") @ObfuscatedSignature( signature = "Lcz;" @@ -23,7 +24,7 @@ public class class65 extends class179 { garbageValue = "-519225044" ) protected boolean vmethod3644(int var1, int var2, int var3, CollisionMap var4) { - return var2 == super.field2120 && var3 == super.field2121; + return var2 == super.approxDestinationX && var3 == super.approxDestinationY; } @ObfuscatedName("fi") @@ -31,131 +32,131 @@ public class class65 extends class179 { signature = "(Lbz;II)V", garbageValue = "406386718" ) - static final void method1232(Actor var0, int var1) { - if(var0.__bw > Client.cycle) { - SpriteIds.method5828(var0); + static final void method1232(Actor actor, int var1) { + if(actor.__bw > Client.cycle) { + SpriteIds.method5828(actor); } else { int var2; int var3; int var4; int var5; int var7; - if(var0.__cr >= Client.cycle) { - if(var0.__cr == Client.cycle || var0.sequence == -1 || var0.sequenceDelay != 0 || var0.sequenceFrameCycle + 1 > WorldMapAreaData.getSequenceDefinition(var0.sequence).frameLengths[var0.sequenceFrame]) { - var2 = var0.__cr - var0.__bw; - var3 = Client.cycle - var0.__bw; - var4 = var0.__bf * 128 + var0.size * 64; - var5 = var0.__be * 128 + var0.size * 64; - int var6 = var0.__bh * 128 + var0.size * 64; - var7 = var0.__bv * 128 + var0.size * 64; - var0.x = (var3 * var6 + var4 * (var2 - var3)) / var2; - var0.y = (var3 * var7 + var5 * (var2 - var3)) / var2; + if(actor.__cr >= Client.cycle) { + if(actor.__cr == Client.cycle || actor.sequence == -1 || actor.sequenceDelay != 0 || actor.sequenceFrameCycle + 1 > WorldMapAreaData.getSequenceDefinition(actor.sequence).frameLengths[actor.sequenceFrame]) { + var2 = actor.__cr - actor.__bw; + var3 = Client.cycle - actor.__bw; + var4 = actor.__bf * 128 + actor.size * 64; + var5 = actor.__be * 128 + actor.size * 64; + int var6 = actor.__bh * 128 + actor.size * 64; + var7 = actor.__bv * 128 + actor.size * 64; + actor.x = (var3 * var6 + var4 * (var2 - var3)) / var2; + actor.y = (var3 * var7 + var5 * (var2 - var3)) / var2; } - var0.__cq = 0; - var0.orientation = var0.__cv; - var0.__ac = var0.orientation; + actor.__cq = 0; + actor.orientation = actor.__cv; + actor.__ac = actor.orientation; } else { - var0.movementSequence = var0.idleSequence; - if(var0.pathLength == 0) { - var0.__cq = 0; + actor.movementSequence = actor.idleSequence; + if(actor.pathLength == 0) { + actor.__cq = 0; } else { label310: { - if(var0.sequence != -1 && var0.sequenceDelay == 0) { - SequenceDefinition var11 = WorldMapAreaData.getSequenceDefinition(var0.sequence); - if(var0.__ch > 0 && var11.__j == 0) { - ++var0.__cq; + if(actor.sequence != -1 && actor.sequenceDelay == 0) { + SequenceDefinition var11 = WorldMapAreaData.getSequenceDefinition(actor.sequence); + if(actor.__ch > 0 && var11.__j == 0) { + ++actor.__cq; break label310; } - if(var0.__ch <= 0 && var11.__s == 0) { - ++var0.__cq; + if(actor.__ch <= 0 && var11.__s == 0) { + ++actor.__cq; break label310; } } - var2 = var0.x; - var3 = var0.y; - var4 = var0.pathX[var0.pathLength - 1] * 128 + var0.size * 64; - var5 = var0.pathY[var0.pathLength - 1] * 128 + var0.size * 64; + var2 = actor.x; + var3 = actor.y; + var4 = actor.pathX[actor.pathLength - 1] * 128 + actor.size * 64; + var5 = actor.pathY[actor.pathLength - 1] * 128 + actor.size * 64; if(var2 < var4) { if(var3 < var5) { - var0.orientation = 1280; + actor.orientation = 1280; } else if(var3 > var5) { - var0.orientation = 1792; + actor.orientation = 1792; } else { - var0.orientation = 1536; + actor.orientation = 1536; } } else if(var2 > var4) { if(var3 < var5) { - var0.orientation = 768; + actor.orientation = 768; } else if(var3 > var5) { - var0.orientation = 256; + actor.orientation = 256; } else { - var0.orientation = 512; + actor.orientation = 512; } } else if(var3 < var5) { - var0.orientation = 1024; + actor.orientation = 1024; } else if(var3 > var5) { - var0.orientation = 0; + actor.orientation = 0; } - byte var12 = var0.pathTraversed[var0.pathLength - 1]; + byte var12 = actor.pathTraversed[actor.pathLength - 1]; if(var4 - var2 <= 256 && var4 - var2 >= -256 && var5 - var3 <= 256 && var5 - var3 >= -256) { - var7 = var0.orientation - var0.__ac & 2047; + var7 = actor.orientation - actor.__ac & 2047; if(var7 > 1024) { var7 -= 2048; } - int var8 = var0.walkTurnSequence; + int var8 = actor.walkTurnSequence; if(var7 >= -256 && var7 <= 256) { - var8 = var0.walkSequence; + var8 = actor.walkSequence; } else if(var7 >= 256 && var7 < 768) { - var8 = var0.walkTurnRightSequence; + var8 = actor.walkTurnRightSequence; } else if(var7 >= -768 && var7 <= -256) { - var8 = var0.walkTurnLeftSequence; + var8 = actor.walkTurnLeftSequence; } if(var8 == -1) { - var8 = var0.walkSequence; + var8 = actor.walkSequence; } - var0.movementSequence = var8; + actor.movementSequence = var8; int var9 = 4; boolean var10 = true; - if(var0 instanceof Npc) { - var10 = ((Npc)var0).definition.isClickable; + if(actor instanceof Npc) { + var10 = ((Npc)actor).definition.isClickable; } if(var10) { - if(var0.__ac != var0.orientation && var0.targetIndex == -1 && var0.__cj != 0) { + if(actor.__ac != actor.orientation && actor.targetIndex == -1 && actor.__cj != 0) { var9 = 2; } - if(var0.pathLength > 2) { + if(actor.pathLength > 2) { var9 = 6; } - if(var0.pathLength > 3) { + if(actor.pathLength > 3) { var9 = 8; } - if(var0.__cq > 0 && var0.pathLength > 1) { + if(actor.__cq > 0 && actor.pathLength > 1) { var9 = 8; - --var0.__cq; + --actor.__cq; } } else { - if(var0.pathLength > 1) { + if(actor.pathLength > 1) { var9 = 6; } - if(var0.pathLength > 2) { + if(actor.pathLength > 2) { var9 = 8; } - if(var0.__cq > 0 && var0.pathLength > 1) { + if(actor.__cq > 0 && actor.pathLength > 1) { var9 = 8; - --var0.__cq; + --actor.__cq; } } @@ -163,48 +164,48 @@ public class class65 extends class179 { var9 <<= 1; } - if(var9 >= 8 && var0.movementSequence == var0.walkSequence && var0.runSequence != -1) { - var0.movementSequence = var0.runSequence; + if(var9 >= 8 && actor.movementSequence == actor.walkSequence && actor.runSequence != -1) { + actor.movementSequence = actor.runSequence; } if(var2 != var4 || var5 != var3) { if(var2 < var4) { - var0.x += var9; - if(var0.x > var4) { - var0.x = var4; + actor.x += var9; + if(actor.x > var4) { + actor.x = var4; } } else if(var2 > var4) { - var0.x -= var9; - if(var0.x < var4) { - var0.x = var4; + actor.x -= var9; + if(actor.x < var4) { + actor.x = var4; } } if(var3 < var5) { - var0.y += var9; - if(var0.y > var5) { - var0.y = var5; + actor.y += var9; + if(actor.y > var5) { + actor.y = var5; } } else if(var3 > var5) { - var0.y -= var9; - if(var0.y < var5) { - var0.y = var5; + actor.y -= var9; + if(actor.y < var5) { + actor.y = var5; } } } - if(var4 == var0.x && var5 == var0.y) { - --var0.pathLength; - if(var0.__ch > 0) { - --var0.__ch; + if(var4 == actor.x && var5 == actor.y) { + --actor.pathLength; + if(actor.__ch > 0) { + --actor.__ch; } } } else { - var0.x = var4; - var0.y = var5; - --var0.pathLength; - if(var0.__ch > 0) { - --var0.__ch; + actor.x = var4; + actor.y = var5; + --actor.pathLength; + if(actor.__ch > 0) { + --actor.__ch; } } } @@ -212,27 +213,27 @@ public class class65 extends class179 { } } - if(var0.x < 128 || var0.y < 128 || var0.x >= 13184 || var0.y >= 13184) { - var0.sequence = -1; - var0.spotAnimation = -1; - var0.__bw = 0; - var0.__cr = 0; - var0.x = var0.pathX[0] * 128 + var0.size * 64; - var0.y = var0.pathY[0] * 128 + var0.size * 64; - var0.__bb_143(); + if(actor.x < 128 || actor.y < 128 || actor.x >= 13184 || actor.y >= 13184) { + actor.sequence = -1; + actor.spotAnimation = -1; + actor.__bw = 0; + actor.__cr = 0; + actor.x = actor.pathX[0] * 128 + actor.size * 64; + actor.y = actor.pathY[0] * 128 + actor.size * 64; + actor.__bb_143(); } - if(Canvas.localPlayer == var0 && (var0.x < 1536 || var0.y < 1536 || var0.x >= 11776 || var0.y >= 11776)) { - var0.sequence = -1; - var0.spotAnimation = -1; - var0.__bw = 0; - var0.__cr = 0; - var0.x = var0.pathX[0] * 128 + var0.size * 64; - var0.y = var0.pathY[0] * 128 + var0.size * 64; - var0.__bb_143(); + if(Canvas.localPlayer == actor && (actor.x < 1536 || actor.y < 1536 || actor.x >= 11776 || actor.y >= 11776)) { + actor.sequence = -1; + actor.spotAnimation = -1; + actor.__bw = 0; + actor.__cr = 0; + actor.x = actor.pathX[0] * 128 + actor.size * 64; + actor.y = actor.pathY[0] * 128 + actor.size * 64; + actor.__bb_143(); } - IndexStoreAction.method4553(var0); - ChatChannel.method2225(var0); + IndexStoreAction.method4553(actor); + ChatChannel.method2225(actor); } } diff --git a/runescape-client/src/main/java/class80.java b/runescape-client/src/main/java/class80.java index 61022cc1b2..49d74e779f 100644 --- a/runescape-client/src/main/java/class80.java +++ b/runescape-client/src/main/java/class80.java @@ -24,21 +24,21 @@ public class class80 { ) static void method2015() { if(Login.__cu_f) { - Login.__cu_o = null; - IndexCacheLoader.__bd_u = null; - WorldMapEvent.__ap_w = null; - Login.__cu_g = null; - Fonts.__kz_l = null; - WorldMapSectionType.__h_e = null; - KeyHandler.__an_x = null; - Login.__cu_d = null; - class308.__kw_n = null; - class30.__ar_bd = null; - Frames.__en_bc = null; - AttackOption.__cj_bo = null; - UrlRequest.__ey_bx = null; + Login.titleboxSprite = null; + IndexCacheLoader.titlebuttonSprite = null; + WorldMapEvent.runesSprite = null; + Login.leftTitleSprite = null; + Fonts.rightTitleSprite = null; + WorldMapSectionType.logoSprite = null; + KeyHandler.title_muteSprite = null; + Login.options_buttons_0Sprite = null; + class308.options_buttons_2Sprite = null; + class30.worldSelectBackSprites = null; + Frames.worldSelectFlagSprites = null; + AttackOption.worldSelectArrows = null; + UrlRequest.worldSelectStars = null; class277.__jn_by = null; - class16.field85.method1762(); + class16.loginScreenRunesAnimation.method1762(); AbstractSocket.method3488(2); UserComparator9.method3343(true); Login.__cu_f = false; diff --git a/runescape-client/src/main/java/class83.java b/runescape-client/src/main/java/class83.java index 21b18571bd..c112879d60 100644 --- a/runescape-client/src/main/java/class83.java +++ b/runescape-client/src/main/java/class83.java @@ -60,6 +60,6 @@ public class class83 { garbageValue = "1413048059" ) public static IndexedSprite method2028(AbstractIndexCache var0, int var1) { - return !class179.method3643(var0, var1)?null:ServerPacket.method3663(); + return !RouteStrategy.loadSpriteFlat(var0, var1)?null:ServerPacket.createIndexedSprite(); } } diff --git a/runescape-client/src/main/java/class98.java b/runescape-client/src/main/java/class98.java index 043142871d..2e7e07fc24 100644 --- a/runescape-client/src/main/java/class98.java +++ b/runescape-client/src/main/java/class98.java @@ -219,7 +219,7 @@ public class class98 { @ObfuscatedName("m") static int method2310(int var0, int var1) { int var2; - for(var2 = (int)Math.pow((double)var0, 1.0D / (double)var1) + 1; class179.method3642(var2, var1) > var0; --var2) { + for(var2 = (int)Math.pow((double)var0, 1.0D / (double)var1) + 1; RouteStrategy.method3642(var2, var1) > var0; --var2) { ; } diff --git a/travis/build.sh b/travis/build.sh index 52d364db04..deba275667 100644 --- a/travis/build.sh +++ b/travis/build.sh @@ -1,3 +1,3 @@ #!/bin/bash -mvn clean install -DskipTests --settings travis/settings.xml +mvn clean install --settings travis/settings.xml diff --git a/travis/settings.xml b/travis/settings.xml index 780196878e..53689ebbce 100644 --- a/travis/settings.xml +++ b/travis/settings.xml @@ -260,7 +260,7 @@ under the License. true false true - true + false