Package mods.railcraft.common.gui.tooltips

Examples of mods.railcraft.common.gui.tooltips.ToolTip


    public void addInformation(ItemStack stack, EntityPlayer player, List info, boolean adv) {
        super.addInformation(stack, player, info, adv);
        String tipTag = getUnlocalizedName() + ".tip.charged";
        if (stack.getItemDamage() >= stack.getMaxDamage() - 5)
            tipTag = getUnlocalizedName() + ".tip.empty";
        ToolTip tip = ToolTip.buildToolTip(tipTag);
        if (tip != null)
            info.addAll(tip.convertToStrings());
    }
View Full Code Here


    @Override
    public void addInformation(ItemStack stack, EntityPlayer player, List info, boolean adv) {
        String tipTag = getUnlocalizedName() + ".tip.charged";
        if (stack.getItemDamage() >= stack.getMaxDamage() - 5)
            tipTag = getUnlocalizedName() + ".tip.empty";
        ToolTip tip = ToolTip.buildToolTip(tipTag);
        if (tip != null)
            info.addAll(tip.convertToStrings());
    }
View Full Code Here

    @Override
    public void addInformation(ItemStack stack, EntityPlayer player, List info, boolean adv) {
        String tipTag = getUnlocalizedName() + ".tip.charged";
        if (stack.getItemDamage() >= stack.getMaxDamage() - 5)
            tipTag = getUnlocalizedName() + ".tip.empty";
        ToolTip tip = ToolTip.buildToolTip(tipTag);
        if (tip != null)
            info.addAll(tip.convertToStrings());
    }
View Full Code Here

        buttonList.add(new GuiBetterButton(0, w + 118, h + 64, 10, StandardButtonTextureSets.LEFT_BUTTON, ""));
        buttonList.add(new GuiBetterButton(1, w + 156, h + 64, 10, StandardButtonTextureSets.RIGHT_BUTTON, ""));

        GuiBetterButton[] dice = new GuiBetterButton[3];

        ToolTip tip = ToolTip.buildToolTip("railcraft.gui.trade.station.dice.tip");
        tip.get(0).format = EnumChatFormatting.YELLOW;

        for (int b = 0; b < 3; b++) {
            dice[b] = new GuiBetterButton(2 + b, w + 93, h + 24 + 21 * b, 16, StandardButtonTextureSets.DICE_BUTTON, "");
            dice[b].setToolTip(tip);
            buttonList.add(dice[b]);
View Full Code Here

            int mX = mouseX - left;
            int mY = mouseY - top;
            for (Widget element : container.getElements()) {
                if (element.hidden)
                    continue;
                ToolTip tips = element.getToolTip();
                if (tips == null)
                    continue;
                boolean mouseOver = element.isMouseOver(mX, mY);
                tips.onTick(mouseOver);
                if (mouseOver && tips.isReady()) {
                    tips.refresh();
                    drawToolTips(tips, mouseX, mouseY);
                }
            }
            for (Object button : buttonList) {
                if (!(button instanceof GuiBetterButton))
                    continue;
                GuiBetterButton betterButton = (GuiBetterButton) button;
                if (!betterButton.visible)
                    continue;
                ToolTip tips = betterButton.getToolTip();
                if (tips == null)
                    continue;
                boolean mouseOver = betterButton.isMouseOverButton(mouseX, mouseY);
                tips.onTick(mouseOver);
                if (mouseOver && tips.isReady()) {
                    tips.refresh();
                    drawToolTips(tips, mouseX, mouseY);
                }
            }
            for (Object obj : inventorySlots.inventorySlots) {
                if (!(obj instanceof SlotRailcraft))
                    continue;
                SlotRailcraft slot = (SlotRailcraft) obj;
                if (slot.getStack() != null)
                    continue;
                ToolTip tips = slot.getToolTip();
                if (tips == null)
                    continue;
                boolean mouseOver = isMouseOverSlot(slot, mouseX, mouseY);
                tips.onTick(mouseOver);
                if (mouseOver && tips.isReady()) {
                    tips.refresh();
                    drawToolTips(tips, mouseX, mouseY);
                }
            }
        }
View Full Code Here

        return control;
    }

    @Override
    public ToolTip getToolTip() {
        ToolTip tip = control.getButtonState().getToolTip();
        if (tip != null) {
            return tip;
        }
        return super.getToolTip();
    }
View Full Code Here

    }

    @Override
    public void addInformation(ItemStack stack, EntityPlayer player, List info, boolean adv) {
        super.addInformation(stack, player, info, adv);
        ToolTip tip = ToolTip.buildToolTip(stack.getUnlocalizedName() + ".tip");
        if (tip != null)
            info.addAll(tip.convertToStrings());
    }
View Full Code Here

    @Override
    public void addInformation(ItemStack stack, EntityPlayer player, List info, boolean adv) {
        super.addInformation(stack, player, info, adv);
        String tipTag = EnumOre.fromMeta(stack.getItemDamage()).getTag() + ".tip";
        if (LocalizationPlugin.hasTag(tipTag)) {
            ToolTip tip = ToolTip.buildToolTip(tipTag);
            info.addAll(tip.convertToStrings());
        }
    }
View Full Code Here

        return null;
    }

    @Override
    public void addInformation(ItemStack stack, EntityPlayer player, List info, boolean adv) {
        ToolTip toolTip = getToolTip(stack, player, adv);
        if (toolTip != null)
            for (ToolTipLine line : toolTip) {
                info.add(line.text);
            }
    }
View Full Code Here

    }

    @Override
    public void addInformation(ItemStack stack, EntityPlayer player, List info, boolean adv) {
        super.addInformation(stack, player, info, adv);
        ToolTip tip = ToolTip.buildToolTip(stack.getUnlocalizedName() + ".tip");
        if (tip != null)
            info.addAll(tip.convertToStrings());
    }
View Full Code Here

TOP

Related Classes of mods.railcraft.common.gui.tooltips.ToolTip

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.