use of net.minecraft.client.gui.FontRenderer in project EnderIO by SleepyTrousers.
the class GuiCombustionGenerator method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
bindGuiTexture();
int sx = (width - xSize) / 2;
int sy = (height - ySize) / 2;
drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize);
TileCombustionGenerator gen = getTileEntity();
CombustionMath math = gen.getMath();
FontRenderer fr = getFontRenderer();
int output = 0;
if (gen.isActive()) {
output = math.getEnergyPerTick();
}
String txt = Lang.GUI_COMBGEN_OUTPUT.get(LangPower.RFt(output));
int sw = fr.getStringWidth(txt);
fr.drawStringWithShadow(txt, guiLeft + xSize / 2 - sw / 2, guiTop + fr.FONT_HEIGHT / 2 + 3, ColorUtil.getRGB(Color.WHITE));
int x = guiLeft + 48;
int y = guiTop + 21;
final SmartTank coolantTank = gen.getCoolantTank();
if (!coolantTank.isEmpty()) {
x = guiLeft + 114;
// right tank
final int fluidAmount = coolantTank.getFluidAmount();
final FluidStack fluid = coolantTank.getFluid();
if (fluidAmount > CENTER) {
RenderUtil.renderGuiTank(fluid, coolantTank.getCapacity() - CENTER, fluidAmount - CENTER, x, y, zLevel, 15, 47);
}
if (gen.isActive()) {
txt = LangFluid.tMB(math.getTicksPerCoolant());
sw = fr.getStringWidth(txt);
fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 47, ColorUtil.getRGB(Color.WHITE));
}
// center coolant chamber
RenderUtil.renderGuiTank(fluid, CENTER, Math.min(fluidAmount, CENTER), guiLeft + 72, guiTop + 28, zLevel, 33, 33);
// draw some gui over the top again to make the center shape
bindGuiTexture();
drawTexturedModalRect(guiLeft + 72, guiTop + 28, 0, 223, 33, 33);
}
final SmartTank fuelTank = gen.getFuelTank();
if (!fuelTank.isEmpty()) {
// left tank
x = guiLeft + 48;
final int fluidAmount = fuelTank.getFluidAmount();
final FluidStack fluid = fuelTank.getFluid();
if (fluidAmount > CENTER) {
RenderUtil.renderGuiTank(fluid, fuelTank.getCapacity() - CENTER, fluidAmount - CENTER, x, y, zLevel, 15, 47);
}
if (gen.isActive()) {
txt = LangFluid.tMB(math.getTicksPerFuel());
sw = fr.getStringWidth(txt);
fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 47, ColorUtil.getRGB(Color.WHITE));
}
// center tank
RenderUtil.renderGuiTank(fluid, CENTER, Math.min(fluidAmount, CENTER), guiLeft + 81, guiTop + 38, zLevel, 14, 14);
}
bindGuiTexture();
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
}
use of net.minecraft.client.gui.FontRenderer in project EnderIO by SleepyTrousers.
the class GuiFarmStation method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
bindGuiTexture();
int sx = (width - xSize) / 2;
int sy = (height - ySize) / 2;
GlStateManager.enableAlpha();
drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize);
bindGuiTexture();
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
GlStateManager.disableDepth();
GlStateManager.enableBlend();
fr.drawString("SW", sx + 55, sy + 48, ColorUtil.getARGB(1f, 1f, 0.35f, 1f), true);
fr.drawString("NW", sx + 55, sy + 66, ColorUtil.getARGB(1f, 1f, 0.35f, 1f), true);
fr.drawString("SE", sx + 73, sy + 48, ColorUtil.getARGB(1f, 1f, 0.35f, 1f), true);
fr.drawString("NE", sx + 73, sy + 66, ColorUtil.getARGB(1f, 1f, 0.35f, 1f), true);
GlStateManager.disableBlend();
GlStateManager.enableDepth();
}
use of net.minecraft.client.gui.FontRenderer in project EnderIO by SleepyTrousers.
the class GuiSensor method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
bindGuiTexture();
int sx = (width - xSize) / 2;
int sy = (height - ySize) / 2;
drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize);
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
String txt = EnderIO.lang.localize("gui.inventorySensor.control1").trim();
FontRenderer fr = getFontRenderer();
fr.drawString(txt, startTF.x - 3 - fr.getStringWidth(txt), startTF.y + 3, 0x000000);
txt = EnderIO.lang.localize("gui.inventorySensor.control2").trim();
fr.drawString(txt, stopTF.x - 3 - fr.getStringWidth(txt), stopTF.y + 3, 0x000000);
checkForTextChange();
}
use of net.minecraft.client.gui.FontRenderer in project OpenModularTurrets by OpenModularTurretsTeam.
the class ConfigureGui method drawGuiContainerForegroundLayer.
@SuppressWarnings("unchecked")
@Override
protected void drawGuiContainerForegroundLayer(int param1, int param2) {
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
fontRenderer.drawString(safeLocalize(OMTNames.Localizations.GUI.TARGETING_OPTIONS) + ": ", 10, 8, 0);
fontRenderer.drawString(safeLocalize(OMTNames.Localizations.GUI.ADD_TRUSTED_PLAYER) + ": ", 10, 87, 0);
if (this.base.getTrustedPlayers().size() == 0) {
fontRenderer.drawString("\u00A7f" + safeLocalize(OMTNames.Localizations.GUI.NO_TRUSTED_PLAYERS), 10, 124, 0);
} else {
fontRenderer.drawString(base.getTrustedPlayers().get(base.trustedPlayerIndex).getName() + "'s " + safeLocalize(OMTNames.Localizations.GUI.PERMISSIONS), 10, 124, 0);
}
textFieldAddTrustedPlayer.drawTextBox();
drawTooltips();
}
use of net.minecraft.client.gui.FontRenderer in project OpenModularTurrets by OpenModularTurretsTeam.
the class ConfigureGui method initGui.
@SuppressWarnings("unchecked")
@Override
public void initGui() {
super.initGui();
this.buttonList.clear();
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
String mobsButton = safeLocalize(OMTNames.Localizations.GUI.ATTACK_MOBS) + ": " + (getColoredBooleanLocalizationYesNo(base.isAttacksMobs()));
String neutralsButton = safeLocalize(OMTNames.Localizations.GUI.ATTACK_NEUTRALS) + ": " + (getColoredBooleanLocalizationYesNo(base.isAttacksNeutrals()));
String playersButton = safeLocalize(OMTNames.Localizations.GUI.ATTACK_PLAYERS) + ": " + (getColoredBooleanLocalizationYesNo(base.isAttacksPlayers()));
int x = (width - xSize) / 2;
int y = (height - ySize) / 2;
textFieldAddTrustedPlayer = new GuiTextField(0, fontRenderer, 11, 99, 100, 18);
textFieldAddTrustedPlayer.setMaxStringLength(50);
textFieldAddTrustedPlayer.setFocused(true);
this.buttonList.add(new GuiButton(1, x + 10, y + 20, 155, 20, mobsButton));
this.buttonList.add(new GuiButton(2, x + 10, y + 40, 155, 20, neutralsButton));
this.buttonList.add(new GuiButton(3, x + 10, y + 60, 155, 20, playersButton));
this.buttonList.add(new GuiButton(4, x + 114, y + 98, 51, 20, "+"));
this.buttonList.add(new GuiButton(5, x + 35, y + 135, 30, 20, "-"));
this.buttonList.add(new GuiButton(6, x + 10, y + 135, 20, 20, "<<"));
this.buttonList.add(new GuiButton(7, x + 145, y + 135, 20, 20, ">>"));
if (this.base.getTrustedPlayers().size() > 0) {
this.buttonList.add(new GuiButton(8, x + 70, y + 135, 23, 20, this.base.getTrustedPlayers().get(base.trustedPlayerIndex).canOpenGUI ? "\u00A72Y" : "\u00A7cN"));
this.buttonList.add(new GuiButton(9, x + 93, y + 135, 23, 20, this.base.getTrustedPlayers().get(base.trustedPlayerIndex).canChangeTargeting ? "\u00A72Y" : "\u00A7cN"));
this.buttonList.add(new GuiButton(10, x + 116, y + 135, 23, 20, this.base.getTrustedPlayers().get(base.trustedPlayerIndex).admin ? "\u00A72Y" : "\u00A7cN"));
} else {
this.buttonList.add(new GuiButton(8, x + 70, y + 135, 23, 20, "?"));
this.buttonList.add(new GuiButton(9, x + 93, y + 135, 23, 20, "?"));
this.buttonList.add(new GuiButton(10, x + 116, y + 135, 23, 20, "?"));
}
}
Aggregations