Clean Up and move guis

This commit is contained in:
Nedelosk committed 2017-03-20 21:21:17 +01:00
1 parent 490feb915f
commit c93a79887f
76 files changed
+361 -360

No files matched your search

@@ -52,23 +52,23 @@ public class PageSpeciesFlowerGenome extends PageSpecies {
final int th = 14;
final int th2 = 18;
new ControlText(contents, new IArea(0, y, w2, th), "Temp. : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getTemperature().getName(), TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getTemperature().getName(), TextJustification.MIDDLE_LEFTt);
y += th;
new ControlText(contents, new IArea(0, y, w2, th), "Moist. : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), Binnie.LANGUAGE.localise(treeSpecies.getMoisture()), TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), Binnie.LANGUAGE.localise(treeSpecies.getMoisture()), TextJustification.MIDDLE_LEFTt);
y += th;
new ControlText(contents, new IArea(0, y, w2, th), "pH. : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), Binnie.LANGUAGE.localise(treeSpecies.getPH()), TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), Binnie.LANGUAGE.localise(treeSpecies.getPH()), TextJustification.MIDDLE_LEFTt);
y += th;
new ControlText(contents, new IArea(0, y, w2, th), "Fertility : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MIDDLE_LEFTt);
y += th;
final float lifespan = genome.getLifespan() * 68.27f / genome.getAgeChance() / 24000.0f;
new ControlText(contents, new IArea(0, y, w2, th), "Lifespan : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), "" + String.format("%.2f", lifespan) + " days", TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), "" + String.format("%.2f", lifespan) + " days", TextJustification.MIDDLE_LEFTt);
y += th;
new ControlText(contents, new IArea(0, y, w2, th), "Nectar : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getActiveAllele(EnumFlowerChromosome.SAPPINESS).getName(), TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getActiveAllele(EnumFlowerChromosome.SAPPINESS).getName(), TextJustification.MIDDLE_LEFTt);
y += th;
int x = w2;
int tot = 0;
@@ -39,17 +39,17 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
@Override
protected void addTabs() {
new PageSpeciesOverview(this.getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.overview", 0));
new PageSpeciesFlowerGenome(this.getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.genome", 0));
new PageSpeciesClassification(this.getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.classification", 0));
new PageSpeciesResultant(this.getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.resultant", 0));
new PageSpeciesMutations(this.getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.further", 0));
new PageBranchOverview(this.getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.overview", 0));
new PageBranchSpecies(this.getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.species", 0));
new PageSpeciesOverview(this.getInfoPages(Mode.SPECIES), new DatabaseTab(Botany.instance, "species.overview", 0));
new PageSpeciesFlowerGenome(this.getInfoPages(Mode.SPECIES), new DatabaseTab(Botany.instance, "species.genome", 0));
new PageSpeciesClassification(this.getInfoPages(Mode.SPECIES), new DatabaseTab(Botany.instance, "species.classification", 0));
new PageSpeciesResultant(this.getInfoPages(Mode.SPECIES), new DatabaseTab(Botany.instance, "species.resultant", 0));
new PageSpeciesMutations(this.getInfoPages(Mode.SPECIES), new DatabaseTab(Botany.instance, "species.further", 0));
new PageBranchOverview(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(Botany.instance, "branches.overview", 0));
new PageBranchSpecies(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(Botany.instance, "branches.species", 0));
this.createMode(FlowerMode.Colour, new ModeWidgets(FlowerMode.Colour, this) {
@Override
public void createListBox(final IArea area) {
this.listBox = new ControlListBox<IFlowerColour>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12) {
this.listBox = new ControlListBox<IFlowerColour>(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12) {
@Override
public IWidget createOption(final IFlowerColour value, final int y) {
return new ControlColourOption(this.getContent(), value, y);
@@ -62,7 +62,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
});
new PageColourMixResultant(this.getInfoPages(FlowerMode.Colour), new DatabaseTab(Botany.instance, "colour.resultant", 0));
new PageColourMix(this.getInfoPages(FlowerMode.Colour), new DatabaseTab(Botany.instance, "colour.further", 0));
new PageBreeder(this.getInfoPages(Mode.Breeder), this.getUsername(), new DatabaseTab(Botany.instance, "breeder", 0));
new PageBreeder(this.getInfoPages(Mode.BREEDER), this.getUsername(), new DatabaseTab(Botany.instance, "breeder", 0));
}
@Override
@@ -105,7 +105,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
final int compartmentWidth = compartmentPageWidth + (doubleTabbed ? 48 : 24);
final int compartmentHeight = compartmentPageHeight;
final Control controlCompartment = new Control(this, x, y, compartmentWidth, compartmentHeight);
final ControlTabBar<Integer> tab = new ControlTabBar<Integer>(controlCompartment, 0, 0, 24, compartmentPageHeight, Position.Left, Arrays.asList(tabs1)) {
final ControlTabBar<Integer> tab = new ControlTabBar<Integer>(controlCompartment, 0, 0, 24, compartmentPageHeight, Position.LEFT, Arrays.asList(tabs1)) {
@Override
public ControlTab<Integer> createTab(final int x, final int y, final int w, final int h, final Integer value) {
return new ControlTabIcon<Integer>(this, x, y, w, h, value) {
@@ -153,7 +153,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
int i = 0;
for (int p2 = 0; p2 < inv.getTabNumber(); ++p2) {
final ControlPage thisPage = page[p2];
final Panel panel = new Panel(thisPage, 0, 0, thisPage.w(), thisPage.h(), MinecraftGUI.PanelType.Black) {
final Panel panel = new Panel(thisPage, 0, 0, thisPage.width(), thisPage.height(), MinecraftGUI.PanelType.Black) {
@Override
@SideOnly(Side.CLIENT)
public void onRenderForeground(int guiWidth, int guiHeight) {
@@ -171,7 +171,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
}
x += compartmentPageWidth;
if (tabs2.length > 0) {
final ControlTabBar<Integer> tab2 = new ControlTabBar<Integer>(controlCompartment, 24 + compartmentPageWidth, 0, 24, compartmentPageHeight, Position.Right, Arrays.asList(tabs2)) {
final ControlTabBar<Integer> tab2 = new ControlTabBar<Integer>(controlCompartment, 24 + compartmentPageWidth, 0, 24, compartmentPageHeight, Position.RIGHT, Arrays.asList(tabs2)) {
@Override
public ControlTab<Integer> createTab(final int x, final int y, final int w, final int h, final Integer value) {
return new ControlTabIcon<Integer>(this, x, y, w, h, value) {
@@ -212,10 +212,10 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
x += 24;
}
x += 16;
this.setSize(new IPoint(Math.max(32 + compartmentWidth, 252), this.h()));
controlCompartment.setPosition(new IPoint((this.w() - controlCompartment.w()) / 2, controlCompartment.y()));
this.setSize(new IPoint(Math.max(32 + compartmentWidth, 252), this.height()));
controlCompartment.setPosition(new IPoint((this.width() - controlCompartment.width()) / 2, controlCompartment.yPos()));
final ControlPlayerInventory invent = new ControlPlayerInventory(this, true);
final ControlSlide slide = new ControlSlide(this, 0, 134, 136, 92, Position.Left);
final ControlSlide slide = new ControlSlide(this, 0, 134, 136, 92, Position.LEFT);
slide.setLabel("Tab Properties");
slide.setSlide(false);
slide.addHelp("Tab Properties");
@@ -289,7 +289,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
final Object texture = this.isMouseOver() ? CraftGUITexture.TabHighlighted : CraftGUITexture.Tab;
CraftGUI.render.texture(CraftGUI.render.getTexture(texture).crop(Position.Bottom, 8), this.getArea());
CraftGUI.render.texture(CraftGUI.render.getTexture(texture).crop(Position.BOTTOM, 8), this.getArea());
}
};
searchButton.addHelp("Search Button");
@@ -118,7 +118,7 @@ public class WindowFieldKit extends Window {
new ControlSlot.Builder(this, handGlass.x() + 54, handGlass.y() + 26).assign(InventoryType.Window, 0);
new ControlSlot.Builder(this, 208, 8).assign(InventoryType.Window, 1);
(this.text = new ControlText(this, new IPoint(232, 13), "Paper")).setColour(2236962);
(this.text = new ControlText(this, new IArea(0, 120, this.w(), 24), "", TextJustification.MiddleCenter)).setColour(2236962);
(this.text = new ControlText(this, new IArea(0, 120, this.width(), 24), "", TextJustification.MiddleCenter)).setColour(2236962);
this.chromo = new ControlChromosome(this, 150, 24);
this.addEventHandler(new EventValueChanged.Handler() {
@Override
@@ -65,7 +65,7 @@ public class WindowGenesis extends Window {
public void initialiseClient() {
new ControlPlayerInventory(this);
this.setTitle("Genesis");
final ControlTabBar<BreedingSystem> tabSystems = new ControlTabBar<BreedingSystem>(this, 8, 28, 23, 100, Position.Left, Binnie.GENETICS.getActiveSystems()) {
final ControlTabBar<BreedingSystem> tabSystems = new ControlTabBar<BreedingSystem>(this, 8, 28, 23, 100, Position.LEFT, Binnie.GENETICS.getActiveSystems()) {
@Override
public ControlTab<BreedingSystem> createTab(final int x, final int y, final int w, final int h, final BreedingSystem value) {
return new ControlTabIcon<BreedingSystem>(this, x, y, w, h, value) {
@@ -99,13 +99,13 @@ public class WindowGenesis extends Window {
final IArea two = new IArea(214, 28, 100, 100);
new Panel(this, one.outset(1), MinecraftGUI.PanelType.Black);
new Panel(this, two.outset(1), MinecraftGUI.PanelType.Black);
this.geneList = new ControlListBox<Gene>(this, one.x(), one.y(), one.w(), one.h(), 10) {
this.geneList = new ControlListBox<Gene>(this, one.xPos(), one.yPos(), one.width(), one.height(), 10) {
@Override
public IWidget createOption(final Gene value, final int y) {
return new ControlGenesisOption(this.getContent(), value, y);
}
};
this.geneOptions = new ControlListBox<Gene>(this, two.x(), two.y(), two.w(), two.h(), 10) {
this.geneOptions = new ControlListBox<Gene>(this, two.xPos(), two.yPos(), two.width(), two.height(), 10) {
@Override
public IWidget createOption(final Gene value, final int y) {
return new ControlTextOption<>(this.getContent(), value, y);
@@ -86,10 +86,10 @@ public class ControlTextEdit extends Control implements IControlValue<String> {
}
protected void renderTextField() {
this.field.width = this.w();
this.field.height = this.h();
this.field.xPosition = (int) ((this.h() - 8.0f) / 2.0f);
this.field.yPosition = (int) ((this.h() - 8.0f) / 2.0f);
this.field.width = this.width();
this.field.height = this.height();
this.field.xPosition = (int) ((this.height() - 8.0f) / 2.0f);
this.field.yPosition = (int) ((this.height() - 8.0f) / 2.0f);
this.field.drawTextBox();
}
}
@@ -32,7 +32,7 @@ public class Control extends Widget implements ITooltipHelp, ITooltip {
}
public Control(final IWidget parent, final IArea area) {
this(parent, area.x(), area.y(), area.w(), area.h());
this(parent, area.xPos(), area.yPos(), area.width(), area.height());
}
protected void initialise() {
@@ -53,7 +53,7 @@ public class ControlList<T> extends Control implements IControlValue<T> {
this.value = value;
if (this.optionWidgets.containsKey(value)) {
final IWidget child = this.optionWidgets.get(value);
this.parent.ensureVisible(child.y(), child.y() + child.h(), this.h());
this.parent.ensureVisible(child.yPos(), child.yPos() + child.height(), this.height());
}
this.parent.callEvent(new EventValueChanged<Object>(this.parent, value));
}
@@ -17,7 +17,7 @@ public class ControlListBox<T> extends ControlScrollableContent<ControlList<T>>
public void initialise() {
ControlList<T> content = this.getContent();
T defaultValue = content == null ? null : content.getDefaultValue();
ControlList<T> child = new ControlList<>(this, 1, 1, this.w() - 2 - this.scrollBarSize, this.h() - 2, defaultValue);
ControlList<T> child = new ControlList<>(this, 1, 1, this.width() - 2 - this.scrollBarSize, this.height() - 2, defaultValue);
this.setScrollableContent(child);
this.addEventHandler(new EventKey.Down.Handler() {
@Override
@@ -8,7 +8,7 @@ public class ControlPage<T> extends Control implements IControlValue<T> {
private T value;
public ControlPage(final IWidget parent, final T value) {
this(parent, 0, 0, parent.w(), parent.h(), value);
this(parent, 0, 0, parent.width(), parent.height(), value);
}
public ControlPage(final IWidget parent, final int x, final int y, final int w, final int h, final T value) {
@@ -24,7 +24,7 @@ public class ControlScrollBar extends Control {
this.addSelfEventHandler(new EventMouse.Drag.Handler() {
@Override
public void onEvent(final EventMouse.Drag event) {
ControlScrollBar.this.scrollable.movePercentage(event.getDy() / (ControlScrollBar.this.h() - ControlScrollBar.this.getBarHeight()));
ControlScrollBar.this.scrollable.movePercentage(event.getDy() / (ControlScrollBar.this.height() - ControlScrollBar.this.getBarHeight()));
}
});
this.addSelfEventHandler(new EventMouse.Down.Handler() {
@@ -34,7 +34,7 @@ public class ControlScrollBar extends Control {
final float percentageIndex = ControlScrollBar.this.scrollable.getPercentageIndex();
final float minPercent = (1.0f - shownPercentage) * percentageIndex;
final float maxPercent = minPercent + shownPercentage;
float clickedPercentage = ControlScrollBar.this.getRelativeMousePosition().y() / (ControlScrollBar.this.h() - 2.0f);
float clickedPercentage = ControlScrollBar.this.getRelativeMousePosition().y() / (ControlScrollBar.this.height() - 2.0f);
clickedPercentage = Math.max(Math.min(clickedPercentage, 1.0f), 0.0f);
if (clickedPercentage > maxPercent) {
ControlScrollBar.this.scrollable.setPercentageIndex((clickedPercentage - shownPercentage) / (1.0f - shownPercentage));
@@ -56,7 +56,7 @@ public class ControlScrollBar extends Control {
}
public int getBarHeight() {
return Math.round(this.h() * this.scrollable.getPercentageShown());
return Math.round(this.height() * this.scrollable.getPercentageShown());
}
protected IArea getRenderArea() {
@@ -64,7 +64,7 @@ public class ControlScrollBar extends Control {
if (height < 6) {
height = 6;
}
final int yOffset = Math.round((this.h() - this.getBarHeight()) * this.scrollable.getPercentageIndex());
final int yOffset = Math.round((this.height() - this.getBarHeight()) * this.scrollable.getPercentageIndex());
return new IArea(0, yOffset, this.getSize().x(), height);
}
@@ -83,7 +83,7 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
Texture iTexture = lTexture.crop(position, 8);
final IArea area = this.getArea();
if (texture == CraftGUITexture.TabDisabled) {
if (position == Position.Top || position == Position.Left) {
if (position == Position.Top || position == Position.LEFT) {
area.setPosition(area.getPosition().sub(new IPoint(4 * position.x(), 4 * position.y())));
area.setSize(area.getSize().add(new IPoint(4 * position.x(), 4 * position.y())));
} else {
@@ -38,12 +38,12 @@ public class ControlTabBar<T> extends Control implements IControlValue<T> {
}
final float length = values.size();
int tabDimension = (int) (this.getSize().y() / length);
if (this.position == Position.Top || this.position == Position.Bottom) {
if (this.position == Position.Top || this.position == Position.BOTTOM) {
tabDimension = (int) (this.getSize().x() / length);
}
int j = 0;
for (final T value : values) {
if (this.position == Position.Top || this.position == Position.Bottom) {
if (this.position == Position.Top || this.position == Position.BOTTOM) {
final IWidget tab = this.createTab(j * tabDimension, 0, tabDimension, this.getSize().y(), value);
} else {
final IWidget tab = this.createTab(0, j * tabDimension, this.getSize().x(), tabDimension, value);
@@ -133,15 +133,15 @@ public interface IWidget {
<E extends Event> void addSelfEventHandler(final EventHandler<E> p0);
boolean contains(final IPoint p0);
boolean contains(final IPoint point);
int x();
int xPos();
int y();
int yPos();
int w();
int width();
int h();
int height();
@SideOnly(Side.CLIENT)
void onRender(final RenderStage stage, int guiWidth, int guiHeight);
@@ -502,22 +502,22 @@ public class Widget implements IWidget {
}
@Override
public int x() {
public int xPos() {
return this.pos().x();
}
@Override
public int y() {
public int yPos() {
return this.pos().y();
}
@Override
public int w() {
public int width() {
return this.size().x();
}
@Override
public int h() {
public int height() {
return this.size().y();
}
@@ -57,40 +57,40 @@ public class IArea {
return position.x() >= this.pos().x() && position.y() >= this.pos.y() && position.x() <= this.pos().x() + this.size().x() && position.y() <= this.pos().y() + this.size().y();
}
public int x() {
public int xPos() {
return this.pos().x();
}
public int y() {
public int yPos() {
return this.pos().y();
}
public int w() {
public int width() {
return this.size().x();
}
public int h() {
public int height() {
return this.size().y();
}
public void x(final int n) {
this.pos = new IPoint(n, this.pos.y());
public void setXPos(final int xPos) {
this.pos = new IPoint(xPos, this.pos.y());
}
public void y(final int n) {
this.pos = new IPoint(this.pos.x(), n);
public void setYPos(final int yPos) {
this.pos = new IPoint(this.pos.x(), yPos);
}
public void w(final int n) {
this.size = new IPoint(n, this.size.y());
public void setWidth(final int width) {
this.size = new IPoint(width, this.size.y());
}
public void h(final int n) {
this.size = new IPoint(this.size.x(), n);
public void setHeight(final int height) {
this.size = new IPoint(this.size.x(), height);
}
public IArea inset(final IBorder border) {
return new IArea(this.x() + border.l(), this.y() + border.t(), this.w() - border.l() - border.r(), this.h() - border.t() - border.b());
return new IArea(this.xPos() + border.l(), this.yPos() + border.t(), this.width() - border.l() - border.r(), this.height() - border.t() - border.b());
}
public IArea outset(final int outset) {
@@ -98,7 +98,7 @@ public class IArea {
}
public IArea outset(final IBorder border) {
return new IArea(this.x() - border.l(), this.y() - border.t(), this.w() + border.l() + border.r(), this.h() + border.t() + border.b());
return new IArea(this.xPos() - border.l(), this.yPos() - border.t(), this.width() + border.l() + border.r(), this.height() + border.t() + border.b());
}
public IArea inset(final int inset) {
@@ -107,10 +107,10 @@ public class IArea {
@Override
public String toString() {
return this.w() + "x" + this.h() + "@" + this.x() + "," + this.y();
return this.width() + "x" + this.height() + "@" + this.xPos() + "," + this.yPos();
}
public IArea shift(final int dx, final int f) {
return new IArea(this.x() + dx, this.y() + f, this.w(), this.h());
return new IArea(this.xPos() + dx, this.yPos() + f, this.width(), this.height());
}
}
@@ -27,7 +27,7 @@ public class IBorder {
}
public IBorder(final Position edge, final int n) {
this((edge == Position.Top) ? n : 0, (edge == Position.Right) ? n : 0, (edge == Position.Bottom) ? n : 0, (edge == Position.Left) ? n : 0);
this((edge == Position.Top) ? n : 0, (edge == Position.RIGHT) ? n : 0, (edge == Position.BOTTOM) ? n : 0, (edge == Position.LEFT) ? n : 0);
}
public IBorder(final IBorder padding) {
@@ -2,9 +2,9 @@ package binnie.craftgui.core.geometry;
public enum Position {
Top(0, -1),
Bottom(0, 1),
Left(-1, 0),
Right(1, 0);
BOTTOM(0, 1),
LEFT(-1, 0),
RIGHT(1, 0);
int x;
int y;
@@ -24,17 +24,17 @@ public enum Position {
public Position opposite() {
switch (this) {
case Bottom: {
case BOTTOM: {
return Position.Top;
}
case Left: {
return Position.Right;
case LEFT: {
return Position.RIGHT;
}
case Right: {
return Position.Left;
case RIGHT: {
return Position.LEFT;
}
case Top: {
return Position.Bottom;
return Position.BOTTOM;
}
default: {
throw new IllegalStateException();
@@ -4,7 +4,7 @@ public enum TextJustification {
TopLeft(0.0f, 0.0f),
TopCenter(0.5f, 0.0f),
TopRight(1.0f, 0.0f),
MiddleLeft(0.0f, 0.5f),
MIDDLE_LEFTt(0.0f, 0.5f),
MiddleCenter(0.5f, 0.5f),
MiddleRight(1.0f, 0.5f),
BottomLeft(0.0f, 1.0f),
@@ -29,10 +29,10 @@ public class TextureRenderer {
final int posY = area.pos().y();
final int width = area.size().x();
final int height = area.size().y();
final int textWidth = texture.w();
final int textHeight = texture.h();
final int u = texture.x();
final int v = texture.y();
final int textWidth = texture.width();
final int textHeight = texture.height();
final int u = texture.xPos();
final int v = texture.yPos();
if (borderTop + borderBottom > height) {
borderTop = height / 2;
borderBottom = height / 2;
@@ -153,7 +153,7 @@ public class TextureRenderer {
this.setTexture(texture);
final IArea textureArea = texture.getArea().outset(texture.getBorder());
final IArea targetArea = area.outset(texture.getBorder());
if (textureArea.w() == targetArea.w() && textureArea.h() == targetArea.h()) {
if (textureArea.width() == targetArea.width() && textureArea.height() == targetArea.height()) {
final IPoint position = targetArea.pos();
GuiUtils.drawTexturedModalRect(position.x(), position.y(), textureArea.pos().x(), textureArea.pos().y(), textureArea.size().x(), textureArea.size().y(), 0);
} else {
@@ -184,8 +184,8 @@ public class TextureRenderer {
}
public void texturePercentage(final Texture texture, final IArea area, final Position direction, final float percentage) {
final int dist = (direction == Position.Top || direction == Position.Bottom) ? Math.round(percentage * texture.h()) : Math.round(percentage * texture.w());
final int dim = (direction == Position.Top || direction == Position.Bottom) ? texture.h() : texture.w();
final int dist = (direction == Position.Top || direction == Position.BOTTOM) ? Math.round(percentage * texture.height()) : Math.round(percentage * texture.width());
final int dim = (direction == Position.Top || direction == Position.BOTTOM) ? texture.height() : texture.width();
int x = area.pos().x();
int y = area.pos().y();
int w = area.size().x();
@@ -195,16 +195,16 @@ public class TextureRenderer {
h *= percentage;
break;
}
case Right: {
case RIGHT: {
x += (1.0f - percentage) * w;
w *= percentage;
break;
}
case Left: {
case LEFT: {
w *= percentage;
break;
}
case Bottom: {
case BOTTOM: {
y += h - (int) (percentage * h);
h *= percentage;
break;
@@ -14,7 +14,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public abstract class Dialog extends Control {
public Dialog(final IWidget parent, final int w, final int h) {
super(parent, (parent.w() - w) / 2, (parent.h() - h) / 2, w, h);
super(parent, (parent.width() - w) / 2, (parent.height() - h) / 2, w, h);
this.addAttribute(Attribute.MouseOver);
this.addAttribute(Attribute.AlwaysOnTop);
this.addAttribute(Attribute.BlockTooltip);
@@ -5,17 +5,17 @@ import binnie.core.BinnieCore;
import binnie.core.resource.BinnieSprite;
public enum GUIIcon {
ArrowUp("arrow-up"),
ArrowDown("arrow-down"),
ARROW_UP("arrow-up"),
ARROW_DOWN("arrow-down"),
ArrowLeft("arrow-left"),
ArrowRight("arrow-right"),
ArrowUpLeft("arrow-upleft"),
ARROW_RIGHT("arrow-right"),
ARROW_UP_LEFT("arrow-upleft"),
ArrowUpRight("arrow-upright"),
ArrowRightUp("arrow-rightup"),
ArrowRightDown("arrow-rightdown"),
ArrowDownRight("arrow-downright"),
ArrowDownLeft("arrow-downleft"),
ArrowLeftDown("arrow-leftdown"),
ARROW_LEFT_DOWN("arrow-leftdown"),
ArrowLeftUp("arrow-leftup");
String path;
@@ -102,7 +102,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
if (Window.this.isClient()) {
Window.this.getGui().resize(Window.this.getSize());
if (Window.this.title != null) {
Window.this.title.setSize(new IPoint(Window.this.w(), Window.this.title.h()));
Window.this.title.setSize(new IPoint(Window.this.width(), Window.this.title.height()));
}
}
}
@@ -288,14 +288,14 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
@Override
public void receiveGuiNBTOnClient(EntityPlayer player, String name, NBTTagCompound nbt) {
if (name.equals("username")) {
final int w = this.w();
final int w = this.width();
final int titleButtonRight = this.titleButtonRight + 16;
this.titleButtonRight = titleButtonRight;
final ControlUser controlUser = new ControlUser(this, w - titleButtonRight, 8, nbt.getString("username"));
this.titleButtonRight += 6;
}
if (name.equals("power-system")) {
final int w2 = this.w();
final int w2 = this.width();
final int titleButtonRight2 = this.titleButtonRight + 16;
this.titleButtonRight = titleButtonRight2;
final ControlPowerSystem controlPowerSystem = new ControlPowerSystem(this, w2 - titleButtonRight2, 8, PowerSystem.get(nbt.getByte("system")));
@@ -87,13 +87,13 @@ public class ControlEnergyBar extends Control implements ITooltip {
final IArea area = this.getArea();
switch (this.direction) {
case Top:
case Bottom: {
case BOTTOM: {
final int height = Math.round(area.size().y() * percentage);
area.setSize(new IPoint(area.size().x(), height));
break;
}
case Left:
case Right: {
case LEFT:
case RIGHT: {
final int width = Math.round(area.size().x() * percentage);
area.setSize(new IPoint(width, area.size().y()));
break;
@@ -12,7 +12,7 @@ public class ControlImage extends Control {
private Object key;
public ControlImage(final IWidget parent, final int x, final int y, final Texture text) {
super(parent, x, y, text.w(), text.h());
super(parent, x, y, text.width(), text.height());
this.key = text;
}
@@ -112,7 +112,7 @@ public class ControlLiquidTank extends Control implements ITooltip {
final IPoint offset = new IPoint(0, height - squaled);
final IArea limited = this.getArea().inset(1);
if (this.horizontal) {
limited.setSize(new IPoint(limited.w() - 1, limited.h()));
limited.setSize(new IPoint(limited.width() - 1, limited.height()));
}
CraftGUI.render.limitArea(new IArea(limited.pos().add(pos).add(offset), limited.size().sub(offset)), guiWidth, guiHeight);
GL11.glEnable(GL11.GL_SCISSOR_TEST);
@@ -13,7 +13,7 @@ public class ControlProgress extends ControlProgressBase {
private Position direction;
public ControlProgress(final IWidget parent, final int x, final int y, final Texture progressBlank, final Texture progressBar, final Position dir) {
super(parent, x, y, (progressBlank == null) ? 0 : progressBlank.w(), (progressBlank == null) ? 0 : progressBlank.h());
super(parent, x, y, (progressBlank == null) ? 0 : progressBlank.width(), (progressBlank == null) ? 0 : progressBlank.height());
this.progressBlank = progressBlank;
this.progressBar = progressBar;
this.progress = 0.0f;
@@ -31,7 +31,7 @@ public class ControlSlide extends Control {
this.addAttribute(Attribute.BlockTooltip);
this.expanded = new IArea(this.getPosition(), this.getSize());
this.anchor = anchor2.opposite();
final int border = (this.anchor.x() != 0) ? (this.expanded.w() - 6) : (this.expanded.h() - 6);
final int border = (this.anchor.x() != 0) ? (this.expanded.width() - 6) : (this.expanded.height() - 6);
this.shrunk = this.expanded.inset(new IBorder(this.anchor, border));
this.slideActive = false;
}
@@ -46,7 +46,7 @@ public class ControlSlide extends Control {
final boolean hor = this.anchor.x() != 0;
final IArea ar = this.isSlideActive() ? this.expanded : this.shrunk;
IArea tabArea = new IArea(hor ? (-lh / 2) : (-lw / 2), hor ? (-lw / 2) : (-lh / 2), hor ? lh : lw, hor ? lw : lh);
final IPoint shift = new IPoint(ar.w() * (1 - this.anchor.x()) / 2, ar.h() * (1 - this.anchor.y()) / 2);
final IPoint shift = new IPoint(ar.width() * (1 - this.anchor.x()) / 2, ar.height() * (1 - this.anchor.y()) / 2);
tabArea = tabArea.shift(shift.x() - (-3 + lh / 2) * this.anchor.x(), shift.y() - (-3 + lh / 2) * this.anchor.y());
Texture texture = CraftGUI.render.getTexture(this.isSlideActive() ? CraftGUITexture.Tab : CraftGUITexture.TabDisabled).crop(this.anchor.opposite(), 8);
CraftGUI.render.texture(texture, tabArea);
@@ -65,8 +65,8 @@ public class ControlSlide extends Control {
GlStateManager.popMatrix();
}
CraftGUI.render.texture(CraftGUITexture.Window, this.getArea());
final Object slideTexture = (this.anchor == Position.Bottom) ? CraftGUITexture.SlideDown : ((this.anchor == Position.Top) ? CraftGUITexture.SlideUp : ((this.anchor == Position.Left) ? CraftGUITexture.SlideLeft : CraftGUITexture.SlideRight));
CraftGUI.render.texture(slideTexture, new IPoint((this.anchor.x() + 1) * this.w() / 2 - 8, (this.anchor.y() + 1) * this.h() / 2 - 8));
final Object slideTexture = (this.anchor == Position.BOTTOM) ? CraftGUITexture.SlideDown : ((this.anchor == Position.Top) ? CraftGUITexture.SlideUp : ((this.anchor == Position.LEFT) ? CraftGUITexture.SlideLeft : CraftGUITexture.SlideRight));
CraftGUI.render.texture(slideTexture, new IPoint((this.anchor.x() + 1) * this.width() / 2 - 8, (this.anchor.y() + 1) * this.height() / 2 - 8));
}
public boolean isSlideActive() {
@@ -24,7 +24,7 @@ public class ControlSlotCharge extends Control {
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
CraftGUI.render.texture(CraftGUITexture.PanelBlack, this.getArea());
CraftGUI.render.texturePercentage(CraftGUI.render.getTexture(CraftGUITexture.SlotCharge), this.getArea().inset(1), Position.Bottom, this.getCharge());
CraftGUI.render.texturePercentage(CraftGUI.render.getTexture(CraftGUITexture.SlotCharge), this.getArea().inset(1), Position.BOTTOM, this.getCharge());
}
public ControlSlotCharge(final IWidget parent, final int x, final int y, final int slot) {
@@ -139,31 +139,31 @@ public abstract class WindowAbstractDatabase extends Window {
(this.panelSearch = new Panel(this, 176, 24, this.selectionBoxWidth, 160, MinecraftGUI.PanelType.Black)).setColour(860416);
this.modePages = new ControlPages<>(this, 0, 0, this.getSize().x(), this.getSize().y());
new ControlTextEdit(this, 176, 184, this.selectionBoxWidth, 16);
this.createMode(Mode.Species, new ModeWidgets(Mode.Species, this) {
this.createMode(Mode.SPECIES, new ModeWidgets(Mode.SPECIES, this) {
@Override
public void createListBox(final IArea area) {
final GameProfile playerName = WindowAbstractDatabase.this.getUsername();
final Collection<IAlleleSpecies> speciesList = this.database.isNEI ? this.database.system.getAllSpecies() : this.database.system.getDiscoveredSpecies(this.database.getWorld(), playerName);
(this.listBox = new ControlSpeciesBox(this.modePage, area.x(), area.y(), area.w(), area.h())).setOptions(speciesList);
(this.listBox = new ControlSpeciesBox(this.modePage, area.xPos(), area.yPos(), area.width(), area.height())).setOptions(speciesList);
}
});
this.createMode(Mode.Branches, new ModeWidgets(Mode.Branches, this) {
this.createMode(Mode.BRANCHES, new ModeWidgets(Mode.BRANCHES, this) {
@Override
public void createListBox(final IArea area) {
final EntityPlayer player = this.database.getPlayer();
final GameProfile playerName = WindowAbstractDatabase.this.getUsername();
final Collection<IClassification> speciesList = this.database.isNEI ? this.database.system.getAllBranches() : this.database.system.getDiscoveredBranches(this.database.getWorld(), playerName);
(this.listBox = new ControlBranchBox(this.modePage, area.x(), area.y(), area.w(), area.h())).setOptions(speciesList);
(this.listBox = new ControlBranchBox(this.modePage, area.xPos(), area.yPos(), area.width(), area.height())).setOptions(speciesList);
}
});
this.createMode(Mode.Breeder, new ModeWidgets(Mode.Breeder, this) {
this.createMode(Mode.BREEDER, new ModeWidgets(Mode.BREEDER, this) {
@Override
public void createListBox(final IArea area) {
this.listBox = new ControlListBox(this.modePage, area.x(), area.y(), area.w(), area.h(), 12);
this.listBox = new ControlListBox(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12);
}
});
this.addTabs();
final ControlTabBar<IDatabaseMode> tab = new ControlTabBar<IDatabaseMode>(this, 176 + this.selectionBoxWidth, 24, 22, 176, Position.Right, this.modePages.getValues()) {
final ControlTabBar<IDatabaseMode> tab = new ControlTabBar<IDatabaseMode>(this, 176 + this.selectionBoxWidth, 24, 22, 176, Position.RIGHT, this.modePages.getValues()) {
@Override
public ControlTab<IDatabaseMode> createTab(final int x, final int y, final int w, final int h, final IDatabaseMode value) {
return new ControlTab<IDatabaseMode>(this, x, y, w, h, value) {
@@ -175,9 +175,9 @@ public abstract class WindowAbstractDatabase extends Window {
}
};
CraftGUIUtil.linkWidgets(tab, this.modePages);
this.changeMode(Mode.Species);
this.changeMode(Mode.SPECIES);
for (final IDatabaseMode mode : this.modes.keySet()) {
this.modes.get(mode).infoTabs = new ControlTabBar<>(this.modes.get(mode).modePage, 8, 24, 16, 176, Position.Left, this.modes.get(mode).infoPages.getValues());
this.modes.get(mode).infoTabs = new ControlTabBar<>(this.modes.get(mode).modePage, 8, 24, 16, 176, Position.LEFT, this.modes.get(mode).infoPages.getValues());
CraftGUIUtil.linkWidgets(this.modes.get(mode).infoTabs, this.modes.get(mode).infoPages);
}
}
@@ -195,8 +195,8 @@ public abstract class WindowAbstractDatabase extends Window {
public void gotoSpecies(final IAlleleSpecies value) {
if (value != null) {
this.modePages.setValue(Mode.Species);
this.changeMode(Mode.Species);
this.modePages.setValue(Mode.SPECIES);
this.changeMode(Mode.SPECIES);
this.modes.get(this.modePages.getValue()).listBox.setValue(value);
}
}
@@ -216,9 +216,9 @@ public abstract class WindowAbstractDatabase extends Window {
}
public enum Mode implements IDatabaseMode {
Species,
Branches,
Breeder;
SPECIES,
BRANCHES,
BREEDER;
@Override
public String getName() {
@@ -50,20 +50,20 @@ public class Texture {
return this.padding.add(this.border);
}
public int w() {
return this.getArea().w();
public int width() {
return this.getArea().width();
}
public int h() {
return this.getArea().h();
public int height() {
return this.getArea().height();
}
public int u() {
return this.getArea().x();
return this.getArea().xPos();
}
public int v() {
return this.getArea().y();
return this.getArea().yPos();
}
public Texture crop(final Position anchor, final int dist) {
@@ -75,24 +75,24 @@ public class Texture {
if (crop.b() > 0) {
copy.border.b(0);
copy.padding.b(copy.padding.b() - Math.min(crop.b(), copy.padding.b()));
copy.area.h(copy.area.h() - crop.b());
copy.area.setHeight(copy.area.height() - crop.b());
}
if (crop.t() > 0) {
copy.border.t(0);
copy.padding.t(copy.padding.t() - Math.min(crop.t(), copy.padding.t()));
copy.area.h(copy.area.h() - crop.t());
copy.area.y(copy.area.y() + crop.t());
copy.area.setHeight(copy.area.height() - crop.t());
copy.area.setYPos(copy.area.yPos() + crop.t());
}
if (crop.r() > 0) {
copy.border.r(0);
copy.padding.r(copy.padding.r() - Math.min(crop.r(), copy.padding.r()));
copy.area.w(copy.area.w() - crop.r());
copy.area.setWidth(copy.area.width() - crop.r());
}
if (crop.l() > 0) {
copy.border.l(0);
copy.padding.l(copy.padding.l() - Math.min(crop.l(), copy.padding.l()));
copy.area.w(copy.area.w() - crop.l());
copy.area.x(copy.area.x() + crop.l());
copy.area.setWidth(copy.area.width() - crop.l());
copy.area.setXPos(copy.area.xPos() + crop.l());
}
return copy;
}
@@ -18,7 +18,7 @@ public class Panel extends Control {
}
public Panel(final IWidget parent, final IArea area, final IPanelType type) {
this(parent, area.x(), area.y(), area.w(), area.h(), type);
this(parent, area.xPos(), area.yPos(), area.width(), area.height(), type);
}
public IPanelType getType() {
@@ -19,7 +19,6 @@ import net.minecraftforge.fml.relauncher.Side;
import org.apache.commons.lang3.tuple.Pair;
import javax.annotation.Nullable;
import java.text.DecimalFormat;
import java.text.NumberFormat;
public class WindowAlvearyMutator extends Window {
@@ -40,12 +39,12 @@ public class WindowAlvearyMutator extends Window {
this.setTitle("Mutator");
new ControlPlayerInventory(this);
new ControlSlot.Builder(this, 79, 30).assign(0);
new ControlText(this, new IArea(0, 52, this.w(), 16), "Possible Mutagens:", TextJustification.MiddleCenter).setColour(5592405);
new ControlText(this, new IArea(0, 52, this.width(), 16), "Possible Mutagens:", TextJustification.MiddleCenter).setColour(5592405);
final int size = AlvearyMutator.getMutagens().size();
final int w = size * 18;
NumberFormat numberFormat = NumberFormat.getNumberInstance(MinecraftForgeClient.getLocale());
if (size > 0) {
int x = (this.w() - w) / 2;
int x = (this.width() - w) / 2;
for (final Pair<ItemStack, Float> mutagen : AlvearyMutator.getMutagens()) {
final ControlItemDisplay display = new ControlItemDisplay(this, x, 66);
display.setItemStack(mutagen.getKey());
@@ -30,7 +30,7 @@ public class WindowAlvearyStimulator extends Window {
@Override
public void initialiseClient() {
this.setTitle("Stimulator");
new ControlEnergyBar(this, 75, 29, 60, 16, Position.Left);
new ControlEnergyBar(this, 75, 29, 60, 16, Position.LEFT);
new ControlSlot.Builder(this, 41, 28).assign(AlvearyStimulator.slotCircuit);
new ControlPlayerInventory(this);
}
@@ -19,16 +19,16 @@ import net.minecraftforge.fml.relauncher.Side;
public class WindowApiaristDatabase extends WindowAbstractDatabase {
@Override
protected void addTabs() {
new PageSpeciesOverview(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.overview", 0));
new PageSpeciesClassification(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.classification", 0));
new PageSpeciesGenome(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.genome", 0));
new PageSpeciesProducts(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.products", 0));
new PageSpeciesClimate(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.climate", 0));
new PageSpeciesResultant(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.resultant", 0));
new PageSpeciesMutations(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.further", 0));
new PageBranchOverview(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.overview", 0));
new PageBranchSpecies(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.species", 0));
new PageBreeder(this.getInfoPages(Mode.Breeder), this.getUsername(), new DatabaseTab(ExtraBees.instance, "breeder", 0));
new PageSpeciesOverview(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraBees.instance, "species.overview", 0));
new PageSpeciesClassification(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraBees.instance, "species.classification", 0));
new PageSpeciesGenome(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraBees.instance, "species.genome", 0));
new PageSpeciesProducts(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraBees.instance, "species.products", 0));
new PageSpeciesClimate(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraBees.instance, "species.climate", 0));
new PageSpeciesResultant(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraBees.instance, "species.resultant", 0));
new PageSpeciesMutations(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraBees.instance, "species.further", 0));
new PageBranchOverview(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraBees.instance, "branches.overview", 0));
new PageBranchSpecies(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraBees.instance, "branches.species", 0));
new PageBreeder(this.getInfoPages(Mode.BREEDER), this.getUsername(), new DatabaseTab(ExtraBees.instance, "breeder", 0));
}
public WindowApiaristDatabase(final EntityPlayer player, final Side side, final boolean nei) {
@@ -50,7 +50,7 @@ public class DistilleryRecipeCategory extends BlankRecipeCategory<DistilleryReci
@SideOnly(Side.CLIENT)
public void drawExtras(Minecraft minecraft) {
CraftGUI.render.texture(DISTILLERY_BASE, IPoint.ZERO);
CraftGUI.render.texturePercentage(LIQUID_FLOW, new IArea(18, 0, 38, 60), Position.Left, progress.getValue() / 100f);
CraftGUI.render.texturePercentage(LIQUID_FLOW, new IArea(18, 0, 38, 60), Position.LEFT, progress.getValue() / 100f);
IDrawable tank = ExtraTreesJeiPlugin.drawables.getTank();
tank.draw(minecraft, 0, 0);
@@ -30,7 +30,7 @@ public class ControlDistilleryProgress extends ControlProgressBase {
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
CraftGUI.render.texture(DISTILLERY_BASE, IPoint.ZERO);
CraftGUI.render.texturePercentage(LIQUID_FLOW, new IArea(18, 0, 38, 66), Position.Left, this.progress);
CraftGUI.render.texturePercentage(LIQUID_FLOW, new IArea(18, 0, 38, 66), Position.LEFT, this.progress);
final DistilleryLogic component = Machine.getInterface(DistilleryLogic.class, Window.get(this).getInventory());
FluidStack stack = null;
if (component != null) {
@@ -29,7 +29,7 @@ public class PagePlanksOverview extends PageAbstract<ItemStack> {
this.deleteAllChildren();
final WindowAbstractDatabase database = Window.get(this);
new ControlText(this, new IArea(0, 0, this.size().x(), 24), species.getDisplayName(), TextJustification.MiddleCenter);
new ControlText(this, new IArea(12, 24, this.size().x() - 24, 24), ExtraTrees.proxy.localise("gui.database.planks.use"), TextJustification.MiddleLeft);
new ControlText(this, new IArea(12, 24, this.size().x() - 24, 24), ExtraTrees.proxy.localise("gui.database.planks.use"), TextJustification.MIDDLE_LEFTt);
final IPlankType type = WoodManager.get(species);
int x = 12;
if (type != null) {
@@ -55,10 +55,10 @@ public class PageSpeciesTreeGenome extends PageSpecies {
final int th = 14;
final int th2 = 18;
final BreedingSystem syst = Binnie.GENETICS.treeBreedingSystem;
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getPlantType().toString(), TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getPlantType().toString(), TextJustification.MIDDLE_LEFTt);
y += th;
new ControlText(contents, new IArea(0, y, w2, th), BinnieCore.getBinnieProxy().localise("gui.temperature.short") + " : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getTemperature().getName(), TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getTemperature().getName(), TextJustification.MIDDLE_LEFTt);
y += th;
//TODO RENDERING
//final IIcon leaf = treeSpecies.getLeafIcon(false, false);
@@ -91,10 +91,10 @@ public class PageSpeciesTreeGenome extends PageSpecies {
y += th2;
}
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.HEIGHT) + " : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getHeight() + "x", TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getHeight() + "x", TextJustification.MIDDLE_LEFTt);
y += th;
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.FERTILITY) + " : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MIDDLE_LEFTt);
y += th;
final List<ItemStack> fruits = new ArrayList<>();
for (final ItemStack stack : genome.getFruitProvider().getProducts().keySet()) {
@@ -110,16 +110,16 @@ public class PageSpeciesTreeGenome extends PageSpecies {
}
}
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.YIELD) + " : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getYield() + "x", TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getYield() + "x", TextJustification.MIDDLE_LEFTt);
y += th;
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.SAPPINESS) + " : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getSappiness() + "x", TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getSappiness() + "x", TextJustification.MIDDLE_LEFTt);
y += th;
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.MATURATION) + " : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getMaturationTime() + "x", TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getMaturationTime() + "x", TextJustification.MIDDLE_LEFTt);
y += th;
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.GIRTH) + " : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getGirth() + "x" + genome.getGirth(), TextJustification.MiddleLeft);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getGirth() + "x" + genome.getGirth(), TextJustification.MIDDLE_LEFTt);
y += th;
contents.setSize(new IPoint(contents.size().x(), y));
scrollable.setScrollableContent(contents);
@@ -41,18 +41,18 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
@Override
protected void addTabs() {
new PageSpeciesOverview(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.overview", 0));
new PageSpeciesTreeGenome(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.genome", 0));
new PageSpeciesClassification(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.classification", 0));
new PageSpeciesResultant(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.resultant", 0));
new PageSpeciesMutations(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.further", 0));
new PageBranchOverview(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.overview", 0));
new PageBranchSpecies(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.species", 0));
new PageBreeder(this.getInfoPages(Mode.Breeder), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder", 0));
this.createMode(TreeMode.Fruit, new ModeWidgets(TreeMode.Fruit, this) {
new PageSpeciesOverview(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.overview", 0));
new PageSpeciesTreeGenome(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.genome", 0));
new PageSpeciesClassification(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.classification", 0));
new PageSpeciesResultant(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.resultant", 0));
new PageSpeciesMutations(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.further", 0));
new PageBranchOverview(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraTrees.instance, "branches.overview", 0));
new PageBranchSpecies(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraTrees.instance, "branches.species", 0));
new PageBreeder(this.getInfoPages(Mode.BREEDER), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder", 0));
this.createMode(TreeMode.FRUIT, new ModeWidgets(TreeMode.FRUIT, this) {
@Override
public void createListBox(final IArea area) {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12) {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12) {
@Override
public IWidget createOption(final ItemStack value, final int y) {
return new ControlItemStackOption(this.getContent(), value, y);
@@ -60,10 +60,10 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
}).setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allFruits);
}
});
this.createMode(TreeMode.Wood, new ModeWidgets(TreeMode.Wood, this) {
this.createMode(TreeMode.WOOD, new ModeWidgets(TreeMode.WOOD, this) {
@Override
public void createListBox(final IArea area) {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12) {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12) {
@Override
public IWidget createOption(final ItemStack value, final int y) {
return new ControlItemStackOption(this.getContent(), value, y);
@@ -71,10 +71,10 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
}).setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allWoods);
}
});
this.createMode(TreeMode.Planks, new ModeWidgets(TreeMode.Planks, this) {
this.createMode(TreeMode.PLANKS, new ModeWidgets(TreeMode.PLANKS, this) {
@Override
public void createListBox(final IArea area) {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12) {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12) {
@Override
public IWidget createOption(final ItemStack value, final int y) {
return new ControlItemStackOption(this.getContent(), value, y);
@@ -82,11 +82,11 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
}).setOptions(WoodManager.getAllPlankTypes().stream().<ItemStack>map(type -> type.getStack()).collect(Collectors.toList()));
}
});
new PageFruit(this.getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.natural", 0), true);
new PageFruit(this.getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.potential", 0), false);
new PageWood(this.getInfoPages(TreeMode.Wood), new DatabaseTab(ExtraTrees.instance, "wood.natural", 0));
new PagePlanksOverview(this.getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.overview", 0));
new PagePlanksTrees(this.getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.natural", 1));
new PageFruit(this.getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.natural", 0), true);
new PageFruit(this.getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.potential", 0), false);
new PageWood(this.getInfoPages(TreeMode.WOOD), new DatabaseTab(ExtraTrees.instance, "wood.natural", 0));
new PagePlanksOverview(this.getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.overview", 0));
new PagePlanksTrees(this.getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.natural", 1));
}
@Override
@@ -100,9 +100,9 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
}
enum TreeMode implements IDatabaseMode {
Fruit,
Wood,
Planks;
FRUIT,
WOOD,
PLANKS;
@Override
public String getName() {
@@ -41,7 +41,7 @@ public class WindowBrewery extends Window {
new ControlSlot.Builder(this, 105, 77).assign(BreweryMachine.SLOT_YEAST);
new ControlLiquidTank(this, 76, 32).setTankID(BreweryMachine.TANK_INPUT);
new ControlLiquidTank(this, 162, 32).setTankID(BreweryMachine.TANK_OUTPUT);
new ControlEnergyBar(this, 196, 32, 16, 60, Position.Bottom);
new ControlEnergyBar(this, 196, 32, 16, 60, Position.BOTTOM);
new ControlBreweryProgress(this, 110, 32);
new ControlSlotArray.Builder(this, this.getSize().x() / 2 - 81, 104, 9, 1).create(BreweryMachine.SLOTS_INVENTORY);
new ControlPlayerInventory(this);
@@ -41,7 +41,7 @@ public class WindowDistillery extends Window {
x += 64;
new ControlLiquidTank(this, x, 35).setTankID(DistilleryMachine.TANK_OUTPUT);
x += 34;
new ControlEnergyBar(this, x, 36, 60, 16, Position.Left);
new ControlEnergyBar(this, x, 36, 60, 16, Position.LEFT);
new ControlPlayerInventory(this);
new ControlErrorState(this, x + 21, 62);
}
@@ -27,14 +27,14 @@ public class WindowLepidopteristDatabase extends WindowAbstractDatabase {
@Override
protected void addTabs() {
new PageSpeciesOverview(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.overview", 0));
new PageSpeciesClassification(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.classification", 0));
new PageSpeciesImage(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.specimen", 0));
new PageSpeciesResultant(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.resultant", 0));
new PageSpeciesMutations(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.further", 0));
new PageBranchOverview(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.overview", 0));
new PageBranchSpecies(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.species", 0));
new PageBreeder(this.getInfoPages(Mode.Breeder), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "butterfly.breeder", 0));
new PageSpeciesOverview(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "butterfly.species.overview", 0));
new PageSpeciesClassification(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "butterfly.species.classification", 0));
new PageSpeciesImage(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "butterfly.species.specimen", 0));
new PageSpeciesResultant(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "butterfly.species.resultant", 0));
new PageSpeciesMutations(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "butterfly.species.further", 0));
new PageBranchOverview(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.overview", 0));
new PageBranchSpecies(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.species", 0));
new PageBreeder(this.getInfoPages(Mode.BREEDER), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "butterfly.breeder", 0));
}
@Override
@@ -41,7 +41,7 @@ public class WindowLumbermill extends Window {
new ControlSlot.Builder(this, 172, 58).assign(LumbermillMachine.SLOT_SAWDUST);
new ControlLumbermillProgress(this, 70, 43);
new ControlLiquidTank(this, 16, 32);
new ControlEnergyBar(this, 8, 112, 16, 60, Position.Bottom);
new ControlEnergyBar(this, 8, 112, 16, 60, Position.BOTTOM);
new ControlPlayerInventory(this);
new ControlErrorState(this, 95, 73);
}
@@ -42,7 +42,7 @@ public class WindowPress extends Window {
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
new ControlSlot.Builder(this, 24, 52).assign(FruitPressMachine.SLOT_FRUIT);
new ControlLiquidTank(this, 99, 32).setTankID(FruitPressMachine.TANK_OUTPUT);
new ControlEnergyBar(this, 154, 32, 16, 60, Position.Bottom);
new ControlEnergyBar(this, 154, 32, 16, 60, Position.BOTTOM);
new ControlPlayerInventory(this);
new ControlErrorState(this, 128, 54);
new ControlFruitPressProgress(this, 62, 24);
@@ -3,17 +3,17 @@ package binnie.genetics.core;
import binnie.core.gui.IBinnieGUID;
import binnie.craftgui.minecraft.Window;
import binnie.genetics.gui.WindowAnalyst;
import binnie.genetics.machine.craftgui.WindowAcclimatiser;
import binnie.genetics.machine.craftgui.WindowAnalyser;
import binnie.genetics.machine.acclimatiser.WindowAcclimatiser;
import binnie.genetics.machine.analyser.WindowAnalyser;
import binnie.genetics.machine.craftgui.WindowGeneBank;
import binnie.genetics.machine.craftgui.WindowGeneBankNEI;
import binnie.genetics.machine.craftgui.WindowGenepool;
import binnie.genetics.machine.craftgui.WindowIncubator;
import binnie.genetics.machine.craftgui.WindowInoculator;
import binnie.genetics.machine.craftgui.WindowIsolator;
import binnie.genetics.machine.craftgui.WindowPolymeriser;
import binnie.genetics.machine.craftgui.WindowSequencer;
import binnie.genetics.machine.craftgui.WindowSplicer;
import binnie.genetics.machine.genepool.WindowGenepool;
import binnie.genetics.machine.incubator.WindowIncubator;
import binnie.genetics.machine.inoculator.WindowInoculator;
import binnie.genetics.machine.isolator.WindowIsolator;
import binnie.genetics.machine.polymeriser.WindowPolymeriser;
import binnie.genetics.machine.sequencer.WindowSequencer;
import binnie.genetics.machine.splicer.WindowSplicer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntity;
@@ -16,17 +16,17 @@ public class AnalystPageAppearance extends ControlAnalystPage {
final IAlleleSpecies species = ind.getGenome().getPrimary();
new ControlTextCentered(this, y, "§nAppearance").setColour(this.getColour());
y += 12;
final ControlColourDisplay a = new ControlColourDisplay(this, this.w() / 2 - 28, y, ind.getGenome().getPrimaryColor());
final ControlColourDisplay a = new ControlColourDisplay(this, this.width() / 2 - 28, y, ind.getGenome().getPrimaryColor());
a.addTooltip("Primary Petal Colour");
final ControlColourDisplay b = new ControlColourDisplay(this, this.w() / 2 - 8, y, ind.getGenome().getSecondaryColor());
final ControlColourDisplay b = new ControlColourDisplay(this, this.width() / 2 - 8, y, ind.getGenome().getSecondaryColor());
b.addTooltip("Secondary Petal Colour");
final ControlColourDisplay c = new ControlColourDisplay(this, this.w() / 2 + 12, y, ind.getGenome().getStemColor());
final ControlColourDisplay c = new ControlColourDisplay(this, this.width() / 2 + 12, y, ind.getGenome().getStemColor());
c.addTooltip("Stem Colour");
y += 26;
final int sections = ind.getGenome().getType().getSections();
final int w = (sections > 1) ? 50 : 100;
// TODO fix this control icon display
new ControlIconDisplay(this, (this.w() - w) / 2, y - ((sections == 1) ? 0 : 0), null) {
new ControlIconDisplay(this, (this.width() - w) / 2, y - ((sections == 1) ? 0 : 0), null) {
@Override
public void onRenderForeground(int guiWidth, int guiHeight) {
// GlStateManager.pushMatrix();
@@ -40,8 +40,8 @@ public class AnalystPageBehaviour extends ControlAnalystPage {
if (!effect.getUID().contains("None")) {
final String effectDesc = BinnieCore.getBinnieProxy().localiseOrBlank("allele." + effect.getUID() + ".desc");
final String loc = effectDesc.equals("") ? ("Effect: " + effect.getName()) : effectDesc;
new ControlText(this, new IArea(4, y, this.w() - 8, 0), loc, TextJustification.TopCenter).setColour(this.getColour());
y += CraftGUI.render.textHeight(loc, this.w() - 8) + 1;
new ControlText(this, new IArea(4, y, this.width() - 8, 0), loc, TextJustification.TopCenter).setColour(this.getColour());
y += CraftGUI.render.textHeight(loc, this.width() - 8) + 1;
new ControlTextCentered(this, y, "§oWithin " + t.getX() / 2 + " blocks").setColour(this.getColour());
y += 22;
}
@@ -60,8 +60,8 @@ public class AnalystPageBehaviour extends ControlAnalystPage {
if (!effect2.getUID().contains("None")) {
final String effectDesc2 = BinnieCore.getBinnieProxy().localiseOrBlank("allele." + effect2.getUID() + ".desc");
final String loc2 = effectDesc2.equals("") ? ("Effect: " + effect2.getName()) : effectDesc2;
new ControlText(this, new IArea(4, y, this.w() - 8, 0), loc2, TextJustification.TopCenter).setColour(this.getColour());
y += CraftGUI.render.textHeight(loc2, this.w() - 8) + 1;
new ControlText(this, new IArea(4, y, this.width() - 8, 0), loc2, TextJustification.TopCenter).setColour(this.getColour());
y += CraftGUI.render.textHeight(loc2, this.width() - 8) + 1;
y += 22;
}
}
@@ -144,7 +144,7 @@ public class AnalystPageBiology extends ControlAnalystPage {
new ControlTextCentered(this, y, "§o" + (int) (floweringLifespan / pollinateTime) + " per lifetime").setColour(this.getColour());
y += 22;
}
this.setSize(new IPoint(this.w(), y));
this.setSize(new IPoint(this.width(), y));
}
private String getMCDayString(final float time) {
@@ -47,17 +47,17 @@ public class AnalystPageClimate extends ControlAnalystPage {
int y = 4;
new ControlTextCentered(this, y, "§nClimate").setColour(this.getColour());
y += 16;
new ControlText(this, new IArea(4, y, this.w() - 8, 14), "Temp. Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4, y, this.width() - 8, 14), "Temp. Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
this.createTemperatureBar(this, (this.w() - 100) / 2, y, 100, 10, temp, tempTol);
this.createTemperatureBar(this, (this.width() - 100) / 2, y, 100, 10, temp, tempTol);
y += 16;
if (!(ind instanceof IFlower)) {
new ControlText(this, new IArea(4, y, this.w() - 8, 14), "Humidity Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4, y, this.width() - 8, 14), "Humidity Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
this.createHumidity(this, (this.w() - 100) / 2, y, 100, 10, humid, humidTol);
this.createHumidity(this, (this.width() - 100) / 2, y, 100, 10, humid, humidTol);
y += 16;
}
new ControlText(this, new IArea(4, y, this.w() - 8, 14), "Biomes", TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4, y, this.width() - 8, 14), "Biomes", TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
final List<Biome> biomes = new ArrayList<>();
for (final Biome biome : Biome.EXPLORATION_BIOMES_LIST) { //TODO check
@@ -76,8 +76,8 @@ public class AnalystPageClimate extends ControlAnalystPage {
}
}
}
final int maxBiomePerLine = (this.w() + 2 - 16) / 18;
final int biomeListX = (this.w() - (Math.min(maxBiomePerLine, biomes.size()) * 18 - 2)) / 2;
final int maxBiomePerLine = (this.width() + 2 - 16) / 18;
final int biomeListX = (this.width() - (Math.min(maxBiomePerLine, biomes.size()) * 18 - 2)) / 2;
int dx = 0;
int dy = 0;
for (final Biome biome2 : biomes) {
@@ -88,7 +88,7 @@ public class AnalystPageClimate extends ControlAnalystPage {
dy += 18;
}
}
this.setSize(new IPoint(this.w(), y + dy + 18 + 8));
this.setSize(new IPoint(this.width(), y + dy + 18 + 8));
}
protected void createTemperatureBar(final IWidget parent, final int x, final int y, final int w, final int h, final EnumTemperature value, final EnumTolerance tol) {
@@ -48,7 +48,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
int y = 4;
new ControlTextCentered(this, y, "§nRegistry").setColour(this.getColour());
y += 16;
new ControlTextEdit(this, 20, y, this.w() - 40, 16) {
new ControlTextEdit(this, 20, y, this.width() - 40, 16) {
@Override
public void onTextEdit(final String value) {
final Collection<IAlleleSpecies> options = new ArrayList<>();
@@ -78,7 +78,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
}
};
y += 22;
new Panel(this, 3, y - 1, this.w() - 6, this.h() - y - 8 + 2, MinecraftGUI.PanelType.TabOutline).setColour(this.getColour());
new Panel(this, 3, y - 1, this.width() - 6, this.height() - y - 8 + 2, MinecraftGUI.PanelType.TabOutline).setColour(this.getColour());
final boolean textView = false;
final Collection<IAlleleSpecies> options = this.getSpecies(system);
for (final IAlleleSpecies species : options) {
@@ -89,7 +89,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
final String maturation = system.getAlleleName(EnumTreeChromosome.MATURATION, system.getIndividual(species.getUID()).getGenome().getActiveAllele(EnumTreeChromosome.MATURATION));
}
if (textView) {
this.scroll = new ControlListBox<IAlleleSpecies>(this, 4, y, this.w() - 8, this.h() - y - 8 - 20, 0) {
this.scroll = new ControlListBox<IAlleleSpecies>(this, 4, y, this.width() - 8, this.height() - y - 8 - 20, 0) {
@Override
public void initialise() {
super.initialise();
@@ -98,7 +98,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
@Override
public IWidget createOption(final IAlleleSpecies v, final int y) {
return new Control(this.getContent(), 0, y, this.w(), 12) {
return new Control(this.getContent(), 0, y, this.width(), 12) {
IAlleleSpecies value = v;
@Override
@@ -110,10 +110,10 @@ public class AnalystPageDatabase extends ControlAnalystPage {
}
};
} else {
this.scroll = new ControlScrollableContent(this, 4, y, this.w() - 8, this.h() - y - 8, 0);
this.scroll = new ControlScrollableContent(this, 4, y, this.width() - 8, this.height() - y - 8, 0);
this.scroll.setScrollableContent(this.getItemScrollList(system, options));
}
new ControlScrollBar(this, this.scroll.x() + this.scroll.w() - 6, this.scroll.y() + 3, 3, this.scroll.h() - 6, this.scroll) {
new ControlScrollBar(this, this.scroll.xPos() + this.scroll.width() - 6, this.scroll.yPos() + 3, 3, this.scroll.height() - 6, this.scroll) {
@Override
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
@@ -127,11 +127,11 @@ public class AnalystPageDatabase extends ControlAnalystPage {
}
private IWidget getItemScrollList(final BreedingSystem system, final Collection<IAlleleSpecies> options) {
return new Control(this.scroll, 0, 0, this.scroll.w(), this.scroll.h()) {
return new Control(this.scroll, 0, 0, this.scroll.width(), this.scroll.height()) {
@Override
public void initialise() {
final int maxBiomePerLine = (this.w() - 4 + 2) / 18;
final int biomeListX = -6 + (this.w() - (maxBiomePerLine * 18 - 2)) / 2;
final int maxBiomePerLine = (this.width() - 4 + 2) / 18;
final int biomeListX = -6 + (this.width() - (maxBiomePerLine * 18 - 2)) / 2;
int dx = 0;
int dy = 0;
for (final IAlleleSpecies species : options) {
@@ -171,7 +171,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
dy += 18;
}
}
this.setSize(new IPoint(this.w(), 4 + dy + 18));
this.setSize(new IPoint(this.width(), 4 + dy + 18));
}
};
}
@@ -55,16 +55,16 @@ public class AnalystPageDescription extends ControlAnalystPage {
new ControlTextCentered(this, y, "§o" + branchBinomial + " " + species.getBinomial() + "§r").setColour(this.getColour());
y += 20;
new ControlTextCentered(this, y, "Discovered by §l" + authority + "§r").setColour(this.getColour());
y += (int) (3.0f + CraftGUI.render.textHeight("Discovered by §l" + authority + "§r", this.w()));
y += (int) (3.0f + CraftGUI.render.textHeight("Discovered by §l" + authority + "§r", this.width()));
new ControlTextCentered(this, y, "Genetic Complexity: " + species.getComplexity()).setColour(this.getColour());
y += 26;
final ControlText descText = new ControlText(this, new IArea(8, y, this.w() - 16, 0), descBody + "§r", TextJustification.TopCenter);
final IWidget signatureText = new ControlText(this, new IArea(8, y, this.w() - 16, 0), descSig + "§r", TextJustification.BottomRight);
final ControlText descText = new ControlText(this, new IArea(8, y, this.width() - 16, 0), descBody + "§r", TextJustification.TopCenter);
final IWidget signatureText = new ControlText(this, new IArea(8, y, this.width() - 16, 0), descSig + "§r", TextJustification.BottomRight);
descText.setColour(this.getColour());
signatureText.setColour(this.getColour());
final int descHeight = CraftGUI.render.textHeight(descText.getValue(), descText.getSize().x());
signatureText.setPosition(new IPoint(signatureText.pos().x(), descText.getPosition().y() + descHeight + 10));
this.setSize(new IPoint(this.w(), 20 + signatureText.y()));
this.setSize(new IPoint(this.width(), 20 + signatureText.yPos()));
}
@Override
@@ -57,7 +57,7 @@ public class AnalystPageFruit extends AnalystPageProduce {
final int w = products.size() * 18 - 2;
final int i = 0;
for (final ItemStack stack : products) {
final ControlItemDisplay d = new ControlItemDisplay(this, (this.w() - w) / 2 + 18 * i, y);
final ControlItemDisplay d = new ControlItemDisplay(this, (this.width() - w) / 2 + 18 * i, y);
d.setTooltip();
d.setItemStack(stack);
}
@@ -69,7 +69,7 @@ public class AnalystPageFruit extends AnalystPageProduce {
final int w = products.size() * 18 - 2;
final int i = 0;
for (final ItemStack stack : specialties) {
final ControlItemDisplay d = new ControlItemDisplay(this, (this.w() - w) / 2 + 18 * i, y);
final ControlItemDisplay d = new ControlItemDisplay(this, (this.width() - w) / 2 + 18 * i, y);
d.setTooltip();
d.setItemStack(stack);
}
@@ -125,7 +125,7 @@ public class AnalystPageFruit extends AnalystPageProduce {
y = this.getRefined("§o" + fam.getName(), y, stacks);
y += 2;
}
this.setSize(new IPoint(this.w(), y + 8));
this.setSize(new IPoint(this.width(), y + 8));
}
@Override
@@ -50,12 +50,12 @@ public class AnalystPageGenome extends ControlAnalystPage {
for (final IChromosomeType chromo : system.getActiveKaryotype()) {
final IAllele allele = active ? ind.getGenome().getActiveAllele(chromo) : ind.getGenome().getInactiveAllele(chromo);
final String alleleName = system.getAlleleName(chromo, allele);
final int height = CraftGUI.render.textHeight(alleleName, this.w() / 2 - 2);
new ControlText(scaled, new IArea(0, y + (height - 9) / 2, this.w() / 2 - 2, 0), system.getChromosomeShortName(chromo) + " :", TextJustification.TopRight).setColour(this.getColour());
new ControlText(scaled, new IArea(this.w() / 2 + 2, y, this.w() / 2 - 2, 0), alleleName, TextJustification.TopLeft).setColour(this.getColour());
final int height = CraftGUI.render.textHeight(alleleName, this.width() / 2 - 2);
new ControlText(scaled, new IArea(0, y + (height - 9) / 2, this.width() / 2 - 2, 0), system.getChromosomeShortName(chromo) + " :", TextJustification.TopRight).setColour(this.getColour());
new ControlText(scaled, new IArea(this.width() / 2 + 2, y, this.width() / 2 - 2, 0), alleleName, TextJustification.TopLeft).setColour(this.getColour());
y += 3 + height;
}
this.setSize(new IPoint(this.w(), y + 8));
this.setSize(new IPoint(this.width(), y + 8));
}
@Override
@@ -20,8 +20,8 @@ public class AnalystPageKaryogram extends ControlAnalystPage {
y += 8;
final ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(ind);
final BreedingSystem system = Binnie.GENETICS.getSystem(root);
final int maxBiomePerLine = (int) ((this.w() + 4.0f - 16.0f) / 22.0f);
int karygramX = (this.w() - (Math.min(maxBiomePerLine, system.getActiveKaryotype().size()) * 18 - 4)) / 2;
final int maxBiomePerLine = (int) ((this.width() + 4.0f - 16.0f) / 22.0f);
int karygramX = (this.width() - (Math.min(maxBiomePerLine, system.getActiveKaryotype().size()) * 18 - 4)) / 2;
int dx = 0;
int dy = 0;
int rem = system.getActiveKaryotype().size();
@@ -90,7 +90,7 @@ public class AnalystPageMutations extends ControlAnalystPage {
} else if (hive != null) {
new ControlTextCentered(this, y, "Natural Habitat").setColour(this.getColour());
y += 10;
final ControlItemDisplay display = new ControlItemDisplay(this, (this.w() - 16) / 2, y);
final ControlItemDisplay display = new ControlItemDisplay(this, (this.width() - 16) / 2, y);
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Steadfast.getAllele()) {
display.addTooltip("Dungeon Chests");
} else {
@@ -100,11 +100,11 @@ public class AnalystPageMutations extends ControlAnalystPage {
y += 24;
}
}
int ox = (this.w() - 88 - 8) / 2;
int ox = (this.width() - 88 - 8) / 2;
int dx = 0;
if (!resultant.isEmpty()) {
if (resultant.size() == 1) {
ox = (this.w() - 44) / 2;
ox = (this.width() - 44) / 2;
}
new ControlTextCentered(this, y, "Resultant Mutations").setColour(this.getColour());
y += 10;
@@ -157,11 +157,11 @@ public class AnalystPageMutations extends ControlAnalystPage {
}
y += 10;
}
ox = (this.w() - 88 - 8) / 2;
ox = (this.width() - 88 - 8) / 2;
dx = 0;
if (!further.isEmpty()) {
if (further.size() == 1) {
ox = (this.w() - 44) / 2;
ox = (this.width() - 44) / 2;
}
new ControlTextCentered(this, y, "Further Mutations").setColour(this.getColour());
y += 10;
@@ -217,7 +217,7 @@ public class AnalystPageMutations extends ControlAnalystPage {
}
}
y += 8;
this.setSize(new IPoint(this.w(), y));
this.setSize(new IPoint(this.width(), y));
}
private boolean isKnown(final BreedingSystem system, final IMutation mutation) {
@@ -195,8 +195,8 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
protected int getRefined(final String string, int y, final Collection<ItemStack> products) {
new ControlTextCentered(this, y, string).setColour(this.getColour());
y += 10;
final int maxBiomePerLine = (this.w() + 2 - 16) / 18;
final int biomeListX = (this.w() - (Math.min(maxBiomePerLine, products.size()) * 18 - 2)) / 2;
final int maxBiomePerLine = (this.width() + 2 - 16) / 18;
final int biomeListX = (this.width() - (Math.min(maxBiomePerLine, products.size()) * 18 - 2)) / 2;
int dx = 0;
int dy = 0;
for (final ItemStack soilStack : products) {
@@ -101,8 +101,8 @@ public class AnalystPageProducts extends AnalystPageProduce {
}
}
}
final int maxBiomePerLine = (int) ((this.w() + 2.0f - 16.0f) / 18.0f);
final int biomeListX = (this.w() - (Math.min(maxBiomePerLine, allFluids.size() + refinedProducts.size()) * 18 - 2)) / 2;
final int maxBiomePerLine = (int) ((this.width() + 2.0f - 16.0f) / 18.0f);
final int biomeListX = (this.width() - (Math.min(maxBiomePerLine, allFluids.size() + refinedProducts.size()) * 18 - 2)) / 2;
int dx = 0;
int dy = 0;
for (final ItemStack soilStack : refinedProducts) {
@@ -132,7 +132,7 @@ public class AnalystPageProducts extends AnalystPageProduce {
}
dx += 18;
}
this.setSize(new IPoint(this.w(), y + dy + 18 + 8));
this.setSize(new IPoint(this.width(), y + dy + 18 + 8));
}
@Nullable
@@ -32,15 +32,15 @@ public class AnalystPageSoil extends ControlAnalystPage {
int y = 4;
new ControlTextCentered(this, y, TextFormatting.UNDERLINE + getTitle()).setColour(this.getColour());
y += 16;
new ControlText(this, new IArea(4, y, this.w() - 8, 14), Genetics.proxy.localise("gui.analyst.soil.tolerance.moisture"), TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4, y, this.width() - 8, 14), Genetics.proxy.localise("gui.analyst.soil.tolerance.moisture"), TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
this.createMoisture(this, (this.w() - 100) / 2, y, 100, 10, moisture, moistureTol);
this.createMoisture(this, (this.width() - 100) / 2, y, 100, 10, moisture, moistureTol);
y += 16;
new ControlText(this, new IArea(4, y, this.w() - 8, 14), Genetics.proxy.localise("gui.analyst.soil.tolerance.ph"), TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4, y, this.width() - 8, 14), Genetics.proxy.localise("gui.analyst.soil.tolerance.ph"), TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
this.createAcidity(this, (this.w() - 100) / 2, y, 100, 10, pH, pHTol);
this.createAcidity(this, (this.width() - 100) / 2, y, 100, 10, pH, pHTol);
y += 16;
new ControlText(this, new IArea(4, y, this.w() - 8, 14), Genetics.proxy.localise("gui.analyst.soil.recommended"), TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4, y, this.width() - 8, 14), Genetics.proxy.localise("gui.analyst.soil.recommended"), TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
EnumMoisture recomMoisture = EnumMoisture.Normal;
final boolean canTolNormal = Tolerance.canTolerate(moisture, EnumMoisture.Normal, moistureTol);
@@ -79,11 +79,11 @@ public class AnalystPageSoil extends ControlAnalystPage {
}
}
final ItemStack stack = new ItemStack(Botany.soil, 1, BlockSoil.getMeta(recomPH, recomMoisture));
final ControlItemDisplay recomSoil = new ControlItemDisplay(this, (this.w() - 24) / 2, y, 24);
final ControlItemDisplay recomSoil = new ControlItemDisplay(this, (this.width() - 24) / 2, y, 24);
recomSoil.setItemStack(stack);
recomSoil.setTooltip();
y += 32;
new ControlText(this, new IArea(4, y, this.w() - 8, 14), Genetics.proxy.localise("gui.analyst.soil.other"), TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4, y, this.width() - 8, 14), Genetics.proxy.localise("gui.analyst.soil.other"), TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
final List<ItemStack> stacks = new ArrayList<>();
for (final EnumAcidity a : EnumSet.range(EnumAcidity.Acid, EnumAcidity.Alkaline)) {
@@ -94,7 +94,7 @@ public class AnalystPageSoil extends ControlAnalystPage {
}
}
final int soilListWidth = 17 * stacks.size() - 1;
final int soilListX = (this.w() - soilListWidth) / 2;
final int soilListX = (this.width() - soilListWidth) / 2;
int t = 0;
for (final ItemStack soilStack : stacks) {
final ControlItemDisplay display = new ControlItemDisplay(this, soilListX + 17 * t++, y);
@@ -14,8 +14,8 @@ public class AnalystPageSpecimen extends ControlAnalystPage {
int y = 4;
new ControlTextCentered(this, y, TextFormatting.UNDERLINE + getTitle()).setColour(this.getColour());
y += 12;
final int w = Math.round((this.w() - 16) * ind.getSize());
new ControlIndividualDisplay(this, (this.w() - w) / 2, y + (this.w() - w) / 2, w, ind);
final int w = Math.round((this.width() - 16) * ind.getSize());
new ControlIndividualDisplay(this, (this.width() - w) / 2, y + (this.width() - w) / 2, w, ind);
}
@Override
@@ -46,7 +46,7 @@ public class AnalystPageWood extends AnalystPageProduce {
final int w = products.size() * 18 - 2;
final int i = 0;
for (final ItemStack stack : products) {
final ControlItemDisplay d = new ControlItemDisplay(this, (this.w() - w) / 2 + 18 * i, y);
final ControlItemDisplay d = new ControlItemDisplay(this, (this.width() - w) / 2 + 18 * i, y);
d.setTooltip();
d.setItemStack(stack);
}
@@ -66,7 +66,7 @@ public class AnalystPageWood extends AnalystPageProduce {
new ControlTextCentered(this, y, "This tree has no \nfruits or nuts").setColour(this.getColour());
y += 28;
}
this.setSize(new IPoint(this.w(), y + 8));
this.setSize(new IPoint(this.width(), y + 8));
}
@Override
@@ -52,12 +52,12 @@ public abstract class ControlToleranceBar<T extends Enum<T>> extends Control imp
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
RenderUtil.drawGradientRect(this.getArea(), -1431655766, -1431655766);
final int w = this.getArea().w() / this.fullSet.size();
final int w = this.getArea().width() / this.fullSet.size();
int t = 0;
for (final T value : this.fullSet) {
final int col = (this.tolerated.contains(value) ? -16777216 : 855638016) + this.getColour(value);
final IBorder inset = new IBorder(this.tolerated.contains(value) ? 1 : 3);
RenderUtil.drawGradientRect(new IArea(w * t, 0, w, this.h()).inset(inset), col, col);
RenderUtil.drawGradientRect(new IArea(w * t, 0, w, this.height()).inset(inset), col, col);
++t;
}
}
@@ -180,7 +180,7 @@ public class WindowAnalyst extends Window {
x += 26;
this.setupValidators();
}
this.tabBar = new Control(this, x, 28, this.w() - 16 - x, 20);
this.tabBar = new Control(this, x, 28, this.width() - 16 - x, 20);
this.analystPanel = new Panel(this, 16, 54, 280, 164, MinecraftGUI.PanelType.Outline) {
@Override
@SideOnly(Side.CLIENT)
@@ -192,8 +192,8 @@ public class WindowAnalyst extends Window {
@Override
public void initialise() {
this.setColour(4473924);
final int sectionWidth = (this.w() - 8 - 4) / 2;
WindowAnalyst.this.leftPage = new ControlScrollableContent<IWidget>(this, 3, 3, sectionWidth + 2, this.h() - 8 + 2, 0) {
final int sectionWidth = (this.width() - 8 - 4) / 2;
WindowAnalyst.this.leftPage = new ControlScrollableContent<IWidget>(this, 3, 3, sectionWidth + 2, this.height() - 8 + 2, 0) {
@Override
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
@@ -204,7 +204,7 @@ public class WindowAnalyst extends Window {
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea());
}
};
new ControlScrollBar(this, sectionWidth + 2 - 3, 6, 3, this.h() - 8 + 2 - 6, WindowAnalyst.this.leftPage) {
new ControlScrollBar(this, sectionWidth + 2 - 3, 6, 3, this.height() - 8 + 2 - 6, WindowAnalyst.this.leftPage) {
@Override
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
@@ -218,7 +218,7 @@ public class WindowAnalyst extends Window {
RenderUtil.drawSolidRect(this.getRenderArea(), WindowAnalyst.this.leftPage.getContent().getColour());
}
};
WindowAnalyst.this.rightPage = new ControlScrollableContent<IWidget>(this, 3 + sectionWidth + 4, 3, sectionWidth + 2, this.h() - 8 + 2, 0) {
WindowAnalyst.this.rightPage = new ControlScrollableContent<IWidget>(this, 3 + sectionWidth + 4, 3, sectionWidth + 2, this.height() - 8 + 2, 0) {
@Override
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
@@ -229,7 +229,7 @@ public class WindowAnalyst extends Window {
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea());
}
};
new ControlScrollBar(this, sectionWidth + 2 - 3 + sectionWidth + 4, 6, 3, this.h() - 8 + 2 - 6, WindowAnalyst.this.rightPage) {
new ControlScrollBar(this, sectionWidth + 2 - 3 + sectionWidth + 4, 6, 3, this.height() - 8 + 2 - 6, WindowAnalyst.this.rightPage) {
@Override
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
@@ -243,11 +243,11 @@ public class WindowAnalyst extends Window {
RenderUtil.drawSolidRect(this.getRenderArea(), WindowAnalyst.this.rightPage.getContent().getColour());
}
};
WindowAnalyst.this.analystPageSize = new IArea(1, 1, sectionWidth, this.h() - 8);
WindowAnalyst.this.analystPageSize = new IArea(1, 1, sectionWidth, this.height() - 8);
}
};
if (!this.isDatabase) {
this.slideUpInv = new ControlSlide(this, (this.getSize().x() - 244) / 2, this.getSize().y() - 80 + 1, 244, 80, Position.Bottom);
this.slideUpInv = new ControlSlide(this, (this.getSize().x() - 244) / 2, this.getSize().y() - 80 + 1, 244, 80, Position.BOTTOM);
new ControlPlayerInventory(this.slideUpInv, true);
this.slideUpInv.setSlide(false);
}
@@ -263,7 +263,7 @@ public class WindowAnalyst extends Window {
}
});
if (!this.isDatabase) {
this.analystNone = new Control(this.analystPanel, 0, 0, this.analystPanel.w(), this.analystPanel.h()) {
this.analystNone = new Control(this.analystPanel, 0, 0, this.analystPanel.width(), this.analystPanel.height()) {
@Override
public void initialise() {
new ControlTextCentered(this, 20, "Add a bee, tree, flower or butterfly to the top left slot. DNA Dye is required if it has not been analysed yet. This dye can also convert vanilla items to breedable individuals.").setColour(4473924);
@@ -355,10 +355,10 @@ public class WindowAnalyst extends Window {
this.analystPages.add(new AnalystPageMutations(this.analystPanel, this.analystPageSize, this.current, this.isMaster));
}
this.tabBar.deleteAllChildren();
final int width = this.tabBar.w() / this.analystPages.size();
final int width = this.tabBar.width() / this.analystPages.size();
int x = 0;
for (final ControlAnalystPage page : this.analystPages) {
new ControlTooltip(this.tabBar, x, 0, width, this.tabBar.h()) {
new ControlTooltip(this.tabBar, x, 0, width, this.tabBar.height()) {
ControlAnalystPage value;
@Override
@@ -1,4 +1,4 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.acclimatiser;
import binnie.core.AbstractMod;
import binnie.craftgui.core.geometry.Position;
@@ -11,7 +11,7 @@ import binnie.craftgui.resource.Texture;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.genetics.machine.acclimatiser.Acclimatiser;
import binnie.genetics.machine.craftgui.WindowMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
@@ -20,10 +20,6 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class WindowAcclimatiser extends WindowMachine {
static Texture ProgressBase = new StandardTexture(64, 0, 130, 21, ExtraBeeTexture.GUIProgress);
static Texture Progress = new StandardTexture(64, 21, 130, 21, ExtraBeeTexture.GUIProgress);
public static final int[] slotReserve = new int[]{0, 1, 2, 3};
public static final int slotTarget = 4;
public static final int[] slotAcclimatiser = new int[]{5, 6, 7};
public static final int[] slotDone = new int[]{8, 9, 10, 11};
public WindowAcclimatiser(final EntityPlayer player, final IInventory inventory, final Side side) {
super(280, 198, player, inventory, side);
@@ -41,7 +37,7 @@ public class WindowAcclimatiser extends WindowMachine {
new ControlSlotArray.Builder(this, x, y + 18 + 18, 3, 1).create(Acclimatiser.SLOT_ACCLIMATISER);
x += 72;
new ControlSlotArray.Builder(this, x, y, 2, 2).create(Acclimatiser.SLOT_DRONE);
new ControlEnergyBar(this, 21, 115, 16, 60, Position.Bottom);
new ControlEnergyBar(this, 21, 115, 16, 60, Position.BOTTOM);
new ControlErrorState(this, 181, 83);
new ControlPlayerInventory(this);
}
@@ -1,4 +1,4 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.analyser;
import binnie.core.AbstractMod;
import binnie.craftgui.core.geometry.Position;
@@ -18,7 +18,7 @@ import binnie.craftgui.window.Panel;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.machine.analyser.Analyser;
import binnie.genetics.machine.craftgui.WindowMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
@@ -44,15 +44,15 @@ public class WindowAnalyser extends WindowMachine {
x += 28;
new ControlSlot.Builder(this, x, y + 54 + 8).assign(13);
new ControlSlotCharge(this, x + 20, y + 54 + 8, 13).setColour(10040319);
new ControlEnergyBar(this, x + 24 + 16, y + 54 + 8 + 1, 60, 16, Position.Left);
new ControlEnergyBar(this, x + 24 + 16, y + 54 + 8 + 1, 60, 16, Position.LEFT);
new ControlErrorState(this, x + 24 + 16 + 60 + 16, y + 54 + 8 + 1);
x -= 28;
new ControlIconDisplay(this, x + 36 + 2, y + 18, GUIIcon.ArrowRight.getIcon().getResourceLocation());
new ControlIconDisplay(this, x + 36 + 2, y + 18, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation());
x += 56;
new Panel(this, x, y, 76, 50, MinecraftGUI.PanelType.Tinted);
new ControlProgress(this, x + 5, y + 5, WindowAnalyser.ProgressBase, WindowAnalyser.Progress, Position.Left);
new ControlProgress(this, x + 5, y + 5, WindowAnalyser.ProgressBase, WindowAnalyser.Progress, Position.LEFT);
new ControlSlot.Builder(this, x + 38 - 9, y + 25 - 9).assign(6);
new ControlIconDisplay(this, x + 76 + 2, y + 18, GUIIcon.ArrowRight.getIcon().getResourceLocation());
new ControlIconDisplay(this, x + 76 + 2, y + 18, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation());
x += 96;
new ControlSlotArray.Builder(this, x, y, 2, 3).create(Analyser.SLOT_FINISHED);
x += 52;
@@ -18,7 +18,9 @@ public class ControlProcessTemporary extends ControlMachineProgress {
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
RenderUtil.drawSolidRect(this.getArea(), -4868683);
final int w = Math.round(this.getSize().y() * this.progress / 100.0f);
RenderUtil.drawSolidRect(new IArea(this.getArea().x(), this.getArea().y(), w, this.getArea().h()), -65536);
final int width = Math.round(this.getSize().y() * this.progress / 100.0f);
IArea area = new IArea(getArea());
area.setWidth(width);
RenderUtil.drawSolidRect(area, -65536);
}
}
@@ -111,7 +111,7 @@ public class WindowGeneBank extends WindowMachine {
this.genes = new ControlGeneScroll(scroll, 1, 1, geneBoxWidth, 116);
scroll.setScrollableContent(this.genes);
this.genes.setGenes(Binnie.GENETICS.beeBreedingSystem);
final ControlTabBar<BreedingSystem> tabBar = new ControlTabBar<BreedingSystem>(this, boxX, 32, 24, 120, Position.Left, Binnie.GENETICS.getActiveSystems()) {
final ControlTabBar<BreedingSystem> tabBar = new ControlTabBar<BreedingSystem>(this, boxX, 32, 24, 120, Position.LEFT, Binnie.GENETICS.getActiveSystems()) {
@Override
public ControlTab<BreedingSystem> createTab(final int x, final int y, final int w, final int h, final BreedingSystem value) {
return new ControlTabIcon<BreedingSystem>(this, x, y, w, h, value) {
@@ -138,7 +138,7 @@ public class WindowGeneBank extends WindowMachine {
};
tabBar.setValue(Binnie.GENETICS.beeBreedingSystem);
boxX -= 8;
final ControlTabBar<String> infoTabs = new ControlTabBar<>(this, boxX + 8, 160, 16, 50, Position.Left, Arrays.asList("Info", "Stats", "Ranking"));
final ControlTabBar<String> infoTabs = new ControlTabBar<>(this, boxX + 8, 160, 16, 50, Position.LEFT, Arrays.asList("Info", "Stats", "Ranking"));
final Panel panelProject = new Panel(this, boxX + 24, 160, geneBoxWidth + 20, 50, MinecraftGUI.PanelType.Black);
int totalGenes = 0;
int seqGenes = 0;
@@ -1,4 +1,4 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.genepool;
import binnie.core.AbstractMod;
import binnie.craftgui.core.geometry.Position;
@@ -16,7 +16,7 @@ import binnie.craftgui.resource.Texture;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.genetics.machine.genepool.Genepool;
import binnie.genetics.machine.craftgui.WindowMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
@@ -40,14 +40,14 @@ public class WindowGenepool extends WindowMachine {
x += 26;
new ControlSlotArray.Builder(this, x, y + 3, 2, 3).create(Genepool.SLOT_RESERVE);
x += 38;
new ControlIconDisplay(this, x, y + 3 + 18 + 1, GUIIcon.ArrowRight.getIcon().getResourceLocation());
new ControlIconDisplay(this, x, y + 3 + 18 + 1, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation());
x += 18;
new ControlSlot.Builder(this, x, y + 3 + 18).assign(0);
x += 18;
new ControlMachineProgress(this, x, y + 19, WindowGenepool.ProgressBase, WindowGenepool.Progress, Position.Left);
new ControlMachineProgress(this, x, y + 19, WindowGenepool.ProgressBase, WindowGenepool.Progress, Position.LEFT);
x += 130;
new ControlLiquidTank(this, x, y).setTankID(0);
new ControlEnergyBar(this, 21, 115, 16, 60, Position.Bottom);
new ControlEnergyBar(this, 21, 115, 16, 60, Position.BOTTOM);
new ControlSlot.Builder(this, 121, 82).assign(7);
new ControlSlotCharge(this, 143, 82, 7).setColour(15722671);
new ControlErrorState(this, 181, 83);
@@ -1,4 +1,4 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.incubator;
import binnie.core.AbstractMod;
import binnie.craftgui.core.geometry.Position;
@@ -15,7 +15,7 @@ import binnie.craftgui.resource.Texture;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.genetics.Genetics;
import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.machine.incubator.Incubator;
import binnie.genetics.machine.craftgui.WindowMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
@@ -39,18 +39,18 @@ public class WindowIncubator extends WindowMachine {
x += 26;
new ControlSlotArray.Builder(this, x, y + 3, 1, 3).create(Incubator.SLOT_QUEUE);
x += 20;
new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ArrowRight.getIcon().getResourceLocation());
new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation());
x += 18;
new ControlMachineProgress(this, x, y + 6, WindowIncubator.ProgressBase, WindowIncubator.Progress, Position.Left);
new ControlMachineProgress(this, x, y + 6, WindowIncubator.ProgressBase, WindowIncubator.Progress, Position.LEFT);
new ControlSlot.Builder(this, x + 11, y + 3 + 10).assign(3);
x += 40;
new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ArrowRight.getIcon().getResourceLocation());
new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation());
x += 18;
new ControlSlotArray.Builder(this, x, y + 3, 1, 3).create(Incubator.SLOT_OUTPUT);
x += 26;
new ControlLiquidTank(this, x, y).setTankID(1);
x += 34;
new ControlEnergyBar(this, x, y + 3, 16, 54, Position.Bottom);
new ControlEnergyBar(this, x, y + 3, 16, 54, Position.BOTTOM);
new ControlErrorState(this, 91, 82);
new ControlPlayerInventory(this);
}
@@ -1,4 +1,4 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.inoculator;
import binnie.core.AbstractMod;
import binnie.craftgui.core.geometry.CraftGUIUtil;
@@ -17,7 +17,7 @@ import binnie.craftgui.resource.Texture;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.genetics.Genetics;
import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.machine.inoculator.Inoculator;
import binnie.genetics.machine.craftgui.WindowMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
@@ -40,23 +40,23 @@ public class WindowInoculator extends WindowMachine {
new ControlLiquidTank(this, x, y + 18 + 16).setTankID(0);
CraftGUIUtil.horizontalGrid(x, y,
new ControlSlotArray.Builder(this, 0, 0, 2, 1).create(Inoculator.SLOT_SERUM_RESERVE),
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowRight.getIcon().getResourceLocation()),
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
new ControlSlot.Builder(this, 0, 0).assign(0),
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowRight.getIcon().getResourceLocation()),
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
new ControlSlotArray.Builder(this, 0, 0, 2, 1).create(Inoculator.SLOT_SERUM_EXPENDED)
);
x += 18;
new ControlMachineProgress(this, x, y + 24, WindowInoculator.ProgressBase, WindowInoculator.Progress, Position.Left);
new ControlEnergyBar(this, 91, 118, 60, 16, Position.Left);
new ControlMachineProgress(this, x, y + 24, WindowInoculator.ProgressBase, WindowInoculator.Progress, Position.LEFT);
new ControlEnergyBar(this, 91, 118, 60, 16, Position.LEFT);
new ControlErrorState(this, 161, 118);
x += 142;
CraftGUIUtil.verticalGrid(x, y, TextJustification.MiddleLeft, 8,
CraftGUIUtil.verticalGrid(x, y, TextJustification.MIDDLE_LEFTt, 8,
new ControlSlotArray.Builder(this, x, y, 4, 1).create(Inoculator.SLOT_RESERVE),
new ControlSlot.Builder(this, x, y + 18 + 8).assign(9),
new ControlSlotArray.Builder(this, x, y + 18 + 8 + 18 + 8, 4, 1).create(Inoculator.SLOT_FINISHED)
);
new ControlIconDisplay(this, x + 18, y + 18 + 2, GUIIcon.ArrowUpLeft.getIcon().getResourceLocation());
new ControlIconDisplay(this, x + 18, y + 18 + 18, GUIIcon.ArrowLeftDown.getIcon().getResourceLocation());
new ControlIconDisplay(this, x + 18, y + 18 + 2, GUIIcon.ARROW_UP_LEFT.getIcon().getResourceLocation());
new ControlIconDisplay(this, x + 18, y + 18 + 18, GUIIcon.ARROW_LEFT_DOWN.getIcon().getResourceLocation());
new ControlPlayerInventory(this);
}
@@ -1,4 +1,4 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.isolator;
import binnie.core.AbstractMod;
import binnie.craftgui.core.geometry.Position;
@@ -16,7 +16,7 @@ import binnie.craftgui.resource.Texture;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.genetics.machine.isolator.Isolator;
import binnie.genetics.machine.craftgui.WindowMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
@@ -40,22 +40,22 @@ public class WindowIsolator extends WindowMachine {
x += 26;
new ControlSlotArray.Builder(this, x, y + 3, 1, 3).create(Isolator.SLOT_RESERVE);
x += 20;
new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ArrowRight.getIcon().getResourceLocation());
new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation());
x += 18;
new ControlSlot.Builder(this, x, y + 3).assign(5);
new ControlSlot.Builder(this, x, y + 36 + 3).assign(0);
new ControlSlotCharge(this, x + 18 + 2, y + 36 + 3, 0).setColour(15722671);
x += 18;
new ControlProgress(this, x, y + 3, WindowIsolator.ProgressBase, WindowIsolator.Progress, Position.Left);
new ControlProgress(this, x, y + 3, WindowIsolator.ProgressBase, WindowIsolator.Progress, Position.LEFT);
x += 142;
new ControlSlot.Builder(this, x, y + 3).assign(6);
new ControlSlot.Builder(this, x, y + 3 + 36).assign(1);
new ControlIconDisplay(this, x + 1, y + 3 + 19, GUIIcon.ArrowUp.getIcon().getResourceLocation());
new ControlIconDisplay(this, x + 1, y + 3 + 19, GUIIcon.ARROW_UP.getIcon().getResourceLocation());
x += 20;
new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ArrowRight.getIcon().getResourceLocation());
new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation());
x += 18;
new ControlSlotArray.Builder(this, x, y + 3, 2, 3).create(Isolator.SLOT_FINISHED);
new ControlEnergyBar(this, 260, 130, 16, 60, Position.Bottom);
new ControlEnergyBar(this, 260, 130, 16, 60, Position.BOTTOM);
new ControlErrorState(this, 153, 81);
new ControlPlayerInventory(this);
}
@@ -1,4 +1,4 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.polymeriser;
import binnie.core.AbstractMod;
import binnie.craftgui.core.geometry.Position;
@@ -16,7 +16,7 @@ import binnie.craftgui.resource.Texture;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.genetics.Genetics;
import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.machine.polymeriser.Polymeriser;
import binnie.genetics.machine.craftgui.WindowMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
@@ -37,13 +37,13 @@ public class WindowPolymeriser extends WindowMachine {
int x = 16;
final int y = 38;
new ControlSlotArray.Builder(this, x, y, 1, 4).create(Polymeriser.SLOT_SERUM_RESERVE);
new ControlIconDisplay(this, x + 18, y + 1, GUIIcon.ArrowRight.getIcon().getResourceLocation());
new ControlIconDisplay(this, x + 18, y + 1, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation());
x += 34;
new ControlMachineProgress(this, x + 18, y - 6, WindowPolymeriser.ProgressBase, WindowPolymeriser.Progress, Position.Left);
new ControlMachineProgress(this, x + 18, y - 6, WindowPolymeriser.ProgressBase, WindowPolymeriser.Progress, Position.LEFT);
new ControlSlot.Builder(this, x, y).assign(0);
new ControlLiquidTank(this, x, y + 18 + 16, true).setTankID(0);
new ControlLiquidTank(this, x, y + 18 + 16 + 18 + 8, true).setTankID(1);
new ControlEnergyBar(this, x + 120, 96, 64, 16, Position.Left);
new ControlEnergyBar(this, x + 120, 96, 64, 16, Position.LEFT);
x += 40;
new ControlSlot.Builder(this, x + 30, y + 18 + 8).assign(1);
new ControlSlotCharge(this, x + 30 + 20, y + 18 + 8, 1).setColour(16766976);
@@ -1,6 +1,8 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.sequencer;
import binnie.core.machines.IMachine;
import binnie.core.machines.Machine;
import binnie.core.machines.MachineUtil;
import binnie.craftgui.controls.ControlText;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.core.geometry.IArea;
@@ -15,6 +17,8 @@ import java.util.Random;
public class ControlSequencerProgress extends ControlProgressBase {
ControlText textControl;
static final String[] CODES = {"A", "T", "G", "C"};
static final String[] COLORS = {"a", "d", "b", "c"};
public ControlSequencerProgress(final IWidget parent, final int x, final int y) {
super(parent, x, y, 100, 52);
@@ -25,20 +29,20 @@ public class ControlSequencerProgress extends ControlProgressBase {
@Override
public void onUpdateClient() {
super.onUpdateClient();
final ItemStack stack = Machine.getMachine(Window.get(this).getInventory()).getMachineUtil().getStack(5);
if (stack.isEmpty()) {
IMachine machine = Machine.getMachine(Window.get(this).getInventory());
MachineUtil machineUtil = machine.getMachineUtil();
ItemStack stackTarget = machineUtil.getStack(Sequencer.SLOT_TARGET);
if (stackTarget.isEmpty()) {
this.textControl.setValue("");
} else {
final Random rand = new Random(stack.getDisplayName().length());
Random rand = new Random(stackTarget.getDisplayName().length());
String text = "";
final String[] codes = {"A", "T", "G", "C"};
final String[] colors = {"a", "d", "b", "c"};
for (int i = 0; i < 65; ++i) {
final int k = rand.nextInt(4);
final String code = codes[k];
int k = rand.nextInt(4);
String code = CODES[k];
if (rand.nextFloat() < this.progress) {
final String col = "�" + colors[k];
text = text + "�r" + col + "�l" + code;
String color = "�" + COLORS[k];
text = text + "�r" + color + "�l" + code;
} else {
text = text + "�r�7�k�l" + code;
}
@@ -1,4 +1,4 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.sequencer;
import binnie.core.AbstractMod;
import binnie.craftgui.controls.ControlText;
@@ -18,7 +18,7 @@ import binnie.craftgui.resource.Texture;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.genetics.machine.sequencer.Sequencer;
import binnie.genetics.machine.craftgui.WindowMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.nbt.NBTTagCompound;
@@ -52,21 +52,21 @@ public class WindowSequencer extends WindowMachine {
int y = 32;
CraftGUIUtil.horizontalGrid(x, y, TextJustification.MiddleCenter, 2,
new ControlSlotArray.Builder(this, 0, 0, 2, 2).create(Sequencer.SLOT_RESERVE),
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowRight.getIcon().getResourceLocation()),
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
new ControlSequencerProgress(this, 0, 0),
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowRight.getIcon().getResourceLocation()),
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 IArea(0, y, this.w(), 12), TextFormatting.DARK_GRAY + Genetics.proxy.localise("machine.machine.sequencer.texts.userless"), TextJustification.MiddleCenter);
this.slotText = new ControlText(this, new IArea(0, y, this.width(), 12), TextFormatting.DARK_GRAY + Genetics.proxy.localise("machine.machine.sequencer.texts.userless"), TextJustification.MiddleCenter);
y += 20;
final ControlSlot slotDye = new ControlSlot.Builder(this, x, y).assign(0);
x += 20;
new ControlSlotCharge(this, x, y, 0).setColour(16750848);
x += 32;
new ControlEnergyBar(this, x, y, 60, 16, Position.Left);
new ControlEnergyBar(this, x, y, 60, 16, Position.LEFT);
x += 92;
final ControlErrorState errorState = new ControlErrorState(this, x, y + 1);
new ControlPlayerInventory(this);
@@ -1,4 +1,4 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.splicer;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.core.geometry.IArea;
@@ -22,7 +22,7 @@ public class ControlSplicerProgress extends ControlProgressBase {
final float progress = this.getProcess().getCurrentProgress() / 100.0f;
final float n = this.getProcess().getProcessTime() / 12.0f;
final int spacing = 10;
final float range = this.w();
final float range = this.width();
final int h = 8;
final float ooy = -((n - 1.0f) * spacing) - range / 2.0f;
final float ddy = (n - 1.0f) * spacing + range;
@@ -37,17 +37,17 @@ public class ControlSplicerProgress extends ControlProgressBase {
final int y = oy + i * spacing;
if (y > -range / 2.0f && y < range / 2.0f) {
final float percentView = (float) Math.sqrt(1.0f - Math.abs(2.0f * y / range));
final float offMovement = (this.h() - 2.0f * h) / 2.0f;
final float offMovement = (this.height() - 2.0f * h) / 2.0f;
final int alpha = 16777216 * (int) (255.0f * percentView);
c1 += alpha;
c2 += alpha;
c3 += alpha;
c4 += alpha;
int viewAmount = Math.round(offMovement * percentView);
RenderUtil.drawSolidRectWithAlpha(new IArea(this.w() / 2 + y, viewAmount, 4, h / 2), c1);
RenderUtil.drawSolidRectWithAlpha(new IArea(this.w() / 2 + y, viewAmount + 4, 4, h / 2), (y < 0) ? c2 : c3);
RenderUtil.drawSolidRectWithAlpha(new IArea(this.w() / 2 + y, this.h() - viewAmount - 8, 4, h / 2), (y < 0) ? c3 : c2);
RenderUtil.drawSolidRectWithAlpha(new IArea(this.w() / 2 + y, this.h() - viewAmount - 4, 4, h / 2), c4);
RenderUtil.drawSolidRectWithAlpha(new IArea(this.width() / 2 + y, viewAmount, 4, h / 2), c1);
RenderUtil.drawSolidRectWithAlpha(new IArea(this.width() / 2 + y, viewAmount + 4, 4, h / 2), (y < 0) ? c2 : c3);
RenderUtil.drawSolidRectWithAlpha(new IArea(this.width() / 2 + y, this.height() - viewAmount - 8, 4, h / 2), (y < 0) ? c3 : c2);
RenderUtil.drawSolidRectWithAlpha(new IArea(this.width() / 2 + y, this.height() - viewAmount - 4, 4, h / 2), c4);
}
}
}
@@ -1,4 +1,4 @@
package binnie.genetics.machine.craftgui;
package binnie.genetics.machine.splicer;
import binnie.core.AbstractMod;
import binnie.craftgui.core.geometry.CraftGUIUtil;
@@ -15,8 +15,8 @@ import binnie.craftgui.resource.Texture;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.genetics.Genetics;
import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.machine.craftgui.WindowMachine;
import binnie.genetics.machine.inoculator.Inoculator;
import binnie.genetics.machine.splicer.Splicer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
@@ -35,22 +35,22 @@ public class WindowSplicer extends WindowMachine {
public void initialiseClient() {
super.initialiseClient();
int x = 16;
new ControlSplicerProgress(this, 84, 32, this.w() - 172, 102);
new ControlSplicerProgress(this, 84, 32, this.width() - 172, 102);
CraftGUIUtil.horizontalGrid(x, 62,
new ControlSlotArray.Builder(this, 0, 0, 2, 1).create(Splicer.SLOT_SERUM_RESERVE),
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowRight.getIcon().getResourceLocation()),
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
new ControlSlot.Builder(this, 0, 0).assign(0)
);
new ControlSlotArray.Builder(this, x + 12, 84, 2, 1).create(Splicer.SLOT_SERUM_EXPENDED);
new ControlIconDisplay(this, x + 12 + 36 + 4, 86, GUIIcon.ArrowUpLeft.getIcon().getResourceLocation());
new ControlEnergyBar(this, 196, 64, 60, 16, Position.Left);
new ControlIconDisplay(this, x + 12 + 36 + 4, 86, GUIIcon.ARROW_UP_LEFT.getIcon().getResourceLocation());
new ControlEnergyBar(this, 196, 64, 60, 16, Position.LEFT);
new ControlErrorState(this, 218, 86);
x += 142;
CraftGUIUtil.verticalGrid((this.w() - 72) / 2, 32, TextJustification.MiddleCenter, 4,
CraftGUIUtil.verticalGrid((this.width() - 72) / 2, 32, TextJustification.MiddleCenter, 4,
new ControlSlotArray.Builder(this, 0, 0, 4, 1).create(Inoculator.SLOT_RESERVE),
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowDown.getIcon().getResourceLocation()),
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_DOWN.getIcon().getResourceLocation()),
new ControlSlot.Builder(this, 0, 0).assign(9),
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowDown.getIcon().getResourceLocation()),
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_DOWN.getIcon().getResourceLocation()),
new ControlSlotArray.Builder(this, 0, 0, 4, 1).create(Inoculator.SLOT_FINISHED)
);
new ControlPlayerInventory(this);