Advertisement
Guest User

method

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