use of forestry.core.tiles.EscritoireGameToken in project ForestryMC by ForestryMC.
the class GameTokenWidget method draw.
@Override
@SideOnly(Side.CLIENT)
public void draw(int startX, int startY) {
EscritoireGameToken token = getToken();
if (token == null) {
return;
}
int tokenColour = token.getTokenColour();
float colorR = (tokenColour >> 16 & 255) / 255.0F;
float colorG = (tokenColour >> 8 & 255) / 255.0F;
float colorB = (tokenColour & 255) / 255.0F;
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
textureManager.bindTexture(manager.gui.textureFile);
GlStateManager.enableDepth();
GlStateManager.color(colorR, colorG, colorB);
manager.gui.drawTexturedModalRect(startX + xPos, startY + yPos, 228, 0, 22, 22);
GlStateManager.color(1.0f, 1.0f, 1.0f);
ItemStack tokenStack = HIDDEN_TOKEN;
if (token.isVisible()) {
tokenStack = token.getTokenStack();
}
GuiUtil.drawItemStack(manager.gui, tokenStack, startX + xPos + 3, startY + yPos + 3);
GlStateManager.disableDepth();
TextureManagerForestry.getInstance().bindGuiTextureMap();
for (String ident : getToken().getOverlayIcons()) {
TextureAtlasSprite icon = TextureManagerForestry.getInstance().getDefault(ident);
manager.gui.drawTexturedModalRect(startX + xPos + 3, startY + yPos + 3, icon, 16, 16);
}
GlStateManager.enableDepth();
}
use of forestry.core.tiles.EscritoireGameToken in project ForestryMC by ForestryMC.
the class GameTokenWidget method getToolTip.
@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
EscritoireGameToken token = getToken();
if (token == null || !token.isVisible()) {
return null;
}
ToolTip tooltip = new ToolTip();
tooltip.add(token.getTooltip());
return tooltip;
}
Aggregations