Search in sources :

Example 11 with ToolTip

use of forestry.core.gui.tooltips.ToolTip in project ForestryMC by ForestryMC.

the class AddresseeSlot method getToolTip.

@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
    String tooltipString = Translator.translateToLocal("for.gui.addressee." + containerLetter.getCarrierType());
    ToolTip tooltip = new ToolTip();
    tooltip.add(tooltipString);
    return tooltip;
}
Also used : ToolTip(forestry.core.gui.tooltips.ToolTip)

Example 12 with ToolTip

use of forestry.core.gui.tooltips.ToolTip in project ForestryMC by ForestryMC.

the class FilteredTank method refreshTooltip.

@Override
@SideOnly(Side.CLIENT)
protected void refreshTooltip() {
    if (hasFluid()) {
        super.refreshTooltip();
        return;
    }
    ToolTip toolTip = getToolTip();
    toolTip.clear();
    if (GuiScreen.isShiftKeyDown() || filters.size() < 5) {
        for (String filterName : filters) {
            Fluid fluidFilter = FluidRegistry.getFluid(filterName);
            EnumRarity rarity = fluidFilter.getRarity();
            if (rarity == null) {
                rarity = EnumRarity.COMMON;
            }
            FluidStack filterFluidStack = FluidRegistry.getFluidStack(fluidFilter.getName(), 0);
            toolTip.add(fluidFilter.getLocalizedName(filterFluidStack), rarity.rarityColor);
        }
    } else {
        toolTip.add(TextFormatting.ITALIC + "<" + Translator.translateToLocal("for.gui.tooltip.tmi") + ">");
    }
    String liquidAmount = Translator.translateToLocalFormatted("for.gui.tooltip.liquid.amount", getFluidAmount(), getCapacity());
    toolTip.add(liquidAmount);
}
Also used : ToolTip(forestry.core.gui.tooltips.ToolTip) EnumRarity(net.minecraft.item.EnumRarity) FluidStack(net.minecraftforge.fluids.FluidStack) Fluid(net.minecraftforge.fluids.Fluid) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 13 with ToolTip

use of forestry.core.gui.tooltips.ToolTip in project ForestryMC by ForestryMC.

the class ItemStackWidgetBase method getToolTip.

@SideOnly(Side.CLIENT)
@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
    Minecraft minecraft = Minecraft.getMinecraft();
    EntityPlayer player = minecraft.player;
    ItemStack itemStack = getItemStack();
    ToolTip tip = new ToolTip();
    if (!itemStack.isEmpty()) {
        tip.add(itemStack.getTooltip(player, minecraft.gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL));
    }
    return tip;
}
Also used : ToolTip(forestry.core.gui.tooltips.ToolTip) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack) Minecraft(net.minecraft.client.Minecraft) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 14 with ToolTip

use of forestry.core.gui.tooltips.ToolTip in project ForestryMC by ForestryMC.

the class WidgetDatabaseSlot method getToolTip.

@Nullable
@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
    Minecraft minecraft = Minecraft.getMinecraft();
    EntityPlayer player = minecraft.player;
    ItemStack itemStack = getItemStack();
    ToolTip tip = new ToolTip();
    if (!itemStack.isEmpty()) {
        tip.add(itemStack.getTooltip(player, minecraft.gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL));
    }
    return tip;
}
Also used : ToolTip(forestry.core.gui.tooltips.ToolTip) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack) Minecraft(net.minecraft.client.Minecraft) Nullable(javax.annotation.Nullable)

Example 15 with ToolTip

use of forestry.core.gui.tooltips.ToolTip in project ForestryMC by ForestryMC.

the class WidgetDatabaseTabs method getToolTip.

@Nullable
@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
    int mouseOverTab = getMouseOverTab(mouseX, mouseY);
    if (mouseOverTab < 0) {
        return null;
    }
    EnumDatabaseTab tab = TABS[mouseOverTab];
    ToolTip toolTip = new ToolTip();
    toolTip.add(parent.getTooltip(tab));
    return toolTip;
}
Also used : EnumDatabaseTab(forestry.api.genetics.EnumDatabaseTab) ToolTip(forestry.core.gui.tooltips.ToolTip) Nullable(javax.annotation.Nullable)

Aggregations

ToolTip (forestry.core.gui.tooltips.ToolTip)15 Nullable (javax.annotation.Nullable)4 FluidStack (net.minecraftforge.fluids.FluidStack)3 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)3 IFilterLogic (forestry.api.genetics.IFilterLogic)2 Minecraft (net.minecraft.client.Minecraft)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 EnumRarity (net.minecraft.item.EnumRarity)2 ItemStack (net.minecraft.item.ItemStack)2 Fluid (net.minecraftforge.fluids.Fluid)2 EnumDatabaseTab (forestry.api.genetics.EnumDatabaseTab)1 IAlleleSpecies (forestry.api.genetics.IAlleleSpecies)1 IFilterRuleType (forestry.api.genetics.IFilterRuleType)1 IToolTipProvider (forestry.core.gui.tooltips.IToolTipProvider)1 EscritoireGameToken (forestry.core.tiles.EscritoireGameToken)1 IFluidTank (net.minecraftforge.fluids.IFluidTank)1