Refactored ServerActiveProperties

This commit is contained in:
Pazaz 2022-06-27 23:55:04 -04:00
parent a59254cde7
commit 7e3712325d
10 changed files with 31 additions and 31 deletions

View file

@ -32,7 +32,7 @@ public class ClientProt {
if (local8.clientCode > 0) {
local37 = MiniMenu.method4265(local8);
}
if (!local37 || !InterfaceList.getServerActiveProperties(local8).method503(arg2 - 1)) {
if (!local37 || !InterfaceList.getServerActiveProperties(local8).isButtonEnabled(arg2 - 1)) {
return;
}
if (arg2 == 1) {

View file

@ -1135,7 +1135,7 @@ public final class Component {
this.dragRenderBehavior = buffer.g1() == 1;
local567 = -1;
this.targetVerb = buffer.gjstr();
if (ServerActiveProperties.method3594(local175) != 0) {
if (ServerActiveProperties.getTargetMask(local175) != 0) {
local567 = buffer.g2();
this.anInt499 = buffer.g2();
if (local567 == 65535) {

View file

@ -221,7 +221,7 @@ public class InterfaceList {
@OriginalMember(owner = "client!qj", name = "a", descriptor = "(Lclient!be;BI)Lclient!na;")
public static JagString getOp(@OriginalArg(0) Component arg0, @OriginalArg(2) int arg1) {
if (!getServerActiveProperties(arg0).method503(arg1) && arg0.onOptionClick == null) {
if (!getServerActiveProperties(arg0).isButtonEnabled(arg1) && arg0.onOptionClick == null) {
return null;
} else if (arg0.ops == null || arg0.ops.length <= arg1 || arg0.ops[arg1] == null || arg0.ops[arg1].trim().length() == 0) {
return Static121.qaOpTest ? JagString.concatenate(new JagString[]{aClass100_903, JagString.parseInt(arg1)}) : null;
@ -655,7 +655,7 @@ public class InterfaceList {
if (local221) {
Static40.method1015(Mouse.clickY - local55, Mouse.clickX - local50, component);
}
if (Static40.aClass13_14 != null && Static40.aClass13_14 != component && local207 && getServerActiveProperties(component).method509()) {
if (Static40.aClass13_14 != null && Static40.aClass13_14 != component && local207 && getServerActiveProperties(component).isDragTarget()) {
aClass13_12 = component;
}
if (component == Static40.aClass13_1) {

View file

@ -204,7 +204,7 @@ public class MiniMenu {
}
}
}
if (local267.method507()) {
if (local267.isObjUseEnabled()) {
add(MiniMap.anInt4075, local276.id, JagString.concatenate(new JagString[]{aClass100_32, local276.name}), local171, (short) 22, LocalizedText.USE, component.id);
}
if (local267.isObjOpsEnabled() && local296 != null) {
@ -279,10 +279,10 @@ public class MiniMenu {
add(getOpCursor(local173, component), local173 + 1, component.optionBase, component.createdComponentId, (short) 9, local828, component.id);
}
}
if (InterfaceList.getServerActiveProperties(component).method506()) {
if (InterfaceList.getServerActiveProperties(component).isResumePauseButtonEnabled()) {
add(-1, 0L, JagString.EMPTY, component.createdComponentId, (short) 41, LocalizedText.CONTINUE, component.id);
}
} else if (InterfaceList.getServerActiveProperties(component).method508() && (anInt4999 & 0x20) != 0) {
} else if (InterfaceList.getServerActiveProperties(component).isUseTarget() && (anInt4999 & 0x20) != 0) {
add(anInt5393, 0L, JagString.concatenate(new JagString[]{aClass100_466, aClass100_408, component.optionBase}), component.createdComponentId, (short) 12, aClass100_545, component.id);
}
}
@ -677,7 +677,7 @@ public class MiniMenu {
if (local693 != null) {
method1294();
@Pc(1493) ServerActiveProperties local1493 = InterfaceList.getServerActiveProperties(local693);
method4246(local19, local15, local1493.getTargetMask(), local1493.anInt540, local693.anInt499, local693.anInt484);
method4246(local19, local15, local1493.getTargetMask(), local1493.targetParam, local693.anInt499, local693.anInt484);
anInt5014 = 0;
aClass100_545 = MiniMap.getTargetVerb(local693);
if (aClass100_545 == null) {
@ -1472,7 +1472,7 @@ public class MiniMenu {
@OriginalMember(owner = "client!aj", name = "a", descriptor = "(BILclient!be;)I")
public static int getOpCursor(@OriginalArg(1) int arg0, @OriginalArg(2) Component arg1) {
if (!InterfaceList.getServerActiveProperties(arg1).method503(arg0) && arg1.onOptionClick == null) {
if (!InterfaceList.getServerActiveProperties(arg1).isButtonEnabled(arg0) && arg1.onOptionClick == null) {
return -1;
} else if (arg1.anIntArray39 == null || arg0 >= arg1.anIntArray39.length) {
return -1;

View file

@ -2162,10 +2162,10 @@ public class Protocol {
ServerActiveProperties properties = (ServerActiveProperties) InterfaceList.properties.get(local904);
ServerActiveProperties target;
if (properties != null) {
target = new ServerActiveProperties(accessMask, properties.anInt540);
target = new ServerActiveProperties(accessMask, properties.targetParam);
properties.unlink();
} else if (local277 == -1) {
target = new ServerActiveProperties(accessMask, InterfaceList.getComponent(pointer).properties.anInt540);
target = new ServerActiveProperties(accessMask, InterfaceList.getComponent(pointer).properties.targetParam);
} else {
target = new ServerActiveProperties(accessMask, -1);
}

View file

@ -548,7 +548,7 @@ public final class ScriptRunner {
anInt1951 = OverheadChat.anIntArray385[local5];
anInt548 = OverheadChat.anIntArray392[local5] = local74;
@Pc(962) JagString local962 = OverheadChat.messages[local5];
if (VarpDomain.anInt2157 == 0) {
if (VarpDomain.chatEffectsDisabled == 0) {
local639 = 16776960;
if (OverheadChat.colors[local5] < 6) {
local639 = OverheadChat.COLORS[OverheadChat.colors[local5]];

View file

@ -8,25 +8,25 @@ import org.openrs2.deob.annotation.OriginalMember;
public final class ServerActiveProperties extends Node {
@OriginalMember(owner = "client!bf", name = "q", descriptor = "I")
public final int anInt540;
public final int targetParam;
@OriginalMember(owner = "client!bf", name = "x", descriptor = "I")
public final int events;
@OriginalMember(owner = "client!bf", name = "<init>", descriptor = "(II)V")
public ServerActiveProperties(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) {
this.anInt540 = arg1;
this.events = arg0;
public ServerActiveProperties(@OriginalArg(0) int events, @OriginalArg(1) int targetParam) {
this.targetParam = targetParam;
this.events = events;
}
@OriginalMember(owner = "client!qc", name = "a", descriptor = "(BI)I")
public static int method3594(@OriginalArg(1) int arg0) {
return arg0 >> 11 & 0x7F;
public static int getTargetMask(@OriginalArg(1) int events) {
return events >> 11 & 0x7F;
}
@OriginalMember(owner = "client!bf", name = "a", descriptor = "(IB)Z")
public final boolean method503(@OriginalArg(0) int arg0) {
return (this.events >> arg0 + 1 & 0x1) != 0;
public final boolean isButtonEnabled(@OriginalArg(0) int button) {
return (this.events >> button + 1 & 0x1) != 0;
}
@OriginalMember(owner = "client!bf", name = "d", descriptor = "(I)Z")
@ -35,27 +35,27 @@ public final class ServerActiveProperties extends Node {
}
@OriginalMember(owner = "client!bf", name = "e", descriptor = "(B)I")
public final int method505() {
public final int getDragDepth() {
return this.events >> 18 & 0x7;
}
@OriginalMember(owner = "client!bf", name = "e", descriptor = "(I)Z")
public final boolean method506() {
public final boolean isResumePauseButtonEnabled() {
return (this.events & 0x1) != 0;
}
@OriginalMember(owner = "client!bf", name = "f", descriptor = "(I)Z")
public final boolean method507() {
public final boolean isObjUseEnabled() {
return (this.events >> 31 & 0x1) != 0;
}
@OriginalMember(owner = "client!bf", name = "g", descriptor = "(I)Z")
public final boolean method508() {
public final boolean isUseTarget() {
return (this.events >> 22 & 0x1) != 0;
}
@OriginalMember(owner = "client!bf", name = "a", descriptor = "(Z)Z")
public final boolean method509() {
public final boolean isDragTarget() {
return (this.events >> 21 & 0x1) != 0;
}
@ -65,12 +65,12 @@ public final class ServerActiveProperties extends Node {
}
@OriginalMember(owner = "client!bf", name = "f", descriptor = "(B)Z")
public final boolean method511() {
public final boolean isObjSwapEnabled() {
return (this.events >> 28 & 0x1) != 0;
}
@OriginalMember(owner = "client!bf", name = "i", descriptor = "(I)I")
public final int getTargetMask() {
return method3594(this.events);
return getTargetMask(this.events);
}
}

View file

@ -23,7 +23,7 @@ public final class Static36 {
@OriginalMember(owner = "client!client", name = "a", descriptor = "(Lclient!be;)Lclient!be;")
public static Component method938(@OriginalArg(0) Component arg0) {
@Pc(4) int local4 = InterfaceList.getServerActiveProperties(arg0).method505();
@Pc(4) int local4 = InterfaceList.getServerActiveProperties(arg0).getDragDepth();
if (local4 == 0) {
return null;
}

View file

@ -27,7 +27,7 @@ public final class Static7 {
local99 = MiniMenu.intArgs2[MiniMenu.size - 1];
@Pc(103) Component local103 = InterfaceList.getComponent(local99);
@Pc(106) ServerActiveProperties local106 = InterfaceList.getServerActiveProperties(local103);
if (local106.method511() || local106.isObjReplaceEnabled()) {
if (local106.isObjSwapEnabled() || local106.isObjReplaceEnabled()) {
InterfaceList.clickedInventoryComponentCycle = 0;
Static123.draggingClickedInventoryObject = false;
if (InterfaceList.clickedInventoryComponent != null) {

View file

@ -20,7 +20,7 @@ public class VarpDomain {
@OriginalMember(owner = "client!qc", name = "K", descriptor = "Lclient!sc;")
public static HashTable aClass133_20 = new HashTable(16);
@OriginalMember(owner = "client!ge", name = "m", descriptor = "I")
public static int anInt2157 = 0;
public static int chatEffectsDisabled = 0;
@OriginalMember(owner = "client!jb", name = "n", descriptor = "I")
public static int anInt2952 = 0;
@OriginalMember(owner = "client!oe", name = "b", descriptor = "I")
@ -118,7 +118,7 @@ public class VarpDomain {
}
@Pc(25) int local25 = activeVarps[arg0];
if (local17 == 6) {
anInt2157 = local25;
chatEffectsDisabled = local25;
}
if (local17 == 5) {
anInt2952 = local25;