mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 03:39:09 +00:00
Cleaned up new wider alyzer GUIs.
Realignment of centered text, nudging some things a pixel over, and some minor unification of shared functions. Due to #132
This commit is contained in:
1 parent
0487cba409
commit
f556633a80
6 files changed
+55
-108
No files matched your search
@@ -41,6 +41,8 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
super(AlleleManager.alleleRegistry.getSpeciesRoot("rootBees"), player,
|
||||
new ContainerBeealyzer(player.inventory, inventory), inventory, 1, inventory.getSizeInventory());
|
||||
|
||||
guiName = "gui.beealyzer";
|
||||
|
||||
ArrayList<ItemStack> beeList = new ArrayList<ItemStack>();
|
||||
((ItemBeeGE) ForestryItem.beeDroneGE.item()).addCreativeItems(beeList, false);
|
||||
for (ItemStack beeStack : beeList)
|
||||
@@ -93,45 +95,6 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
|
||||
}
|
||||
|
||||
private void drawAnalyticsOverview() {
|
||||
|
||||
startPage();
|
||||
|
||||
newLine();
|
||||
String title = StringUtil.localize("gui.beealyzer").toUpperCase();
|
||||
drawCenteredLine(title, 8, 158);
|
||||
newLine();
|
||||
|
||||
fontRendererObj.drawSplitString(StringUtil.localize("gui.beealyzer.help"), (int) ((guiLeft + COLUMN_0 + 4) * (1 / factor)),
|
||||
(int) ((guiTop + 42) * (1 / factor)), (int) (158 * (1 / factor)), fontColor.get("gui.screen"));
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
|
||||
drawLine(StringUtil.localize("gui.beealyzer.overview") + ":", COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("I : " + StringUtil.localize("gui.general"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("II : " + StringUtil.localize("gui.environment"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("III: " + StringUtil.localize("gui.produce"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("IV : " + StringUtil.localize("gui.evolution"), COLUMN_0 + 4);
|
||||
|
||||
newLine();
|
||||
|
||||
String mode = breedingTracker.getModeName();
|
||||
if (mode != null && !mode.isEmpty()) {
|
||||
newLine();
|
||||
String rules = StringUtil.localize("gui.beealyzer.behaviour") + ": " + StringUtil.capitalize(mode);
|
||||
drawLine(rules, 8 + getCenteredOffset(title, 158), fontColor.get("gui.beealyzer.binomial"));
|
||||
}
|
||||
|
||||
endPage();
|
||||
|
||||
}
|
||||
|
||||
private void drawAnalyticsPage1(IBee bee, EnumBeeType type) {
|
||||
|
||||
startPage(COLUMN_0, COLUMN_1, COLUMN_2);
|
||||
@@ -265,16 +228,14 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
if (!bee.isNatural())
|
||||
displayText = "bees.stock.ignoble";
|
||||
displayText = StringUtil.localize(displayText);
|
||||
// int offset = (int)(((158 - fontRendererObj.getStringWidth(origin)) / 2)*(1/factor));
|
||||
drawCenteredLine(displayText, 8, 158, fontColor.get("gui.beealyzer.binomial"));;
|
||||
drawCenteredLine(displayText, 8, 208, fontColor.get("gui.beealyzer.binomial"));
|
||||
}
|
||||
|
||||
if (bee.getGeneration() >= 0) {
|
||||
newLine();
|
||||
|
||||
displayText = StringUtil.localizeAndFormat("gui.beealyzer.generations", bee.getGeneration());
|
||||
// offset = (int)(((158 - fontRendererObj.getStringWidth(origin)) / 2)*(1/factor));
|
||||
drawCenteredLine(displayText, 8, 158, fontColor.get("gui.beealyzer.binomial"));
|
||||
drawCenteredLine(displayText, 8, 208, fontColor.get("gui.beealyzer.binomial"));
|
||||
}
|
||||
|
||||
endPage();
|
||||
|
||||
@@ -46,6 +46,8 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
super(AlleleManager.alleleRegistry.getSpeciesRoot("rootTrees"), player,
|
||||
new ContainerTreealyzer(player.inventory, inventory), inventory, 1, inventory.getSizeInventory());
|
||||
|
||||
guiName = "gui.treealyzer";
|
||||
|
||||
ArrayList<ItemStack> treeList = new ArrayList<ItemStack>();
|
||||
((ItemGermlingGE) ForestryItem.sapling.item()).addCreativeItems(treeList, false);
|
||||
for (ItemStack beeStack : treeList)
|
||||
@@ -96,35 +98,6 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
|
||||
}
|
||||
|
||||
private void drawAnalyticsOverview() {
|
||||
|
||||
startPage();
|
||||
|
||||
newLine();
|
||||
String title = StringUtil.localize("gui.treealyzer").toUpperCase();
|
||||
drawCenteredLine(title, 8, 158);
|
||||
newLine();
|
||||
|
||||
fontRendererObj.drawSplitString(StringUtil.localize("gui.treealyzer.help"), (int) ((guiLeft + COLUMN_0 + 4) * (1 / factor)),
|
||||
(int) ((guiTop + 42) * (1 / factor)), (int) (158 * (1 / factor)), fontColor.get("gui.screen"));
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
|
||||
drawLine(StringUtil.localize("gui.treealyzer.overview") + ":", COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("I : " + StringUtil.localize("gui.general"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("II : " + StringUtil.localize("gui.environment"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("III: " + StringUtil.localize("gui.produce"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("IV : " + StringUtil.localize("gui.evolution"), COLUMN_0 + 4);
|
||||
|
||||
endPage();
|
||||
}
|
||||
|
||||
private void drawAnalyticsPage1(ITree tree, EnumGermlingType type) {
|
||||
|
||||
startPage(COLUMN_0, COLUMN_1, COLUMN_2);
|
||||
|
||||
@@ -17,7 +17,7 @@ public class ContainerAlyzer extends ContainerItemInventory {
|
||||
|
||||
this.inventory = inventory;
|
||||
|
||||
final int xPosLeftSlots = 222;
|
||||
final int xPosLeftSlots = 223;
|
||||
|
||||
// Energy
|
||||
this.addSlot(new SlotCustom(inventory, inventory.SLOT_ENERGY, xPosLeftSlots, 8, acceptedEnergy));
|
||||
|
||||
@@ -50,6 +50,8 @@ public abstract class GuiAlyzer extends GuiForestry<TileForestry> {
|
||||
protected ISpeciesRoot speciesRoot;
|
||||
protected IBreedingTracker breedingTracker;
|
||||
|
||||
protected String guiName;
|
||||
|
||||
protected HashMap<String, ItemStack> iconStacks = new HashMap<String, ItemStack>();
|
||||
|
||||
public GuiAlyzer(ISpeciesRoot speciesRoot, EntityPlayer player, ContainerForestry container, IInventory inventory, int pageMax, int pageSize) {
|
||||
@@ -127,6 +129,44 @@ public abstract class GuiAlyzer extends GuiForestry<TileForestry> {
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawAnalyticsOverview() {
|
||||
|
||||
startPage();
|
||||
|
||||
newLine();
|
||||
String title = StringUtil.localize(guiName).toUpperCase();
|
||||
drawCenteredLine(title, 8, 208);
|
||||
newLine();
|
||||
|
||||
fontRendererObj.drawSplitString(StringUtil.localize(guiName + ".help"), (int) ((guiLeft + COLUMN_0 + 4) * (1 / factor)),
|
||||
(int) ((guiTop + 42) * (1 / factor)), (int) (195 * (1 / factor)), fontColor.get("gui.screen"));
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
|
||||
drawLine(StringUtil.localize("gui.alyzer.overview") + ":", COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("I : " + StringUtil.localize("gui.general"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("II : " + StringUtil.localize("gui.environment"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("III: " + StringUtil.localize("gui.produce"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("IV : " + StringUtil.localize("gui.evolution"), COLUMN_0 + 4);
|
||||
|
||||
newLine();
|
||||
|
||||
String mode = breedingTracker.getModeName();
|
||||
if (mode != null && !mode.isEmpty()) {
|
||||
newLine();
|
||||
String rules = StringUtil.localize(guiName + ".behaviour") + ": " + StringUtil.capitalize(mode);
|
||||
drawCenteredLine(rules, 8, 208, fontColor.get(guiName + ".binomial"));
|
||||
}
|
||||
|
||||
endPage();
|
||||
}
|
||||
|
||||
protected final void drawAnalyticsPageClassification(IIndividual individual) {
|
||||
|
||||
startPage();
|
||||
@@ -172,19 +212,19 @@ public abstract class GuiAlyzer extends GuiForestry<TileForestry> {
|
||||
drawLine(StringUtil.localize("gui.alyzer.authority") + ": " + individual.getGenome().getPrimary().getAuthority(), 12);
|
||||
if (AlleleManager.alleleRegistry.isBlacklisted(individual.getIdent())) {
|
||||
String extinct = ">> " + StringUtil.localize("gui.alyzer.extinct").toUpperCase() + " <<";
|
||||
fontRendererObj.drawStringWithShadow(extinct, adjustToFactor(guiLeft + 160) - fontRendererObj.getStringWidth(extinct),
|
||||
fontRendererObj.drawStringWithShadow(extinct, adjustToFactor(guiLeft + 208) - fontRendererObj.getStringWidth(extinct),
|
||||
adjustToFactor(guiTop + getLineY()), fontColor.get("gui.beealyzer.dominant"));
|
||||
}
|
||||
|
||||
newLine();
|
||||
String description = individual.getGenome().getPrimary().getDescription();
|
||||
if (description == null || description.isEmpty())
|
||||
drawSplitLine(StringUtil.localize("gui.alyzer.nodescription"), 12, 156, 0x666666);
|
||||
drawSplitLine(StringUtil.localize("gui.alyzer.nodescription"), 12, 208, 0x666666);
|
||||
else {
|
||||
String tokens[] = description.split("\\|");
|
||||
drawSplitLine(tokens[0], 12, 202, 0x666666);
|
||||
drawSplitLine(tokens[0], 12, 208, 0x666666);
|
||||
if (tokens.length > 1)
|
||||
fontRendererObj.drawStringWithShadow("- " + tokens[1], adjustToFactor(guiLeft + 160) - fontRendererObj.getStringWidth("- " + tokens[1]),
|
||||
fontRendererObj.drawStringWithShadow("- " + tokens[1], adjustToFactor(guiLeft + 208) - fontRendererObj.getStringWidth("- " + tokens[1]),
|
||||
adjustToFactor(guiTop + 145 - 14), 0x99cc32);
|
||||
}
|
||||
|
||||
@@ -391,7 +431,7 @@ public abstract class GuiAlyzer extends GuiForestry<TileForestry> {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
Proxies.common.bindTexture(textureFile);
|
||||
drawTexturedModalRect((int) ((guiLeft + x + 19) * (1 / factor)), (int) ((guiTop + getLineY()) * (1 / factor)), 60, 240 + texOffset, 12, 8);
|
||||
drawTexturedModalRect((int) ((guiLeft + x + 14) * (1 / factor)), (int) ((guiTop + getLineY()) * (1 / factor)), 60, 240 + texOffset, 12, 8);
|
||||
|
||||
drawLine(Integer.toString(fertility) + " x", x, textColor);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ public class GuiFlutterlyzer extends GuiAlyzer {
|
||||
super(AlleleManager.alleleRegistry.getSpeciesRoot("rootButterflies"), player,
|
||||
new ContainerFlutterlyzer(player.inventory, inventory), inventory, 1, inventory.getSizeInventory());
|
||||
|
||||
guiName = "gui.flutterlyzer";
|
||||
|
||||
ArrayList<ItemStack> butterflyList = new ArrayList<ItemStack>();
|
||||
((ItemButterflyGE) ForestryItem.butterflyGE.item()).addCreativeItems(butterflyList, false);
|
||||
for (ItemStack butterflyStack : butterflyList)
|
||||
@@ -94,35 +96,6 @@ public class GuiFlutterlyzer extends GuiAlyzer {
|
||||
|
||||
}
|
||||
|
||||
private void drawAnalyticsOverview() {
|
||||
|
||||
startPage();
|
||||
|
||||
newLine();
|
||||
String title = StringUtil.localize("gui.flutterlyzer").toUpperCase();
|
||||
drawCenteredLine(title, 8, 158);
|
||||
newLine();
|
||||
|
||||
fontRendererObj.drawSplitString(StringUtil.localize("gui.flutterlyzer.help"), (int) ((guiLeft + COLUMN_0 + 4) * (1 / factor)),
|
||||
(int) ((guiTop + 42) * (1 / factor)), (int) (158 * (1 / factor)), fontColor.get("gui.screen"));
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
|
||||
drawLine(StringUtil.localize("gui.beealyzer.overview") + ":", COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("I : " + StringUtil.localize("gui.general"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("II : " + StringUtil.localize("gui.environment"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("III: " + StringUtil.localize("gui.produce"), COLUMN_0 + 4);
|
||||
newLine();
|
||||
drawLine("IV : " + StringUtil.localize("gui.evolution"), COLUMN_0 + 4);
|
||||
|
||||
endPage();
|
||||
}
|
||||
|
||||
private void drawAnalyticsPage1(IButterfly butterfly) {
|
||||
startPage(COLUMN_0, COLUMN_1, COLUMN_2);
|
||||
|
||||
|
||||
Reference in new issue
Block a user