mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-11 17:10:24 -07:00
Interface debugging
This commit is contained in:
parent
8dfbcb9423
commit
d69ac42050
15 changed files with 149 additions and 31 deletions
|
|
@ -1,7 +1,9 @@
|
|||
package plugin;
|
||||
|
||||
import rt4.Component;
|
||||
import rt4.Npc;
|
||||
import rt4.Player;
|
||||
import rt4.Tile;
|
||||
|
||||
/**
|
||||
* The base plugin class which is meant to be extended by plugins.
|
||||
|
|
@ -58,4 +60,7 @@ public abstract class Plugin {
|
|||
public void NPCOverheadDraw(Npc npc, int screenX, int screenY) {}
|
||||
|
||||
public void ProcessCommand(String commandStr, String[] args) {}
|
||||
|
||||
public void ComponentDraw(int componentIndex, Component component, int screenX, int screenY) {}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
package plugin;
|
||||
|
||||
import rt4.GlobalJsonConfig;
|
||||
import rt4.JagString;
|
||||
import rt4.Npc;
|
||||
import rt4.Player;
|
||||
import rt4.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
|
|
@ -98,4 +95,8 @@ public class PluginRepository {
|
|||
String[] args = Arrays.copyOfRange(tokens, 1, tokens.length);
|
||||
loadedPlugins.values().forEach((plugin) -> plugin.ProcessCommand(tokens[0], args));
|
||||
}
|
||||
|
||||
public static void ComponentDraw(int componentIndex, Component component, int screenX, int screenY) {
|
||||
loadedPlugins.values().forEach((plugin) -> plugin.ComponentDraw(componentIndex, component, screenX, screenY));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,4 +47,8 @@ public class API {
|
|||
public static boolean PlayerHasPrivilege(Privileges privilege) {
|
||||
return LoginManager.staffModLevel >= privilege.ordinal();
|
||||
}
|
||||
|
||||
public static boolean IsHD() {
|
||||
return GlRenderer.enabled;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ public class FontColor {
|
|||
|
||||
public final int colorCode;
|
||||
|
||||
FontColor(int colorCode) {
|
||||
public FontColor(int colorCode) {
|
||||
this.colorCode = colorCode;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import org.openrs2.deob.annotation.OriginalMember;
|
|||
public final class ComponentPointer extends Node {
|
||||
|
||||
@OriginalMember(owner = "client!wk", name = "r", descriptor = "I")
|
||||
public int anInt5878;
|
||||
public int interfaceId;
|
||||
|
||||
@OriginalMember(owner = "client!wk", name = "s", descriptor = "I")
|
||||
public int anInt5879;
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ public class Cs1ScriptRunner {
|
|||
}
|
||||
|
||||
@OriginalMember(owner = "client!gn", name = "a", descriptor = "(III[Lclient!be;IIIIBI)V")
|
||||
public static void method1809(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) Component[] components, @OriginalArg(4) int arg4, @OriginalArg(5) int layer, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(9) int parentRectangle) {
|
||||
public static void renderComponent(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) Component[] components, @OriginalArg(4) int arg4, @OriginalArg(5) int layer, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(9) int parentRectangle) {
|
||||
if (GlRenderer.enabled) {
|
||||
GlRaster.setClip(arg0, arg6, arg4, arg7);
|
||||
} else {
|
||||
|
|
@ -573,9 +573,9 @@ public class Cs1ScriptRunner {
|
|||
component.scrollY = 0;
|
||||
}
|
||||
}
|
||||
method1809(local166, local114 - component.scrollY, -component.scrollX + local123, components, local302, component.id, local164, local291, rectangle);
|
||||
renderComponent(local166, local114 - component.scrollY, -component.scrollX + local123, components, local302, component.id, local164, local291, rectangle);
|
||||
if (component.createdComponents != null) {
|
||||
method1809(local166, local114 - component.scrollY, -component.scrollX + local123, component.createdComponents, local302, component.id, local164, local291, rectangle);
|
||||
renderComponent(local166, local114 - component.scrollY, -component.scrollX + local123, component.createdComponents, local302, component.id, local164, local291, rectangle);
|
||||
}
|
||||
@Pc(1186) ComponentPointer local1186 = (ComponentPointer) InterfaceList.openInterfaces.get(component.id);
|
||||
if (local1186 != null) {
|
||||
|
|
@ -586,7 +586,7 @@ public class Cs1ScriptRunner {
|
|||
MiniMenu.actions[0] = 1005;
|
||||
MiniMenu.opBases[0] = JagString.EMPTY;
|
||||
}
|
||||
method86(local1186.anInt5878, local166, local302, local123, rectangle, local291, local164, local114);
|
||||
method86(local1186.interfaceId, local166, local302, local123, rectangle, local291, local164, local114);
|
||||
}
|
||||
if (GlRenderer.enabled) {
|
||||
GlRaster.setClip(arg0, arg6, arg4, arg7);
|
||||
|
|
@ -712,6 +712,7 @@ public class Cs1ScriptRunner {
|
|||
local270++;
|
||||
}
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local123, local114);
|
||||
} else if (component.type == 3) {
|
||||
if (isTrue(component)) {
|
||||
local270 = component.activeColor;
|
||||
|
|
@ -747,6 +748,7 @@ public class Cs1ScriptRunner {
|
|||
} else {
|
||||
SoftwareRaster.method2487(local123, local114, component.width, component.height, local270, 256 - (alpha & 0xFF));
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local123, local114);
|
||||
} else {
|
||||
@Pc(1921) Font local1921;
|
||||
if (component.type == 4) {
|
||||
|
|
@ -785,6 +787,7 @@ public class Cs1ScriptRunner {
|
|||
local1934 = interpolate(component, local1934);
|
||||
}
|
||||
local1921.drawInterfaceText(local1934, local123, local114, component.width, component.height, local276, component.shadowed ? 0 : -1, component.halign, component.valign, component.vpadding);
|
||||
PluginRepository.ComponentDraw(i, component, local123, local114);
|
||||
} else if (Component.aBoolean72) {
|
||||
InterfaceList.redraw(component);
|
||||
}
|
||||
|
|
@ -817,6 +820,7 @@ public class Cs1ScriptRunner {
|
|||
} else {
|
||||
local2282.method1426(local123, local114, 256 - (alpha & 0xFF), memory, color);
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local123, local114);
|
||||
} else if (local2274) {
|
||||
for (local563 = 0; local563 < color; local563++) {
|
||||
if (alpha == 0) {
|
||||
|
|
@ -825,6 +829,7 @@ public class Cs1ScriptRunner {
|
|||
local2282.method1426(local123, local114 + local563 * local468, -(alpha & 0xFF) + 256, memory, 1);
|
||||
}
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local123, local114);
|
||||
} else if (local2279) {
|
||||
for (local563 = 0; local563 < memory; local563++) {
|
||||
if (alpha == 0) {
|
||||
|
|
@ -833,6 +838,7 @@ public class Cs1ScriptRunner {
|
|||
local2282.method1426(local276 * local563 + local123, local114, 256 - (alpha & 0xFF), 1, color);
|
||||
}
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local123, local114);
|
||||
} else {
|
||||
for (local563 = 0; local563 < memory; local563++) {
|
||||
for (local571 = 0; local571 < color; local571++) {
|
||||
|
|
@ -843,6 +849,7 @@ public class Cs1ScriptRunner {
|
|||
}
|
||||
}
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local123 + local276, local468 + local114);
|
||||
}
|
||||
|
||||
GlRaster.setClip(arg0, arg6, arg4, arg7);
|
||||
|
|
@ -851,7 +858,7 @@ public class Cs1ScriptRunner {
|
|||
for (cardMemory = 0; cardMemory < memory; cardMemory++) {
|
||||
for (local556 = 0; local556 < color; local556++) {
|
||||
if (component.angle2d != 0) {
|
||||
sprite.method1420(local114 + local468 * local556 + local468 / 2, component.angle2d, 4096, cardMemory * local276 + local123 + local276 / 2);
|
||||
sprite.renderAngled(local114 + local468 * local556 + local468 / 2, component.angle2d, 4096, cardMemory * local276 + local123 + local276 / 2);
|
||||
} else if (alpha == 0) {
|
||||
sprite.render(cardMemory * local276 + local123, local468 * local556 + local114);
|
||||
} else {
|
||||
|
|
@ -859,21 +866,23 @@ public class Cs1ScriptRunner {
|
|||
}
|
||||
}
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local123 + local276, local114 + local468);
|
||||
|
||||
SoftwareRaster.setClip(arg0, arg6, arg4, arg7);
|
||||
}
|
||||
} else {
|
||||
memory = component.width * 4096 / local276;
|
||||
if (component.angle2d != 0) {
|
||||
sprite.method1420(local114 + component.height / 2, component.angle2d, memory, local123 + component.width / 2);
|
||||
sprite.renderAngled(local114 + component.height / 2, component.angle2d, memory, local123 + component.width / 2);
|
||||
} else if (alpha != 0) {
|
||||
sprite.method1422(local123, local114, component.width, component.height, 256 - (alpha & 0xFF));
|
||||
sprite.renderAlpha(local123, local114, component.width, component.height, 256 - (alpha & 0xFF));
|
||||
} else if (local276 == component.width && local468 == component.height) {
|
||||
sprite.render(local123, local114);
|
||||
} else {
|
||||
// render icons in a container i.e bank icons
|
||||
sprite.renderResized(local123, local114, component.width, component.height);
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local123, local114);
|
||||
}
|
||||
} else if (Component.aBoolean72) {
|
||||
InterfaceList.redraw(component);
|
||||
|
|
@ -992,6 +1001,7 @@ public class Cs1ScriptRunner {
|
|||
Rasteriser.prepareOffsets();
|
||||
}
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local123 + component.width / 2, local114 + component.height / 2);
|
||||
} else {
|
||||
if (component.type == 7) {
|
||||
local1921 = component.method491(Sprites.nameIcons);
|
||||
|
|
@ -1025,6 +1035,7 @@ public class Cs1ScriptRunner {
|
|||
local276++;
|
||||
}
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local123 + component.invMarginX + 115, local114 + component.invMarginY + 12);
|
||||
}
|
||||
if (component.type == 8 && Protocol.aClass13_11 == component && Protocol.anInt5235 == anInt4504) {
|
||||
local276 = 0;
|
||||
|
|
@ -1083,6 +1094,7 @@ public class Cs1ScriptRunner {
|
|||
local3299.renderLeft(local3325, cardMemory + 3, objId, 0, -1);
|
||||
objId += local3299.lineHeight + 1;
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, cardMemory + 3, objId);
|
||||
}
|
||||
if (component.type == 9) {
|
||||
if (component.aBoolean20) {
|
||||
|
|
@ -1105,6 +1117,7 @@ public class Cs1ScriptRunner {
|
|||
} else {
|
||||
SoftwareRaster.method2494(local123, local276, local468, memory, component.color, component.lineWidth);
|
||||
}
|
||||
PluginRepository.ComponentDraw(i, component, local468, local276);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1120,7 +1133,7 @@ public class Cs1ScriptRunner {
|
|||
@OriginalMember(owner = "client!ag", name = "a", descriptor = "(IIIIIIIII)V")
|
||||
public static void method86(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4, @OriginalArg(6) int arg5, @OriginalArg(7) int arg6, @OriginalArg(8) int arg7) {
|
||||
if (InterfaceList.load(arg0)) {
|
||||
method1809(arg1, arg7, arg3, InterfaceList.components[arg0], arg2, -1, arg6, arg5, arg4);
|
||||
renderComponent(arg1, arg7, arg3, InterfaceList.components[arg0], arg2, -1, arg6, arg5, arg4);
|
||||
} else if (arg4 == -1) {
|
||||
for (@Pc(27) int local27 = 0; local27 < 100; local27++) {
|
||||
InterfaceList.aBooleanArray100[local27] = true;
|
||||
|
|
@ -1135,7 +1148,7 @@ public class Cs1ScriptRunner {
|
|||
aClass13Array13 = null;
|
||||
method86(InterfaceList.topLevelInterface, 0, GameShell.canvasWidth, 0, -1, GameShell.canvasHeight, 0, 0);
|
||||
if (aClass13Array13 != null) {
|
||||
method1809(0, anInt3126, anInt4696, aClass13Array13, GameShell.canvasWidth, -1412584499, 0, GameShell.canvasHeight, aClass13_1.rectangle);
|
||||
renderComponent(0, anInt3126, anInt4696, aClass13Array13, GameShell.canvasWidth, -1412584499, 0, GameShell.canvasHeight, aClass13_1.rectangle);
|
||||
aClass13Array13 = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -363,7 +363,7 @@ public class GlSprite extends Sprite {
|
|||
|
||||
@OriginalMember(owner = "client!cf", name = "b", descriptor = "(IIIII)V")
|
||||
@Override
|
||||
public final void method1422(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4) {
|
||||
public final void renderAlpha(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4) {
|
||||
if (arg2 <= 0 || arg3 <= 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ public class InterfaceList {
|
|||
@OriginalMember(owner = "client!i", name = "i", descriptor = "(Z)V")
|
||||
public static void redrawActiveInterfaces() {
|
||||
for (@Pc(6) ComponentPointer local6 = (ComponentPointer) openInterfaces.head(); local6 != null; local6 = (ComponentPointer) openInterfaces.next()) {
|
||||
@Pc(14) int local14 = local6.anInt5878;
|
||||
@Pc(14) int local14 = local6.interfaceId;
|
||||
if (load(local14)) {
|
||||
@Pc(21) boolean local21 = true;
|
||||
@Pc(25) Component[] local25 = components[local14];
|
||||
|
|
@ -318,7 +318,7 @@ public class InterfaceList {
|
|||
}
|
||||
@Pc(66) ComponentPointer local66 = (ComponentPointer) openInterfaces.get(arg0.id);
|
||||
if (local66 != null) {
|
||||
method4017(local32, arg1, local66.anInt5878, local20);
|
||||
method4017(local32, arg1, local66.interfaceId, local20);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -368,7 +368,7 @@ public class InterfaceList {
|
|||
@OriginalMember(owner = "client!ke", name = "a", descriptor = "(ZLclient!wk;Z)V")
|
||||
public static void closeInterface(@OriginalArg(0) boolean arg0, @OriginalArg(1) ComponentPointer arg1) {
|
||||
@Pc(9) int local9 = (int) arg1.key;
|
||||
@Pc(16) int local16 = arg1.anInt5878;
|
||||
@Pc(16) int local16 = arg1.interfaceId;
|
||||
arg1.unlink();
|
||||
if (arg0) {
|
||||
method2275(local16);
|
||||
|
|
@ -532,7 +532,7 @@ public class InterfaceList {
|
|||
@Pc(28) int local28 = arg0.id >>> 16;
|
||||
@Pc(33) HashTableIterator local33 = new HashTableIterator(openInterfaces);
|
||||
for (@Pc(38) ComponentPointer local38 = (ComponentPointer) local33.method2701(); local38 != null; local38 = (ComponentPointer) local33.method2700()) {
|
||||
if (local28 == local38.anInt5878) {
|
||||
if (local28 == local38.interfaceId) {
|
||||
return getComponent((int) local38.key);
|
||||
}
|
||||
}
|
||||
|
|
@ -575,7 +575,7 @@ public class InterfaceList {
|
|||
}
|
||||
@Pc(49) ComponentPointer local49 = (ComponentPointer) openInterfaces.get(local23.id);
|
||||
if (local49 != null) {
|
||||
runScripts(arg1, local49.anInt5878);
|
||||
runScripts(arg1, local49.interfaceId);
|
||||
}
|
||||
}
|
||||
@Pc(72) HookRequest local72;
|
||||
|
|
@ -1045,7 +1045,7 @@ public class InterfaceList {
|
|||
}
|
||||
@Pc(1595) ComponentPointer local1595 = (ComponentPointer) openInterfaces.get(component.id);
|
||||
if (local1595 != null) {
|
||||
method1320(local50, local63, local55, local65, local1595.anInt5878, local61, local67);
|
||||
method1320(local50, local63, local55, local65, local1595.interfaceId, local61, local67);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1232,7 +1232,7 @@ public class InterfaceList {
|
|||
}
|
||||
@Pc(73) ComponentPointer local73 = (ComponentPointer) openInterfaces.get(local15.id);
|
||||
if (local73 != null) {
|
||||
method1949(local73.anInt5878);
|
||||
method1949(local73.interfaceId);
|
||||
}
|
||||
}
|
||||
if (local15.type == 6) {
|
||||
|
|
|
|||
|
|
@ -1712,7 +1712,7 @@ public class Protocol {
|
|||
@Pc(3449) ComponentPointer src = (ComponentPointer) InterfaceList.openInterfaces.get(source);
|
||||
ComponentPointer tgt = (ComponentPointer) InterfaceList.openInterfaces.get(target);
|
||||
if (tgt != null) {
|
||||
InterfaceList.closeInterface(src == null || tgt.anInt5878 != src.anInt5878, tgt);
|
||||
InterfaceList.closeInterface(src == null || tgt.interfaceId != src.interfaceId, tgt);
|
||||
}
|
||||
if (src != null) {
|
||||
src.unlink();
|
||||
|
|
@ -1852,7 +1852,7 @@ public class Protocol {
|
|||
setVerifyId(tracknum);
|
||||
ComponentPointer ptr = (ComponentPointer) InterfaceList.openInterfaces.get(pointer);
|
||||
if (ptr != null) {
|
||||
InterfaceList.closeInterface(ptr.anInt5878 != component, ptr);
|
||||
InterfaceList.closeInterface(ptr.interfaceId != component, ptr);
|
||||
}
|
||||
method1148(component, pointer, type);
|
||||
opcode = -1;
|
||||
|
|
@ -3472,7 +3472,7 @@ public class Protocol {
|
|||
public static ComponentPointer method1148(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2) {
|
||||
@Pc(9) ComponentPointer local9 = new ComponentPointer();
|
||||
local9.anInt5879 = arg2;
|
||||
local9.anInt5878 = arg0;
|
||||
local9.interfaceId = arg0;
|
||||
InterfaceList.openInterfaces.put(local9, arg1);
|
||||
InterfaceList.method1753(arg0);
|
||||
@Pc(28) Component local28 = InterfaceList.getComponent(arg1);
|
||||
|
|
|
|||
|
|
@ -2989,7 +2989,7 @@ public final class ScriptRunner {
|
|||
int1 = intStack[isp];
|
||||
int3 = intStack[isp + 1];
|
||||
@Pc(12663) ComponentPointer local12663 = (ComponentPointer) InterfaceList.openInterfaces.get(int1);
|
||||
if (local12663 != null && local12663.anInt5878 == int3) {
|
||||
if (local12663 != null && local12663.interfaceId == int3) {
|
||||
intStack[isp++] = 1;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -740,7 +740,7 @@ public final class SoftwareAlphaSprite extends SoftwareSprite {
|
|||
|
||||
@OriginalMember(owner = "client!am", name = "b", descriptor = "(IIIII)V")
|
||||
@Override
|
||||
public final void method1422(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4) {
|
||||
public final void renderAlpha(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4) {
|
||||
if (arg2 <= 0 || arg3 <= 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1213,7 +1213,7 @@ public class SoftwareSprite extends Sprite {
|
|||
|
||||
@OriginalMember(owner = "client!mm", name = "b", descriptor = "(IIIII)V")
|
||||
@Override
|
||||
public void method1422(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4) {
|
||||
public void renderAlpha(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4) {
|
||||
if (arg2 <= 0 || arg3 <= 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public abstract class Sprite extends SecondaryNode {
|
|||
public abstract void renderResized(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3);
|
||||
|
||||
@OriginalMember(owner = "client!qf", name = "a", descriptor = "(IIIII)V")
|
||||
public final void method1420(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3) {
|
||||
public final void renderAngled(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3) {
|
||||
@Pc(8) int local8 = this.anInt1860 << 3;
|
||||
@Pc(17) int local17 = this.anInt1866 << 3;
|
||||
@Pc(25) int local25 = (arg3 << 4) + (local8 & 0xF);
|
||||
|
|
@ -55,7 +55,7 @@ public abstract class Sprite extends SecondaryNode {
|
|||
public abstract void renderHorizontalFlip(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1);
|
||||
|
||||
@OriginalMember(owner = "client!qf", name = "b", descriptor = "(IIIII)V")
|
||||
public abstract void method1422(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4);
|
||||
public abstract void renderAlpha(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4);
|
||||
|
||||
@OriginalMember(owner = "client!qf", name = "e", descriptor = "(II)V")
|
||||
public abstract void render(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,91 @@
|
|||
package InterfaceDebugPlugin;
|
||||
|
||||
import plugin.Plugin;
|
||||
import plugin.api.*;
|
||||
import rt4.Component;
|
||||
import rt4.GameShell;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class plugin extends Plugin {
|
||||
private boolean isEnabled;
|
||||
private boolean isVerbose;
|
||||
|
||||
private ArrayList<Integer> activeVarps = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void ComponentDraw(int componentIndex, Component component, int screenX, int screenY) {
|
||||
if (!isEnabled) return;
|
||||
|
||||
FontColor color = new FontColor((((component.type * 50) << 16) | 255 << 8 | Math.min(component.type * 50, 255)));
|
||||
|
||||
if (!isVerbose) {
|
||||
if
|
||||
(
|
||||
component.type != 0
|
||||
&& component.type != 9
|
||||
&& (component.type != 5
|
||||
|| (component.onOptionClick != null
|
||||
|| component.onMouseOver != null
|
||||
|| component.onHold != null
|
||||
|| component.varpTriggers != null
|
||||
|| component.onVarcstrTransmit != null
|
||||
|| component.onVarcTransmit != null
|
||||
|| component.cs1ComparisonOpcodes != null))
|
||||
|| component.hidden
|
||||
) return;
|
||||
}
|
||||
|
||||
API.DrawText(
|
||||
FontType.SMALL,
|
||||
color,
|
||||
TextModifier.LEFT,
|
||||
componentIndex + "",
|
||||
screenX,
|
||||
screenY
|
||||
);
|
||||
|
||||
if (component.varpTriggers != null) {
|
||||
Arrays.stream(component.varpTriggers).forEach(varp -> { if(!activeVarps.contains(varp)) activeVarps.add(varp); });
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Draw(long timeDelta) {
|
||||
if (!isEnabled) return;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Varps: [");
|
||||
|
||||
for (int varp : activeVarps) sb.append(varp).append(" ");
|
||||
|
||||
sb.append("]");
|
||||
|
||||
API.DrawText(
|
||||
FontType.SMALL,
|
||||
FontColor.YELLOW,
|
||||
TextModifier.CENTER,
|
||||
sb.toString(),
|
||||
GameShell.canvasWidth / 2 - 100,
|
||||
20
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ProcessCommand(String commandStr, String[] args) {
|
||||
if (!API.PlayerHasPrivilege(Privileges.JMOD)) return;
|
||||
|
||||
if (commandStr.equalsIgnoreCase("::debug_iface")){
|
||||
isEnabled = !isEnabled;
|
||||
}
|
||||
|
||||
if (commandStr.equalsIgnoreCase("::debug_iface_verbose")) {
|
||||
isVerbose = !isVerbose;
|
||||
}
|
||||
|
||||
if (commandStr.equalsIgnoreCase("::clear_iface_varps")) {
|
||||
activeVarps.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
AUTHOR='Me'
|
||||
DESCRIPTION='Make sure to rename both the MyPlugin folder and the package statement in plugin.java!
|
||||
VERSION=-1.1
|
||||
Loading…
Add table
Add a link
Reference in a new issue