mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 03:49:07 +00:00
port to forestry 4.2
This commit is contained in:
1 parent
dbc5c1a564
commit
f969f63b66
3697 files changed
+78372
No files matched your search
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.genetics.gui;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import binnie.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.craftgui.botany.ControlColourDisplay;
|
||||
import binnie.craftgui.controls.ControlTextCentered;
|
||||
import binnie.botany.api.IFlower;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
|
||||
public class AnalystPageAppearance extends ControlAnalystPage
|
||||
{
|
||||
public AnalystPageAppearance(final IWidget parent, final IArea area, final IFlower ind) {
|
||||
super(parent, area);
|
||||
this.setColour(3355443);
|
||||
int y = 4;
|
||||
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.0f - 28.0f, y);
|
||||
a.setValue(ind.getGenome().getPrimaryColor());
|
||||
a.addTooltip("Primary Petal Colour");
|
||||
final ControlColourDisplay b = new ControlColourDisplay(this, this.w() / 2.0f - 8.0f, y);
|
||||
b.setValue(ind.getGenome().getSecondaryColor());
|
||||
b.addTooltip("Secondary Petal Colour");
|
||||
final ControlColourDisplay c = new ControlColourDisplay(this, this.w() / 2.0f + 12.0f, y);
|
||||
c.setValue(ind.getGenome().getStemColor());
|
||||
c.addTooltip("Stem Colour");
|
||||
y += 26;
|
||||
final int sections = ind.getGenome().getType().getSections();
|
||||
final int w = (sections > 1) ? 50 : 100;
|
||||
new ControlIconDisplay(this, (this.w() - w) / 2.0f, y - ((sections == 1) ? 0 : 0), null) {
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
GL11.glPushMatrix();
|
||||
final float scale = w / 16.0f;
|
||||
final float dy = (sections > 1) ? 16.0f : 0.0f;
|
||||
GL11.glScalef(scale, scale, 1.0f);
|
||||
CraftGUI.Render.colour(ind.getGenome().getStemColor().getColor(false));
|
||||
if (sections > 1) {
|
||||
CraftGUI.Render.iconBlock(new IPoint(0.0f, 0.0f), ind.getGenome().getType().getStem(EnumFlowerStage.FLOWER, true, 1));
|
||||
}
|
||||
CraftGUI.Render.iconBlock(new IPoint(0.0f, dy), ind.getGenome().getType().getStem(EnumFlowerStage.FLOWER, true, 0));
|
||||
CraftGUI.Render.colour(ind.getGenome().getPrimaryColor().getColor(false));
|
||||
if (sections > 1) {
|
||||
CraftGUI.Render.iconBlock(new IPoint(0.0f, 0.0f), ind.getGenome().getType().getPetalIcon(EnumFlowerStage.FLOWER, true, 1));
|
||||
}
|
||||
CraftGUI.Render.iconBlock(new IPoint(0.0f, dy), ind.getGenome().getType().getPetalIcon(EnumFlowerStage.FLOWER, true, 0));
|
||||
CraftGUI.Render.colour(ind.getGenome().getSecondaryColor().getColor(false));
|
||||
if (sections > 1) {
|
||||
CraftGUI.Render.iconBlock(new IPoint(0.0f, 0.0f), ind.getGenome().getType().getVariantIcon(EnumFlowerStage.FLOWER, true, 1));
|
||||
}
|
||||
CraftGUI.Render.iconBlock(new IPoint(0.0f, dy), ind.getGenome().getType().getVariantIcon(EnumFlowerStage.FLOWER, true, 0));
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Appearance";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user