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;
}
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);
}
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;
}
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;
}
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;
}
Aggregations