Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void drawInterface(int j, int x, Widget widget, int y)
- {
- //Checks if the interface has any children
- if(widget.components == null || widget.components.size() == 0) return;
- if(widget.id == 409) //Skill guide
- DrawingArea.drawTransparentBox(-100, 0, DrawingArea.width + 100, DrawingArea.height, 0x4F4224, 150);
- int topX = DrawingArea.topX;
- int topY = DrawingArea.topY;
- int bottomX = DrawingArea.bottomX;
- int bottomY = DrawingArea.bottomY;
- DrawingArea.setDrawingArea(y + widget.height, x, x + widget.width, y);
- double perRow = 0;
- double totalCollums = 0;
- for(WComponent components : widget.components) {
- Widget component = components.component;
- int drawX = components.position[0] + x;
- int drawY = (components.position[1] + y) - j;
- drawX += component.itemOffsetX;
- drawY += component.itemOffsetY;
- if(widget.id == 634 && component.type == 4 && !component.message.contains("\\n")) {
- drawY += 12;
- }
- if(component.hideLayer || component.isMouseoverTriggered && hoverSpriteId != component.id)
- continue;
- if(widget.id == 226) {
- if(component.id == 0 || component.id == 1) {
- if(ClientSettings.currentScreenMode.equals(ScreenMode.FIXED)) {
- widget.width = 512;
- widget.height = 334;
- component.modelZoom = 200;
- } else {
- drawY += 620;
- widget.width = ClientSettings.currentGameWidth;
- widget.height = ClientSettings.currentGameHeight;
- component.modelZoom = 100;
- }
- }
- }
- if(component.contentType > 0)
- drawFriendsListOrWelcomeScreen(component);
- handleCustomInterfaceScripts(widget, component);
- if(component.type == 0) {
- if(component.scrollPosition > component.scrollMax - component.height) component.scrollPosition = component.scrollMax - component.height;
- if(component.scrollPosition < 0) component.scrollPosition = 0;
- drawInterface(component.scrollPosition, drawX, component, drawY);
- if(component.scrollMax > component.height) drawScrollbar(component.height, component.scrollPosition, drawY, drawX + component.width, component.scrollMax, openInterfaceID == 409 ? true : false, false);
- } else if(component.type == 2) {
- if(openInterfaceID == 496 && component.parentID == 498 && component.id == 0 && useTabs) {
- drawBankItems(drawX, drawY);
- } else {
- int slot = 0;
- for(int l3 = 0; l3 < component.height; l3++) {
- for(int l4 = 0; l4 < component.width; l4++) {
- int k5 = drawX + l4 * (32 + component.invSpritePadX);
- int j6 = drawY + l3 * (32 + component.invSpritePadY);
- if(slot < 20) {
- k5 += component.spritesX[slot];
- j6 += component.spritesY[slot];
- }
- if(component.inv[slot] > 0) {
- if(component.id >= 50481 && component.id <= 50485) {
- DrawingArea.fillPixels(k5 - 10, 71, 42, 0x000000, j6);
- DrawingArea.fillPixels(k5 - 9, 69, 41, 0x000000, j6);
- DrawingArea.method335(0x514a44, j6, 67, 40, 256, k5 - 8);
- k5 += 7;
- j6 += 5;
- }
- if(component.id == 21811 || component.id == 21821) {
- int rarity = 0;
- for(int i = 0; i < rewards.length; i++) {
- if(rewards[i][0] == component.inv[slot]) {
- rarity = rewards[i][2];
- break;
- }
- }
- int color = 0x00ff37;
- if(rarity == 1)
- color = 0xfffa00;
- else if(rarity == 2)
- color = 0xffaa00;
- else if(rarity == 3)
- color = 0xff0000;
- DrawingArea.fillPixels(k5 - 5, 42, 42, 0x342B1C, j6 - 4);
- DrawingArea.fillPixels(k5 - 4, 40, 40, 0x342B1C, j6 - 3);
- DrawingArea.fillPixels(k5 - 3, 38, 38, color, j6 - 2);
- DrawingArea.method335(0x514a44, j6 - 1, 36, 36, 256, k5 - 2);
- }
- int k6 = 0;
- int j7 = 0;
- int itemId = component.inv[slot] - 1;
- if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && oldMouseInvInterfaceIndex == slot) { //oldMouseInvInterfaceIndex
- int l9 = 0;
- if(itemSelected == 1 && anInt1283 == slot && anInt1284 == component.id)
- l9 = 0xffffff;
- int itemSpriteOpacity = 256;
- if(openInterfaceID == 406 && component.invStackSizes[slot] < 1 || component.parentID == 497 && component.invStackSizes[slot] < 1 || component.parentID == 602 && component.invStackSizes[slot] < 1)
- itemSpriteOpacity = 99;
- if(invOverlayInterfaceID == 408) {
- ItemDefinition def = ItemDefinition.forID(itemId);
- if(!(def.name.endsWith("(lg)") || def.name.endsWith("(sk)") || def.name.endsWith(" set")))
- itemSpriteOpacity = 99;
- }
- if(component.id == 8) {
- boolean isRunes = itemId >= 554 && itemId <= 566 || itemId >= 4694 && itemId <= 4699;
- if(!isRunes)
- itemSpriteOpacity = 99;
- }
- if(widget.id == 609 && component.id == 6 && (itemId == 11855 || itemId == 11839))
- itemSpriteOpacity = 99;
- Sprite itemSprite = ItemDefinition.getSprite(itemId, component.invStackSizes[slot], l9);
- if(itemSprite != null) {
- if(activeInterfaceType != 0 && oldMouseInvInterfaceIndex == slot && anInt1084 == component.id && atInventoryParent == widget.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 < 5) {
- k6 = 0;
- j7 = 0;
- }
- itemSprite.drawSprite1(k5 + k6, j6 + j7);
- if(j6 + j7 < DrawingArea.topY && widget.scrollPosition > 0) {
- int i10 = (cycleTimer * (DrawingArea.topY - j6 - j7)) / 3;
- if(i10 > cycleTimer * 10)
- i10 = cycleTimer * 10;
- if(i10 > widget.scrollPosition)
- i10 = widget.scrollPosition;
- widget.scrollPosition -= i10;
- anInt1088 += i10;
- }
- if(j6 + j7 + 32 > DrawingArea.bottomY && widget.scrollPosition < widget.scrollMax - widget.height) {
- int j10 = (cycleTimer * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
- if(j10 > cycleTimer * 10)
- j10 = cycleTimer * 10;
- if(j10 > widget.scrollMax - widget.height - widget.scrollPosition)
- j10 = widget.scrollMax - widget.height - widget.scrollPosition;
- widget.scrollPosition += j10;
- anInt1088 -= j10;
- }
- } else if(atInventoryInterfaceType != 0 && atInventoryIndex == slot && atInventoryInterface == component.id && atInventoryParent == widget.id) {
- itemSprite.drawSprite1(k5, j6);
- } else {
- boolean isLootingBag = widget.id == 114 && component.id == 0 && itemId == 11855 && hasItems(); //component.id == 5064 && itemId == 11941
- if(isLootingBag)
- cacheSprite[57].drawSpriteWithOpacity(k5-1, j6, 50);
- if(itemId != 1)
- itemSprite.drawSpriteWithOpacity(k5, j6, itemSpriteOpacity);
- if(component.inv[slot] - 1 > 32000) {
- cacheSprite[144].drawSprite(k5, j6 + 15);
- }
- }
- if(itemSprite.maxWidth == 33 || component.invStackSizes[slot] != 1) {
- boolean isChild = Widget.isChild(openInterfaceID, component);
- if(!(openInterfaceID == 406 && isChild || openInterfaceID == 496 && isChild || openInterfaceID == 602 && isChild)) {
- int k10 = component.invStackSizes[slot];
- smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
- int color = k10 > 99999 && k10 < 10000000 ? 0xFFFFFF : k10 > 9999999 ? 0x00ff80 : 0xFFFF00;
- smallText.method385(color, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
- }
- }
- }
- }
- } else if(component.sprites != null && slot < 20) {
- Sprite class30_sub2_sub1_sub1_1 = component.sprites[slot];
- if(class30_sub2_sub1_sub1_1 != null) {
- class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
- }
- }
- if (widget.id == 603 && component.id == 8) { //component.id == 3415
- if(System.currentTimeMillis() - changedTwo[slot] < 15000) {
- int trans = (int) (255 - (System.currentTimeMillis() - changedTwo[slot]) * 255 / 15000);
- if(tick % 40 < 20)
- itemRemoved.drawSpriteWithOpacity(k5 - 5, j6 - 4, trans);
- }
- }
- if (widget.id == 603 && component.id == 9) {
- if(System.currentTimeMillis() - changed[slot] < 15000) {
- int trans = (int) (255 - (System.currentTimeMillis() - changed[slot]) * 255 / 15000);
- if(tick % 40 < 20)
- itemRemoved.drawSpriteWithOpacity(k5 - 5, j6 - 4, trans);
- }
- }
- slot++;
- }
- }
- }
- } else if(component.type == 3) {
- boolean isHovering = false;
- if(anInt1039 == component.id || hoverSpriteId == component.id || anInt1026 == component.id) {
- isHovering = true;
- }
- int color;
- if(interfaceIsSelected(component) || (dropDownMenuHover == component.id && hoverParentId == component.parentID)) { // || dropDownMenuHover == component.id
- color = component.enabledColor;
- if(isHovering && component.enabledHoverColor != 0)
- color = component.enabledHoverColor;
- } else {
- color = component.textColor;
- if(isHovering && component.textColorHover != 0)
- color = component.textColorHover;
- }
- if(component.opacity == 0) {
- if(component.filledColor)
- DrawingArea.method336(component.height, drawY, drawX, color, component.width);
- else
- DrawingArea.fillPixels(drawX, component.width, component.height, color, drawY);
- } else
- if(component.filledColor)
- DrawingArea.method335(color, drawY, component.width, component.height, 256 - (component.opacity & 0xff), drawX);
- else
- DrawingArea.method338(drawY, component.height, 256 - (component.opacity & 0xff), color, component.width, drawX);
- } else if(component.type == 4) {
- TextDrawingArea textDrawingArea = component.textDrawingAreas;
- if(component.message == null) continue;
- String s = component.message;
- boolean isHovering = false;
- if(s.startsWith("Uptime: "))
- s = Widget.interfaces.get(539).components.get(4).component.message;
- if(s.startsWith("time:"))
- s = getAge(Long.parseLong(s.replace("time:", "")));
- if((/*anInt1039 == component.id || */hoverSpriteId == component.id || anInt1026 == component.id) && hoverParentId == component.parentID) {
- isHovering = true;
- }
- int i4;
- if(interfaceIsSelected(component)) {
- i4 = component.enabledColor;
- if(isHovering && component.enabledHoverColor != 0)
- i4 = component.enabledHoverColor;
- if(component.enabledText.length() > 0)
- s = component.enabledText;
- } else {
- i4 = component.textColor;
- if(isHovering && component.textColorHover != 0) {
- i4 = component.textColorHover;
- }
- }
- if(component.atActionType == 6 && aBoolean1149) {
- s = "Please wait...";
- i4 = component.textColor;
- }
- if(DrawingArea.width == 479) {
- if(i4 == 0xffff00)
- i4 = 255;
- if(i4 == 49152)
- i4 = 0xffffff;
- }
- if((component.parentID == 1151) || (component.parentID == 12855)) {
- switch (i4) {
- case 16773120: i4 = 0xFE981F; break;
- case 7040819: i4 = 0xAF6A1A; break;
- }
- }
- for(int i = 0, id = 63381; i < 20; i++, id += 4) {
- if(component.id == id + 1) {
- if(component.message.contains("\\n")) {
- drawY -= 7;
- }
- }
- }
- for(int i = 0, id = 63346; i < 10; i++, id += 2) {
- if(component.id == id + 1) {
- if(component.message.contains("\\n")) {
- drawY -= 6;
- }
- }
- }
- for(int l6 = drawY + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
- if(s.indexOf("%") != -1) {
- do {
- int k7 = s.indexOf("%1");
- if(k7 == -1)
- break;
- s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(component, 0)) + s.substring(k7 + 2);
- } while(true);
- do {
- int l7 = s.indexOf("%2");
- if(l7 == -1)
- break;
- s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(component, 1)) + s.substring(l7 + 2);
- } while(true);
- do {
- int i8 = s.indexOf("%3");
- if(i8 == -1)
- break;
- s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(component, 2)) + s.substring(i8 + 2);
- } while(true);
- do {
- int j8 = s.indexOf("%4");
- if(j8 == -1)
- break;
- s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(component, 3)) + s.substring(j8 + 2);
- } while(true);
- do {
- int k8 = s.indexOf("%5");
- if(k8 == -1)
- break;
- s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(component, 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 = "";
- }
- RSFont font = null;
- if(textDrawingArea == bigFancyFont)
- font = newBigFancyFont;
- //System.out.println("AAAA");
- else if (textDrawingArea == smallText)
- font = newSmallFont;
- else if (textDrawingArea == aTextDrawingArea_1271)
- font = newRegularFont;
- else if (textDrawingArea == chatTextDrawingArea)
- font = newBoldFont;
- else if (textDrawingArea == aTextDrawingArea_1273)
- font = newFancyFont;
- else
- font = newFancyFont;
- int[] text = { 53114, 53125, 53136, 53147, 53158, 53169 };
- for(int i = 0; i < text.length; i++) {
- if(component.id != text[i]) continue;
- if(component.id == text[i] && s1.length() >= 20) {
- drawX += 10;
- font = newSmallFont;
- } else
- font = newRegularFont;
- if(component.id == text[i] && !ClientSettings.progress_on_hover) {
- l6 -= 11;
- }
- }
- if(component.centerText){
- if(font != null)
- font.drawCenteredString(s1, (drawX + component.width / 2) + component.xAdjust, l6 + component.yAdjust, i4, component.textShadow ? 0 : -1);
- else
- textDrawingArea.method382(i4, (drawX + component.width / 2) + component.xAdjust, s1, l6 + component.yAdjust, component.textShadow);
- } else if(component.adjustX){
- if(font != null)
- font.drawBasicString(s1, (drawX - font.getTextWidth(s1)) + component.xAdjust, l6 + component.yAdjust, i4, component.textShadow ? 0 : -1);
- else
- textDrawingArea.method382(i4, (drawX - textDrawingArea.getTextWidth(s1)) + component.xAdjust, s1, l6 + component.yAdjust, component.textShadow);
- } else if(font != null)
- font.drawBasicString(s1, (drawX) + component.xAdjust, l6 + component.yAdjust, i4, component.textShadow ? 0 : -1);
- else
- textDrawingArea.method389(component.textShadow, (drawX) + component.xAdjust, i4, s1, l6 + component.yAdjust);
- if(component.id == 60001)
- component.width = font.getTextWidth(s1);
- }
- } else if(component.type == 5) {
- if(component.dropDownSprite) {
- Widget menu = Widget.interfaces.get(component.parentID - 3);
- Sprite scroll = menu.hideLayer ? scrollDown : scrollUp;
- scroll.drawSprite(drawX, drawY);
- }
- Sprite sprite;
- boolean isHovering = (hoverSpriteId == component.id && hoverParentId == component.parentID && component.parentID != 536);
- /**
- * Handles bank checks
- */
- boolean bankChild = isHovering && component.parentID == 497 && component.id < 20;
- int spriteId = component.id == 1 ? 311 : component.atActionType == 9 ? 310 : 312;
- boolean hover = interfaceIsSelected(component) || (hoverSpriteId == component.id && hoverParentId == component.parentID && component.parentID != 536);
- if(hover)
- sprite = bankChild ? cacheSprite[spriteId] : component.hoverSprite;
- else
- sprite = component.defaultSprite;
- //Handle setting the icon for auto casting
- if(widget.id == 531 && component.id == 18)
- sprite = cacheSprite[autocastingSpellSprite];
- if(spellSelected == 1 && component.id == spellID && component.parentID == widget.id && spellID != 0) {
- sprite.drawOutlinedSprite(drawX, drawY, 0xffffff);
- } else {
- if(sprite == null) continue;
- if(component.parentID == 536 && component.id > 0 && component.id < 30) {
- boolean hovering = hoverSpriteId == component.id && hoverParentId == component.parentID;
- sprite.drawSpriteWithOpacity(drawX, drawY, hovering ? 256 : 200);
- } else
- sprite.drawSprite(drawX, drawY);
- }
- if(sprite != null) {
- Sprite fade = cacheSprite[479];
- if(widget.id == 578 && component.id == 0)
- fade = cacheSprite[69];
- int trans = 0;
- boolean requireTrans = widget.id == 507 && component.id == 6 || widget.id == 578 && component.id == 0;
- if (requireTrans) {
- int time = (int) (System.currentTimeMillis() % 2000);
- if(time <= 1000)
- trans = time * 255 / 1000;
- else
- trans = (1000 - (time - 1000)) * 255 / 1000;
- }
- if(trans != 0) {
- fade.drawSpriteWithOpacity(drawX, drawY, trans);
- }
- }
- } else if(component.type == 6) {
- int k3 = Texture.textureInt1;
- int j4 = Texture.textureInt2;
- Texture.textureInt1 = drawX + component.width / 2;
- Texture.textureInt2 = drawY + component.height / 2;
- int i5 = Texture.anIntArray1470[component.modelRotation1] * component.modelZoom >> 16;
- int l5 = Texture.anIntArray1471[component.modelRotation1] * component.modelZoom >> 16;
- boolean flag2 = interfaceIsSelected(component);
- int i7;
- if(flag2)
- i7 = component.enabledAnimationId;
- else
- i7 = component.disabledAnimationId;
- Model model;
- if(i7 == -1) {
- model = component.method209(-1, -1, flag2);
- } else {
- AnimationDefinition animation = AnimationDefinition.anims[i7];
- //System.out.println("component.anInt246: " + component.anInt246);
- model = component.method209(animation.secondaryFrames[component.anInt246], animation.primaryFrames[component.anInt246], flag2);
- }
- if(model != null)
- model.method482(component.modelRotation2, 0, component.modelRotation1, 0, i5, l5);
- Texture.textureInt1 = k3;
- Texture.textureInt2 = j4;
- } else if(component.type == 7) {
- TextDrawingArea textDrawingArea_1 = component.textDrawingAreas;
- int k4 = 0;
- for(int j5 = 0; j5 < component.height; j5++) {
- for(int i6 = 0; i6 < component.width; i6++) {
- if(component.inv[k4] > 0) {
- ItemDefinition itemDef = ItemDefinition.forID(component.inv[k4] - 1);
- String s2 = itemDef.name;
- if(itemDef.stackable || component.invStackSizes[k4] != 1)
- s2 = s2 + " x" + intToKOrMilLongName(component.invStackSizes[k4]);
- int i9 = drawX + i6 * (115 + component.invSpritePadX);
- int k9 = drawY + j5 * (12 + component.invSpritePadY);
- if(component.centerText)
- textDrawingArea_1.method382(component.textColor, i9 + component.width / 2, s2, k9, component.textShadow);
- else
- textDrawingArea_1.method389(component.textShadow, i9, component.textColor, s2, k9);
- }
- k4++;
- }
- }
- } else if (component.type == 8 && hoverParentId == widget.id && component.id == hoverSpriteId && !menuOpen) {
- drawHoverBox(drawX, drawY, outcome, false);
- } else if (component.type == 9 && (anInt1500 == component.id || anInt1044 == component.id || anInt1129 == component.id) && anInt1501 == 50 && !menuOpen) {
- if(component.parentID == 534 && !ClientSettings.enablePrayerTooltips)
- return;
- int boxWidth = 0;
- int boxHeight = 0;
- TextDrawingArea textDrawingArea_2 = aTextDrawingArea_1271;
- int i4;
- if(interfaceIsSelected(component))
- i4 = component.enabledColor;
- else
- i4 = component.textColor;
- if(component.atActionType == 6 && aBoolean1149) {
- i4 = component.textColor;
- }
- if(DrawingArea.width == 479) {
- if(i4 == 0xffff00)
- i4 = 255;
- if(i4 == 49152)
- i4 = 0xffffff;
- }
- if((component.parentID == 1151) || (component.parentID == 12855)) {
- switch (i4) {
- case 16773120: i4 = 0xFE981F; break;
- case 7040819: i4 = 0xAF6A1A; break;
- }
- }
- RSFont font = null;
- if(textDrawingArea_2 == bigFancyFont)
- font = newBigFancyFont;
- //System.out.println("AAAA");
- else if (textDrawingArea_2 == smallText)
- font = newSmallFont;
- else if (textDrawingArea_2 == aTextDrawingArea_1271)
- font = newRegularFont;
- else if (textDrawingArea_2 == chatTextDrawingArea)
- font = newBoldFont;
- else if (textDrawingArea_2 == aTextDrawingArea_1273)
- font = newFancyFont;
- else
- font = newFancyFont;
- for (String s1 = component.message; s1.length() > 0;) {
- if (s1.indexOf("%") != -1) {
- do {
- int k7 = s1.indexOf("%1");
- if (k7 == -1)
- break;
- s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(component, 0)) + s1.substring(k7 + 2);
- } while (true);
- do {
- int l7 = s1.indexOf("%2");
- if (l7 == -1)
- break;
- s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(component, 1)) + s1.substring(l7 + 2);
- } while (true);
- do {
- int i8 = s1.indexOf("%3");
- if (i8 == -1)
- break;
- s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(component, 2)) + s1.substring(i8 + 2);
- } while (true);
- do {
- int j8 = s1.indexOf("%4");
- if (j8 == -1)
- break;
- s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(component, 3)) + s1.substring(j8 + 2);
- } while (true);
- do {
- int k8 = s1.indexOf("%5");
- if (k8 == -1)
- break;
- s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(component, 4)) + s1.substring(k8 + 2);
- } while (true);
- }
- 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 = (drawX + component.width) - 5 - boxWidth;
- int yPos = drawY + component.height + 5;
- if (xPos < drawX + 5)
- xPos = drawX + 5;
- if (xPos + boxWidth > x + widget.width) {
- xPos = (x + widget.width) - boxWidth;
- }
- if (yPos + boxHeight > y + widget.height)
- yPos = (drawY - boxHeight);
- switch (component.id) {
- case 9217:
- case 9220:
- case 9223:
- case 9226:
- case 9229:
- case 9232:
- case 9235:
- case 9238:
- xPos -= 80;
- break;
- case 9239:
- yPos -= 100;
- break;
- }
- DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
- DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
- String s2 = component.message;
- for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {
- if (s2.indexOf("%") != -1) {
- do {
- int k7 = s2.indexOf("%1");
- if (k7 == -1)
- break;
- s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(component, 0)) + s2.substring(k7 + 2);
- } while (true);
- do {
- int l7 = s2.indexOf("%2");
- if (l7 == -1)
- break;
- s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(component, 1)) + s2.substring(l7 + 2);
- } while (true);
- do {
- int i8 = s2.indexOf("%3");
- if (i8 == -1)
- break;
- s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(component, 2)) + s2.substring(i8 + 2);
- } while (true);
- do {
- int j8 = s2.indexOf("%4");
- if (j8 == -1)
- break;
- s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(component, 3)) + s2.substring(j8 + 2);
- } while (true);
- do {
- int k8 = s2.indexOf("%5");
- if (k8 == -1)
- break;
- s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(component, 4)) + s2.substring(k8 + 2);
- } while (true);
- }
- int l11 = s2.indexOf("\\n");
- String s5;
- if (l11 != -1) {
- s5 = s2.substring(0, l11);
- s2 = s2.substring(l11 + 2);
- } else {
- s5 = s2;
- s2 = "";
- }
- if (component.centerText) {
- if(font != null)
- font.drawCenteredString(s5, xPos + component.width / 2, j11, i4, component.textShadow ? 0 : -1);
- else
- textDrawingArea_2.method382(yPos, xPos + component.width / 2, s5, j11, false);
- } else {
- if (s5.contains("\\r")) {
- String text = s5.substring(0, s5.indexOf("\\r"));
- String text2 = s5.substring(s5.indexOf("\\r") + 2);
- textDrawingArea_2.method389(false, xPos + 3, 0, text, j11);
- int rightX = boxWidth + xPos - textDrawingArea_2.getTextWidth(text2) - 2;
- if(font != null)
- font.drawBasicString(text2, rightX, j11, i4, component.textShadow ? 0 : -1);
- else
- textDrawingArea_2.method389(false, rightX, 0, text2, j11);
- } else {
- if(font != null)
- font.drawBasicString(s5, xPos + 3, j11, i4, component.textShadow ? 0 : -1);
- else
- textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
- }
- }
- DrawingArea.setDrawingArea(bottomY, topX, bottomX, topY);
- }
- } else if (component.type == 10 && (anInt1500 == component.id || anInt1044 == component.id || anInt1129 == component.id) && anInt1501 == 50 && !menuOpen) {
- String outcome = component.message;
- Widget parent = Widget.interfaces.get(component.parentID);
- if(parent.hideLayer) continue;
- int dX = component.realX == 0 ? drawX : component.realX;
- int dY = component.realY == 0 ? drawY : component.realY;
- if(component.parentID >= 627 && component.parentID <= 632) {
- dY += (component.width / 2) - 20; //
- }
- if(ClientSettings.currentScreenMode.equals(ScreenMode.RESIZABLE)) {
- dX -= 20;
- int addX = ClientSettings.currentGameWidth - 208;
- int addY = ClientSettings.currentGameHeight - 275 - (stackTabs() ? 103 : 73);
- if(!ClientSettings.resizablePanel) {
- addX = ClientSettings.currentGameWidth - 233;
- addY = ClientSettings.currentGameHeight - 335;
- }
- dX += addX;
- dY += addY;
- }
- int boxWidth = 0;
- int boxHeight = 0;
- TextDrawingArea textDrawingArea_2 = aTextDrawingArea_1271;
- for (String s1 = component.message; s1.length() > 0;) {
- if (s1.indexOf("%") != -1) {
- do {
- int k7 = s1.indexOf("%1");
- if (k7 == -1)
- break;
- s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(component, 0)) + s1.substring(k7 + 2);
- } while (true);
- do {
- int l7 = s1.indexOf("%2");
- if (l7 == -1)
- break;
- s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(component, 1)) + s1.substring(l7 + 2);
- } while (true);
- do {
- int i8 = s1.indexOf("%3");
- if (i8 == -1)
- break;
- s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(component, 2)) + s1.substring(i8 + 2);
- } while (true);
- do {
- int j8 = s1.indexOf("%4");
- if (j8 == -1)
- break;
- s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(component, 3)) + s1.substring(j8 + 2);
- } while (true);
- do {
- int k8 = s1.indexOf("%5");
- if (k8 == -1)
- break;
- s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(component, 4)) + s1.substring(k8 + 2);
- } while (true);
- }
- 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;
- if(component.parentID == 627) {
- System.out.println("boxWidth: " + boxWidth);
- System.out.println("boxHeight: " + boxHeight);
- }
- /*int xPos = (dX + component.width) - 5 - boxWidth;
- int yPos = dY + component.height + 5;
- if (xPos < dX + 5)
- xPos = dX + 5;
- if (xPos + boxWidth > x + widget.width) {
- xPos = (x + widget.width) - boxWidth;
- }
- if (yPos + boxHeight > y + widget.height)
- yPos = (dY - boxHeight);
- System.out.println("xPos: " + xPos);
- System.out.println("yPos: " + yPos);
- if(component.parentID == 627) {
- dX = xPos;
- dY = yPos;
- }*/
- drawHoverBox(dX, dY, outcome, component.adjust);
- } else if(component.type == 11 && !ClientSettings.progress_on_hover) {
- String[] split = component.message.split("/");
- if(component.hideLayer || split.length == 1 || split[0] == null || split[1] == null) continue;
- int totalSold = Integer.parseInt(split[0]), quantity = Integer.parseInt(split[1]);
- double percent = ((double) totalSold / (double) quantity) * 100;
- int procent = (int) (percent * 96 / 100);
- DrawingArea.method335(0x000000, drawY - 23, 100, 18, 255, drawX + 2); //Black color
- DrawingArea.method335(/*0x464644*/0x372F27, drawY - 22, 98, 16, 255, drawX + 3); //Grey color
- //DrawingArea.method335(0xFF0000, drawY - 21, 96, 14, 255, drawX + 4); //Red color
- DrawingArea.method335(totalSold != quantity ? 0xD88020 : 0x008000, drawY - 21, procent, 14, 255, drawX + 4); //Orange/Green color
- DrawingArea.method335(0x000000, drawY - 21, 3, 14, 50, drawX + 4); //Shadow left
- DrawingArea.method335(0x000000, drawY - 21, 93, 3, 50, drawX + 7); //Shadow top
- newSmallFont.drawCenteredString("" + component.message, drawX + 50, drawY - 9, 0xFFFFFF, 1);
- }
- }
- DrawingArea.setDrawingArea(bottomY, topX, bottomX, topY);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement