mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 05:02:34 +00:00
Feature/code improve (#221)
* Code improvement for genetics.api Code improvement for genetics.core Fix missed localization for info of Lab Stand * Code improvement for genetics.genetics package
This commit is contained in:
1 parent
9e1ec59b86
commit
3ff4957a10
105 files changed
+1500
-1443
No files matched your search
@@ -28,16 +28,16 @@ import binnie.core.util.I18N;
|
||||
public class AnalystPageGenome extends ControlAnalystPage {
|
||||
boolean active;
|
||||
|
||||
public AnalystPageGenome(final IWidget parent, final Area area, final boolean active, final IIndividual ind) {
|
||||
public AnalystPageGenome(IWidget parent, Area area, boolean active, IIndividual ind) {
|
||||
super(parent, area);
|
||||
this.active = active;
|
||||
this.setColour(26265);
|
||||
setColor(26265);
|
||||
int y = 4;
|
||||
new ControlTextCentered(this, y, TextFormatting.UNDERLINE + this.getTitle()).setColour(this.getColour());
|
||||
new ControlTextCentered(this, y, TextFormatting.UNDERLINE + getTitle()).setColor(getColor());
|
||||
y += 16;
|
||||
final ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(ind);
|
||||
final BreedingSystem system = Binnie.GENETICS.getSystem(root);
|
||||
final Control scaled = new Control(this, 0, y, 0, 0) {
|
||||
ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(ind);
|
||||
BreedingSystem system = Binnie.GENETICS.getSystem(root);
|
||||
Control scaled = new Control(this, 0, y, 0, 0) {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
@@ -52,19 +52,19 @@ public class AnalystPageGenome extends ControlAnalystPage {
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
};
|
||||
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.width() / 2 - 2);
|
||||
new ControlText(scaled, new Area(0, y + (height - 9) / 2, this.width() / 2 - 2, 0), system.getChromosomeShortName(chromo) + " :", TextJustification.TOP_RIGHT).setColour(this.getColour());
|
||||
new ControlText(scaled, new Area(this.width() / 2 + 2, y, this.width() / 2 - 2, 0), alleleName, TextJustification.TOP_LEFT).setColour(this.getColour());
|
||||
for (IChromosomeType chromo : system.getActiveKaryotype()) {
|
||||
IAllele allele = active ? ind.getGenome().getActiveAllele(chromo) : ind.getGenome().getInactiveAllele(chromo);
|
||||
String alleleName = system.getAlleleName(chromo, allele);
|
||||
int height = CraftGUI.render.textHeight(alleleName, width() / 2 - 2);
|
||||
new ControlText(scaled, new Area(0, y + (height - 9) / 2, width() / 2 - 2, 0), system.getChromosomeShortName(chromo) + " :", TextJustification.TOP_RIGHT).setColor(getColor());
|
||||
new ControlText(scaled, new Area(width() / 2 + 2, y, width() / 2 - 2, 0), alleleName, TextJustification.TOP_LEFT).setColor(getColor());
|
||||
y += 3 + height;
|
||||
}
|
||||
this.setSize(new Point(this.width(), y + 8));
|
||||
setSize(new Point(width(), y + 8));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return I18N.localise("genetics.gui.analyst.genome." + (this.active ? "active" : "inactive")) + " " + I18N.localise("genetics.gui.analyst.genome.title");
|
||||
return I18N.localise("genetics.gui.analyst.genome." + (active ? "active" : "inactive")) + " " + I18N.localise("genetics.gui.analyst.genome.title");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user