Code:
private void drawInterface(int j, int k, RSInterface class9, int l) {
if(class9.interfaceType != 0 || class9.children == null)
return;
if(class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
return;
int i1 = DrawingArea.clipStartX;
int j1 = DrawingArea.clipStartY;
int k1 = DrawingArea.clipEndX;
int l1 = DrawingArea.clipEndY;
DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
int i2 = class9.children.length;
boolean drawBlackBox = false;
for(int j2 = 0; j2 < i2; j2++) {
int k2 = class9.childX[j2] + k;
int l2 = (class9.childY[j2] + l) - j;
RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
if (class9_1 == null) {
System.out.println(j2+" -- " + class9.children[j2] );
return;
}
k2 += class9_1.xOffset;
l2 += class9_1.yOffset;
if(class9_1.contentType > 0 || class9_1.id > 31112 && class9_1.id < 31239) {
drawFriendsListOrWelcomeScreen(class9_1);
}
//here
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(class9_1.id == IDs[m5] + 1) {
if(m5 > 61)
drawBlackBox(k2 + 1, l2);
else
drawBlackBox(k2, l2 + 1);
drawBlackBox = true;
drawingBlackBox = true;
}
}
if (drawingBlackBox && (class9.id == 1151 || class9.id == 12855) && class9.children[j2] == 12854) {
continue;
}
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(class9_1.id == runeChildren[r])
class9_1.modelZoom = 775;
if(class9_1.interfaceType == 10) {
Sprite sprite;
if(interfaceIsSelected(class9_1)) {
sprite = class9_1.enabledSprite;
} else {
sprite = class9_1.disabledSprite;
}
if(sprite != null) {
sprite.drawSpriteOpacity(k2, l2, class9_1.opacity);
}
}
if(class9_1.interfaceType == 0) {
drawOnBankInterface();
if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
if(class9_1.scrollPosition < 0)
class9_1.scrollPosition = 0;
drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
if(class9_1.scrollMax > class9_1.height)
drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
} else if(class9_1.interfaceType != 1)
if(class9_1.interfaceType == 2) {
int i3 = 0;
for(int l3 = 0; l3 < class9_1.height; l3++) {
for(int l4 = 0; l4 < class9_1.width; l4++) {
int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
if(i3 < 20) {
k5 += class9_1.spritesX[i3];
j6 += class9_1.spritesY[i3];
}
if(class9_1.inventory[i3] > 0) {
int k6 = 0;
int j7 = 0;
int j9 = class9_1.inventory[i3] - 1;
if(k5 > DrawingArea.clipStartX - 32 && k5 < DrawingArea.clipEndX && j6 > DrawingArea.clipStartY - 32 && j6 < DrawingArea.clipEndY || activeInterfaceType != 0 && anInt1085 == i3) {
int l9 = 0;
if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
l9 = 0xffffff;
Sprite Sprite_2 = ItemDef.getSprite(j9, class9_1.inventoryValue[i3], l9);
if(Sprite_2 != null) {
if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
k6 = super.mouseX - anInt1087;
j7 = super.mouseY - anInt1088;
if(k6 < 5 && k6 > -5)
k6 = 0;
if(j7 < 5 && j7 > -5)
j7 = 0;
if(anInt989 < 10) {
k6 = 0;
j7 = 0;
}
Sprite_2.drawSprite1(k5 + k6, j6 + j7);
if(j6 + j7 < DrawingArea.clipStartY && class9.scrollPosition > 0) {
int i10 = (anInt945 * (DrawingArea.clipStartY - j6 - j7)) / 3;
if(i10 > anInt945 * 10)
i10 = anInt945 * 10;
if(i10 > class9.scrollPosition)
i10 = class9.scrollPosition;
class9.scrollPosition -= i10;
anInt1088 += i10;
}
if(j6 + j7 + 32 > DrawingArea.clipEndY && class9.scrollPosition < class9.scrollMax - class9.height) {
int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.clipEndY)) / 3;
if(j10 > anInt945 * 10)
j10 = anInt945 * 10;
if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
j10 = class9.scrollMax - class9.height - class9.scrollPosition;
class9.scrollPosition += j10;
anInt1088 -= j10;
}
} else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
Sprite_2.drawSprite1(k5, j6);
else
Sprite_2.drawSprite(k5, j6);
if(Sprite_2.maxWidth == 33 || class9_1.inventoryValue[i3] != 1)
{
int k10 = class9_1.inventoryValue[i3];
smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
if(k10 >= 1)
smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
if(k10 >= 100000)
smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
if(k10 >= 10000000)
smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
}
}
}
} else if(class9_1.sprites != null && i3 < 20) {
Sprite Sprite_1 = class9_1.sprites[i3];
if(Sprite_1 != null)
Sprite_1.drawSprite(k5, j6);
}
i3++;
}
}
} else if(class9_1.interfaceType == 3) {
boolean flag = false;
if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
flag = true;
int j3;
if(interfaceIsSelected(class9_1)) {
j3 = class9_1.enabledColor;
if(flag && class9_1.enabledHoverColor != 0)
j3 = class9_1.enabledHoverColor;
} else {
j3 = class9_1.disabledColor;
if(flag && class9_1.disabledHoverColor != 0)
j3 = class9_1.disabledHoverColor;
}
if(class9_1.opacity == 0) {
if(class9_1.boxFilled)
DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
else
DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
} else if(class9_1.boxFilled)
DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.opacity & 0xff), k2);
else
DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.opacity & 0xff), j3, class9_1.width, k2);
} else if(class9_1.interfaceType == 4) {
RSFont textDrawingArea = class9_1.rsFonts;
String s = class9_1.disabledMessage;
boolean flag1 = false;
if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
flag1 = true;
int i4;
if(interfaceIsSelected(class9_1)) {
i4 = class9_1.enabledColor;
if(flag1 && class9_1.enabledHoverColor != 0)
i4 = class9_1.enabledHoverColor;
if(class9_1.enabledMessage.length() > 0)
s = class9_1.enabledMessage;
} else {
i4 = class9_1.disabledColor;
if(flag1 && class9_1.disabledHoverColor != 0)
i4 = class9_1.disabledHoverColor;
}
if(class9_1.atActionType == 6 && aBoolean1149) {
s = "Please wait...";
i4 = class9_1.disabledColor;
}
if(DrawingArea.canvasWidth == 516) {//519
if(i4 == 0xffff00)
i4 = 255;
if(i4 == 49152)
i4 = 0xffffff;
}
//Magic interface
if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
switch (i4) {
case 16773120: i4 = 0xFE981F; break;
case 7040819: i4 = 0xAF6A1A; break;
}
}
//Skill interface
int id = 4004; int id2 = 4005;
if(class9_1.parentID == 3917 && class9_1.id != id && class9_1.id != id+2 && class9_1.id != id+4 && class9_1.id != id+6
&& class9_1.id != id+8 && class9_1.id != id+10 && class9_1.id != id+12 && class9_1.id != id+14 && class9_1.id != id+16
&& class9_1.id != id+18 && class9_1.id != id+20 && class9_1.id != id+23 && class9_1.id != id+24 && class9_1.id != id+26
&& class9_1.id != id+28 && class9_1.id != id+30 && class9_1.id != id+32 && class9_1.id != id+34 && class9_1.id != 13926
&& class9_1.id != 4152 && class9_1.id != 12166 && class9_1.id != id2 && class9_1.id != id2+2 && class9_1.id != id2+4 && class9_1.id != id2+6
&& class9_1.id != id2+8 && class9_1.id != id2+10 && class9_1.id != id2+12 && class9_1.id != id2+14 && class9_1.id != id2+16
&& class9_1.id != id2+18 && class9_1.id != id2+20 && class9_1.id != id2+23 && class9_1.id != id2+24 && class9_1.id != id2+26
&& class9_1.id != id2+28 && class9_1.id != id2+30 && class9_1.id != id2+32 && class9_1.id != id2+34 && class9_1.id != 13927
&& class9_1.id != 4153 && class9_1.id != 12167 && class9_1.id != 4026) {
if(i4 == 16776960)
i4 = 0x0000;
class9_1.textShadowed = false;
}
for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
{
if(s.indexOf("%") != -1)
{
do
{
int k7 = s.indexOf("%1");
if(k7 == -1)
break;
if(class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id !=13921 && class9_1.id !=13922 && class9_1.id !=12171 && class9_1.id !=12172)
s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
else
s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
} while(true);
do
{
int l7 = s.indexOf("%2");
if(l7 == -1)
break;
s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
} while(true);
do
{
int i8 = s.indexOf("%3");
if(i8 == -1)
break;
s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
} while(true);
do
{
int j8 = s.indexOf("%4");
if(j8 == -1)
break;
s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
} while(true);
do
{
int k8 = s.indexOf("%5");
if(k8 == -1)
break;
s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 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 ((class9_1.id >= 18144) && (class9_1.id <= 18343)) {
int i22 = 0;
if (s1.startsWith("@cr")) {
i22 = Integer.valueOf(s1.substring(3, 4)).intValue();
s1 = s1.substring(5);
s1 = " " + s1;
//((cz)localObject).a(rsi.an, i2, i11, str4, i17);
//textDrawingArea.method389(class9_1.textShadowed, i2, i4, s1, l6);
if (i22 > 0) {
//DrawingArea.setDrawingArea(256, 0, 463, 100);
clanChatIcons[i22].drawSprite(43, l6 - 10);
}
}
}
if (class9.children[j2] == 31159)
s1 = RSInterface.interfaceCache[31160].disabledMessage;
if(class9_1.textCentered)
textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadowed);
else
textDrawingArea.method389(class9_1.textShadowed, k2, i4, s1, l6);
}
} else if(class9_1.interfaceType == 5) {
Sprite sprite;
if ((class9_1.itemSpriteId1 != -1) && (class9_1.disabledSprite == null)) {
class9_1.disabledSprite = ItemDef.getSprite(class9_1.itemSpriteId1, 1, class9_1.itemSpriteZoom1 == -1 ? 0 : -1, class9_1.itemSpriteZoom1);
class9_1.enabledSprite = ItemDef.getSprite(class9_1.itemSpriteId2, 1, class9_1.itemSpriteZoom2 == -1 ? 0 : -1, class9_1.itemSpriteZoom2);
//if (class9_1.greyScale)
//if (class9_1.disabledSprite != null) class9_1.disabledSprite.greyScale();
}
if(interfaceIsSelected(class9_1))
sprite = class9_1.enabledSprite;
else
sprite = class9_1.disabledSprite;
if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
sprite.drawSprite2(k2, l2, 0xffffff);
} else {
if(Autocast && class9_1.id == autocastId)
magicAuto.drawSprite(k2-1, l2);
if (sprite != null)
sprite.drawSprite(k2, l2);
}
if(sprite != null)
sprite.drawSprite(k2, l2);
} else if(class9_1.interfaceType == 6) {
int k3 = Rasterizer.centerX;
int j4 = Rasterizer.centerY;
Rasterizer.centerX = k2 + class9_1.width / 2;
Rasterizer.centerY = l2 + class9_1.height / 2;
int i5 = Rasterizer.SINE[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
int l5 = Rasterizer.COSINE[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
boolean flag2 = interfaceIsSelected(class9_1);
int i7;
if(flag2)
i7 = class9_1.enabledAnimation;
else
i7 = class9_1.disabledAnimation;
Model model;
if(i7 == -1) {
model = class9_1.method209(-1, -1, flag2);
} else {
Animation animation = Animation.anims[i7];
model = class9_1.method209(animation.anIntArray354[class9_1.animationLength], animation.anIntArray353[class9_1.animationLength], flag2);
}
if(model != null)
model.method482(class9_1.modelRotationX, 0, class9_1.modelRotationY, 0, i5, l5);
Rasterizer.centerX = k3;
Rasterizer.centerY = j4;
} else if(class9_1.interfaceType == 7) {
RSFont textDrawingArea_1 = class9_1.rsFonts;
int k4 = 0;
for(int j5 = 0; j5 < class9_1.height; j5++) {
for(int i6 = 0; i6 < class9_1.width; i6++) {
if(class9_1.inventory[k4] > 0) {
ItemDef itemDef = ItemDef.forID(class9_1.inventory[k4] - 1);
String s2 = itemDef.name;
if(itemDef.stackable || class9_1.inventoryValue[k4] != 1)
s2 = s2 + " x" + intToKOrMilLongName(class9_1.inventoryValue[k4]);
int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
if(class9_1.textCentered)
textDrawingArea_1.method382(class9_1.disabledColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadowed);
else
textDrawingArea_1.method389(class9_1.textShadowed, i9, class9_1.disabledColor, s2, k9);
}
k4++;
}
}
} else if (class9_1.interfaceType == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 100) {
int boxWidth = 0;
int boxHeight = 0;
RSFont textDrawingArea_2 = aTextDrawingArea_1271;
for (String s1 = class9_1.disabledMessage; 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 = textDrawingArea_2.getTextWidth(s4);
if (j10 > boxWidth) {
boxWidth = j10;
}
boxHeight += textDrawingArea_2.anInt1497 + 1;
}
boxWidth += 6;
boxHeight += 7;
int xPos = (l2 + class9_1.width) - 5 - boxWidth;
int yPos = k2 + class9_1.height + 5;
if (xPos < l2 + 5) {
xPos = l2 + 5;
}
if (xPos + boxWidth > j + class9.width) {
xPos = (j + class9.width) - boxWidth;
}
if (yPos + boxHeight > k + class9.height) {
yPos = (k + class9.height) - boxHeight;
}
DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
String s2 = class9_1.disabledMessage;
for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {//anInt1497
int l11 = s2.indexOf("\\n");
String s5;
if (l11 != -1) {
s5 = s2.substring(0, l11);
s2 = s2.substring(l11 + 2);
} else {
s5 = s2;
s2 = "";
}
textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
}
} else if (class9_1.interfaceType == 9) {
drawHoverBox(k2, l2, class9_1.disabledMessage);
}else if (class9_1.interfaceType == 10 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && !menuOpen) {
int boxWidth = 0;
int boxHeight = 0;
TextDrawingArea textDrawingArea_2 = newRegularFont;
for (String s1 = class9_1.disabledMessage; 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 = textDrawingArea_2.getTextWidth(s4);
if (j10 > boxWidth) {
boxWidth = j10;
}
boxHeight += textDrawingArea_2.baseCharacterHeight + 1;
}
boxWidth += 6;
boxHeight += 7;
int xPos = (k2 + class9_1.width) - 5 - boxWidth;
int yPos = l2 + class9_1.height + 5;
if (xPos < k2 + 5) {
xPos = k2 + 5;
}
if (xPos + boxWidth > j + class9.width) {
xPos = (j + class9.width) - boxWidth;
}
if (yPos + boxHeight > k + class9.height) {
yPos = (k + class9.height) - boxHeight;
}
if(class9.isInventoryInterface)
{
if(xPos + boxWidth + j > 249)
xPos = 251 - boxWidth - j;
if(yPos + boxHeight + k > 261)
yPos = 245 - boxHeight - k;
}
DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
String s2 = class9_1.disabledMessage;
for (int j11 = yPos + textDrawingArea_2.baseCharacterHeight + 2; s2.length() > 0; j11 += textDrawingArea_2.baseCharacterHeight + 1) {//anInt1497
int l11 = s2.indexOf("\\n");
String s5;
if (l11 != -1) {
s5 = s2.substring(0, l11);
s2 = s2.substring(l11 + 2);
} else {
s5 = s2;
s2 = "";
}
// textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
textDrawingArea_2.drawBasicString(s5, xPos+3,j11, 0, -1);
}
}
}
if ((class9.id == 1151 || class9.id == 12855))
if (!drawBlackBox) drawingBlackBox = false;
DrawingArea.setDrawingArea(l1, i1, k1, j1);
}