public void a(Minecraft minecraft, int i, int j) { /* drawButton */ super.a(minecraft, i, j); InvTweaksObfuscation obf = new InvTweaksObfuscation(minecraft); if (!isEnabled2()) { return; } if (tooltipLines != null) { // Compute hover time if (isMouseOverButton(i, j)) { long systemTime = System.currentTimeMillis(); if (prevSystemTime != 0) { hoverTime += systemTime - prevSystemTime; } prevSystemTime = systemTime; } else { hoverTime = 0; prevSystemTime = 0; } // Draw tooltip if hover time is long enough if (hoverTime > InvTweaksConst.TOOLTIP_DELAY && tooltipLines != null) { asb fontRenderer = obf.getFontRenderer(); // Compute tooltip params int x = i + 12, y = j - LINE_HEIGHT * tooltipLines.length; if (tooltipWidth == -1) { for (String line : tooltipLines) { tooltipWidth = Math.max(obf.getStringWidth(fontRenderer, line), tooltipWidth); } } if (x + tooltipWidth > obf.getWindowWidth(obf.getCurrentScreen())) { x = obf.getWindowWidth(obf.getCurrentScreen()) - tooltipWidth; } // Draw background drawGradientRect( x - 3, y - 3, x + tooltipWidth + 3, y + LINE_HEIGHT * tooltipLines.length, 0xc0000000, 0xc0000000); // Draw lines int lineCount = 0; for (String line : tooltipLines) { obf.drawStringWithShadow(fontRenderer, line, x, y + (lineCount++) * LINE_HEIGHT, -1); } } } }
public static synchronized String get(String key) { String currentLanguage = InvTweaksObfuscation.getCurrentLanguage(); if (!currentLanguage.equals(loadedLanguage)) { loadedLanguage = load(currentLanguage); } return mappings.getProperty(key, defaultMappings.getProperty(key, key)); }