Search in sources :

Example 11 with GuiAnimatedStat

use of me.desht.pneumaticcraft.client.gui.widget.GuiAnimatedStat in project pnc-repressurized by TeamPneumatic.

the class GuiPressureModule method initGui.

@Override
public void initGui() {
    super.initGui();
    int xStart = (width - xSize) / 2;
    int yStart = (height - ySize) / 2;
    addLabel("lower", guiLeft + 10, guiTop + 30);
    addLabel("bar", guiLeft + 45, guiTop + 42);
    addLabel("higher", guiLeft + 140, guiTop + 30);
    String title = I18n.format("item." + module.getType() + ".name");
    addLabel(title, width / 2 - fontRenderer.getStringWidth(title) / 2, guiTop + 5);
    lowerBoundField = new GuiTextField(-1, fontRenderer, xStart + 10, yStart + 41, 30, 10);
    lowerBoundField.setText(PneumaticCraftUtils.roundNumberTo(module.lowerBound, 1));
    higherBoundField = new GuiTextField(-1, fontRenderer, xStart + 140, yStart + 41, 30, 10);
    higherBoundField.setText(PneumaticCraftUtils.roundNumberTo(module.higherBound, 1));
    graphLowY = guiTop + 153;
    graphHighY = guiTop + 93;
    graphLeft = guiLeft + 22;
    graphRight = guiLeft + 172;
    addWidget(new WidgetTooltipArea(graphLeft - 20, graphHighY, 25, graphLowY - graphHighY, "gui.redstone"));
    addWidget(new WidgetTooltipArea(graphLeft, graphLowY - 5, graphRight - graphLeft, 25, "gui.threshold"));
    addWidget((IGuiWidget) new GuiAnimatedStat(this, "gui.tab.info", Textures.GUI_INFO_LOCATION, xStart, yStart + 5, 0xFF8888FF, null, true).setText("gui.tab.info.tubeModule"));
    advancedMode = new GuiCheckBox(0, guiLeft + 6, guiTop + 15, 0xFF404040, "gui.tubeModule.advancedConfig").setTooltip(I18n.format("gui.tubeModule.advancedConfig.tooltip"));
    advancedMode.checked = true;
    addWidget(advancedMode);
}
Also used : GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox) WidgetTooltipArea(me.desht.pneumaticcraft.client.gui.widget.WidgetTooltipArea) GuiTextField(net.minecraft.client.gui.GuiTextField) GuiAnimatedStat(me.desht.pneumaticcraft.client.gui.widget.GuiAnimatedStat)

Example 12 with GuiAnimatedStat

use of me.desht.pneumaticcraft.client.gui.widget.GuiAnimatedStat in project pnc-repressurized by TeamPneumatic.

the class BlockTrackUpgradeHandler method getAnimatedStat.

@Override
public GuiAnimatedStat getAnimatedStat() {
    if (blockTrackInfo == null) {
        Minecraft minecraft = Minecraft.getMinecraft();
        ScaledResolution sr = new ScaledResolution(minecraft);
        blockTrackInfo = new GuiAnimatedStat(null, "Current tracked blocks:", CraftingRegistrator.getUpgrade(EnumUpgrade.BLOCK_TRACKER), statX != -1 ? statX : sr.getScaledWidth() - 2, statY, 0x3000AA00, null, statLeftSided);
        blockTrackInfo.setMinDimensionsAndReset(0, 0);
    }
    return blockTrackInfo;
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) GuiAnimatedStat(me.desht.pneumaticcraft.client.gui.widget.GuiAnimatedStat) Minecraft(net.minecraft.client.Minecraft)

Aggregations

GuiAnimatedStat (me.desht.pneumaticcraft.client.gui.widget.GuiAnimatedStat)12 ArrayList (java.util.ArrayList)6 ItemStack (net.minecraft.item.ItemStack)6 Minecraft (net.minecraft.client.Minecraft)4 ScaledResolution (net.minecraft.client.gui.ScaledResolution)4 GuiCheckBox (me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)3 WidgetTank (me.desht.pneumaticcraft.client.gui.widget.WidgetTank)3 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)3 IGuiAnimatedStat (me.desht.pneumaticcraft.api.client.IGuiAnimatedStat)1 WidgetEnergy (me.desht.pneumaticcraft.client.gui.widget.WidgetEnergy)1 WidgetTemperature (me.desht.pneumaticcraft.client.gui.widget.WidgetTemperature)1 WidgetTooltipArea (me.desht.pneumaticcraft.client.gui.widget.WidgetTooltipArea)1 GuiTextField (net.minecraft.client.gui.GuiTextField)1 Item (net.minecraft.item.Item)1 IEnergyStorage (net.minecraftforge.energy.IEnergyStorage)1