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.type != 0 || class9.children == null || class9.interfaceShown)
- 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]];
- i2 += class9_1.anInt263;
- j2 += class9_1.anInt265;
- if((class9_1.hoverType >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
- if(class9_1.hoverType >= 0)
- anInt886 = class9_1.hoverType;
- 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 == 0)
- {
- buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
- if(class9_1.scrollMax > class9_1.height)
- 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)
- {
- 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(" "));
- if (class9_1.spellName.endsWith("Rush") || class9_1.spellName.endsWith("Burst") || class9_1.spellName.endsWith("Blitz") || class9_1.spellName.endsWith("Barrage") || class9_1.spellName.endsWith("strike") || class9_1.spellName.endsWith("bolt") || class9_1.spellName.equals("Crumble undead") || class9_1.spellName.endsWith("blast") || class9_1.spellName.endsWith("wave") || class9_1.spellName.equals("Claws of Guthix") || class9_1.spellName.equals("Flames of Zamorak") || class9_1.spellName.equals("Magic Dart")) {
- menuActionName[menuActionRow] = "Autocast @gre@" + class9_1.spellName;
- menuActionID[menuActionRow] = 104;
- 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)
- {
- //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 169;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- if (class9_1.hoverText != null) {
- //drawHoverBox(k, l, class9_1.hoverText);
- //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
- }
- }
- if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
- {
- //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
- 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)
- {
- //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 679;
- 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 + " -> @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.actions != null && itemDef.actions[l3] != null)
- {
- menuActionName[menuActionRow] = itemDef.actions[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.actions != null)
- {
- for(int i4 = 2; i4 >= 0; i4--)
- if(itemDef.actions[i4] != null)
- {
- menuActionName[menuActionRow] = itemDef.actions[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 = 4; j4 >= 0; j4--)
- if(class9_1.actions[j4] != null)
- {
- 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;
- menuActionCmd1[menuActionRow] = itemDef.ID;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
- 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