Gui rendering cleanup

This commit is contained in:
mezz committed 2017-01-24 20:53:27 -08:00
1 parent 17f036522e
commit 31a305ffc2
173 files changed
+1317 -1349

No files matched your search

@@ -46,7 +46,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
int y = 4;
new ControlTextCentered(this, y, "§nRegistry").setColour(this.getColour());
y += 16;
new ControlTextEdit(this, 20.0f, y, this.w() - 40.0f, 16.0f) {
new ControlTextEdit(this, 20, y, this.w() - 40, 16) {
@Override
public void onTextEdit(final String value) {
final Collection<IAlleleSpecies> options = new ArrayList<>();
@@ -66,7 +66,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
}
@Override
public void onRenderBackground() {
public void onRenderBackground(int guiWidth, int guiHeight) {
CraftGUI.render.colour(5592405);
CraftGUI.render.texture(CraftGUITexture.TabSolid, this.getArea().inset(1));
CraftGUI.render.colour(AnalystPageDatabase.this.getColour());
@@ -75,7 +75,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
}
};
y += 22;
new Panel(this, 3.0f, y - 1, this.w() - 6.0f, this.h() - y - 8.0f + 2.0f, MinecraftGUI.PanelType.TabOutline).setColour(this.getColour());
new Panel(this, 3, y - 1, this.w() - 6, this.h() - 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) {
@@ -86,7 +86,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.0f, y, this.w() - 8.0f, this.h() - y - 8.0f - 20.0f, 0.0f) {
this.scroll = new ControlListBox<IAlleleSpecies>(this, 4, y, this.w() - 8, this.h() - y - 8 - 20, 0) {
@Override
public void initialise() {
super.initialise();
@@ -95,22 +95,22 @@ public class AnalystPageDatabase extends ControlAnalystPage {
@Override
public IWidget createOption(final IAlleleSpecies v, final int y) {
return new Control(this.getContent(), 0.0f, y, this.w(), 12.0f) {
return new Control(this.getContent(), 0, y, this.w(), 12) {
IAlleleSpecies value = v;
@Override
public void onRenderBackground() {
public void onRenderBackground(int guiWidth, int guiHeight) {
CraftGUI.render.text(this.getArea(), TextJustification.MiddleCenter, this.value.getName(), 16777215);
}
};
}
};
} else {
(this.scroll = new ControlScrollableContent(this, 4.0f, y, this.w() - 8.0f, this.h() - y - 8.0f, 0.0f)).setScrollableContent(this.getItemScrollList(system, options));
(this.scroll = new ControlScrollableContent(this, 4, y, this.w() - 8, this.h() - y - 8, 0)).setScrollableContent(this.getItemScrollList(system, options));
}
new ControlScrollBar(this, this.scroll.x() + this.scroll.w() - 6.0f, this.scroll.y() + 3.0f, 3.0f, this.scroll.h() - 6.0f, this.scroll) {
new ControlScrollBar(this, this.scroll.x() + this.scroll.w() - 6, this.scroll.y() + 3, 3, this.scroll.h() - 6, this.scroll) {
@Override
public void onRenderBackground() {
public void onRenderBackground(int guiWidth, int guiHeight) {
if (!this.isEnabled()) {
return;
}
@@ -121,11 +121,11 @@ public class AnalystPageDatabase extends ControlAnalystPage {
}
private IWidget getItemScrollList(final BreedingSystem system, final Collection<IAlleleSpecies> options) {
return new Control(this.scroll, 0.0f, 0.0f, this.scroll.w(), this.scroll.h()) {
return new Control(this.scroll, 0, 0, this.scroll.w(), this.scroll.h()) {
@Override
public void initialise() {
final int maxBiomePerLine = (int) ((this.w() - 4.0f + 2.0f) / 18.0f);
final float biomeListX = -6.0f + (this.w() - (maxBiomePerLine * 18 - 2)) / 2.0f;
final int maxBiomePerLine = (this.w() - 4 + 2) / 18;
final int biomeListX = -6 + (this.w() - (maxBiomePerLine * 18 - 2)) / 2;
int dx = 0;
int dy = 0;
for (final IAlleleSpecies species : options) {
@@ -143,7 +143,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
}
@Override
public void onRenderBackground() {
public void onRenderBackground(int guiWidth, int guiHeight) {
final WindowAnalyst window = (WindowAnalyst) AnalystPageDatabase.this.getSuperParent();
if (window.getIndividual() != null && window.getIndividual().getGenome().getPrimary() == species) {
CraftGUI.render.colour(15658734);
@@ -154,7 +154,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
CraftGUI.render.colour(15658734);
CraftGUI.render.texture(CraftGUITexture.TabSolid, this.getArea().outset(1));
}
super.onRenderBackground();
super.onRenderBackground(guiWidth, guiHeight);
}
};
dx += 18;