Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void buildInterfaceMenu(int i, RSInterface class9, int k, int l,
- int i1, int j1) {
- if (class9 == null) {
- return;
- }
- if (class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
- return;
- if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
- return;
- int k1 = class9.children.length;
- for (int l1 = 0; l1 < k1; l1++) {
- int i2 = class9.childX[l1] + i;
- int j2 = (class9.childY[l1] + l) - j1;
- RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
- if (class9_1 == null) {
- break;
- }
- i2 += class9_1.anInt263;
- j2 += class9_1.anInt265;
- if ((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0)
- && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- if (class9_1.mOverInterToTrigger >= 0)
- anInt886 = class9_1.mOverInterToTrigger;
- else
- anInt886 = class9_1.id;
- }
- if (class9_1.type == 8 && k >= i2 && i1 >= j2
- && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
- anInt1315 = class9_1.id;
- }
- if (class9_1.type == 9 && k >= i2 && i1 >= j2
- && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
- anInt1315 = class9_1.id;
- }
- if (class9_1.type == 5 && k >= i2 && i1 >= j2
- && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
- hoverId = class9_1.id;
- } else {
- hoverId = -1;
- }
- if (class9_1.type == 0) {
- buildInterfaceMenu(i2, class9_1, k, j2, i1,
- class9_1.scrollPosition);
- if (class9_1.scrollMax > class9_1.height)
- if (scrollbarVisible(class9_1))
- method65(i2 + class9_1.width, class9_1.height, k, i1,
- class9_1, j2, true, class9_1.scrollMax);
- } else {
- if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2
- && k < i2 + class9_1.width && i1 < j2 + class9_1.height + 10) {
- boolean flag = false;
- if (class9_1.contentType != 0)
- flag = buildFriendsListMenu(class9_1);
- if (!flag) {
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 315;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2
- && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- String s = class9_1.selectedActionName;
- if (s.indexOf(" ") != -1)
- s = s.substring(0, s.indexOf(" "));
- menuActionName[menuActionRow] = "Autocast" + "@gre@ "
- + class9_1.spellName;
- menuActionID[menuActionRow] = 104;// autocast
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- menuActionName[menuActionRow] = s + " @gre@"
- + class9_1.spellName;
- menuActionID[menuActionRow] = 626;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2
- && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
- menuActionName[menuActionRow] = "Close";
- menuActionID[menuActionRow] = 200;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2
- && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 169;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2
- && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 646;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2
- && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 679;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.atActionType == 8 && !aBoolean1149 && k >= i2
- && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- for (int s1 = 0; s1 < class9_1.tooltips.length; s1++) {
- if (!RSInterface.interfaceCache[32007].isMouseoverTriggered) {
- if (class9_1.id > 32016) {
- continue;
- }
- }
- menuActionName[menuActionRow] = class9_1.tooltips[s1];
- menuActionID[menuActionRow] = 1700 + s1;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- if (class9_1.atActionType == 9 && !aBoolean1149 && k >= i2
- && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 1100;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.atActionType == 10 && !aBoolean1149 && k >= i2
- && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- menuActionName[menuActionRow] = class9_1.getMenuItem().getText();
- menuActionID[menuActionRow] = 1200;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (k >= i2 && i1 >= j2
- && k < i2 + (class9_1.type == 4 ? 100 : class9_1.width)
- && i1 < j2 + class9_1.height) {
- if (class9_1.actions != null) {
- if ((class9_1.type == 4 && class9_1.message.length() > 0)
- || class9_1.type == 5) {
- for (int action = class9_1.actions.length - 1; action >= 0; action--) {
- if (class9_1.actions[action] != null) {
- menuActionName[menuActionRow] = class9_1.actions[action]
- + (class9_1.type == 4 ? " "
- + class9_1.message : "");
- menuActionID[menuActionRow] = 647;
- menuActionCmd2[menuActionRow] = action;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- }
- }
- }
- if (class9_1.type == 2) {
- int k2 = 0;
- for (int l2 = 0; l2 < class9_1.height; l2++) {
- for (int i3 = 0; i3 < class9_1.width; i3++) {
- int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
- int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
- if (k2 < 20) {
- j3 += class9_1.spritesX[k2];
- k3 += class9_1.spritesY[k2];
- }
- if (k >= j3 && i1 >= k3 && k < j3 + 32
- && i1 < k3 + 32) {
- mouseInvInterfaceIndex = k2;
- lastActiveInvInterface = class9_1.id;
- if (class9_1.inv[k2] > 0) {
- ItemDef itemDef = ItemDef
- .forID(class9_1.inv[k2] - 1);
- if (itemSelected == 1
- && class9_1.isInventoryInterface) {
- if (class9_1.id != anInt1284
- || k2 != anInt1283) {
- menuActionName[menuActionRow] = "Use "
- + selectedItemName
- + " with @lre@"
- + itemDef.name;
- menuActionID[menuActionRow] = 870;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- } else if (spellSelected == 1
- && class9_1.isInventoryInterface) {
- if ((spellUsableOn & 0x10) == 16) {
- menuActionName[menuActionRow] = spellTooltip
- + " @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 543;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- } else {
- if (class9_1.isInventoryInterface) {
- for (int l3 = 4; l3 >= 3; l3--)
- if (itemDef.options != null
- && itemDef.options[l3] != null) {
- menuActionName[menuActionRow] = itemDef.options[l3]
- + " @lre@"
- + itemDef.name;
- if (l3 == 3)
- menuActionID[menuActionRow] = 493;
- if (l3 == 4)
- menuActionID[menuActionRow] = 847;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- } else if (l3 == 4) {
- menuActionName[menuActionRow] = "Drop @lre@"
- + itemDef.name;
- menuActionID[menuActionRow] = 847;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- if (class9_1.usableItemInterface) {
- menuActionName[menuActionRow] = "Use @lre@"
- + itemDef.name;
- menuActionID[menuActionRow] = 447;
- menuActionCmd1[menuActionRow] = itemDef.id;
- // k2 = inventory spot
- // System.out.println(k2);
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.isInventoryInterface
- && itemDef.options != null) {
- for (int i4 = 2; i4 >= 0; i4--)
- if (itemDef.options[i4] != null) {
- menuActionName[menuActionRow] = itemDef.options[i4]
- + " @lre@"
- + itemDef.name;
- if (i4 == 0)
- menuActionID[menuActionRow] = 74;
- if (i4 == 1)
- menuActionID[menuActionRow] = 454;
- if (i4 == 2)
- menuActionID[menuActionRow] = 539;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- if (class9_1.actions != null) {
- for (int j4 = 6; j4 >= 0; j4--) {
- if (j4 > class9_1.actions.length - 1)
- continue;
- if (class9_1.actions[j4] != null) {
- if (class9_1.parentID == 5292) {
- if (modifiableXValue > 0) {
- if (class9_1.actions.length < 7) {
- class9_1.actions = new String[] {
- "Withdraw 1",
- "Withdraw 5",
- "Withdraw 10",
- "Withdraw All",
- "Withdraw X",
- "Withdraw "
- + modifiableXValue,
- "Withdraw All but one" };
- }
- class9_1.actions[5] = "Withdraw "
- + modifiableXValue;
- }
- }
- menuActionName[menuActionRow] = class9_1.actions[j4]
- + " @lre@"
- + itemDef.name;
- if (j4 == 0)
- menuActionID[menuActionRow] = 632;
- if (j4 == 1)
- menuActionID[menuActionRow] = 78;
- if (j4 == 2)
- menuActionID[menuActionRow] = 867;
- if (j4 == 3)
- menuActionID[menuActionRow] = 431;
- if (j4 == 4)
- menuActionID[menuActionRow] = 53;
- if (class9_1.parentID == 5292) {
- if (class9_1.actions.length < 7) {
- if (j4 == 5)
- menuActionID[menuActionRow] = 291;
- } else {
- if (j4 == 5)
- menuActionID[menuActionRow] = 300;
- if (j4 == 6)
- menuActionID[menuActionRow] = 291;
- }
- }
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- }
- if (class9_1.parentID >= 58040
- && class9_1.parentID <= 58048
- || class9_1.parentID >= 32100
- && class9_1.parentID <= 32156
- || class9_1.parentID >= 32200
- && class9_1.parentID <= 32222) {
- return;
- }
- if (class9_1.isItemSearchComponent) {
- menuActionName[menuActionRow] = "Select @lre@"
- + itemDef.name;
- menuActionID[menuActionRow] = 1130;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- } else {
- if (!RSInterface.interfaceCache[32007].isMouseoverTriggered) {
- if (class9_1.id > 32016) {
- continue;
- }
- }
- menuActionName[menuActionRow] = "Examine @lre@"
- + itemDef.name;
- menuActionID[menuActionRow] = 1125;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- }
- }
- k2++;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement