Code:
private void drawChatArea() {
chatBackImage.initDrawingArea();
Texture.anIntArray1472 = anIntArray1180;
chatArea[getSpriteID()].drawSprite(0, 0);
if(spriteChanged){
aBoolean1233 = true;
inputTaken = true;
}
if(is459) {
RSFont textDrawingArea = aTextDrawingArea_1271;
if(messagePromptRaised) {
newBoldFont.drawCenteredString(aString1121, 239, 60, 0, -1);
newBoldFont.drawCenteredString( promptInput + "*", 239, 80, 128, -1);
} else if(inputDialogState == 1) {
newBoldFont.drawCenteredString("Enter amount:", 239, 60, 0, -1);
newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
} else if(inputDialogState == 2) {
newBoldFont.drawCenteredString("Enter name:", 239, 60, 0, -1);
newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
} else if(aString844 != null) {
newBoldFont.drawCenteredString(aString844, 239, 60, 0, -1);
newBoldFont.drawCenteredString("Click to continue", 239, 80, 128, -1);
} else if(backDialogID != -1) {
drawInterface(0, 16, RSInterface.interfaceCache[backDialogID], 20);
} else if(dialogID != -1) {
drawInterface(0, 16, RSInterface.interfaceCache[dialogID], 20);
} else {
int j77 = 0;
int j = 0;
DrawingArea.setDrawingArea(93+5, 0, 463, 22);
for(int k = 0; k < 100; k++)
if(chatMessages[k] != null) {
int chatType = chatTypes[k];
int yPos = (88 - j77 * 14) + anInt1089 + 5;
String s1 = chatNames[k];
byte byte0 = 0;
if (s1 != null && s1.startsWith("@cr0@")) {
s1 = s1.substring(5);
byte0 = 1;
} else if(s1 != null && s1.startsWith("@cr1@")) {
s1 = s1.substring(5);
byte0 = 2;
} else if(s1 != null && s1.startsWith("@cr2@")) {
s1 = s1.substring(5);
byte0 = 3;
} else if(s1 != null && s1.startsWith("@cr3@")) {
s1 = s1.substring(5);
byte0 = 4;
}
/* Draws Chat Colored Messages */
if(chatType == 0) {
if (chatTypeView == 5 || chatTypeView == 0) {
if(yPos > 0 && yPos < 110)
newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0, -1);
j++;
j77++;
}
}
/* Draws clickable URL text into chatarea */
if(chatType == 9) {
if (chatTypeView == 5 || chatTypeView == 0) {
if(yPos > 0 && yPos < 110)
newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 19, yPos, 0x7e3200, -1);
j++;
j77++;
}
}
if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
if (chatTypeView == 1 || chatTypeView == 0) {
if(yPos > 0 && yPos < 110) {
int xPos = 19;
switch(byte0) {
case 1:
modIcons[0].drawSprite(xPos, yPos - 12);
xPos += 14;
break;
case 2:
modIcons[1].drawSprite(xPos, yPos - 12);
xPos += 14;
break;
case 3:
modIcons[2].drawSprite(xPos, yPos - 12);
xPos += 14;
break;
case 4:
modIcons[3].drawSprite(xPos, yPos - 12);
xPos += 14;
break;
}
newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
xPos += newRegularFont.getTextWidth(s1) + 8;
newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
}
j++;
j77++;
}
}
if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
if (chatTypeView == 2 || chatTypeView == 0) {
if(yPos > 0 && yPos < 110) {
int k1 = 4;
newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
k1 += newRegularFont.getTextWidth("From ");
switch(byte0) {
case 1:
modIcons[0].drawSprite(k1, yPos - 12);
k1 += 14;
break;
case 2:
modIcons[1].drawSprite(k1, yPos - 12);
k1 += 14;
break;
case 3:
modIcons[2].drawSprite(k1, yPos - 12);
k1 += 14;
break;
case 4:
modIcons[3].drawSprite(k1, yPos - 12);
k1 += 14;
break;
}
newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
k1 += newRegularFont.getTextWidth(s1) + 8;
newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
}
j++;
j77++;
}
}
if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
if (chatTypeView == 3 || chatTypeView == 0) {
if(yPos > 0 && yPos < 110)
newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 19, yPos, 0x800080, -1);
j++;
j77++;
}
}
if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
if (chatTypeView == 2 || chatTypeView == 0) {
if(yPos > 0 && yPos < 110)
newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0x800000, -1);
j++;
j77++;
}
}
if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
if (chatTypeView == 2 || chatTypeView == 0) {
if(yPos > 0 && yPos < 110) {
newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
newRegularFont.drawBasicString(chatMessages[k], 12 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
}
j++;
j77++;
}
}
if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
if (chatTypeView == 3 || chatTypeView == 0) {
if(yPos > 0 && yPos < 110)
newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
j++;
j77++;
}
if(chatType == 11 && (clanChatMode == 0)) {
if (chatTypeView == 11) {
if(yPos > 0 && yPos < 110)
newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
j++;
j77++;
}
}
}
if(chatType == 16) {
int j2 = 40+11;
int clanNameWidth = textDrawingArea.getTextWidth(clanname);
if(chatTypeView == 11 || chatTypeView == 0) {
if(yPos > 0 && yPos < 110)
switch(chatRights[k]) {
case 1:
j2 += clanNameWidth;
modIcons[0].drawSprite(j2 - 18, yPos - 12);
j2 += 15;
break;
case 2:
j2 += clanNameWidth;
modIcons[1].drawSprite(j2 - 18, yPos - 12);
j2 += 15;
break;
case 3:
j2 += clanNameWidth;
modIcons[2].drawSprite(j2 - 18, yPos - 12);
j2 += 15;
break;
case 4:
j2 += clanNameWidth;
modIcons[3].drawSprite(j2 - 18, yPos - 12);
j2 += 15;
break;
default:
j2 += clanNameWidth;
break;
}
newRegularFont.drawBasicString("[", 19, yPos, 0, -1);
newRegularFont.drawBasicString("]", clanNameWidth + 16+11, yPos, 0, -1);
newRegularFont.drawBasicString(""+capitalize(clanname)+"", 25, yPos, 255, -1);
newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
j++;
j77++;
}
}
}
DrawingArea.defaultDrawingAreaSize();
anInt1211 = j * 14 + 7;
if(anInt1211 < 78)
anInt1211 = 78;
drawScrollbar(77, anInt1211 - anInt1089 - 77, 20, 480, anInt1211);
String s;
if(myPlayer != null && myPlayer.name != null)
s = myPlayer.name;
else
s = TextClass.fixName(capitalize(myUsername));
newRegularFont.drawBasicString(s + ":", 19, 110, 0, -1);
newRegularFont.drawBasicString(inputString + "*", 20 + textDrawingArea.getTextWidth(s + ": "), 110, 255, -1);
DrawingArea.method339(97, 0x000000, 479, 17);
}
} else if(is474 || is480 || is508 || is525 || is562) {
RSFont textDrawingArea = aTextDrawingArea_1271;
if(messagePromptRaised) {
newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
newBoldFont.drawCenteredString( promptInput + "*", 259, 80, 128, -1);
} else if(inputDialogState == 1) {
newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
} else if(inputDialogState == 2) {
newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
} else if(aString844 != null) {
newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
newBoldFont.drawCenteredString("Click to continue", 259, 80, 128, -1);
} else if(backDialogID != -1) {
drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
} else if(dialogID != -1) {
drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
} else {
int j77 = -3;
int j = 0;
DrawingArea.setDrawingArea(122, 8, 497, 7);
for(int k = 0; k < 500; k++)
if(chatMessages[k] != null) {
int chatType = chatTypes[k];
int yPos = (70 - j77 * 14) + anInt1089 + 5;
String s1 = chatNames[k];
byte byte0 = 0;
if (s1 != null && s1.startsWith("@cr0@")) {
s1 = s1.substring(5);
byte0 = 1;
} else if(s1 != null && s1.startsWith("@cr1@")) {
s1 = s1.substring(5);
byte0 = 2;
} else if(s1 != null && s1.startsWith("@cr2@")) {
s1 = s1.substring(5);
byte0 = 3;
} else if(s1 != null && s1.startsWith("@cr3@")) {
s1 = s1.substring(5);
byte0 = 4;
}
/* Draws Chat Colored Messages */
if(chatType == 0) {
if (chatTypeView == 5 || chatTypeView == 0) {
if(yPos > 0 && yPos < 210)
newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
j++;
j77++;
}
}
/* Draws clickable URL text into chatarea */
if(chatType == 9) {
if (chatTypeView == 5 || chatTypeView == 0) {
if(yPos > 0 && yPos < 210)
newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 11, yPos, 0x7e3200, -1);
j++;
j77++;
}
}
if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
if (chatTypeView == 1 || chatTypeView == 0) {
if(yPos > 0 && yPos < 210) {
int xPos = 11;
switch(byte0) {
case 1:
modIcons[0].drawSprite(xPos, yPos - 12);
xPos += 14;
break;
case 2:
modIcons[1].drawSprite(xPos, yPos - 12);
xPos += 14;
break;
case 3:
modIcons[2].drawSprite(xPos, yPos - 12);
xPos += 14;
break;
case 4:
modIcons[3].drawSprite(xPos, yPos - 12);
xPos += 14;
break;
}
newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
xPos += newRegularFont.getTextWidth(s1) + 8;
newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
}
j++;
j77++;
}
}
if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
if (chatTypeView == 2 || chatTypeView == 0) {
if(yPos > 0 && yPos < 210) {
int k1 = 11;
newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
k1 += newRegularFont.getTextWidth("From ");
switch(byte0) {
case 1:
modIcons[0].drawSprite(k1, yPos - 12);
k1 += 14;
break;
case 2:
modIcons[1].drawSprite(k1, yPos - 12);
k1 += 14;
break;
case 3:
modIcons[2].drawSprite(k1, yPos - 12);
k1 += 14;
break;
case 4:
modIcons[3].drawSprite(k1, yPos - 12);
k1 += 14;
break;
}
newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
k1 += newRegularFont.getTextWidth(s1) + 8;
newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
}
j++;
j77++;
}
}
if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
if (chatTypeView == 3 || chatTypeView == 0) {
if(yPos > 0 && yPos < 210)
newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
j++;
j77++;
}
}
if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
if (chatTypeView == 2 || chatTypeView == 0) {
if(yPos > 0 && yPos < 210)
newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
j++;
j77++;
}
}
if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
if (chatTypeView == 2 || chatTypeView == 0) {
if(yPos > 0 && yPos < 210) {
newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
}
j++;
j77++;
}
}
if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
if (chatTypeView == 3 || chatTypeView == 0) {
if(yPos > 0 && yPos < 210)
newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
j++;
j77++;
}
if(chatType == 11 && (clanChatMode == 0)) {
if (chatTypeView == 11) {
if(yPos > 0 && yPos < 210)
newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
j++;
j77++;
}
}
}
if(chatType == 16) {
int j2 = 40;
int clanNameWidth = textDrawingArea.getTextWidth(clanname);
if(chatTypeView == 11 || chatTypeView == 0) {
if(yPos > 3 && yPos < 130)
switch(chatRights[k]) {
case 1:
j2 += clanNameWidth;
modIcons[0].drawSprite(j2 - 18, yPos - 12);
j2 += 14;
break;
case 2:
j2 += clanNameWidth;
modIcons[1].drawSprite(j2 - 18, yPos - 12);
j2 += 14;
break;
case 3:
j2 += clanNameWidth;
modIcons[2].drawSprite(j2 - 18, yPos - 12);
j2 += 14;
break;
case 4:
j2 += clanNameWidth;
modIcons[3].drawSprite(j2 - 18, yPos - 12);
j2 += 14;
break;
default:
j2 += clanNameWidth;
break;
}
newRegularFont.drawBasicString("[", 8, yPos, 0, -1);
newRegularFont.drawBasicString("]", clanNameWidth + 16, yPos, 0, -1);
newRegularFont.drawBasicString(""+capitalize(clanname)+"", 14, yPos, 255, -1);
newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
j++;
j77++;
}
}
}
DrawingArea.defaultDrawingAreaSize();
anInt1211 = j * 14 + 7 + 5;
if(anInt1211 < 111)
anInt1211 = 111;
drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
String s;
if(myPlayer != null && myPlayer.name != null)
s = myPlayer.name;
else
s = TextClass.fixName(capitalize(myUsername));
if(is508) {
qc.drawSprite(textDrawingArea.getTextWidth(s) + 11, 123);
newRegularFont.drawBasicString(s, 11, 133, 0, -1);
newRegularFont.drawBasicString(":", (25 + textDrawingArea.getTextWidth(s)), 133, 0, -1);
newRegularFont.drawBasicString(inputString + ((loopCycle % 40 < 20) ? "<col=0>|" : ""), 23 + textDrawingArea.getTextWidth(s + ": "), 133 ,255 , -1);
DrawingArea.method339(121, 0x807660, 506, 7);
} else {
newRegularFont.drawBasicString(s + ":", 11, 133, 0, -1);
newRegularFont.drawBasicString(inputString + "*", 12 + textDrawingArea.getTextWidth(s + ": "), 133, 255, -1);
DrawingArea.method339(121, 0x807660, 506, 7);
}
}
}
drawChannelButtons();
chatBackImage.drawGraphics(338, super.graphics, 0);
inGameScreen.initDrawingArea();
Texture.anIntArray1472 = anIntArray1182;
}