use of binnie.core.gui.geometry.Area in project Binnie by ForestryMC.
the class WindowSequencer method initialiseClient.
@Override
@SideOnly(Side.CLIENT)
public void initialiseClient() {
super.initialiseClient();
int x = 16;
int y = 32;
CraftGUIUtil.horizontalGrid(x, y, TextJustification.MIDDLE_CENTER, 2, new ControlSlotArray.Builder(this, 0, 0, 2, 2).create(Sequencer.SLOT_RESERVE), new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()), new ControlSequencerProgress(this, 0, 0), new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()), new ControlSlot.Builder(this, 0, 0).assign(6));
final ControlSlot slotTarget = new ControlSlot.Builder(this, x + 96, y + 16).assign(5);
x = 34;
y = 92;
this.slotText = new ControlText(this, new Area(0, y, this.getWidth(), 12), TextFormatting.DARK_GRAY + I18N.localise("genetics.machine.sequencer.texts.userless"), TextJustification.MIDDLE_CENTER);
y += 20;
final ControlSlot slotDye = new ControlSlot.Builder(this, x, y).assign(0);
x += 20;
new ControlSlotCharge(this, x, y, 0).setColor(16750848);
x += 32;
new ControlEnergyBar(this, x, y, 60, 16, Alignment.LEFT);
x += 92;
final ControlErrorState errorState = new ControlErrorState(this, x, y + 1);
new ControlPlayerInventory(this);
}
use of binnie.core.gui.geometry.Area in project Binnie by ForestryMC.
the class ControlClimateBar method onRenderBackground.
@Override
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_BACK, getArea());
int types = isHumidity ? 3 : 6;
int w = (int) ((getSize().xPos() - 2.0f) / types);
for (int i = 0; i < types; ++i) {
int x = i * w;
if (tolerated.contains(i)) {
int color;
if (isHumidity) {
color = HUMID_COLORS[i];
} else {
color = TEMP_COLORS[i];
}
RenderUtil.drawSolidRect(new Area(x + 1, 1, w, getSize().yPos() - 2), color);
}
}
CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_GLASS, getArea());
}
use of binnie.core.gui.geometry.Area in project Binnie by ForestryMC.
the class ControlSlot method onRenderForeground.
@Override
@SideOnly(Side.CLIENT)
public void onRenderForeground(int guiWidth, int guiHeight) {
boolean highlighted = false;
for (final Map.Entry<EnumHighlighting, List<Integer>> highlight : ControlSlot.highlighting.entrySet()) {
if (highlight.getKey() == EnumHighlighting.SHIFT_CLICK && !ControlSlot.shiftClickActive) {
continue;
}
if (highlighted || !highlight.getValue().contains(this.slot.slotNumber)) {
continue;
}
highlighted = true;
final int c = -1442840576 + Math.min(highlight.getKey().getColour(), 16777215);
GlStateManager.disableBlend();
GlStateManager.disableDepth();
RenderUtil.drawGradientRect(new Area(1, 1, 16, 16), c, c);
GlStateManager.enableBlend();
GlStateManager.enableDepth();
}
if (!highlighted && this.getTopParent().getMousedOverWidget() == this) {
GuiCraftGUI gui = Window.get(this).getGui();
GlStateManager.disableBlend();
GlStateManager.disableDepth();
if (!gui.getDraggedItem().isEmpty() && !this.slot.isItemValid(gui.getDraggedItem())) {
RenderUtil.drawGradientRect(new Area(1, 1, 16, 16), -1426089575, -1426089575);
} else {
RenderUtil.drawGradientRect(new Area(1, 1, 16, 16), -2130706433, -2130706433);
}
GlStateManager.enableBlend();
GlStateManager.enableDepth();
}
}
use of binnie.core.gui.geometry.Area in project Binnie by ForestryMC.
the class ControlSlotBase method onRenderBackground.
@Override
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
CraftGUI.RENDER.texture(CraftGUITexture.SLOT, this.getArea());
if (this.getTopParent().getMousedOverWidget() == this) {
Area area = new Area(new Point(1, 1), this.getArea().size().sub(new Point(2, 2)));
RenderUtil.drawGradientRect(area, -2130706433, -2130706433);
}
}
use of binnie.core.gui.geometry.Area in project Binnie by ForestryMC.
the class WindowFieldKit method initialiseClient.
@Override
@SideOnly(Side.CLIENT)
public void initialiseClient() {
this.setTitle(I18N.localise("binniecore.gui.fieldkit.title"));
CraftGUI.RENDER.setStyleSheet(StyleSheetManager.getSheet(StyleSheetManager.PUNNETT_SHEET));
WindowInventory inventory = this.getWindowInventory();
inventory.createSlot(INDIVIDUAL_SLOT);
inventory.createSlot(PAPER_SLOT);
this.setupValidators();
new ControlPlayerInventory(this);
final Point handGlass = new Point(16, 32);
this.GlassControl = new ControlImage(this, handGlass.xPos(), handGlass.yPos(), new StandardTexture(0, 160, 96, 96, BinnieCoreTexture.GUI_PUNNETT));
new ControlSlot.Builder(this, handGlass.xPos() + 54, handGlass.yPos() + 26).assign(InventoryType.WINDOW, 0);
new ControlSlot.Builder(this, 208, 8).assign(InventoryType.WINDOW, 1);
(this.text = new ControlText(this, new Point(232, 13), I18N.localise("binniecore.gui.fieldkit.paper"))).setColor(2236962);
(this.text = new ControlText(this, new Area(0, 120, this.getWidth(), 24), "", TextJustification.MIDDLE_CENTER)).setColor(2236962);
this.chromo = new ControlChromosome(this, 150, 24);
this.addEventHandler(EventValueChanged.class, EventHandlerOrigin.DIRECT_CHILD, this.chromo, event -> {
final IChromosomeType type = (IChromosomeType) event.getValue();
if (type != null && WindowFieldKit.this.info.containsKey(type)) {
final String t = WindowFieldKit.this.info.get(type);
WindowFieldKit.this.text.setValue(t);
} else {
WindowFieldKit.this.text.setValue("");
}
});
}
Aggregations