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