Advertisement
Guest User

Untitled

a guest
Mar 11th, 2020
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 30.57 KB | None | 0 0
  1.     private void drawInterface(int j, int x, Widget widget, int y)
  2.     {
  3.         //Checks if the interface has any children
  4.         if(widget.components == null || widget.components.size() == 0) return;
  5.        
  6.         if(widget.id == 409) //Skill guide
  7.             DrawingArea.drawTransparentBox(-100, 0, DrawingArea.width + 100, DrawingArea.height, 0x4F4224, 150);
  8.        
  9.         int topX = DrawingArea.topX;
  10.         int topY = DrawingArea.topY;
  11.         int bottomX = DrawingArea.bottomX;
  12.         int bottomY = DrawingArea.bottomY;
  13.        
  14.         DrawingArea.setDrawingArea(y + widget.height, x, x + widget.width, y);
  15.        
  16.         double perRow = 0;
  17.         double totalCollums = 0;
  18.        
  19.         for(WComponent components : widget.components) {
  20.            
  21.             Widget component = components.component;
  22.            
  23.             int drawX = components.position[0] + x;
  24.             int drawY = (components.position[1] + y) - j;
  25.  
  26.             drawX += component.itemOffsetX;
  27.             drawY += component.itemOffsetY;
  28.            
  29.             if(widget.id == 634 && component.type == 4 && !component.message.contains("\\n")) {
  30.                 drawY += 12;
  31.             }
  32.            
  33.             if(component.hideLayer || component.isMouseoverTriggered && hoverSpriteId != component.id)
  34.                 continue;
  35.            
  36.             if(widget.id == 226) {
  37.                 if(component.id == 0 || component.id == 1) {
  38.                     if(ClientSettings.currentScreenMode.equals(ScreenMode.FIXED)) {
  39.                         widget.width = 512;
  40.                         widget.height = 334;
  41.                         component.modelZoom = 200;
  42.                     } else {
  43.                         drawY += 620;
  44.                         widget.width = ClientSettings.currentGameWidth;
  45.                         widget.height = ClientSettings.currentGameHeight;
  46.                         component.modelZoom = 100;
  47.                     }
  48.                 }
  49.             }
  50.            
  51.             if(component.contentType > 0)
  52.                 drawFriendsListOrWelcomeScreen(component);
  53.            
  54.             handleCustomInterfaceScripts(widget, component);
  55.            
  56.             if(component.type == 0) {
  57.                 if(component.scrollPosition > component.scrollMax - component.height) component.scrollPosition = component.scrollMax - component.height;
  58.  
  59.                 if(component.scrollPosition < 0) component.scrollPosition = 0;
  60.  
  61.                 drawInterface(component.scrollPosition, drawX, component, drawY);
  62.                
  63.                 if(component.scrollMax > component.height) drawScrollbar(component.height, component.scrollPosition, drawY, drawX + component.width, component.scrollMax, openInterfaceID == 409 ? true : false, false);
  64.             } else if(component.type == 2) {
  65.                 if(openInterfaceID == 496 && component.parentID == 498 && component.id == 0 && useTabs) {
  66.                     drawBankItems(drawX, drawY);
  67.                 } else {
  68.                     int slot = 0;
  69.                     for(int l3 = 0; l3 < component.height; l3++) {
  70.                         for(int l4 = 0; l4 < component.width; l4++) {
  71.                             int k5 = drawX + l4 * (32 + component.invSpritePadX);
  72.                             int j6 = drawY + l3 * (32 + component.invSpritePadY);
  73.  
  74.                             if(slot < 20) {
  75.                                 k5 += component.spritesX[slot];
  76.                                 j6 += component.spritesY[slot];
  77.                             }
  78.  
  79.                             if(component.inv[slot] > 0) {
  80.  
  81.                                 if(component.id >= 50481 && component.id <= 50485) {
  82.                                     DrawingArea.fillPixels(k5 - 10, 71, 42, 0x000000, j6);
  83.                                     DrawingArea.fillPixels(k5 - 9, 69, 41, 0x000000, j6);
  84.                                     DrawingArea.method335(0x514a44, j6, 67, 40, 256, k5 - 8);
  85.  
  86.                                     k5 += 7;
  87.                                     j6 += 5;
  88.                                 }
  89.  
  90.                                 if(component.id == 21811 || component.id == 21821) {
  91.                                     int rarity = 0;
  92.                                     for(int i = 0; i < rewards.length; i++) {
  93.                                         if(rewards[i][0] == component.inv[slot]) {
  94.                                             rarity = rewards[i][2];
  95.                                             break;
  96.                                         }
  97.                                     }
  98.                                     int color = 0x00ff37;
  99.                                     if(rarity == 1)
  100.                                         color = 0xfffa00;
  101.                                     else if(rarity == 2)
  102.                                         color = 0xffaa00;
  103.                                     else if(rarity == 3)
  104.                                         color = 0xff0000;
  105.                                     DrawingArea.fillPixels(k5 - 5, 42, 42, 0x342B1C, j6 - 4);
  106.                                     DrawingArea.fillPixels(k5 - 4, 40, 40, 0x342B1C, j6 - 3);
  107.                                     DrawingArea.fillPixels(k5 - 3, 38, 38, color, j6 - 2);
  108.                                     DrawingArea.method335(0x514a44, j6 - 1, 36, 36, 256, k5 - 2);
  109.                                 }
  110.  
  111.                                 int k6 = 0;
  112.                                 int j7 = 0;
  113.                                 int itemId = component.inv[slot] - 1;
  114.                                 if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && oldMouseInvInterfaceIndex == slot) { //oldMouseInvInterfaceIndex
  115.                                    
  116.                                     int l9 = 0;
  117.                                     if(itemSelected == 1 && anInt1283 == slot && anInt1284 == component.id)
  118.                                         l9 = 0xffffff;
  119.  
  120.                                     int itemSpriteOpacity = 256;
  121.  
  122.                                     if(openInterfaceID == 406 && component.invStackSizes[slot] < 1 || component.parentID == 497 && component.invStackSizes[slot] < 1 || component.parentID == 602 && component.invStackSizes[slot] < 1)
  123.                                         itemSpriteOpacity = 99;
  124.  
  125.                                     if(invOverlayInterfaceID == 408) {
  126.                                         ItemDefinition def = ItemDefinition.forID(itemId);
  127.  
  128.                                         if(!(def.name.endsWith("(lg)") || def.name.endsWith("(sk)") || def.name.endsWith(" set")))
  129.                                             itemSpriteOpacity = 99;
  130.                                     }
  131.  
  132.                                     if(component.id == 8) {
  133.                                         boolean isRunes = itemId >= 554 && itemId <= 566 || itemId >= 4694 && itemId <= 4699;
  134.                                         if(!isRunes)
  135.                                             itemSpriteOpacity = 99;
  136.                                     }
  137.  
  138.                                     if(widget.id == 609 && component.id == 6 && (itemId == 11855 || itemId == 11839))
  139.                                         itemSpriteOpacity = 99;
  140.  
  141.                                     Sprite itemSprite = ItemDefinition.getSprite(itemId, component.invStackSizes[slot], l9);
  142.                                     if(itemSprite != null) {
  143.                                         if(activeInterfaceType != 0 && oldMouseInvInterfaceIndex == slot && anInt1084 == component.id && atInventoryParent == widget.id) {
  144.                                             k6 = super.mouseX - anInt1087;
  145.                                             j7 = super.mouseY - anInt1088;
  146.                                             if(k6 < 5 && k6 > -5)
  147.                                                 k6 = 0;
  148.                                             if(j7 < 5 && j7 > -5)
  149.                                                 j7 = 0;
  150.                                             if(anInt989 < 5) {
  151.                                                 k6 = 0;
  152.                                                 j7 = 0;
  153.                                             }
  154.                                             itemSprite.drawSprite1(k5 + k6, j6 + j7);
  155.                                             if(j6 + j7 < DrawingArea.topY && widget.scrollPosition > 0) {
  156.                                                 int i10 = (cycleTimer * (DrawingArea.topY - j6 - j7)) / 3;
  157.                                                 if(i10 > cycleTimer * 10)
  158.                                                     i10 = cycleTimer * 10;
  159.                                                 if(i10 > widget.scrollPosition)
  160.                                                     i10 = widget.scrollPosition;
  161.                                                 widget.scrollPosition -= i10;
  162.                                                 anInt1088 += i10;
  163.                                             }
  164.                                             if(j6 + j7 + 32 > DrawingArea.bottomY && widget.scrollPosition < widget.scrollMax - widget.height) {
  165.                                                 int j10 = (cycleTimer * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  166.                                                 if(j10 > cycleTimer * 10)
  167.                                                     j10 = cycleTimer * 10;
  168.                                                 if(j10 > widget.scrollMax - widget.height - widget.scrollPosition)
  169.                                                     j10 = widget.scrollMax - widget.height - widget.scrollPosition;
  170.                                                 widget.scrollPosition += j10;
  171.                                                 anInt1088 -= j10;
  172.                                             }
  173.                                         } else if(atInventoryInterfaceType != 0 && atInventoryIndex == slot && atInventoryInterface == component.id && atInventoryParent == widget.id) {
  174.                                             itemSprite.drawSprite1(k5, j6);
  175.                                         } else {
  176.                                             boolean isLootingBag = widget.id == 114 && component.id == 0 && itemId == 11855 && hasItems(); //component.id == 5064 && itemId == 11941
  177.  
  178.                                             if(isLootingBag)
  179.                                                 cacheSprite[57].drawSpriteWithOpacity(k5-1, j6, 50);
  180.  
  181.                                             if(itemId != 1)
  182.                                                 itemSprite.drawSpriteWithOpacity(k5, j6, itemSpriteOpacity);
  183.  
  184.                                             if(component.inv[slot] - 1 > 32000) {
  185.                                                 cacheSprite[144].drawSprite(k5, j6 + 15);
  186.                                             }
  187.                                         }
  188.                                         if(itemSprite.maxWidth == 33 || component.invStackSizes[slot] != 1) {
  189.                                             boolean isChild = Widget.isChild(openInterfaceID, component);
  190.                                             if(!(openInterfaceID == 406 && isChild || openInterfaceID == 496 && isChild || openInterfaceID == 602 && isChild)) {
  191.                                                 int k10 = component.invStackSizes[slot];
  192.                                                 smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  193.                                                 int color = k10 > 99999 && k10 < 10000000 ? 0xFFFFFF : k10 > 9999999 ? 0x00ff80 : 0xFFFF00;
  194.                                                 smallText.method385(color, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  195.                                             }
  196.                                         }
  197.                                     }
  198.                                 }
  199.                             } else if(component.sprites != null && slot < 20) {
  200.                                 Sprite class30_sub2_sub1_sub1_1 = component.sprites[slot];
  201.                                 if(class30_sub2_sub1_sub1_1 != null) {
  202.                                     class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  203.                                 }
  204.                             }
  205.                             if (widget.id == 603 && component.id == 8) { //component.id == 3415
  206.                                 if(System.currentTimeMillis() - changedTwo[slot] < 15000) {
  207.  
  208.                                     int trans = (int) (255 - (System.currentTimeMillis() - changedTwo[slot]) * 255 / 15000);
  209.                                     if(tick % 40 < 20)
  210.                                         itemRemoved.drawSpriteWithOpacity(k5 - 5, j6 - 4, trans);
  211.                                 }
  212.                             }
  213.  
  214.                             if (widget.id == 603 && component.id == 9) {
  215.                                 if(System.currentTimeMillis() - changed[slot] < 15000) {
  216.  
  217.                                     int trans = (int) (255 - (System.currentTimeMillis() - changed[slot]) * 255 / 15000);
  218.                                     if(tick % 40 < 20)
  219.                                         itemRemoved.drawSpriteWithOpacity(k5 - 5, j6 - 4, trans);
  220.                                 }
  221.                             }
  222.                             slot++;
  223.                         }
  224.                     }
  225.                 }
  226.             } else if(component.type == 3) {
  227.  
  228.                 boolean isHovering = false;
  229.                
  230.                 if(anInt1039 == component.id || hoverSpriteId == component.id || anInt1026 == component.id) {
  231.                     isHovering = true;
  232.                 }
  233.  
  234.                 int color;
  235.                 if(interfaceIsSelected(component) || (dropDownMenuHover == component.id && hoverParentId == component.parentID)) { // || dropDownMenuHover == component.id
  236.                     color = component.enabledColor;
  237.                     if(isHovering && component.enabledHoverColor != 0)
  238.                         color = component.enabledHoverColor;
  239.                 } else {
  240.                     color = component.textColor;
  241.                     if(isHovering && component.textColorHover != 0)
  242.                         color = component.textColorHover;
  243.                 }
  244.                 if(component.opacity == 0) {
  245.                     if(component.filledColor)
  246.                         DrawingArea.method336(component.height, drawY, drawX, color, component.width);
  247.                     else
  248.                         DrawingArea.fillPixels(drawX, component.width, component.height, color, drawY);
  249.                 } else
  250.                     if(component.filledColor)
  251.                         DrawingArea.method335(color, drawY, component.width, component.height, 256 - (component.opacity & 0xff), drawX);
  252.                     else
  253.                         DrawingArea.method338(drawY, component.height, 256 - (component.opacity & 0xff), color, component.width, drawX);
  254.  
  255.             } else if(component.type == 4) {
  256.                 TextDrawingArea textDrawingArea = component.textDrawingAreas;
  257.                
  258.                 if(component.message == null) continue;
  259.                
  260.                 String s = component.message;
  261.                 boolean isHovering = false;
  262.  
  263.                 if(s.startsWith("Uptime: "))
  264.                     s = Widget.interfaces.get(539).components.get(4).component.message;
  265.                
  266.                 if(s.startsWith("time:"))
  267.                     s = getAge(Long.parseLong(s.replace("time:", "")));
  268.                
  269.                 if((/*anInt1039 == component.id || */hoverSpriteId == component.id || anInt1026 == component.id) && hoverParentId == component.parentID) {
  270.                     isHovering = true;
  271.                 }
  272.                
  273.                 int i4;
  274.                 if(interfaceIsSelected(component)) {
  275.                     i4 = component.enabledColor;
  276.                     if(isHovering && component.enabledHoverColor != 0)
  277.                         i4 = component.enabledHoverColor;
  278.                     if(component.enabledText.length() > 0)
  279.                         s = component.enabledText;
  280.                 } else {
  281.                     i4 = component.textColor;
  282.                     if(isHovering && component.textColorHover != 0) {
  283.                         i4 = component.textColorHover;
  284.                     }
  285.                 }
  286.                 if(component.atActionType == 6 && aBoolean1149) {
  287.                     s = "Please wait...";
  288.                     i4 = component.textColor;
  289.                 }
  290.                 if(DrawingArea.width == 479) {
  291.                     if(i4 == 0xffff00)
  292.                         i4 = 255;
  293.                     if(i4 == 49152)
  294.                         i4 = 0xffffff;
  295.                 }
  296.                 if((component.parentID == 1151) || (component.parentID == 12855)) {
  297.                     switch (i4) {
  298.                     case 16773120: i4 = 0xFE981F; break;
  299.                     case 7040819: i4 = 0xAF6A1A; break;
  300.                     }
  301.                 }
  302.  
  303.                 for(int i = 0, id = 63381; i < 20; i++, id += 4) {
  304.                     if(component.id == id + 1) {
  305.                         if(component.message.contains("\\n")) {
  306.                             drawY -= 7;
  307.                         }
  308.                     }
  309.                 }
  310.  
  311.                 for(int i = 0, id = 63346; i < 10; i++, id += 2) {
  312.                     if(component.id == id + 1) {
  313.                         if(component.message.contains("\\n")) {
  314.                             drawY -= 6;
  315.                         }
  316.                     }
  317.                 }
  318.  
  319.                 for(int l6 = drawY + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  320.                     if(s.indexOf("%") != -1) {
  321.                         do {
  322.                             int k7 = s.indexOf("%1");
  323.                             if(k7 == -1)
  324.                                 break;
  325.                            
  326.                             s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(component, 0)) + s.substring(k7 + 2);
  327.                         } while(true);
  328.                         do {
  329.                             int l7 = s.indexOf("%2");
  330.                             if(l7 == -1)
  331.                                 break;
  332.                             s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(component, 1)) + s.substring(l7 + 2);
  333.                         } while(true);
  334.                         do {
  335.                             int i8 = s.indexOf("%3");
  336.                             if(i8 == -1)
  337.                                 break;
  338.                             s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(component, 2)) + s.substring(i8 + 2);
  339.                         } while(true);
  340.                         do {
  341.                             int j8 = s.indexOf("%4");
  342.                             if(j8 == -1)
  343.                                 break;
  344.                             s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(component, 3)) + s.substring(j8 + 2);
  345.                         } while(true);
  346.                         do {
  347.                             int k8 = s.indexOf("%5");
  348.                             if(k8 == -1)
  349.                                 break;
  350.                             s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(component, 4)) + s.substring(k8 + 2);
  351.                         } while(true);
  352.                     }
  353.                     int l8 = s.indexOf("\\n");
  354.                     String s1;
  355.                     if(l8 != -1) {
  356.                         s1 = s.substring(0, l8);
  357.                         s = s.substring(l8 + 2);
  358.                     } else {
  359.                         s1 = s;
  360.                         s = "";
  361.                     }
  362.                     RSFont font = null;
  363.                     if(textDrawingArea == bigFancyFont)
  364.                         font = newBigFancyFont;
  365.                         //System.out.println("AAAA");
  366.                     else if (textDrawingArea == smallText)
  367.                         font = newSmallFont;
  368.                     else if (textDrawingArea == aTextDrawingArea_1271)
  369.                         font = newRegularFont;
  370.                     else if (textDrawingArea == chatTextDrawingArea)
  371.                         font = newBoldFont;
  372.                     else if (textDrawingArea == aTextDrawingArea_1273)
  373.                         font = newFancyFont;
  374.                     else
  375.                         font = newFancyFont;
  376.  
  377.                     int[] text = { 53114, 53125, 53136, 53147, 53158, 53169 };
  378.  
  379.                     for(int i = 0; i < text.length; i++) {
  380.                         if(component.id != text[i]) continue;
  381.  
  382.                         if(component.id == text[i] && s1.length() >= 20) {
  383.                             drawX += 10;
  384.                             font = newSmallFont;
  385.                         } else
  386.                             font = newRegularFont;
  387.  
  388.                         if(component.id == text[i] && !ClientSettings.progress_on_hover) {
  389.                             l6 -= 11;
  390.                         }
  391.                     }
  392.  
  393.                     if(component.centerText){
  394.                         if(font != null)
  395.                             font.drawCenteredString(s1, (drawX + component.width / 2) + component.xAdjust, l6 + component.yAdjust, i4, component.textShadow ? 0 : -1);
  396.                         else
  397.                             textDrawingArea.method382(i4, (drawX + component.width / 2) + component.xAdjust, s1, l6 + component.yAdjust, component.textShadow);
  398.                     } else if(component.adjustX){
  399.                         if(font != null)
  400.                             font.drawBasicString(s1, (drawX - font.getTextWidth(s1)) + component.xAdjust, l6 + component.yAdjust, i4, component.textShadow ? 0 : -1);
  401.                         else
  402.                             textDrawingArea.method382(i4, (drawX - textDrawingArea.getTextWidth(s1)) + component.xAdjust, s1, l6 + component.yAdjust, component.textShadow);
  403.                     } else if(font != null)
  404.                         font.drawBasicString(s1, (drawX) + component.xAdjust, l6 + component.yAdjust, i4, component.textShadow ? 0 : -1);
  405.                     else
  406.                         textDrawingArea.method389(component.textShadow, (drawX) + component.xAdjust, i4, s1, l6 + component.yAdjust);
  407.  
  408.                     if(component.id == 60001)
  409.                         component.width = font.getTextWidth(s1);
  410.                 }
  411.             } else if(component.type == 5) {
  412.                 if(component.dropDownSprite) {
  413.                     Widget menu = Widget.interfaces.get(component.parentID - 3);
  414.                     Sprite scroll = menu.hideLayer ? scrollDown : scrollUp;
  415.                     scroll.drawSprite(drawX, drawY);
  416.                 }
  417.  
  418.                 Sprite sprite;
  419.                
  420.                 boolean isHovering = (hoverSpriteId == component.id && hoverParentId == component.parentID && component.parentID != 536);
  421.                 /**
  422.                  * Handles bank checks
  423.                  */
  424.                 boolean bankChild = isHovering && component.parentID == 497 && component.id < 20;
  425.                 int spriteId = component.id == 1 ? 311 : component.atActionType == 9 ? 310 : 312;
  426.                
  427.                 boolean hover = interfaceIsSelected(component) || (hoverSpriteId == component.id && hoverParentId == component.parentID && component.parentID != 536);
  428.                
  429.                 if(hover)
  430.                     sprite = bankChild ? cacheSprite[spriteId] : component.hoverSprite;
  431.                 else
  432.                     sprite = component.defaultSprite;
  433.  
  434.                 //Handle setting the icon for auto casting
  435.                 if(widget.id == 531 && component.id == 18)
  436.                     sprite = cacheSprite[autocastingSpellSprite];
  437.                
  438.                 if(spellSelected == 1 && component.id == spellID && component.parentID == widget.id && spellID != 0) {
  439.                     sprite.drawOutlinedSprite(drawX, drawY, 0xffffff);
  440.                 } else {
  441.                     if(sprite == null) continue;
  442.                    
  443.                     if(component.parentID == 536 && component.id > 0 && component.id < 30) {
  444.                         boolean hovering = hoverSpriteId == component.id && hoverParentId == component.parentID;
  445.                         sprite.drawSpriteWithOpacity(drawX, drawY, hovering ? 256 : 200);
  446.                     } else
  447.                         sprite.drawSprite(drawX, drawY);
  448.                 }
  449.  
  450.                 if(sprite != null) {
  451.                     Sprite fade = cacheSprite[479];
  452.                    
  453.                     if(widget.id == 578 && component.id == 0)
  454.                         fade = cacheSprite[69];
  455.                    
  456.                     int trans = 0;
  457.                     boolean requireTrans = widget.id == 507 && component.id == 6 || widget.id == 578 && component.id == 0;
  458.                     if (requireTrans) {
  459.                         int time = (int) (System.currentTimeMillis() % 2000);
  460.                         if(time <= 1000)
  461.                             trans = time * 255 / 1000;
  462.                         else
  463.                             trans = (1000 - (time - 1000)) * 255 / 1000;
  464.                     }
  465.                    
  466.                     if(trans != 0) {
  467.                         fade.drawSpriteWithOpacity(drawX, drawY, trans);
  468.                     }
  469.                 }
  470.  
  471.  
  472.             } else if(component.type == 6) {
  473.                 int k3 = Texture.textureInt1;
  474.                 int j4 = Texture.textureInt2;
  475.                 Texture.textureInt1 = drawX + component.width / 2;
  476.                 Texture.textureInt2 = drawY + component.height / 2;
  477.                 int i5 = Texture.anIntArray1470[component.modelRotation1] * component.modelZoom >> 16;
  478.                 int l5 = Texture.anIntArray1471[component.modelRotation1] * component.modelZoom >> 16;
  479.  
  480.                 boolean flag2 = interfaceIsSelected(component);
  481.                 int i7;
  482.                 if(flag2)
  483.                     i7 = component.enabledAnimationId;
  484.                 else
  485.                     i7 = component.disabledAnimationId;
  486.                 Model model;
  487.                 if(i7 == -1) {
  488.                     model = component.method209(-1, -1, flag2);
  489.                 } else {
  490.                     AnimationDefinition animation = AnimationDefinition.anims[i7];
  491.                     //System.out.println("component.anInt246: " + component.anInt246);
  492.                     model = component.method209(animation.secondaryFrames[component.anInt246], animation.primaryFrames[component.anInt246], flag2);
  493.                 }
  494.  
  495.                 if(model != null)
  496.                     model.method482(component.modelRotation2, 0, component.modelRotation1, 0, i5, l5);
  497.  
  498.                 Texture.textureInt1 = k3;
  499.                 Texture.textureInt2 = j4;
  500.             } else if(component.type == 7) {
  501.                 TextDrawingArea textDrawingArea_1 = component.textDrawingAreas;
  502.                 int k4 = 0;
  503.                 for(int j5 = 0; j5 < component.height; j5++) {
  504.                     for(int i6 = 0; i6 < component.width; i6++) {
  505.                         if(component.inv[k4] > 0) {
  506.                             ItemDefinition itemDef = ItemDefinition.forID(component.inv[k4] - 1);
  507.                             String s2 = itemDef.name;
  508.                             if(itemDef.stackable || component.invStackSizes[k4] != 1)
  509.                                 s2 = s2 + " x" + intToKOrMilLongName(component.invStackSizes[k4]);
  510.                             int i9 = drawX + i6 * (115 + component.invSpritePadX);
  511.                             int k9 = drawY + j5 * (12 + component.invSpritePadY);
  512.                             if(component.centerText)
  513.                                 textDrawingArea_1.method382(component.textColor, i9 + component.width / 2, s2, k9, component.textShadow);
  514.                             else
  515.                                 textDrawingArea_1.method389(component.textShadow, i9, component.textColor, s2, k9);
  516.                         }
  517.                         k4++;
  518.                     }
  519.                 }
  520.             } else if (component.type == 8 && hoverParentId == widget.id && component.id == hoverSpriteId && !menuOpen) {
  521.                 drawHoverBox(drawX, drawY, outcome, false);
  522.             } else if (component.type == 9 && (anInt1500 == component.id || anInt1044 == component.id || anInt1129 == component.id) && anInt1501 == 50 && !menuOpen) {
  523.                 if(component.parentID == 534 && !ClientSettings.enablePrayerTooltips)
  524.                     return;
  525.  
  526.                 int boxWidth = 0;
  527.                 int boxHeight = 0;
  528.                 TextDrawingArea textDrawingArea_2 = aTextDrawingArea_1271;
  529.                
  530.                 int i4;
  531.                 if(interfaceIsSelected(component))
  532.                     i4 = component.enabledColor;
  533.                 else
  534.                     i4 = component.textColor;
  535.                
  536.                 if(component.atActionType == 6 && aBoolean1149) {
  537.                     i4 = component.textColor;
  538.                 }
  539.                 if(DrawingArea.width == 479) {
  540.                     if(i4 == 0xffff00)
  541.                         i4 = 255;
  542.                     if(i4 == 49152)
  543.                         i4 = 0xffffff;
  544.                 }
  545.                 if((component.parentID == 1151) || (component.parentID == 12855)) {
  546.                     switch (i4) {
  547.                     case 16773120: i4 = 0xFE981F; break;
  548.                     case 7040819: i4 = 0xAF6A1A; break;
  549.                     }
  550.                 }
  551.                
  552.                 RSFont font = null;
  553.                 if(textDrawingArea_2 == bigFancyFont)
  554.                     font = newBigFancyFont;
  555.                     //System.out.println("AAAA");
  556.                 else if (textDrawingArea_2 == smallText)
  557.                     font = newSmallFont;
  558.                 else if (textDrawingArea_2 == aTextDrawingArea_1271)
  559.                     font = newRegularFont;
  560.                 else if (textDrawingArea_2 == chatTextDrawingArea)
  561.                     font = newBoldFont;
  562.                 else if (textDrawingArea_2 == aTextDrawingArea_1273)
  563.                     font = newFancyFont;
  564.                 else
  565.                     font = newFancyFont;
  566.                
  567.                 for (String s1 = component.message; s1.length() > 0;) {
  568.                     if (s1.indexOf("%") != -1) {
  569.                         do {
  570.                             int k7 = s1.indexOf("%1");
  571.                             if (k7 == -1)
  572.                                 break;
  573.                             s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(component, 0)) + s1.substring(k7 + 2);
  574.                         } while (true);
  575.                         do {
  576.                             int l7 = s1.indexOf("%2");
  577.                             if (l7 == -1)
  578.                                 break;
  579.                             s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(component, 1)) + s1.substring(l7 + 2);
  580.                         } while (true);
  581.                         do {
  582.                             int i8 = s1.indexOf("%3");
  583.                             if (i8 == -1)
  584.                                 break;
  585.                             s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(component, 2)) + s1.substring(i8 + 2);
  586.                         } while (true);
  587.                         do {
  588.                             int j8 = s1.indexOf("%4");
  589.                             if (j8 == -1)
  590.                                 break;
  591.                             s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(component, 3)) + s1.substring(j8 + 2);
  592.                         } while (true);
  593.                         do {
  594.                             int k8 = s1.indexOf("%5");
  595.                             if (k8 == -1)
  596.                                 break;
  597.                             s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(component, 4)) + s1.substring(k8 + 2);
  598.                         } while (true);
  599.                     }
  600.                     int l7 = s1.indexOf("\\n");
  601.                     String s4;
  602.                     if (l7 != -1) {
  603.                         s4 = s1.substring(0, l7);
  604.                         s1 = s1.substring(l7 + 2);
  605.                     } else {
  606.                         s4 = s1;
  607.                         s1 = "";
  608.                     }
  609.                     int j10 = textDrawingArea_2.getTextWidth(s4);
  610.                     if (j10 > boxWidth) {
  611.                         boxWidth = j10;
  612.                     }
  613.                     boxHeight += textDrawingArea_2.anInt1497 + 1;
  614.                 }
  615.                
  616.                 boxWidth += 6;
  617.                 boxHeight += 7;
  618.                
  619.                 int xPos = (drawX + component.width) - 5 - boxWidth;
  620.                 int yPos = drawY + component.height + 5;
  621.                
  622.                 if (xPos < drawX + 5)
  623.                     xPos = drawX + 5;
  624.                 if (xPos + boxWidth > x + widget.width) {
  625.                     xPos = (x + widget.width) - boxWidth;
  626.                 }
  627.                 if (yPos + boxHeight > y + widget.height)
  628.                     yPos = (drawY - boxHeight);
  629.                
  630.                 switch (component.id) {
  631.                     case 9217:
  632.                     case 9220:
  633.                     case 9223:
  634.                     case 9226:
  635.                     case 9229:
  636.                     case 9232:
  637.                     case 9235:
  638.                     case 9238:
  639.                         xPos -= 80;
  640.                         break;
  641.                     case 9239:
  642.                         yPos -= 100;
  643.                         break;
  644.                 }
  645.                
  646.                 DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  647.                 DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  648.                
  649.                 String s2 = component.message;
  650.                 for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {
  651.                     if (s2.indexOf("%") != -1) {
  652.                         do {
  653.                             int k7 = s2.indexOf("%1");
  654.                             if (k7 == -1)
  655.                                 break;
  656.                             s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(component, 0)) + s2.substring(k7 + 2);
  657.                         } while (true);
  658.                         do {
  659.                             int l7 = s2.indexOf("%2");
  660.                             if (l7 == -1)
  661.                                 break;
  662.                             s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(component, 1)) + s2.substring(l7 + 2);
  663.                         } while (true);
  664.                         do {
  665.                             int i8 = s2.indexOf("%3");
  666.                             if (i8 == -1)
  667.                                 break;
  668.                             s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(component, 2)) + s2.substring(i8 + 2);
  669.                         } while (true);
  670.                         do {
  671.                             int j8 = s2.indexOf("%4");
  672.                             if (j8 == -1)
  673.                                 break;
  674.                             s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(component, 3)) + s2.substring(j8 + 2);
  675.                         } while (true);
  676.                         do {
  677.                             int k8 = s2.indexOf("%5");
  678.                             if (k8 == -1)
  679.                                 break;
  680.                             s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(component, 4)) + s2.substring(k8 + 2);
  681.                         } while (true);
  682.                     }
  683.                     int l11 = s2.indexOf("\\n");
  684.                     String s5;
  685.                     if (l11 != -1) {
  686.                         s5 = s2.substring(0, l11);
  687.                         s2 = s2.substring(l11 + 2);
  688.                     } else {
  689.                         s5 = s2;
  690.                         s2 = "";
  691.                     }
  692.                     if (component.centerText) {
  693.                         if(font != null)
  694.                             font.drawCenteredString(s5, xPos + component.width / 2, j11, i4, component.textShadow ? 0 : -1);
  695.                         else
  696.                             textDrawingArea_2.method382(yPos, xPos + component.width / 2, s5, j11, false);
  697.                     } else {
  698.                         if (s5.contains("\\r")) {
  699.                             String text = s5.substring(0, s5.indexOf("\\r"));
  700.                             String text2 = s5.substring(s5.indexOf("\\r") + 2);
  701.                             textDrawingArea_2.method389(false, xPos + 3, 0, text, j11);
  702.                             int rightX = boxWidth + xPos - textDrawingArea_2.getTextWidth(text2) - 2;
  703.                            
  704.                             if(font != null)
  705.                                 font.drawBasicString(text2, rightX, j11, i4, component.textShadow ? 0 : -1);
  706.                             else
  707.                                 textDrawingArea_2.method389(false, rightX, 0, text2, j11);
  708.                         } else {
  709.                             if(font != null)
  710.                                 font.drawBasicString(s5, xPos + 3, j11, i4, component.textShadow ? 0 : -1);
  711.                             else
  712.                                 textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  713.                         }
  714.                     }
  715.                     DrawingArea.setDrawingArea(bottomY, topX, bottomX, topY);
  716.                 }
  717.             } else if (component.type == 10 && (anInt1500 == component.id || anInt1044 == component.id || anInt1129 == component.id) && anInt1501 == 50 && !menuOpen) {
  718.                 String outcome = component.message;
  719.                
  720.                 Widget parent = Widget.interfaces.get(component.parentID);
  721.                
  722.                 if(parent.hideLayer) continue;
  723.                
  724.                 int dX = component.realX == 0 ? drawX : component.realX;
  725.                 int dY = component.realY == 0 ? drawY : component.realY;
  726.                
  727.                 if(component.parentID >= 627 && component.parentID <= 632) {
  728.                     dY += (component.width / 2) - 20; //
  729.                 }
  730.  
  731.                 if(ClientSettings.currentScreenMode.equals(ScreenMode.RESIZABLE)) {
  732.  
  733.                     dX -= 20;
  734.  
  735.                     int addX = ClientSettings.currentGameWidth - 208;
  736.                     int addY = ClientSettings.currentGameHeight - 275 - (stackTabs() ? 103 : 73);
  737.  
  738.                     if(!ClientSettings.resizablePanel) {
  739.                         addX = ClientSettings.currentGameWidth - 233;
  740.                         addY = ClientSettings.currentGameHeight - 335;
  741.                     }
  742.  
  743.                     dX += addX;
  744.                     dY += addY;
  745.                 }
  746.                
  747.                 int boxWidth = 0;
  748.                 int boxHeight = 0;
  749.                 TextDrawingArea textDrawingArea_2 = aTextDrawingArea_1271;
  750.                
  751.                 for (String s1 = component.message; s1.length() > 0;) {
  752.                     if (s1.indexOf("%") != -1) {
  753.                         do {
  754.                             int k7 = s1.indexOf("%1");
  755.                             if (k7 == -1)
  756.                                 break;
  757.                             s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(component, 0)) + s1.substring(k7 + 2);
  758.                         } while (true);
  759.                         do {
  760.                             int l7 = s1.indexOf("%2");
  761.                             if (l7 == -1)
  762.                                 break;
  763.                             s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(component, 1)) + s1.substring(l7 + 2);
  764.                         } while (true);
  765.                         do {
  766.                             int i8 = s1.indexOf("%3");
  767.                             if (i8 == -1)
  768.                                 break;
  769.                             s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(component, 2)) + s1.substring(i8 + 2);
  770.                         } while (true);
  771.                         do {
  772.                             int j8 = s1.indexOf("%4");
  773.                             if (j8 == -1)
  774.                                 break;
  775.                             s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(component, 3)) + s1.substring(j8 + 2);
  776.                         } while (true);
  777.                         do {
  778.                             int k8 = s1.indexOf("%5");
  779.                             if (k8 == -1)
  780.                                 break;
  781.                             s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(component, 4)) + s1.substring(k8 + 2);
  782.                         } while (true);
  783.                     }
  784.                     int l7 = s1.indexOf("\\n");
  785.                     String s4;
  786.                     if (l7 != -1) {
  787.                         s4 = s1.substring(0, l7);
  788.                         s1 = s1.substring(l7 + 2);
  789.                     } else {
  790.                         s4 = s1;
  791.                         s1 = "";
  792.                     }
  793.                     int j10 = textDrawingArea_2.getTextWidth(s4);
  794.                     if (j10 > boxWidth) {
  795.                         boxWidth = j10;
  796.                     }
  797.                     boxHeight += textDrawingArea_2.anInt1497 + 1;
  798.                 }
  799.                
  800.                 boxWidth += 6;
  801.                 boxHeight += 7;
  802.                
  803.                 if(component.parentID == 627) {
  804.                     System.out.println("boxWidth: " + boxWidth);
  805.                     System.out.println("boxHeight: " + boxHeight);
  806.                 }
  807.                
  808.                 /*int xPos = (dX + component.width) - 5 - boxWidth;
  809.                 int yPos = dY + component.height + 5;
  810.                
  811.                 if (xPos < dX + 5)
  812.                     xPos = dX + 5;
  813.                 if (xPos + boxWidth > x + widget.width) {
  814.                     xPos = (x + widget.width) - boxWidth;
  815.                 }
  816.                 if (yPos + boxHeight > y + widget.height)
  817.                     yPos = (dY - boxHeight);
  818.  
  819.                 System.out.println("xPos: " + xPos);
  820.                 System.out.println("yPos: " + yPos);
  821.                
  822.                 if(component.parentID == 627) {
  823.                     dX = xPos;
  824.                     dY = yPos;
  825.                 }*/
  826.  
  827.                 drawHoverBox(dX, dY, outcome, component.adjust);
  828.             } else if(component.type == 11 && !ClientSettings.progress_on_hover) {
  829.                 String[] split = component.message.split("/");
  830.                 if(component.hideLayer || split.length == 1 || split[0] == null || split[1] == null) continue;
  831.                
  832.                 int totalSold = Integer.parseInt(split[0]), quantity = Integer.parseInt(split[1]);
  833.                 double percent = ((double) totalSold / (double) quantity) * 100;
  834.                 int procent = (int) (percent * 96 / 100);
  835.                 DrawingArea.method335(0x000000, drawY - 23, 100, 18, 255, drawX + 2); //Black color
  836.                 DrawingArea.method335(/*0x464644*/0x372F27, drawY - 22, 98, 16, 255, drawX + 3); //Grey color
  837.                 //DrawingArea.method335(0xFF0000, drawY - 21, 96, 14, 255, drawX + 4); //Red color
  838.                 DrawingArea.method335(totalSold != quantity ? 0xD88020 : 0x008000, drawY - 21, procent, 14, 255, drawX + 4); //Orange/Green color
  839.                 DrawingArea.method335(0x000000, drawY - 21, 3, 14, 50, drawX + 4); //Shadow left
  840.                 DrawingArea.method335(0x000000, drawY - 21, 93, 3, 50, drawX + 7); //Shadow top
  841.                 newSmallFont.drawCenteredString("" + component.message, drawX + 50, drawY - 9, 0xFFFFFF, 1);
  842.             }
  843.         }
  844.         DrawingArea.setDrawingArea(bottomY, topX, bottomX, topY);
  845.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement