Advertisement
Guest User

Untitled

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