protected void drawFluidStackTooltip(FluidStack par1ItemStack, int par2, int par3) { this.zLevel = 100; List list = getLiquidTooltip(par1ItemStack, this.mc.gameSettings.advancedItemTooltips); for (int k = 0; k < list.size(); ++k) { list.set(k, EnumChatFormatting.GRAY + (String) list.get(k)); } this.drawToolTip(list, par2, par3); this.zLevel = 0; }
@Override public void readPageFromXML(Element element) { NodeList nodes = element.getElementsByTagName("tooltype"); if (nodes != null) type = nodes.item(0).getTextContent(); nodes = element.getElementsByTagName("recipe"); if (nodes != null) { String recipe = nodes.item(0).getTextContent(); icons = MantleClientRegistry.getRecipeIcons(recipe); if (type.equals("travelmulti")) { List<ItemStack[]> stacks = new LinkedList<ItemStack[]>(); List<String> tools = new LinkedList<String>(); String[] suffixes = new String[] {"goggles", "vest", "wings", "boots", "glove", "belt"}; for (String suffix : suffixes) { ItemStack[] icons2 = MantleClientRegistry.getRecipeIcons(nodes.item(0).getTextContent() + suffix); if (icons2 != null) { stacks.add(icons2); tools.add(suffix); } } iconsMulti = new ItemStack[stacks.size()][]; toolMulti = new ItemStack[stacks.size()]; for (int i = 0; i < stacks.size(); i++) { iconsMulti[i] = stacks.get(i); toolMulti[i] = MantleClientRegistry.getManualIcon("travel" + tools.get(i)); } icons = iconsMulti[0]; lastUpdate = System.currentTimeMillis(); counter = 0; } } }
protected void drawToolTip(List par1List, int par2, int par3) { if (!par1List.isEmpty()) { GL11.glDisable(GL12.GL_RESCALE_NORMAL); RenderHelper.disableStandardItemLighting(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); int k = 0; Iterator iterator = par1List.iterator(); while (iterator.hasNext()) { String s = (String) iterator.next(); int l = this.fontRenderer.getStringWidth(s); if (l > k) { k = l; } } int i1 = par2 + 12; int j1 = par3 - 12; int k1 = 8; if (par1List.size() > 1) { k1 += 2 + (par1List.size() - 1) * 10; } if (i1 + k > this.width) { i1 -= 28 + k; } if (j1 + k1 + 6 > this.height) { j1 = this.height - k1 - 6; } this.zLevel = 300.0F; itemRenderer.zLevel = 300.0F; int l1 = -267386864; this.drawGradientRect(i1 - 3, j1 - 4, i1 + k + 3, j1 - 3, l1, l1); this.drawGradientRect(i1 - 3, j1 + k1 + 3, i1 + k + 3, j1 + k1 + 4, l1, l1); this.drawGradientRect(i1 - 3, j1 - 3, i1 + k + 3, j1 + k1 + 3, l1, l1); this.drawGradientRect(i1 - 4, j1 - 3, i1 - 3, j1 + k1 + 3, l1, l1); this.drawGradientRect(i1 + k + 3, j1 - 3, i1 + k + 4, j1 + k1 + 3, l1, l1); int i2 = 1347420415; int j2 = (i2 & 16711422) >> 1 | i2 & -16777216; this.drawGradientRect(i1 - 3, j1 - 3 + 1, i1 - 3 + 1, j1 + k1 + 3 - 1, i2, j2); this.drawGradientRect(i1 + k + 2, j1 - 3 + 1, i1 + k + 3, j1 + k1 + 3 - 1, i2, j2); this.drawGradientRect(i1 - 3, j1 - 3, i1 + k + 3, j1 - 3 + 1, i2, i2); this.drawGradientRect(i1 - 3, j1 + k1 + 2, i1 + k + 3, j1 + k1 + 3, j2, j2); for (int k2 = 0; k2 < par1List.size(); ++k2) { String s1 = (String) par1List.get(k2); this.fontRenderer.drawStringWithShadow(s1, i1, j1, -1); if (k2 == 0) { j1 += 2; } j1 += 10; } this.zLevel = 0.0F; itemRenderer.zLevel = 0.0F; } }