Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void drawInterface(int yScrollPoint, int xPadding, RSInterface rsInterface, int yPadding) {
- try {
- if(rsInterface.type != 0 || rsInterface.children == null)
- return;
- if(rsInterface.isMouseoverTriggered && lastHoverChildId != rsInterface.id && anInt1048 != rsInterface.id && anInt1039 != rsInterface.id)
- return;
- int xTopPos = DrawingArea.topX;
- int yTopPos = DrawingArea.topY;
- int xBottomPos = DrawingArea.bottomX;
- int yBottomPos = DrawingArea.bottomY;
- DrawingArea.setDrawingArea(yPadding + rsInterface.height, xPadding, xPadding + rsInterface.width, yPadding);
- int totalChildren = rsInterface.children.length;
- for(int childIndex = 0; childIndex < totalChildren; childIndex++) {
- int xSpritePos = rsInterface.childX[childIndex] + xPadding;
- int ySpritePos = (rsInterface.childY[childIndex] + yPadding) - yScrollPoint;
- RSInterface rsChildren = RSInterface.interfaceCache[rsInterface.children[childIndex]];
- xSpritePos += rsChildren.anInt263;
- ySpritePos += rsChildren.anInt265;
- if(rsChildren.contentType > 0)
- drawFriendsListOrWelcomeScreen(rsChildren);
- //here 196113008
- int[] IDs = {
- 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
- 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
- 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
- 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
- 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
- /* Ancients */
- 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
- 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
- };
- for(int m5 = 0; m5 < IDs.length; m5++) {
- if(rsChildren.id == IDs[m5] + 1) {
- if(m5 > 61)
- drawBlackBox(xSpritePos + 1, ySpritePos);
- else
- drawBlackBox(xSpritePos, ySpritePos + 1);
- }
- }
- int[] runeChildren = {
- 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
- 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
- 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
- 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
- 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
- 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
- 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
- 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
- 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
- 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
- 15885, 18474, 18475, 18478
- };
- for(int r = 0; r < runeChildren.length; r++)
- if(rsChildren.id == runeChildren[r])
- rsChildren.modelZoom = 775;
- if(rsChildren.type == 0) {
- if(rsChildren.scrollPosition > rsChildren.scrollMax - rsChildren.height)
- rsChildren.scrollPosition = rsChildren.scrollMax - rsChildren.height;
- if(rsChildren.scrollPosition < 0)
- rsChildren.scrollPosition = 0;
- drawInterface(rsChildren.scrollPosition, xSpritePos, rsChildren, ySpritePos);
- if(rsChildren.scrollMax > rsChildren.height)
- drawScrollbar(rsChildren.height, rsChildren.scrollPosition, ySpritePos, xSpritePos + rsChildren.width, rsChildren.scrollMax,false);
- } else if(rsChildren.type != 1)
- if(rsChildren.type == 2) {
- int spriteIndex = 0;
- for(int l3 = 0; l3 < rsChildren.height; l3++) {
- for(int l4 = 0; l4 < rsChildren.width; l4++) {
- int spritePosX = xSpritePos + l4 * (32 + rsChildren.invSpritePadX);
- int spritePosY = ySpritePos + l3 * (32 + rsChildren.invSpritePadY);
- if(spriteIndex < 20) {
- spritePosX += rsChildren.spritesX[spriteIndex];
- spritePosY += rsChildren.spritesY[spriteIndex];
- }
- if(rsChildren.inv[spriteIndex] > 0) {
- int k6 = 0;
- int j7 = 0;
- int inventoryItemId = rsChildren.inv[spriteIndex] - 1;
- if(((spritePosX > DrawingArea.topX - 32 && spritePosX < DrawingArea.bottomX && spritePosY > DrawingArea.topY - 32 && spritePosY < DrawingArea.bottomY) || (activeInterfaceType != 0 && anInt1085 == spriteIndex))
- || (rsChildren.parentID == 5292 && activeInterfaceType != 0 && anInt1085 == spriteIndex && dragItemInterface == rsChildren.id)
- ) {
- int selectedColour = 0;
- if(itemSelected == 1 && itemSlotUsedOn == spriteIndex && anInt1284 == rsChildren.id)
- selectedColour = 0xffffff;
- Sprite itemSprite = ItemDef.getSprite(inventoryItemId, rsChildren.invStackSizes[spriteIndex], selectedColour);
- if(itemSprite != null) {
- if(activeInterfaceType != 0 && anInt1085 == spriteIndex && dragItemInterface == rsChildren.id) {
- k6 = super.mouseX - dragItemX;
- j7 = super.mouseY - dragItemY;
- if(k6 < 5 && k6 > -5)
- k6 = 0;
- if(j7 < 5 && j7 > -5)
- j7 = 0;
- if(anInt989 < 5) {
- k6 = 0;
- j7 = 0;
- }
- if(rsChildren.parentID == 5292 && activeInterfaceType != 0 && anInt1085 == spriteIndex && dragItemInterface == rsChildren.id) {
- DrawingArea.topY -= 40;
- }
- itemSprite.drawSprite1(spritePosX + k6, spritePosY + j7, 128);
- if(rsChildren.parentID == 5292 && activeInterfaceType != 0 && anInt1085 == spriteIndex && dragItemInterface == rsChildren.id) {
- DrawingArea.topY += 40;
- }
- if(
- //(spritePosX > DrawingArea.topX - 32 && spritePosX < DrawingArea.bottomX && spritePosY > DrawingArea.topY - 32 && spritePosY < DrawingArea.bottomY) &&
- (spritePosY + j7 < DrawingArea.topY && rsInterface.scrollPosition > 0)) {
- int i10 = (anInt945 * (DrawingArea.topY - spritePosY - j7)) / 3;
- if(i10 > anInt945 * 10)
- i10 = anInt945 * 10;
- if(i10 > rsInterface.scrollPosition)
- i10 = rsInterface.scrollPosition;
- rsInterface.scrollPosition -= i10;
- dragItemY += i10;
- }
- if(spritePosY + j7 + 32 > DrawingArea.bottomY && rsInterface.scrollPosition < rsInterface.scrollMax - rsInterface.height) {
- int j10 = (anInt945 * ((spritePosY + j7 + 32) - DrawingArea.bottomY)) / 3;
- if(j10 > anInt945 * 10)
- j10 = anInt945 * 10;
- if(j10 > rsInterface.scrollMax - rsInterface.height - rsInterface.scrollPosition)
- j10 = rsInterface.scrollMax - rsInterface.height - rsInterface.scrollPosition;
- rsInterface.scrollPosition += j10;
- dragItemY -= j10;
- }
- } else if(atInventoryInterfaceType != 0 && atInventoryIndex == spriteIndex && atInventoryInterface == rsChildren.id)
- itemSprite.drawSprite1(spritePosX, spritePosY, 128);
- else
- itemSprite.drawSprite(spritePosX, spritePosY);
- if(rsChildren.parentID == 3824 || (rsChildren.parentID == 5292 && myPrivilege == 3)) {
- infinityIcon.drawSprite(spritePosX + k6, spritePosY + j7);
- } else if(itemSprite.maxWidth == 33 || rsChildren.invStackSizes[spriteIndex] != 1) {
- int k10 = rsChildren.invStackSizes[spriteIndex];
- smallFont.method385(0, intToKOrMil(k10), spritePosY + 10 + j7, spritePosX + 1 + k6);//this is the shadow
- if(k10 >= 1)
- smallFont.method385(0xFFFF00, intToKOrMil(k10), spritePosY + 9 + j7, spritePosX + k6);
- if(k10 >= 100000)
- smallFont.method385(0xFFFFFF, intToKOrMil(k10), spritePosY + 9 + j7, spritePosX + k6);
- if(k10 >= 10000000)
- smallFont.method385(0x00FF80, intToKOrMil(k10), spritePosY + 9 + j7, spritePosX + k6);
- //if(k10 >= 1000000000)
- //smallFont.method385(0xFF0000, intToKOrMil(k10), spritePosY + 9 + j7, spritePosX + k6);
- }
- }
- }
- } else if(rsChildren.sprites != null && spriteIndex < 20) {
- Sprite sprite = rsChildren.sprites[spriteIndex];
- if(sprite != null)
- sprite.drawSprite(spritePosX, spritePosY);
- }
- spriteIndex++;
- }
- }
- } else if(rsChildren.type == 3) {
- boolean flag = false;
- if(anInt1039 == rsChildren.id || anInt1048 == rsChildren.id || lastHoverChildId == rsChildren.id)
- flag = true;
- int j3;
- if(interfaceIsSelected(rsChildren)) {
- j3 = rsChildren.anInt219;
- if(flag && rsChildren.anInt239 != 0)
- j3 = rsChildren.anInt239;
- } else {
- j3 = rsChildren.textColor;
- if(flag && rsChildren.textHoverColour != 0)
- j3 = rsChildren.textHoverColour;
- }
- if(rsChildren.opacity == 0) {
- if(rsChildren.aBoolean227)
- DrawingArea.drawPixels(rsChildren.height, ySpritePos, xSpritePos, j3, rsChildren.width);
- else
- DrawingArea.fillPixels(xSpritePos, rsChildren.width, rsChildren.height, j3, ySpritePos);
- } else if(rsChildren.aBoolean227)
- DrawingArea.method335(j3, ySpritePos, rsChildren.width, rsChildren.height, 256 - (rsChildren.opacity & 0xff), xSpritePos);
- else
- DrawingArea.method338(ySpritePos, rsChildren.height, 256 - (rsChildren.opacity & 0xff), j3, rsChildren.width, xSpritePos);
- } else if(rsChildren.type == 4) {
- RSFont rsFont = rsChildren.rsFonts;
- String s = rsChildren.message;
- boolean flag1 = false;
- if(anInt1039 == rsChildren.id || anInt1048 == rsChildren.id || lastHoverChildId == rsChildren.id)
- flag1 = true;
- int i4;
- if(interfaceIsSelected(rsChildren)) {
- i4 = rsChildren.anInt219;
- if(flag1 && rsChildren.anInt239 != 0)
- i4 = rsChildren.anInt239;
- if(rsChildren.disabledText.length() > 0)
- s = rsChildren.disabledText;
- } else {
- i4 = rsChildren.textColor;
- if(flag1 && rsChildren.textHoverColour != 0)
- i4 = rsChildren.textHoverColour;
- }
- if(rsChildren.atActionType == 6 && aBoolean1149) {
- s = "Please wait...";
- i4 = rsChildren.textColor;
- }
- if(DrawingArea.width == 519) {
- if(i4 == 0xffff00)
- i4 = 255;
- if(i4 == 49152)
- i4 = 0xffffff;
- }
- if((rsChildren.parentID == 1151) || (rsChildren.parentID == 12855)) {
- switch (i4) {
- case 16773120: i4 = 0xFE981F; break;
- case 7040819: i4 = 0xAF6A1A; break;
- }
- }
- for(int l6 = ySpritePos + rsFont.anInt1497; s.length() > 0; l6 += rsFont.anInt1497) {
- if(s.indexOf("%") != -1) {
- do {
- int k7 = s.indexOf("%1");
- if(k7 == -1)
- break;
- if(rsChildren.id < 4000 || rsChildren.id > 5000 && rsChildren.id !=13921 && rsChildren.id !=13922 && rsChildren.id !=12171 && rsChildren.id !=12172)
- s = s.substring(0, k7) + methodR(extractInterfaceValues(rsChildren, 0)) + s.substring(k7 + 2);
- else
- s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(rsChildren, 0)) + s.substring(k7 + 2);
- } while(true);
- do {
- int l7 = s.indexOf("%2");
- if(l7 == -1)
- break;
- s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(rsChildren, 1)) + s.substring(l7 + 2);
- } while(true);
- do {
- int i8 = s.indexOf("%3");
- if(i8 == -1)
- break;
- s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(rsChildren, 2)) + s.substring(i8 + 2);
- } while(true);
- do {
- int j8 = s.indexOf("%4");
- if(j8 == -1)
- break;
- s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(rsChildren, 3)) + s.substring(j8 + 2);
- } while(true);
- do {
- int k8 = s.indexOf("%5");
- if(k8 == -1)
- break;
- s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(rsChildren, 4)) + s.substring(k8 + 2);
- } while(true);
- }
- int l8 = s.indexOf("\\n");
- String s1;
- if(l8 != -1) {
- s1 = s.substring(0, l8);
- s = s.substring(l8 + 2);
- } else {
- s1 = s;
- s = "";
- }
- if(rsChildren.centerText)
- rsFont.method382(i4, xSpritePos + rsChildren.width / 2, s1, l6, rsChildren.textShadow);
- else
- rsFont.method389(rsChildren.textShadow, xSpritePos, i4, s1, l6);
- }
- } else if(rsChildren.type == 5 || rsChildren.type == 10) {
- Sprite sprite = null;
- if(rsChildren.itemSpriteId1 != -1 && rsChildren.sprite1 == null) {
- //fuckyou
- rsChildren.sprite1 = ItemDef.getSprite(rsChildren.itemSpriteId1, 1, (rsChildren.itemSpriteZoom1 == -1) ? 0 : -1,rsChildren.itemSpriteZoom1);
- rsChildren.sprite2 = ItemDef.getSprite(rsChildren.itemSpriteId2, 1, (rsChildren.itemSpriteZoom2 == -1) ? 0 : -1,rsChildren.itemSpriteZoom2);
- //rsChildren.sprite2 = ItemDef.getSprite(rsChildren.itemSpriteId2, rsChildren.invStackSizes[spriteIndex], selectedColour);
- //System.out.println("parent ID" + rsChildren.id);
- if(rsChildren.greyScale)
- rsChildren.sprite1.greyScale();
- }
- if(interfaceIsSelected(rsChildren) || hoverSpriteId == rsChildren.id)
- sprite = rsChildren.sprite2;
- else
- sprite = rsChildren.sprite1;
- if(spellSelected == 1 && rsChildren.id == spellID && spellID != 0 && sprite != null) {
- sprite.drawSprite(xSpritePos, ySpritePos, 0xffffff);//Outline
- } else {
- if (sprite != null)
- if(rsChildren.type == 5)
- sprite.drawSprite(xSpritePos, ySpritePos);
- else
- sprite.drawSprite1(xSpritePos, ySpritePos, rsChildren.opacity);
- }
- if(autoCast && rsChildren.id == autocastId)
- magicAuto.drawSprite(xSpritePos-3, ySpritePos-2);
- } else if(rsChildren.type == 6) {
- int k3 = Texture.textureInt1;
- int j4 = Texture.textureInt2;
- Texture.textureInt1 = xSpritePos + rsChildren.width / 2;
- Texture.textureInt2 = ySpritePos + rsChildren.height / 2;
- int i5 = Texture.anIntArray1470[rsChildren.modelRotation1] * rsChildren.modelZoom >> 16;
- int l5 = Texture.anIntArray1471[rsChildren.modelRotation1] * rsChildren.modelZoom >> 16;
- boolean flag2 = interfaceIsSelected(rsChildren);
- int i7;
- if(flag2)
- i7 = rsChildren.anInt258;
- else
- i7 = rsChildren.anInt257;
- Model model;
- if(i7 == -1) {
- model = rsChildren.method209(-1, -1, flag2);
- } else {
- Animation animation = Animation.anims[i7];
- model = rsChildren.method209(animation.anIntArray354[rsChildren.anInt246], animation.anIntArray353[rsChildren.anInt246], flag2);
- }
- if(model != null)
- model.rendersingle(rsChildren.modelRotation2, 0, rsChildren.modelRotation1, 0, i5, l5);
- Texture.textureInt1 = k3;
- Texture.textureInt2 = j4;
- } else if(rsChildren.type == 7) {
- RSFont rsFont_1 = rsChildren.rsFonts;
- int k4 = 0;
- for(int j5 = 0; j5 < rsChildren.height; j5++) {
- for(int i6 = 0; i6 < rsChildren.width; i6++) {
- if(rsChildren.inv[k4] > 0) {
- ItemDef itemDef = ItemDef.forID(rsChildren.inv[k4] - 1,(myPrivilege == 0));
- String s2 = itemDef.name;
- if(itemDef.stackable || rsChildren.invStackSizes[k4] != 1)
- s2 = s2 + " x" + intToKOrMilLongName(rsChildren.invStackSizes[k4]);
- int i9 = xSpritePos + i6 * (115 + rsChildren.invSpritePadX);
- int k9 = ySpritePos + j5 * (12 + rsChildren.invSpritePadY);
- if(rsChildren.centerText)
- rsFont_1.method382(rsChildren.textColor, i9 + rsChildren.width / 2, s2, k9, rsChildren.textShadow);
- else
- rsFont_1.method389(rsChildren.textShadow, i9, rsChildren.textColor, s2, k9);
- }
- k4++;
- }
- }
- } else if (rsChildren.type == 8 && (anInt1500 == rsChildren.id || anInt1044 == rsChildren.id || lastHoverToggleChildId == rsChildren.id) && anInt1501 == 100) {
- int boxWidth = 0;
- int boxHeight = 0;
- RSFont rsFont_2 = normalFont;
- for (String s1 = rsChildren.message; s1.length() > 0;) {
- int l7 = s1.indexOf("\\n");
- String s4;
- if (l7 != -1) {
- s4 = s1.substring(0, l7);
- s1 = s1.substring(l7 + 2);
- } else {
- s4 = s1;
- s1 = "";
- }
- int j10 = rsFont_2.getTextWidth(s4);
- if (j10 > boxWidth) {
- boxWidth = j10;
- }
- boxHeight += rsFont_2.anInt1497 + 1;
- }
- boxWidth += 6;
- boxHeight += 7;
- int xPos = (ySpritePos + rsChildren.width) - 5 - boxWidth;
- int yPos = xSpritePos + rsChildren.height + 5;
- if (xPos < ySpritePos + 5) {
- xPos = ySpritePos + 5;
- }
- if (xPos + boxWidth > yScrollPoint + rsInterface.width) {
- xPos = (yScrollPoint + rsInterface.width) - boxWidth;
- }
- if (yPos + boxHeight > xPadding + rsInterface.height) {
- yPos = (xPadding + rsInterface.height) - boxHeight;
- }
- DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
- DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
- String s2 = rsChildren.message;
- for (int j11 = yPos + rsFont_2.anInt1497 + 2; s2.length() > 0; j11 += rsFont_2.anInt1497 + 1) {//anInt1497
- int newLineIndex = s2.indexOf("\\n");
- String s5;
- if (newLineIndex != -1) {
- s5 = s2.substring(0, newLineIndex);
- s2 = s2.substring(newLineIndex + 2);
- } else {
- s5 = s2;
- s2 = "";
- }
- rsFont_2.method389(false, xPos + 3, 0, s5, j11);
- }
- } else if (rsChildren.type == 9) {
- drawHoverBox(xSpritePos, ySpritePos, rsChildren.message);
- }
- }
- DrawingArea.setDrawingArea(yBottomPos, xTopPos, xBottomPos, yTopPos);
- } catch(NullPointerException ex) {
- }
- }
Add Comment
Please, Sign In to add comment