Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.05 KB | None | 0 0
  1. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l,
  2. int i1, int j1) {
  3. if (class9 == null)
  4. class9 = RSInterface.interfaceCache[21356];
  5. if (class9.type != 0 || class9.children == null || class9.invisible)
  6. return;
  7. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  8. return;
  9. int k1 = class9.children.length;
  10. for (int l1 = 0; l1 < k1; l1++) {
  11. int i2 = class9.childX[l1] + i;
  12. int j2 = (class9.childY[l1] + l) - j1;
  13. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  14. if(super.clickMode3 != 0) {
  15. k = super.clickX;
  16. i1 = super.clickY;
  17. }
  18. i2 += class9_1.anInt263;
  19. j2 += class9_1.anInt265;
  20. if ((class9_1.hoverType >= 0 || class9_1.anInt216 != 0) && k >= i2
  21. && i1 >= j2 && k < i2 + class9_1.width
  22. && i1 < j2 + class9_1.height)
  23. if (class9_1.hoverType >= 0)
  24. anInt886 = class9_1.hoverType;
  25. else
  26. anInt886 = class9_1.id;
  27. if (class9_1.type == 8 && k >= i2 && i1 >= j2
  28. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  29. anInt1315 = class9_1.id;
  30. }
  31. if (class9_1.type == 0) {
  32. buildInterfaceMenu(i2, class9_1, k, j2, i1,
  33. class9_1.scrollPosition);
  34. if (class9_1.scrollMax > class9_1.height)
  35. method65(i2 + class9_1.width, class9_1.height, k, i1,
  36. class9_1, j2, true, class9_1.scrollMax);
  37. } else {
  38. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2
  39. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  40. boolean flag = false;
  41. if (class9_1.contentType != 0)
  42. flag = buildFriendsListMenu(class9_1);
  43. if (!flag) {
  44. menuActionName[menuActionRow] = class9_1.tooltip;
  45. menuActionID[menuActionRow] = 315;
  46. menuActionCmd3[menuActionRow] = class9_1.id;
  47. menuActionRow++;
  48. }
  49. }
  50. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2
  51. && i1 >= j2 && k < i2 + class9_1.width
  52. && i1 < j2 + class9_1.height) {
  53. String s = class9_1.selectedActionName;
  54. if (s.indexOf(" ") != -1)
  55. s = s.substring(0, s.indexOf(" "));
  56. if (class9_1.spellName.endsWith("Rush")
  57. || class9_1.spellName.endsWith("Burst")
  58. || class9_1.spellName.endsWith("Blitz")
  59. || class9_1.spellName.endsWith("Barrage")
  60. || class9_1.spellName.endsWith("strike")
  61. || class9_1.spellName.endsWith("bolt")
  62. || class9_1.spellName.equals("Crumble undead")
  63. || class9_1.spellName.endsWith("blast")
  64. || class9_1.spellName.endsWith("wave")
  65. || class9_1.spellName.equals("Claws of Guthix")
  66. || class9_1.spellName.equals("Flames of Zamorak")
  67. || class9_1.spellName.equals("Magic Dart")) {
  68. menuActionName[menuActionRow] = "Autocast @gre@"
  69. + class9_1.spellName;
  70. menuActionID[menuActionRow] = 104;
  71. menuActionCmd3[menuActionRow] = class9_1.id;
  72. menuActionRow++;
  73. }
  74. menuActionName[menuActionRow] = s + " @gre@"
  75. + class9_1.spellName;
  76. menuActionID[menuActionRow] = 626;
  77. menuActionCmd3[menuActionRow] = class9_1.id;
  78. menuActionRow++;
  79. }
  80. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2
  81. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  82. menuActionName[menuActionRow] = "Close";
  83. menuActionID[menuActionRow] = 200;
  84. menuActionCmd3[menuActionRow] = class9_1.id;
  85. menuActionRow++;
  86. }
  87. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2
  88. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  89. // System.out.println("2"+class9_1.tooltip + ", " +
  90. // class9_1.interfaceID);
  91. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  92. // class9_1.id;
  93. menuActionName[menuActionRow] = class9_1.tooltip;
  94. menuActionID[menuActionRow] = 169;
  95. menuActionCmd3[menuActionRow] = class9_1.id;
  96. menuActionRow++;
  97. if (class9_1.hoverText != null) {
  98. // drawHoverBox(k, l, class9_1.hoverText);
  99. // System.out.println("DRAWING INTERFACE: " +
  100. // class9_1.hoverText);
  101. }
  102. }
  103. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2
  104. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  105. // System.out.println("3"+class9_1.tooltip + ", " +
  106. // class9_1.interfaceID);
  107. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  108. // class9_1.id;
  109. menuActionName[menuActionRow] = class9_1.tooltip;
  110. menuActionID[menuActionRow] = 646;
  111. menuActionCmd3[menuActionRow] = class9_1.id;
  112. menuActionRow++;
  113. }
  114. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2
  115. && i1 >= j2 && k < i2 + class9_1.width
  116. && i1 < j2 + class9_1.height) {
  117. // System.out.println("4"+class9_1.tooltip + ", " +
  118. // class9_1.interfaceID);
  119. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  120. // class9_1.id;
  121. menuActionName[menuActionRow] = class9_1.tooltip;
  122. menuActionID[menuActionRow] = 679;
  123. menuActionCmd3[menuActionRow] = class9_1.id;
  124. menuActionRow++;
  125. }
  126. if (class9_1.atActionType == 8 && !aBoolean1149 && k >= i2
  127. && i1 >= j2 && k < i2 + class9_1.width
  128. && i1 < j2 + class9_1.height) {
  129. for (int s1 = 0; s1 < class9_1.tooltips.length; s1++) {
  130. menuActionName[menuActionRow] = class9_1.tooltips[s1];
  131. menuActionID[menuActionRow] = 1700 + s1;
  132. menuActionCmd3[menuActionRow] = class9_1.id;
  133. menuActionRow++;
  134. }
  135. }
  136. // clan chat
  137. if (k >= i2 && i1 >= j2
  138. && k < i2 + (class9_1.type == 4 ? 100 : class9_1.width)
  139. && i1 < j2 + class9_1.height) {
  140. if (class9_1.actions != null) {
  141. if (class9_1.type == 4 && class9_1.message.length() > 0
  142. || class9_1.type == 5) {
  143. for (int action = class9_1.actions.length - 1; action >= 0; action--) {
  144. if (class9_1.actions[action] != null) {
  145. String kl = class9_1.actions[action]
  146. + (class9_1.type == 4 ? " "
  147. + TextDrawingArea
  148. .clanFix(class9_1.message)
  149. : "");
  150. menuActionName[menuActionRow] = kl;
  151. menuActionID[menuActionRow] = 647;
  152. menuActionCmd2[menuActionRow] = action;
  153. menuActionCmd3[menuActionRow] = class9_1.id;
  154. menuActionRow++;
  155. }
  156. }
  157. }
  158. }
  159. }
  160. if (class9_1.type == 2) {
  161. int k2 = 0;
  162. for (int l2 = 0; l2 < class9_1.height; l2++) {
  163. for (int i3 = 0; i3 < class9_1.width; i3++) {
  164. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  165. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  166. if (k2 < 20) {
  167. j3 += class9_1.spritesX[k2];
  168. k3 += class9_1.spritesY[k2];
  169. }
  170. if (k >= j3 && i1 >= k3 && k < j3 + 32
  171. && i1 < k3 + 32) {
  172. mouseInvInterfaceIndex = k2;
  173. lastActiveInvInterface = class9_1.id;
  174. if (class9_1.inv[k2] > 0) {
  175. ItemDef itemDef = ItemDef
  176. .forID(class9_1.inv[k2] - 1);
  177. if (itemSelected == 1
  178. && class9_1.isInventoryInterface) {
  179. if (class9_1.id != anInt1284
  180. || k2 != anInt1283) {
  181. menuActionName[menuActionRow] = "Use "
  182. + selectedItemName
  183. + " with @lre@"
  184. + itemDef.name;
  185. menuActionID[menuActionRow] = 870;
  186. menuActionCmd1[menuActionRow] = itemDef.id;
  187. menuActionCmd2[menuActionRow] = k2;
  188. menuActionCmd3[menuActionRow] = class9_1.id;
  189. menuActionRow++;
  190. }
  191. } else if (spellSelected == 1
  192. && class9_1.isInventoryInterface) {
  193. if ((spellUsableOn & 0x10) == 16) {
  194. menuActionName[menuActionRow] = spellTooltip
  195. + " @lre@" + itemDef.name;
  196. menuActionID[menuActionRow] = 543;
  197. menuActionCmd1[menuActionRow] = itemDef.id;
  198. menuActionCmd2[menuActionRow] = k2;
  199. menuActionCmd3[menuActionRow] = class9_1.id;
  200. menuActionRow++;
  201. }
  202. } else {
  203. if (class9_1.isInventoryInterface) {
  204. for (int l3 = 4; l3 >= 3; l3--)
  205. if (itemDef.itemActions != null
  206. && itemDef.itemActions[l3] != null) {
  207. menuActionName[menuActionRow] = itemDef.itemActions[l3]
  208. + " @lre@"
  209. + itemDef.name;
  210. if (l3 == 3)
  211. menuActionID[menuActionRow] = 493;
  212. if (l3 == 4)
  213. menuActionID[menuActionRow] = 847;
  214. menuActionCmd1[menuActionRow] = itemDef.id;
  215. menuActionCmd2[menuActionRow] = k2;
  216. menuActionCmd3[menuActionRow] = class9_1.id;
  217. menuActionRow++;
  218. } else if (l3 == 4) {
  219. menuActionName[menuActionRow] = "Drop @lre@"
  220. + itemDef.name;
  221. menuActionID[menuActionRow] = 847;
  222. menuActionCmd1[menuActionRow] = itemDef.id;
  223. menuActionCmd2[menuActionRow] = k2;
  224. menuActionCmd3[menuActionRow] = class9_1.id;
  225. menuActionRow++;
  226. }
  227. }
  228. if (class9_1.usableItemInterface) {
  229. menuActionName[menuActionRow] = "Use @lre@"
  230. + itemDef.name;
  231. menuActionID[menuActionRow] = 447;
  232. menuActionCmd1[menuActionRow] = itemDef.id;
  233. menuActionCmd2[menuActionRow] = k2;
  234. menuActionCmd3[menuActionRow] = class9_1.id;
  235. menuActionRow++;
  236. }
  237. if (class9_1.isInventoryInterface
  238. && itemDef.itemActions != null) {
  239. for (int i4 = 2; i4 >= 0; i4--)
  240. if (itemDef.itemActions[i4] != null) {
  241. menuActionName[menuActionRow] = itemDef.itemActions[i4]
  242. + " @lre@"
  243. + itemDef.name;
  244. if (i4 == 0)
  245. menuActionID[menuActionRow] = 74;
  246. if (i4 == 1)
  247. menuActionID[menuActionRow] = 454;
  248. if (i4 == 2)
  249. menuActionID[menuActionRow] = 539;
  250. menuActionCmd1[menuActionRow] = itemDef.id;
  251. menuActionCmd2[menuActionRow] = k2;
  252. menuActionCmd3[menuActionRow] = class9_1.id;
  253. menuActionRow++;
  254. }
  255.  
  256. }
  257. if (class9_1.actions != null) {
  258. for (int j4 = 6; j4 >= 0; j4--) {
  259. if (j4 > class9_1.actions.length - 1)
  260. continue;
  261. if (class9_1.actions[j4] != null) {
  262. if(class9_1.parentID == 5292) {
  263. if(modifiableXValue > 0) {
  264. if(class9_1.actions.length < 7) {
  265. class9_1.actions = new String[] {
  266. "Withdraw 1", "Withdraw 5", "Withdraw 10",
  267. "Withdraw All", "Withdraw X", "Withdraw "+modifiableXValue, "Withdraw All but one"
  268. };
  269. }
  270. class9_1.actions[5] = "Withdraw "+modifiableXValue;
  271. }
  272. }
  273. menuActionName[menuActionRow] = class9_1.actions[j4]
  274. + " @lre@"
  275. + itemDef.name;
  276. if (j4 == 0)
  277. menuActionID[menuActionRow] = 632;
  278. if (j4 == 1)
  279. menuActionID[menuActionRow] = 78;
  280. if (j4 == 2)
  281. menuActionID[menuActionRow] = 867;
  282. if (j4 == 3)
  283. menuActionID[menuActionRow] = 431;
  284. if (j4 == 4)
  285. menuActionID[menuActionRow] = 53;
  286. if (class9_1.parentID == 5292) {
  287. if (class9_1.actions.length < 7) {
  288. if (j4 == 5)
  289. menuActionID[menuActionRow] = 291;
  290. } else {
  291. if (j4 == 5)
  292. menuActionID[menuActionRow] = 300;
  293. if (j4 == 6)
  294. menuActionID[menuActionRow] = 291;
  295. }
  296. }
  297. menuActionCmd1[menuActionRow] = itemDef.id;
  298. menuActionCmd2[menuActionRow] = k2;
  299. menuActionCmd3[menuActionRow] = class9_1.id;
  300. menuActionRow++;
  301. }
  302. }
  303. }
  304. // menuActionName[menuActionRow] =
  305. // "Examine @lre@" + itemDef.name +
  306. // " @gre@(@whi@" + (class9_1.inv[k2] -
  307. // 1) + "@gre@)";
  308. if (class9_1.parentID >= 58040
  309. && class9_1.parentID <= 58048)
  310. return;
  311. menuActionName[menuActionRow] = "Examine @lre@"
  312. + itemDef.name;
  313. menuActionID[menuActionRow] = 1125;
  314. menuActionCmd1[menuActionRow] = itemDef.id;
  315. menuActionCmd2[menuActionRow] = k2;
  316. menuActionCmd3[menuActionRow] = class9_1.id;
  317. menuActionRow++;
  318. }
  319. }
  320. }
  321. k2++;
  322. }
  323. }
  324. }
  325. }
  326. }
  327. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement