CondenserOutputWrapper( CondenserOutput condenserOutput, ItemStack outputItem, IDrawable buttonIcon ) { this.condenserOutput = condenserOutput; this.outputItem = outputItem; this.buttonIcon = buttonIcon; this.buttonHoverChecker = new HoverChecker( 28, 28 + 16, 78, 78 + 16, 0 ); }
@Nullable @Override public List<String> getTooltipStrings( int mouseX, int mouseY ) { if( this.buttonHoverChecker.checkHover( mouseX, mouseY ) ) { String key; switch( this.condenserOutput ) { case MATTER_BALLS: key = "gui.tooltips.appliedenergistics2.MatterBalls"; break; case SINGULARITY: key = "gui.tooltips.appliedenergistics2.Singularity"; break; default: return Collections.emptyList(); } return Splitter.on( "\\n" ).splitToList( I18n.format( key, this.condenserOutput.requiredPower ) ); } return Collections.emptyList(); }
public void updateBounds(Rectangle area) { this.x = area.x; this.y = area.y; this.width = area.width; this.height = area.height; this.hoverChecker.updateBounds(area.y, area.y + area.height, area.x, area.x + area.width); setSelectionPos(getCursorPosition()); }
@Override public boolean isMouseOver(int mouseX, int mouseY) { return hoverChecker.checkHover(mouseX, mouseY); }
public RecipeGuiTab(int x, int y) { this.x = x; this.y = y; this.hoverChecker = new HoverChecker(y, y + TAB_HEIGHT, x, x + TAB_WIDTH, 0); }
public boolean isMouseOver(int mouseX, int mouseY) { return hoverChecker.checkHover(mouseX, mouseY); }
public DebugRecipe() { this.button = new GuiButtonExt(0, 110, 30, "test"); this.button.setWidth(40); this.buttonHoverChecker = new HoverChecker(this.button, 0); }
public final boolean isMouseOver(int mouseX, int mouseY) { return this.hoverChecker.checkHover(mouseX, mouseY); }
public GuiIconToggleButton(IDrawable offIcon, IDrawable onIcon) { this.offIcon = offIcon; this.onIcon = onIcon; this.button = new GuiIconButton(2, new DrawableBlank(0, 0), (mc, x, y) -> true); this.hoverChecker = new HoverChecker(this.button, 0); }
@Override public List<String> getTooltipStrings(int mouseX, int mouseY) { List<String> tooltipStrings = new ArrayList<>(); if (buttonHoverChecker.checkHover(mouseX, mouseY)) { tooltipStrings.add("button tooltip!"); } else { tooltipStrings.add(TextFormatting.BOLD + "tooltip debug"); } tooltipStrings.add(mouseX + ", " + mouseY); return tooltipStrings; }
public GuiTextFieldFilter(int componentId, IngredientFilter ingredientFilter) { super(componentId, Minecraft.getMinecraft().fontRenderer, 0, 0, 0, 0); setMaxStringLength(maxSearchLength); this.hoverChecker = new HoverChecker(0, 0, 0, 0, 0); this.ingredientFilter = ingredientFilter; this.background = Internal.getHelpers().getGuiHelper().getSearchBackground(); }
@Nullable public List<String> getTooltipStrings(int mouseX, int mouseY) { if (hoverChecker.checkHover(mouseX, mouseY)) { return Collections.singletonList(Translator.translateToLocal("jei.tooltip.shapeless.recipe")); } return null; } }
public ShapelessIcon() { this.icon = Internal.getHelpers().getGuiHelper().getShapelessIcon(); int iconBottom = icon.getHeight() / scale; int iconLeft = CraftingRecipeCategory.width - (icon.getWidth() / scale); int iconRight = iconLeft + icon.getWidth() / scale; this.hoverChecker = new HoverChecker(0, iconBottom, iconLeft, iconRight, 0); }
@Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { if (isMouseOver(mouseX, mouseY)) { if (titleHoverChecker.checkHover(mouseX, mouseY)) { if (logic.setCategoryFocus()) { return; } } else { for (RecipeLayout recipeLayout : recipeLayouts) { if (recipeLayout.handleClick(mc, mouseX, mouseY, mouseButton)) { return; } } } } if (recipeGuiTabs.isMouseOver(mouseX, mouseY)) { if (recipeGuiTabs.handleMouseClicked(mouseX, mouseY, mouseButton)) { return; } } if (handleKeybinds(mouseButton - 100)) { return; } super.mouseClicked(mouseX, mouseY, mouseButton); }
titleHoverChecker = new HoverChecker(titleY, titleY + fontRenderer.FONT_HEIGHT, titleX, titleX + titleWidth, 0);
if (titleHoverChecker.checkHover(mouseX, mouseY) && !logic.hasAllCategories()) { String showAllRecipesString = Translator.translateToLocal("jei.tooltip.show.all.recipes"); TooltipRenderer.drawHoveringText(mc, showAllRecipesString, mouseX, mouseY);