Search in sources :

Example 1 with ToolTip

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

the class HabitatSlot method getToolTip.

@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
    ToolTip tooltip = new ToolTip();
    tooltip.add(name);
    return tooltip;
}
Also used : ToolTip(forestry.core.gui.tooltips.ToolTip)

Example 2 with ToolTip

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

the class StandardTank method refreshTooltip.

@SideOnly(Side.CLIENT)
protected void refreshTooltip() {
    ToolTip toolTip = getToolTip();
    toolTip.clear();
    int amount = 0;
    FluidStack fluidStack = getFluid();
    if (fluidStack != null) {
        Fluid fluidType = fluidStack.getFluid();
        EnumRarity rarity = fluidType.getRarity();
        if (rarity == null) {
            rarity = EnumRarity.COMMON;
        }
        toolTip.add(fluidType.getLocalizedName(getFluid()), rarity.rarityColor);
        amount = getFluid().amount;
    }
    String liquidAmount = Translator.translateToLocalFormatted("for.gui.tooltip.liquid.amount", amount, 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 3 with ToolTip

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

the class RuleWidget method getToolTip.

@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
    IFilterLogic logic = gui.getLogic();
    IFilterRuleType rule = logic.getRule(facing);
    ToolTip tooltip = new ToolTip();
    tooltip.add(getName(rule));
    return tooltip;
}
Also used : ToolTip(forestry.core.gui.tooltips.ToolTip) IFilterRuleType(forestry.api.genetics.IFilterRuleType) IFilterLogic(forestry.api.genetics.IFilterLogic)

Example 4 with ToolTip

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

the class SpeciesWidget method getToolTip.

@Nullable
@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
    IFilterLogic logic = gui.getLogic();
    IAlleleSpecies allele = (IAlleleSpecies) logic.getGenomeFilter(facing, index, active);
    if (allele == null) {
        return null;
    }
    ToolTip tooltip = new ToolTip();
    tooltip.add(getName(allele));
    return tooltip;
}
Also used : ToolTip(forestry.core.gui.tooltips.ToolTip) IFilterLogic(forestry.api.genetics.IFilterLogic) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) Nullable(javax.annotation.Nullable)

Example 5 with ToolTip

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

the class ProbeButton method getToolTip.

@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
    ToolTip tooltip = new ToolTip();
    tooltip.add(Translator.translateToLocal("for.gui.escritoire.probe"));
    return tooltip;
}
Also used : ToolTip(forestry.core.gui.tooltips.ToolTip)

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