mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-28 07:56:01 +00:00
Auto-format spaces to tabs (#2)
This commit is contained in:
1 parent
25be7fd254
commit
5bb4b5d9a5
756 files changed
+49198
-48489
No files matched your search
@@ -13,59 +13,59 @@ import forestry.api.genetics.IIndividual;
|
||||
import java.util.Objects;
|
||||
|
||||
public class AnalystPageDescription extends ControlAnalystPage {
|
||||
public AnalystPageDescription(final IWidget parent, final IArea area, final IIndividual ind) {
|
||||
super(parent, area);
|
||||
this.setColour(3355443);
|
||||
int y = 4;
|
||||
final IAlleleSpecies species = ind.getGenome().getPrimary();
|
||||
final String branchBinomial = (species.getBranch() != null) ? species.getBranch().getScientific() : "<Unknown>";
|
||||
final String branchName = (species.getBranch() != null) ? species.getBranch().getName() : "Unknown";
|
||||
final String desc = species.getDescription();
|
||||
String descBody = "§o";
|
||||
String descSig = "";
|
||||
if (desc == null || Objects.equals(desc, "") || desc.contains("for.description")) {
|
||||
descBody += "";
|
||||
} else {
|
||||
final String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
for (int i = 1; i < descStrings.length - 1; ++i) {
|
||||
descBody = descBody + " " + descStrings[i];
|
||||
}
|
||||
if (descStrings.length > 1) {
|
||||
descSig += descStrings[descStrings.length - 1];
|
||||
}
|
||||
}
|
||||
String authority = species.getAuthority();
|
||||
if (authority.contains("Binnie")) {
|
||||
authority = "§1§l" + authority;
|
||||
}
|
||||
if (authority.contains("Sengir")) {
|
||||
authority = "§2§l" + authority;
|
||||
}
|
||||
if (authority.contains("MysteriousAges")) {
|
||||
authority = "§5§l" + authority;
|
||||
}
|
||||
new ControlTextCentered(this, y, "§nDescription").setColour(this.getColour());
|
||||
y += 16;
|
||||
new ControlTextCentered(this, y, species.getName() + "§r").setColour(this.getColour());
|
||||
y += 10;
|
||||
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()));
|
||||
new ControlTextCentered(this, y, "Genetic Complexity: " + species.getComplexity()).setColour(this.getColour());
|
||||
y += 26;
|
||||
final ControlText descText = new ControlText(this, new IArea(8.0f, y, this.w() - 16.0f, 0.0f), descBody + "§r", TextJustification.TopCenter);
|
||||
final IWidget signatureText = new ControlText(this, new IArea(8.0f, y, this.w() - 16.0f, 0.0f), descSig + "§r", TextJustification.BottomRight);
|
||||
descText.setColour(this.getColour());
|
||||
signatureText.setColour(this.getColour());
|
||||
final float descHeight = CraftGUI.Render.textHeight(descText.getValue(), descText.getSize().x());
|
||||
signatureText.setPosition(new IPoint(signatureText.pos().x(), descText.getPosition().y() + descHeight + 10.0f));
|
||||
this.setSize(new IPoint(this.w(), 20.0f + signatureText.y()));
|
||||
}
|
||||
public AnalystPageDescription(final IWidget parent, final IArea area, final IIndividual ind) {
|
||||
super(parent, area);
|
||||
this.setColour(3355443);
|
||||
int y = 4;
|
||||
final IAlleleSpecies species = ind.getGenome().getPrimary();
|
||||
final String branchBinomial = (species.getBranch() != null) ? species.getBranch().getScientific() : "<Unknown>";
|
||||
final String branchName = (species.getBranch() != null) ? species.getBranch().getName() : "Unknown";
|
||||
final String desc = species.getDescription();
|
||||
String descBody = "§o";
|
||||
String descSig = "";
|
||||
if (desc == null || Objects.equals(desc, "") || desc.contains("for.description")) {
|
||||
descBody += "";
|
||||
} else {
|
||||
final String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
for (int i = 1; i < descStrings.length - 1; ++i) {
|
||||
descBody = descBody + " " + descStrings[i];
|
||||
}
|
||||
if (descStrings.length > 1) {
|
||||
descSig += descStrings[descStrings.length - 1];
|
||||
}
|
||||
}
|
||||
String authority = species.getAuthority();
|
||||
if (authority.contains("Binnie")) {
|
||||
authority = "§1§l" + authority;
|
||||
}
|
||||
if (authority.contains("Sengir")) {
|
||||
authority = "§2§l" + authority;
|
||||
}
|
||||
if (authority.contains("MysteriousAges")) {
|
||||
authority = "§5§l" + authority;
|
||||
}
|
||||
new ControlTextCentered(this, y, "§nDescription").setColour(this.getColour());
|
||||
y += 16;
|
||||
new ControlTextCentered(this, y, species.getName() + "§r").setColour(this.getColour());
|
||||
y += 10;
|
||||
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()));
|
||||
new ControlTextCentered(this, y, "Genetic Complexity: " + species.getComplexity()).setColour(this.getColour());
|
||||
y += 26;
|
||||
final ControlText descText = new ControlText(this, new IArea(8.0f, y, this.w() - 16.0f, 0.0f), descBody + "§r", TextJustification.TopCenter);
|
||||
final IWidget signatureText = new ControlText(this, new IArea(8.0f, y, this.w() - 16.0f, 0.0f), descSig + "§r", TextJustification.BottomRight);
|
||||
descText.setColour(this.getColour());
|
||||
signatureText.setColour(this.getColour());
|
||||
final float descHeight = CraftGUI.Render.textHeight(descText.getValue(), descText.getSize().x());
|
||||
signatureText.setPosition(new IPoint(signatureText.pos().x(), descText.getPosition().y() + descHeight + 10.0f));
|
||||
this.setSize(new IPoint(this.w(), 20.0f + signatureText.y()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Description";
|
||||
}
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Description";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user