Guest User

Untitled

a guest
Jul 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.24 KB | None | 0 0
  1. private void drawInterface(int yScrollPoint, int xPadding, RSInterface rsInterface, int yPadding) {
  2. try {
  3. if(rsInterface.type != 0 || rsInterface.children == null)
  4. return;
  5. if(rsInterface.isMouseoverTriggered && lastHoverChildId != rsInterface.id && anInt1048 != rsInterface.id && anInt1039 != rsInterface.id)
  6. return;
  7. int xTopPos = DrawingArea.topX;
  8. int yTopPos = DrawingArea.topY;
  9. int xBottomPos = DrawingArea.bottomX;
  10. int yBottomPos = DrawingArea.bottomY;
  11. DrawingArea.setDrawingArea(yPadding + rsInterface.height, xPadding, xPadding + rsInterface.width, yPadding);
  12. int totalChildren = rsInterface.children.length;
  13. for(int childIndex = 0; childIndex < totalChildren; childIndex++) {
  14. int xSpritePos = rsInterface.childX[childIndex] + xPadding;
  15. int ySpritePos = (rsInterface.childY[childIndex] + yPadding) - yScrollPoint;
  16. RSInterface rsChildren = RSInterface.interfaceCache[rsInterface.children[childIndex]];
  17. xSpritePos += rsChildren.anInt263;
  18. ySpritePos += rsChildren.anInt265;
  19. if(rsChildren.contentType > 0)
  20. drawFriendsListOrWelcomeScreen(rsChildren);
  21. //here 196113008
  22. int[] IDs = {
  23. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  24. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  25. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  26. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  27. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  28. /* Ancients */
  29. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  30. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  31. };
  32. for(int m5 = 0; m5 < IDs.length; m5++) {
  33. if(rsChildren.id == IDs[m5] + 1) {
  34. if(m5 > 61)
  35. drawBlackBox(xSpritePos + 1, ySpritePos);
  36. else
  37. drawBlackBox(xSpritePos, ySpritePos + 1);
  38. }
  39. }
  40. int[] runeChildren = {
  41. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  42. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  43. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  44. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  45. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  46. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  47. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  48. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  49. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  50. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  51. 15885, 18474, 18475, 18478
  52. };
  53. for(int r = 0; r < runeChildren.length; r++)
  54. if(rsChildren.id == runeChildren[r])
  55. rsChildren.modelZoom = 775;
  56. if(rsChildren.type == 0) {
  57. if(rsChildren.scrollPosition > rsChildren.scrollMax - rsChildren.height)
  58. rsChildren.scrollPosition = rsChildren.scrollMax - rsChildren.height;
  59. if(rsChildren.scrollPosition < 0)
  60. rsChildren.scrollPosition = 0;
  61. drawInterface(rsChildren.scrollPosition, xSpritePos, rsChildren, ySpritePos);
  62. if(rsChildren.scrollMax > rsChildren.height)
  63. drawScrollbar(rsChildren.height, rsChildren.scrollPosition, ySpritePos, xSpritePos + rsChildren.width, rsChildren.scrollMax,false);
  64. } else if(rsChildren.type != 1)
  65. if(rsChildren.type == 2) {
  66. int spriteIndex = 0;
  67. for(int l3 = 0; l3 < rsChildren.height; l3++) {
  68. for(int l4 = 0; l4 < rsChildren.width; l4++) {
  69. int spritePosX = xSpritePos + l4 * (32 + rsChildren.invSpritePadX);
  70. int spritePosY = ySpritePos + l3 * (32 + rsChildren.invSpritePadY);
  71. if(spriteIndex < 20) {
  72. spritePosX += rsChildren.spritesX[spriteIndex];
  73. spritePosY += rsChildren.spritesY[spriteIndex];
  74. }
  75. if(rsChildren.inv[spriteIndex] > 0) {
  76. int k6 = 0;
  77. int j7 = 0;
  78. int inventoryItemId = rsChildren.inv[spriteIndex] - 1;
  79.  
  80. if(((spritePosX > DrawingArea.topX - 32 && spritePosX < DrawingArea.bottomX && spritePosY > DrawingArea.topY - 32 && spritePosY < DrawingArea.bottomY) || (activeInterfaceType != 0 && anInt1085 == spriteIndex))
  81. || (rsChildren.parentID == 5292 && activeInterfaceType != 0 && anInt1085 == spriteIndex && dragItemInterface == rsChildren.id)
  82. ) {
  83. int selectedColour = 0;
  84. if(itemSelected == 1 && itemSlotUsedOn == spriteIndex && anInt1284 == rsChildren.id)
  85. selectedColour = 0xffffff;
  86. Sprite itemSprite = ItemDef.getSprite(inventoryItemId, rsChildren.invStackSizes[spriteIndex], selectedColour);
  87. if(itemSprite != null) {
  88. if(activeInterfaceType != 0 && anInt1085 == spriteIndex && dragItemInterface == rsChildren.id) {
  89. k6 = super.mouseX - dragItemX;
  90. j7 = super.mouseY - dragItemY;
  91. if(k6 < 5 && k6 > -5)
  92. k6 = 0;
  93. if(j7 < 5 && j7 > -5)
  94. j7 = 0;
  95. if(anInt989 < 5) {
  96. k6 = 0;
  97. j7 = 0;
  98. }
  99. if(rsChildren.parentID == 5292 && activeInterfaceType != 0 && anInt1085 == spriteIndex && dragItemInterface == rsChildren.id) {
  100. DrawingArea.topY -= 40;
  101. }
  102. itemSprite.drawSprite1(spritePosX + k6, spritePosY + j7, 128);
  103. if(rsChildren.parentID == 5292 && activeInterfaceType != 0 && anInt1085 == spriteIndex && dragItemInterface == rsChildren.id) {
  104. DrawingArea.topY += 40;
  105. }
  106. if(
  107. //(spritePosX > DrawingArea.topX - 32 && spritePosX < DrawingArea.bottomX && spritePosY > DrawingArea.topY - 32 && spritePosY < DrawingArea.bottomY) &&
  108. (spritePosY + j7 < DrawingArea.topY && rsInterface.scrollPosition > 0)) {
  109. int i10 = (anInt945 * (DrawingArea.topY - spritePosY - j7)) / 3;
  110. if(i10 > anInt945 * 10)
  111. i10 = anInt945 * 10;
  112. if(i10 > rsInterface.scrollPosition)
  113. i10 = rsInterface.scrollPosition;
  114. rsInterface.scrollPosition -= i10;
  115. dragItemY += i10;
  116. }
  117. if(spritePosY + j7 + 32 > DrawingArea.bottomY && rsInterface.scrollPosition < rsInterface.scrollMax - rsInterface.height) {
  118. int j10 = (anInt945 * ((spritePosY + j7 + 32) - DrawingArea.bottomY)) / 3;
  119. if(j10 > anInt945 * 10)
  120. j10 = anInt945 * 10;
  121. if(j10 > rsInterface.scrollMax - rsInterface.height - rsInterface.scrollPosition)
  122. j10 = rsInterface.scrollMax - rsInterface.height - rsInterface.scrollPosition;
  123. rsInterface.scrollPosition += j10;
  124. dragItemY -= j10;
  125. }
  126. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == spriteIndex && atInventoryInterface == rsChildren.id)
  127. itemSprite.drawSprite1(spritePosX, spritePosY, 128);
  128. else
  129. itemSprite.drawSprite(spritePosX, spritePosY);
  130. if(rsChildren.parentID == 3824 || (rsChildren.parentID == 5292 && myPrivilege == 3)) {
  131. infinityIcon.drawSprite(spritePosX + k6, spritePosY + j7);
  132. } else if(itemSprite.maxWidth == 33 || rsChildren.invStackSizes[spriteIndex] != 1) {
  133. int k10 = rsChildren.invStackSizes[spriteIndex];
  134. smallFont.method385(0, intToKOrMil(k10), spritePosY + 10 + j7, spritePosX + 1 + k6);//this is the shadow
  135. if(k10 >= 1)
  136. smallFont.method385(0xFFFF00, intToKOrMil(k10), spritePosY + 9 + j7, spritePosX + k6);
  137. if(k10 >= 100000)
  138. smallFont.method385(0xFFFFFF, intToKOrMil(k10), spritePosY + 9 + j7, spritePosX + k6);
  139. if(k10 >= 10000000)
  140. smallFont.method385(0x00FF80, intToKOrMil(k10), spritePosY + 9 + j7, spritePosX + k6);
  141. //if(k10 >= 1000000000)
  142. //smallFont.method385(0xFF0000, intToKOrMil(k10), spritePosY + 9 + j7, spritePosX + k6);
  143. }
  144. }
  145. }
  146. } else if(rsChildren.sprites != null && spriteIndex < 20) {
  147. Sprite sprite = rsChildren.sprites[spriteIndex];
  148. if(sprite != null)
  149. sprite.drawSprite(spritePosX, spritePosY);
  150. }
  151. spriteIndex++;
  152. }
  153. }
  154. } else if(rsChildren.type == 3) {
  155. boolean flag = false;
  156. if(anInt1039 == rsChildren.id || anInt1048 == rsChildren.id || lastHoverChildId == rsChildren.id)
  157. flag = true;
  158. int j3;
  159. if(interfaceIsSelected(rsChildren)) {
  160. j3 = rsChildren.anInt219;
  161. if(flag && rsChildren.anInt239 != 0)
  162. j3 = rsChildren.anInt239;
  163. } else {
  164. j3 = rsChildren.textColor;
  165. if(flag && rsChildren.textHoverColour != 0)
  166. j3 = rsChildren.textHoverColour;
  167. }
  168. if(rsChildren.opacity == 0) {
  169. if(rsChildren.aBoolean227)
  170. DrawingArea.drawPixels(rsChildren.height, ySpritePos, xSpritePos, j3, rsChildren.width);
  171. else
  172. DrawingArea.fillPixels(xSpritePos, rsChildren.width, rsChildren.height, j3, ySpritePos);
  173. } else if(rsChildren.aBoolean227)
  174. DrawingArea.method335(j3, ySpritePos, rsChildren.width, rsChildren.height, 256 - (rsChildren.opacity & 0xff), xSpritePos);
  175. else
  176. DrawingArea.method338(ySpritePos, rsChildren.height, 256 - (rsChildren.opacity & 0xff), j3, rsChildren.width, xSpritePos);
  177. } else if(rsChildren.type == 4) {
  178. RSFont rsFont = rsChildren.rsFonts;
  179. String s = rsChildren.message;
  180. boolean flag1 = false;
  181. if(anInt1039 == rsChildren.id || anInt1048 == rsChildren.id || lastHoverChildId == rsChildren.id)
  182. flag1 = true;
  183. int i4;
  184. if(interfaceIsSelected(rsChildren)) {
  185. i4 = rsChildren.anInt219;
  186. if(flag1 && rsChildren.anInt239 != 0)
  187. i4 = rsChildren.anInt239;
  188. if(rsChildren.disabledText.length() > 0)
  189. s = rsChildren.disabledText;
  190. } else {
  191. i4 = rsChildren.textColor;
  192. if(flag1 && rsChildren.textHoverColour != 0)
  193. i4 = rsChildren.textHoverColour;
  194. }
  195. if(rsChildren.atActionType == 6 && aBoolean1149) {
  196. s = "Please wait...";
  197. i4 = rsChildren.textColor;
  198. }
  199. if(DrawingArea.width == 519) {
  200. if(i4 == 0xffff00)
  201. i4 = 255;
  202. if(i4 == 49152)
  203. i4 = 0xffffff;
  204. }
  205. if((rsChildren.parentID == 1151) || (rsChildren.parentID == 12855)) {
  206. switch (i4) {
  207. case 16773120: i4 = 0xFE981F; break;
  208. case 7040819: i4 = 0xAF6A1A; break;
  209. }
  210. }
  211. for(int l6 = ySpritePos + rsFont.anInt1497; s.length() > 0; l6 += rsFont.anInt1497) {
  212. if(s.indexOf("%") != -1) {
  213. do {
  214. int k7 = s.indexOf("%1");
  215. if(k7 == -1)
  216. break;
  217. if(rsChildren.id < 4000 || rsChildren.id > 5000 && rsChildren.id !=13921 && rsChildren.id !=13922 && rsChildren.id !=12171 && rsChildren.id !=12172)
  218. s = s.substring(0, k7) + methodR(extractInterfaceValues(rsChildren, 0)) + s.substring(k7 + 2);
  219. else
  220. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(rsChildren, 0)) + s.substring(k7 + 2);
  221. } while(true);
  222. do {
  223. int l7 = s.indexOf("%2");
  224. if(l7 == -1)
  225. break;
  226. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(rsChildren, 1)) + s.substring(l7 + 2);
  227. } while(true);
  228. do {
  229. int i8 = s.indexOf("%3");
  230. if(i8 == -1)
  231. break;
  232. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(rsChildren, 2)) + s.substring(i8 + 2);
  233. } while(true);
  234. do {
  235. int j8 = s.indexOf("%4");
  236. if(j8 == -1)
  237. break;
  238. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(rsChildren, 3)) + s.substring(j8 + 2);
  239. } while(true);
  240. do {
  241. int k8 = s.indexOf("%5");
  242. if(k8 == -1)
  243. break;
  244. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(rsChildren, 4)) + s.substring(k8 + 2);
  245. } while(true);
  246. }
  247. int l8 = s.indexOf("\\n");
  248. String s1;
  249. if(l8 != -1) {
  250. s1 = s.substring(0, l8);
  251. s = s.substring(l8 + 2);
  252. } else {
  253. s1 = s;
  254. s = "";
  255. }
  256. if(rsChildren.centerText)
  257. rsFont.method382(i4, xSpritePos + rsChildren.width / 2, s1, l6, rsChildren.textShadow);
  258. else
  259. rsFont.method389(rsChildren.textShadow, xSpritePos, i4, s1, l6);
  260. }
  261. } else if(rsChildren.type == 5 || rsChildren.type == 10) {
  262. Sprite sprite = null;
  263. if(rsChildren.itemSpriteId1 != -1 && rsChildren.sprite1 == null) {
  264. //fuckyou
  265. rsChildren.sprite1 = ItemDef.getSprite(rsChildren.itemSpriteId1, 1, (rsChildren.itemSpriteZoom1 == -1) ? 0 : -1,rsChildren.itemSpriteZoom1);
  266. rsChildren.sprite2 = ItemDef.getSprite(rsChildren.itemSpriteId2, 1, (rsChildren.itemSpriteZoom2 == -1) ? 0 : -1,rsChildren.itemSpriteZoom2);
  267. //rsChildren.sprite2 = ItemDef.getSprite(rsChildren.itemSpriteId2, rsChildren.invStackSizes[spriteIndex], selectedColour);
  268. //System.out.println("parent ID" + rsChildren.id);
  269.  
  270. if(rsChildren.greyScale)
  271. rsChildren.sprite1.greyScale();
  272. }
  273. if(interfaceIsSelected(rsChildren) || hoverSpriteId == rsChildren.id)
  274. sprite = rsChildren.sprite2;
  275. else
  276. sprite = rsChildren.sprite1;
  277. if(spellSelected == 1 && rsChildren.id == spellID && spellID != 0 && sprite != null) {
  278. sprite.drawSprite(xSpritePos, ySpritePos, 0xffffff);//Outline
  279. } else {
  280. if (sprite != null)
  281. if(rsChildren.type == 5)
  282. sprite.drawSprite(xSpritePos, ySpritePos);
  283. else
  284. sprite.drawSprite1(xSpritePos, ySpritePos, rsChildren.opacity);
  285. }
  286. if(autoCast && rsChildren.id == autocastId)
  287. magicAuto.drawSprite(xSpritePos-3, ySpritePos-2);
  288. } else if(rsChildren.type == 6) {
  289. int k3 = Texture.textureInt1;
  290. int j4 = Texture.textureInt2;
  291. Texture.textureInt1 = xSpritePos + rsChildren.width / 2;
  292. Texture.textureInt2 = ySpritePos + rsChildren.height / 2;
  293. int i5 = Texture.anIntArray1470[rsChildren.modelRotation1] * rsChildren.modelZoom >> 16;
  294. int l5 = Texture.anIntArray1471[rsChildren.modelRotation1] * rsChildren.modelZoom >> 16;
  295. boolean flag2 = interfaceIsSelected(rsChildren);
  296. int i7;
  297. if(flag2)
  298. i7 = rsChildren.anInt258;
  299. else
  300. i7 = rsChildren.anInt257;
  301. Model model;
  302. if(i7 == -1) {
  303. model = rsChildren.method209(-1, -1, flag2);
  304. } else {
  305. Animation animation = Animation.anims[i7];
  306. model = rsChildren.method209(animation.anIntArray354[rsChildren.anInt246], animation.anIntArray353[rsChildren.anInt246], flag2);
  307. }
  308. if(model != null)
  309. model.rendersingle(rsChildren.modelRotation2, 0, rsChildren.modelRotation1, 0, i5, l5);
  310. Texture.textureInt1 = k3;
  311. Texture.textureInt2 = j4;
  312.  
  313. } else if(rsChildren.type == 7) {
  314. RSFont rsFont_1 = rsChildren.rsFonts;
  315. int k4 = 0;
  316. for(int j5 = 0; j5 < rsChildren.height; j5++) {
  317. for(int i6 = 0; i6 < rsChildren.width; i6++) {
  318. if(rsChildren.inv[k4] > 0) {
  319. ItemDef itemDef = ItemDef.forID(rsChildren.inv[k4] - 1,(myPrivilege == 0));
  320. String s2 = itemDef.name;
  321. if(itemDef.stackable || rsChildren.invStackSizes[k4] != 1)
  322. s2 = s2 + " x" + intToKOrMilLongName(rsChildren.invStackSizes[k4]);
  323. int i9 = xSpritePos + i6 * (115 + rsChildren.invSpritePadX);
  324. int k9 = ySpritePos + j5 * (12 + rsChildren.invSpritePadY);
  325. if(rsChildren.centerText)
  326. rsFont_1.method382(rsChildren.textColor, i9 + rsChildren.width / 2, s2, k9, rsChildren.textShadow);
  327. else
  328. rsFont_1.method389(rsChildren.textShadow, i9, rsChildren.textColor, s2, k9);
  329. }
  330. k4++;
  331. }
  332. }
  333. } else if (rsChildren.type == 8 && (anInt1500 == rsChildren.id || anInt1044 == rsChildren.id || lastHoverToggleChildId == rsChildren.id) && anInt1501 == 100) {
  334. int boxWidth = 0;
  335. int boxHeight = 0;
  336. RSFont rsFont_2 = normalFont;
  337. for (String s1 = rsChildren.message; s1.length() > 0;) {
  338. int l7 = s1.indexOf("\\n");
  339. String s4;
  340. if (l7 != -1) {
  341. s4 = s1.substring(0, l7);
  342. s1 = s1.substring(l7 + 2);
  343. } else {
  344. s4 = s1;
  345. s1 = "";
  346. }
  347. int j10 = rsFont_2.getTextWidth(s4);
  348. if (j10 > boxWidth) {
  349. boxWidth = j10;
  350. }
  351. boxHeight += rsFont_2.anInt1497 + 1;
  352. }
  353. boxWidth += 6;
  354. boxHeight += 7;
  355. int xPos = (ySpritePos + rsChildren.width) - 5 - boxWidth;
  356. int yPos = xSpritePos + rsChildren.height + 5;
  357. if (xPos < ySpritePos + 5) {
  358. xPos = ySpritePos + 5;
  359. }
  360. if (xPos + boxWidth > yScrollPoint + rsInterface.width) {
  361. xPos = (yScrollPoint + rsInterface.width) - boxWidth;
  362. }
  363. if (yPos + boxHeight > xPadding + rsInterface.height) {
  364. yPos = (xPadding + rsInterface.height) - boxHeight;
  365. }
  366. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  367. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  368. String s2 = rsChildren.message;
  369. for (int j11 = yPos + rsFont_2.anInt1497 + 2; s2.length() > 0; j11 += rsFont_2.anInt1497 + 1) {//anInt1497
  370. int newLineIndex = s2.indexOf("\\n");
  371. String s5;
  372. if (newLineIndex != -1) {
  373. s5 = s2.substring(0, newLineIndex);
  374. s2 = s2.substring(newLineIndex + 2);
  375. } else {
  376. s5 = s2;
  377. s2 = "";
  378. }
  379. rsFont_2.method389(false, xPos + 3, 0, s5, j11);
  380. }
  381. } else if (rsChildren.type == 9) {
  382. drawHoverBox(xSpritePos, ySpritePos, rsChildren.message);
  383. }
  384. }
  385. DrawingArea.setDrawingArea(yBottomPos, xTopPos, xBottomPos, yTopPos);
  386. } catch(NullPointerException ex) {
  387.  
  388. }
  389. }
Add Comment
Please, Sign In to add comment