Search in sources :

Example 1 with GuiAnimatedStat

use of pneumaticCraft.client.gui.widget.GuiAnimatedStat in project PneumaticCraft by MineMaarten.

the class GuiPneumaticContainerBase method refreshScreen.

protected void refreshScreen() {
    ScaledResolution scaledresolution = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
    int i = scaledresolution.getScaledWidth();
    int j = scaledresolution.getScaledHeight();
    setWorldAndResolution(Minecraft.getMinecraft(), i, j);
    for (IGuiWidget widget : widgets) {
        if (widget instanceof GuiAnimatedStat) {
            widget.update();
        }
    }
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) IGuiWidget(pneumaticCraft.client.gui.widget.IGuiWidget) GuiAnimatedStat(pneumaticCraft.client.gui.widget.GuiAnimatedStat) IGuiAnimatedStat(pneumaticCraft.api.client.IGuiAnimatedStat) Point(java.awt.Point)

Example 2 with GuiAnimatedStat

use of pneumaticCraft.client.gui.widget.GuiAnimatedStat in project PneumaticCraft by MineMaarten.

the class GuiPneumaticContainerBase method addAnimatedStat.

protected GuiAnimatedStat addAnimatedStat(String title, String icon, int color, boolean leftSided) {
    int xStart = (width - xSize) / 2;
    int yStart = (height - ySize) / 2;
    GuiAnimatedStat stat = new GuiAnimatedStat(this, title, icon, xStart + (leftSided ? 0 : xSize), leftSided && lastLeftStat != null || !leftSided && lastRightStat != null ? 3 : yStart + 5, color, leftSided ? lastLeftStat : lastRightStat, leftSided);
    addWidget(stat);
    if (leftSided) {
        lastLeftStat = stat;
    } else {
        lastRightStat = stat;
    }
    return stat;
}
Also used : GuiAnimatedStat(pneumaticCraft.client.gui.widget.GuiAnimatedStat) IGuiAnimatedStat(pneumaticCraft.api.client.IGuiAnimatedStat) Point(java.awt.Point)

Example 3 with GuiAnimatedStat

use of pneumaticCraft.client.gui.widget.GuiAnimatedStat in project PneumaticCraft by MineMaarten.

the class GuiPneumaticContainerBase method addAnimatedStat.

protected GuiAnimatedStat addAnimatedStat(String title, ItemStack icon, int color, boolean leftSided) {
    int xStart = (width - xSize) / 2;
    int yStart = (height - ySize) / 2;
    GuiAnimatedStat stat = new GuiAnimatedStat(this, title, icon, xStart + (leftSided ? 0 : xSize), leftSided && lastLeftStat != null || !leftSided && lastRightStat != null ? 3 : yStart + 5, color, leftSided ? lastLeftStat : lastRightStat, leftSided);
    addWidget(stat);
    if (leftSided) {
        lastLeftStat = stat;
    } else {
        lastRightStat = stat;
    }
    return stat;
}
Also used : GuiAnimatedStat(pneumaticCraft.client.gui.widget.GuiAnimatedStat) IGuiAnimatedStat(pneumaticCraft.api.client.IGuiAnimatedStat) Point(java.awt.Point)

Example 4 with GuiAnimatedStat

use of pneumaticCraft.client.gui.widget.GuiAnimatedStat in project PneumaticCraft by MineMaarten.

the class GuiLiquidHopper method initGui.

@Override
public void initGui() {
    super.initGui();
    addWidget(new WidgetTank(0, guiLeft + 116, guiTop + 15, te.getTank()));
    statusStat = addAnimatedStat("gui.tab.hopperStatus", new ItemStack(Blockss.omnidirectionalHopper), 0xFFFFAA00, false);
    GuiAnimatedStat optionStat = addAnimatedStat("gui.tab.gasLift.mode", new ItemStack(net.minecraft.init.Blocks.lever), 0xFFFFCC00, false);
    List<String> text = new ArrayList<String>();
    for (int i = 0; i < 4; i++) text.add("               ");
    optionStat.setTextWithoutCuttingString(text);
    GuiButtonSpecial button = new GuiButtonSpecial(1, 5, 20, 20, 20, "");
    button.setRenderStacks(new ItemStack(Items.bucket));
    button.setTooltipText(I18n.format("gui.tab.liquidHopper.mode.empty"));
    optionStat.addWidget(button);
    modeButtons[0] = button;
    button = new GuiButtonSpecial(2, 30, 20, 20, 20, "");
    button.setRenderStacks(new ItemStack(Items.water_bucket));
    button.setTooltipText(I18n.format("gui.tab.liquidHopper.mode.leaveLiquid"));
    optionStat.addWidget(button);
    modeButtons[1] = button;
}
Also used : ArrayList(java.util.ArrayList) WidgetTank(pneumaticCraft.client.gui.widget.WidgetTank) ItemStack(net.minecraft.item.ItemStack) GuiAnimatedStat(pneumaticCraft.client.gui.widget.GuiAnimatedStat) Point(java.awt.Point)

Example 5 with GuiAnimatedStat

use of pneumaticCraft.client.gui.widget.GuiAnimatedStat in project PneumaticCraft by MineMaarten.

the class MainHelmetHandler method getAnimatedStat.

@Override
@SideOnly(Side.CLIENT)
public IGuiAnimatedStat getAnimatedStat() {
    if (powerStat == null) {
        Minecraft minecraft = Minecraft.getMinecraft();
        ScaledResolution sr = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
        powerStat = new GuiAnimatedStat(null, "Helmet Pressure: ", "", powerStatX != -1 ? powerStatX : sr.getScaledWidth() - 2, powerStatY, 0x3000AA00, null, powerStatLeftSided);
        powerStat.setMinDimensionsAndReset(0, 0);
        powerStat.openWindow();
    }
    return powerStat;
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) GuiAnimatedStat(pneumaticCraft.client.gui.widget.GuiAnimatedStat) IGuiAnimatedStat(pneumaticCraft.api.client.IGuiAnimatedStat) Minecraft(net.minecraft.client.Minecraft) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

GuiAnimatedStat (pneumaticCraft.client.gui.widget.GuiAnimatedStat)15 ItemStack (net.minecraft.item.ItemStack)9 Point (java.awt.Point)6 ArrayList (java.util.ArrayList)6 ScaledResolution (net.minecraft.client.gui.ScaledResolution)5 Minecraft (net.minecraft.client.Minecraft)4 IGuiAnimatedStat (pneumaticCraft.api.client.IGuiAnimatedStat)4 SideOnly (cpw.mods.fml.relauncher.SideOnly)3 GuiCheckBox (pneumaticCraft.client.gui.widget.GuiCheckBox)3 WidgetTank (pneumaticCraft.client.gui.widget.WidgetTank)3 GuiTextField (net.minecraft.client.gui.GuiTextField)1 Item (net.minecraft.item.Item)1 IGuiWidget (pneumaticCraft.client.gui.widget.IGuiWidget)1 WidgetTemperature (pneumaticCraft.client.gui.widget.WidgetTemperature)1 WidgetTooltipArea (pneumaticCraft.client.gui.widget.WidgetTooltipArea)1