mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 12:32:23 +00:00
Fix #776 Rearrange and use full-size text on (bee/tree/flutter)-alzyer
This commit is contained in:
1 parent
7cda899bef
commit
09fcbad632
9 files changed
+127
-141
No files matched your search
@@ -86,7 +86,7 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
drawAnalyticsPage3(bee, beeType);
|
||||
break;
|
||||
case 4:
|
||||
drawAnalyticsPage4(bee);
|
||||
drawAnalyticsPageMutations(bee);
|
||||
break;
|
||||
case 6:
|
||||
drawAnalyticsPageClassification(bee);
|
||||
@@ -112,14 +112,17 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
String customSecondaryBeeKey = "bees.custom.beealyzer." + type.getName() + "." + bee.getGenome().getSecondary().getUnlocalizedName().replace("bees.species.", "");
|
||||
|
||||
drawSpeciesRow(StringUtil.localize("gui.species"), bee, EnumBeeChromosome.SPECIES, checkCustomName(customPrimaryBeeKey), checkCustomName(customSecondaryBeeKey));
|
||||
newLine();
|
||||
}
|
||||
|
||||
drawChromosomeRow(StringUtil.localize("gui.lifespan"), bee, EnumBeeChromosome.LIFESPAN);
|
||||
|
||||
newLine();
|
||||
drawChromosomeRow(StringUtil.localize("gui.speed"), bee, EnumBeeChromosome.SPEED);
|
||||
|
||||
newLine();
|
||||
drawChromosomeRow(StringUtil.localize("gui.pollination"), bee, EnumBeeChromosome.FLOWERING);
|
||||
|
||||
newLine();
|
||||
drawChromosomeRow(StringUtil.localize("gui.flowers"), bee, EnumBeeChromosome.FLOWER_PROVIDER);
|
||||
newLine();
|
||||
|
||||
drawLine(StringUtil.localize("gui.fertility"), COLUMN_0);
|
||||
IAlleleInteger primaryFertility = (IAlleleInteger) bee.getGenome().getActiveAllele(EnumBeeChromosome.FERTILITY);
|
||||
@@ -136,6 +139,8 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
new Vect(inactiveTerritory.getValue()).toString(),
|
||||
bee, EnumBeeChromosome.TERRITORY);
|
||||
|
||||
newLine();
|
||||
|
||||
drawChromosomeRow(StringUtil.localize("gui.effect"), bee, EnumBeeChromosome.EFFECT);
|
||||
|
||||
newLine();
|
||||
@@ -150,31 +155,33 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
drawLine(StringUtil.localize("gui.active"), COLUMN_1);
|
||||
drawLine(StringUtil.localize("gui.inactive"), COLUMN_2);
|
||||
|
||||
newLine();
|
||||
newLine();
|
||||
|
||||
drawRow(StringUtil.localize("gui.climate"), AlleleManager.climateHelper.toDisplay(bee.getGenome().getPrimary().getTemperature()),
|
||||
AlleleManager.climateHelper.toDisplay(bee.getGenome().getSecondary().getTemperature()), bee, EnumBeeChromosome.SPECIES);
|
||||
|
||||
newLine();
|
||||
|
||||
IAlleleTolerance tempToleranceActive = (IAlleleTolerance) bee.getGenome().getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE);
|
||||
IAlleleTolerance tempToleranceInactive = (IAlleleTolerance) bee.getGenome().getInactiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE);
|
||||
drawLine(StringUtil.localize("gui.temptol"), COLUMN_0);
|
||||
drawLine(" " + StringUtil.localize("gui.tolerance"), COLUMN_0);
|
||||
drawToleranceInfo(tempToleranceActive, COLUMN_1);
|
||||
drawToleranceInfo(tempToleranceInactive, COLUMN_2);
|
||||
|
||||
newLine();
|
||||
newLine(16);
|
||||
|
||||
drawRow(StringUtil.localize("gui.humidity"), AlleleManager.climateHelper.toDisplay(bee.getGenome().getPrimary().getHumidity()),
|
||||
AlleleManager.climateHelper.toDisplay(bee.getGenome().getSecondary().getHumidity()), bee, EnumBeeChromosome.SPECIES);
|
||||
|
||||
newLine();
|
||||
|
||||
IAlleleTolerance humidToleranceActive = (IAlleleTolerance) bee.getGenome().getActiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE);
|
||||
IAlleleTolerance humidToleranceInactive = (IAlleleTolerance) bee.getGenome().getInactiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE);
|
||||
drawLine(StringUtil.localize("gui.humidtol"), COLUMN_0);
|
||||
drawLine(" " + StringUtil.localize("gui.tolerance"), COLUMN_0);
|
||||
drawToleranceInfo(humidToleranceActive, COLUMN_1);
|
||||
drawToleranceInfo(humidToleranceInactive, COLUMN_2);
|
||||
|
||||
newLine();
|
||||
newLine();
|
||||
newLine(16);
|
||||
|
||||
String yes = StringUtil.localize("yes");
|
||||
String no = StringUtil.localize("no");
|
||||
@@ -196,22 +203,22 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
drawLine(StringUtil.localize("gui.diurnal"), COLUMN_0);
|
||||
drawLine(diurnal0, COLUMN_1, getColorCoding(false));
|
||||
drawLine(diurnal1, COLUMN_2, getColorCoding(false));
|
||||
newLine();
|
||||
newLineCompressed();
|
||||
|
||||
drawLine(StringUtil.localize("gui.nocturnal"), COLUMN_0);
|
||||
drawLine(nocturnal0, COLUMN_1, getColorCoding(false));
|
||||
drawLine(nocturnal1, COLUMN_2, getColorCoding(false));
|
||||
newLine();
|
||||
newLineCompressed();
|
||||
|
||||
String primary = StringUtil.readableBoolean(bee.getGenome().getTolerantFlyer(), yes, no);
|
||||
String secondary = StringUtil.readableBoolean(((AlleleBoolean) bee.getGenome().getInactiveAllele(EnumBeeChromosome.TOLERANT_FLYER)).getValue(), yes,
|
||||
no);
|
||||
String secondary = StringUtil.readableBoolean(((AlleleBoolean) bee.getGenome().getInactiveAllele(EnumBeeChromosome.TOLERANT_FLYER)).getValue(), yes, no);
|
||||
|
||||
drawRow(StringUtil.localize("gui.flyer"), primary, secondary, bee, EnumBeeChromosome.TOLERANT_FLYER);
|
||||
|
||||
newLineCompressed();
|
||||
|
||||
primary = StringUtil.readableBoolean(bee.getGenome().getCaveDwelling(), yes, no);
|
||||
secondary = StringUtil.readableBoolean(((AlleleBoolean) bee.getGenome().getInactiveAllele(EnumBeeChromosome.CAVE_DWELLING)).getValue(), yes,
|
||||
no);
|
||||
secondary = StringUtil.readableBoolean(((AlleleBoolean) bee.getGenome().getInactiveAllele(EnumBeeChromosome.CAVE_DWELLING)).getValue(), yes, no);
|
||||
|
||||
drawRow(StringUtil.localize("gui.cave"), primary, secondary, bee, EnumBeeChromosome.CAVE_DWELLING);
|
||||
|
||||
@@ -228,8 +235,7 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
}
|
||||
|
||||
if (bee.getGeneration() >= 0) {
|
||||
newLine();
|
||||
|
||||
newLineCompressed();
|
||||
displayText = StringUtil.localizeAndFormat("gui.beealyzer.generations", bee.getGeneration());
|
||||
drawCenteredLine(displayText, 8, 208, fontColor.get("gui.beealyzer.binomial"));
|
||||
}
|
||||
@@ -239,9 +245,6 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
|
||||
private void drawAnalyticsPage3(IBee bee, EnumBeeType type) {
|
||||
|
||||
float factor = this.factor;
|
||||
this.setFactor(1.0f);
|
||||
|
||||
startPage(COLUMN_0, COLUMN_1, COLUMN_2);
|
||||
|
||||
drawLine(StringUtil.localize("gui.beealyzer.produce") + ":", COLUMN_0);
|
||||
@@ -250,10 +253,10 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
|
||||
int x = COLUMN_0;
|
||||
for (ItemStack stack : bee.getProduceList()) {
|
||||
widgetManager.add(new ItemStackWidget(adjustToFactor(x), adjustToFactor(getLineY()), stack));
|
||||
widgetManager.add(new ItemStackWidget(x, getLineY(), stack));
|
||||
|
||||
x += 18;
|
||||
if (x > adjustToFactor(148)) {
|
||||
if (x > 148) {
|
||||
x = COLUMN_0;
|
||||
newLine();
|
||||
}
|
||||
@@ -262,24 +265,23 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
|
||||
drawLine(StringUtil.localize("gui.beealyzer.specialty") + ":", COLUMN_0);
|
||||
newLine();
|
||||
|
||||
x = COLUMN_0;
|
||||
for (ItemStack stack : bee.getSpecialtyList()) {
|
||||
widgetManager.add(new ItemStackWidget(adjustToFactor(x), adjustToFactor(getLineY()), stack));
|
||||
widgetManager.add(new ItemStackWidget(x, getLineY(), stack));
|
||||
|
||||
x += 18;
|
||||
if (x > adjustToFactor(148)) {
|
||||
if (x > 148) {
|
||||
x = COLUMN_0;
|
||||
newLine();
|
||||
}
|
||||
}
|
||||
|
||||
endPage();
|
||||
|
||||
this.setFactor(factor);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
drawAnalyticsPage3(tree);
|
||||
break;
|
||||
case 4:
|
||||
drawAnalyticsPage4(tree);
|
||||
drawAnalyticsPageMutations(tree);
|
||||
break;
|
||||
case 6:
|
||||
drawAnalyticsPageClassification(tree);
|
||||
@@ -114,28 +114,20 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
newLine();
|
||||
newLine();
|
||||
|
||||
/*
|
||||
IAlleleTreeSpecies primary = tree.getGenome().getPrimaryAsTree();
|
||||
IAlleleTreeSpecies secondary = tree.getGenome().getSecondaryAsTree();
|
||||
|
||||
drawLine(StringUtil.localize("gui.species"), COLUMN_0);
|
||||
drawSplitLine(primary.getName(), COLUMN_1, COLUMN_2 - COLUMN_1 - 4, tree, EnumTreeChromosome.SPECIES, false);
|
||||
drawSplitLine(secondary.getName(), COLUMN_2, COLUMN_2 - COLUMN_1 - 4, tree, EnumTreeChromosome.SPECIES, true);
|
||||
|
||||
newLine();
|
||||
newLine();*/
|
||||
|
||||
{
|
||||
String customPrimaryTreeKey = "trees.custom.treealyzer." + type.getName() + "." + tree.getGenome().getPrimary().getUnlocalizedName().replace("trees.species.", "");
|
||||
String customSecondaryTreeKey = "trees.custom.treealyzer." + type.getName() + "." + tree.getGenome().getSecondary().getUnlocalizedName().replace("trees.species.", "");
|
||||
|
||||
drawSpeciesRow(StringUtil.localize("gui.species"), tree, EnumTreeChromosome.SPECIES, checkCustomName(customPrimaryTreeKey), checkCustomName(customSecondaryTreeKey));
|
||||
newLine();
|
||||
}
|
||||
newLine();
|
||||
|
||||
drawChromosomeRow(StringUtil.localize("gui.saplings"), tree, EnumTreeChromosome.FERTILITY);
|
||||
newLineCompressed();
|
||||
drawChromosomeRow(StringUtil.localize("gui.maturity"), tree, EnumTreeChromosome.MATURATION);
|
||||
newLineCompressed();
|
||||
drawChromosomeRow(StringUtil.localize("gui.height"), tree, EnumTreeChromosome.HEIGHT);
|
||||
newLineCompressed();
|
||||
|
||||
IAlleleInteger activeGirth = (IAlleleInteger) tree.getGenome().getActiveAllele(EnumTreeChromosome.GIRTH);
|
||||
IAlleleInteger inactiveGirth = (IAlleleInteger) tree.getGenome().getInactiveAllele(EnumTreeChromosome.GIRTH);
|
||||
@@ -143,10 +135,12 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
drawLine(String.format("%sx%s", activeGirth.getValue(), activeGirth.getValue()), COLUMN_1, tree, EnumTreeChromosome.GIRTH, false);
|
||||
drawLine(String.format("%sx%s", inactiveGirth.getValue(), inactiveGirth.getValue()), COLUMN_2, tree, EnumTreeChromosome.GIRTH, true);
|
||||
|
||||
newLine();
|
||||
newLineCompressed();
|
||||
|
||||
drawChromosomeRow(StringUtil.localize("gui.yield"), tree, EnumTreeChromosome.YIELD);
|
||||
newLineCompressed();
|
||||
drawChromosomeRow(StringUtil.localize("gui.sappiness"), tree, EnumTreeChromosome.SAPPINESS);
|
||||
newLineCompressed();
|
||||
|
||||
String yes = StringUtil.localize("yes");
|
||||
String no = StringUtil.localize("no");
|
||||
@@ -158,7 +152,7 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
drawLine(StringUtil.readableBoolean(primaryFireproof.getValue(), yes, no), COLUMN_1, tree, EnumTreeChromosome.FIREPROOF, false);
|
||||
drawLine(StringUtil.readableBoolean(secondaryFireproof.getValue(), yes, no), COLUMN_2, tree, EnumTreeChromosome.FIREPROOF, false);
|
||||
|
||||
newLine();
|
||||
newLineCompressed();
|
||||
|
||||
drawChromosomeRow(StringUtil.localize("gui.effect"), tree, EnumTreeChromosome.EFFECT);
|
||||
|
||||
@@ -283,15 +277,16 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
|
||||
int x = COLUMN_0;
|
||||
for (ItemStack stack : tree.getProduceList()) {
|
||||
itemRender.renderItemIntoGUI(fontRendererObj, mc.renderEngine, stack, (int) ((guiLeft + x) * (1 / factor)),
|
||||
(int) ((guiTop + getLineY()) * (1 / factor)));
|
||||
itemRender.renderItemIntoGUI(fontRendererObj, mc.renderEngine, stack, guiLeft + x, guiTop + getLineY());
|
||||
x += 18;
|
||||
if (x > adjustToFactor(148)) {
|
||||
if (x > 148) {
|
||||
x = COLUMN_0;
|
||||
newLine();
|
||||
}
|
||||
}
|
||||
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
|
||||
@@ -300,10 +295,9 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
|
||||
x = COLUMN_0;
|
||||
for (ItemStack stack : tree.getSpecialtyList()) {
|
||||
itemRender.renderItemIntoGUI(fontRendererObj, mc.renderEngine, stack, (int) ((guiLeft + x) * (1 / factor)),
|
||||
(int) ((guiTop + getLineY()) * (1 / factor)));
|
||||
itemRender.renderItemIntoGUI(fontRendererObj, mc.renderEngine, stack, guiLeft + x, guiTop + getLineY());
|
||||
x += 18;
|
||||
if (x > adjustToFactor(148)) {
|
||||
if (x > 148) {
|
||||
x = COLUMN_0;
|
||||
newLine();
|
||||
}
|
||||
|
||||
@@ -192,8 +192,6 @@ public class Config {
|
||||
property.set(false);
|
||||
|
||||
// Make sure the default mode files are there.
|
||||
File easyMode = new File(Forestry.instance.getConfigFolder(), "gamemodes/EASY.cfg");
|
||||
CopyFileToFS(easyMode, "/config/forestry/gamemodes/EASY.cfg");
|
||||
|
||||
File opMode = new File(Forestry.instance.getConfigFolder(), "gamemodes/OP.cfg");
|
||||
CopyFileToFS(opMode, "/config/forestry/gamemodes/OP.cfg");
|
||||
|
||||
@@ -45,8 +45,8 @@ import forestry.core.utils.StringUtil;
|
||||
public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory> {
|
||||
|
||||
protected static final int COLUMN_0 = 12;
|
||||
protected static final int COLUMN_1 = 85;
|
||||
protected static final int COLUMN_2 = 150;
|
||||
protected static final int COLUMN_1 = 90;
|
||||
protected static final int COLUMN_2 = 155;
|
||||
|
||||
protected final ISpeciesRoot speciesRoot;
|
||||
protected final IBreedingTracker breedingTracker;
|
||||
@@ -109,32 +109,27 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
|
||||
IAlleleSpecies secondary = individual.getGenome().getSecondary();
|
||||
|
||||
drawLine(text0, column0);
|
||||
int columnwidth = column2 - column1 - 16;
|
||||
int columnwidth = column2 - column1 - 2;
|
||||
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
drawItemStack(iconStacks.get(primary.getUID()), adjustToFactor(guiLeft + column1 + columnwidth - 4), adjustToFactor(guiTop + getLineY()));
|
||||
drawItemStack(iconStacks.get(secondary.getUID()), adjustToFactor(guiLeft + column2 + columnwidth - 2), adjustToFactor(guiTop + getLineY()));
|
||||
drawItemStack(iconStacks.get(primary.getUID()), guiLeft + column1 + (columnwidth - 20), guiTop + 10);
|
||||
drawItemStack(iconStacks.get(secondary.getUID()), guiLeft + column2 + (columnwidth - 20), guiTop + 10);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
String primaryName;
|
||||
String secondaryName;
|
||||
|
||||
primaryName = customPrimaryName == null ? primary.getName() : customPrimaryName;
|
||||
secondaryName = customSecondaryName == null ? secondary.getName() : customSecondaryName;
|
||||
String primaryName = customPrimaryName == null ? primary.getName() : customPrimaryName;
|
||||
String secondaryName = customSecondaryName == null ? secondary.getName() : customSecondaryName;
|
||||
|
||||
drawSplitLine(primaryName, column1, columnwidth, individual, chromosome, false);
|
||||
drawSplitLine(secondaryName, column2, columnwidth, individual, chromosome, true);
|
||||
|
||||
newLine();
|
||||
newLine();
|
||||
|
||||
}
|
||||
|
||||
protected final void drawSpeciesRow(String text0, IIndividual individual, IChromosomeType chromosome) {
|
||||
drawSpeciesRow(text0, individual, chromosome, null, null);
|
||||
}
|
||||
|
||||
protected final String checkCustomName(String key) {
|
||||
protected static String checkCustomName(String key) {
|
||||
if (StringUtil.canTranslate(key)) {
|
||||
return StringUtil.localize(key);
|
||||
} else {
|
||||
@@ -157,9 +152,7 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
|
||||
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();
|
||||
fontRendererObj.drawSplitString(StringUtil.localize(guiName + ".help"), guiLeft + COLUMN_0 + 4, guiTop + 42, 200, fontColor.get("gui.screen"));
|
||||
newLine();
|
||||
newLine();
|
||||
newLine();
|
||||
@@ -215,9 +208,9 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
|
||||
}
|
||||
|
||||
drawLine(group.getScientific(), x, group.getLevel().getColour());
|
||||
drawLine(group.getLevel().name(), 155, group.getLevel().getColour());
|
||||
newLine();
|
||||
x += 10;
|
||||
drawLine(group.getLevel().name(), 170, group.getLevel().getColour());
|
||||
newLineCompressed();
|
||||
x += 12;
|
||||
}
|
||||
|
||||
// Add the species name
|
||||
@@ -227,27 +220,26 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
|
||||
}
|
||||
|
||||
drawLine(binomial, x, 0xebae85);
|
||||
drawLine("SPECIES", 155, 0xebae85);
|
||||
drawLine("SPECIES", 170, 0xebae85);
|
||||
|
||||
newLine();
|
||||
newLine();
|
||||
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 + 208) - fontRendererObj.getStringWidth(extinct),
|
||||
adjustToFactor(guiTop + getLineY()), fontColor.get("gui.beealyzer.dominant"));
|
||||
fontRendererObj.drawStringWithShadow(extinct, guiLeft + 200 - fontRendererObj.getStringWidth(extinct),
|
||||
guiTop + getLineY(), fontColor.get("gui.beealyzer.dominant"));
|
||||
}
|
||||
|
||||
newLine();
|
||||
String description = individual.getGenome().getPrimary().getDescription();
|
||||
if (StringUtils.isBlank(description) || description.startsWith("for.description.")) {
|
||||
drawSplitLine(StringUtil.localize("gui.alyzer.nodescription"), 12, 208, 0x666666);
|
||||
drawSplitLine(StringUtil.localize("gui.alyzer.nodescription"), 12, 200, 0x666666);
|
||||
} else {
|
||||
String tokens[] = description.split("\\|");
|
||||
drawSplitLine(tokens[0], 12, 208, 0x666666);
|
||||
drawSplitLine(tokens[0], 12, 200, 0x666666);
|
||||
if (tokens.length > 1) {
|
||||
fontRendererObj.drawStringWithShadow("- " + tokens[1], adjustToFactor(guiLeft + 208) - fontRendererObj.getStringWidth("- " + tokens[1]),
|
||||
adjustToFactor(guiTop + 145 - 14), 0x99cc32);
|
||||
String signature = "- " + tokens[1];
|
||||
fontRendererObj.drawStringWithShadow(signature, (guiLeft + 210) - fontRendererObj.getStringWidth(signature), guiTop + 145 - 14, 0x99cc32);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,10 +247,7 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
|
||||
|
||||
}
|
||||
|
||||
protected void drawAnalyticsPage4(IIndividual individual) {
|
||||
|
||||
float factor = this.factor;
|
||||
this.setFactor(1.0f);
|
||||
protected void drawAnalyticsPageMutations(IIndividual individual) {
|
||||
|
||||
startPage(COLUMN_0, COLUMN_1, COLUMN_2);
|
||||
drawLine(StringUtil.localize("gui.beealyzer.mutations") + ":", COLUMN_0);
|
||||
@@ -296,13 +285,10 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
|
||||
if (x >= columnWidth * 4) {
|
||||
x = 0;
|
||||
newLine();
|
||||
newLine();
|
||||
}
|
||||
}
|
||||
|
||||
endPage();
|
||||
|
||||
this.setFactor(factor);
|
||||
}
|
||||
|
||||
protected void drawMutationInfo(IMutation combination, IAllele species, int x) {
|
||||
@@ -310,7 +296,7 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
|
||||
ItemStack partnerBee = iconStacks.get(combination.getPartner(species).getUID());
|
||||
widgetManager.add(new ItemStackWidget(x, getLineY(), partnerBee));
|
||||
|
||||
drawProbabilityArrow(combination.getBaseChance(), adjustToFactor(guiLeft) + x + 18, adjustToFactor(guiTop) + getLineY() + 4);
|
||||
drawProbabilityArrow(combination.getBaseChance(), guiLeft + x + 18, guiTop + getLineY() + 4);
|
||||
|
||||
IAllele result = combination.getTemplate()[EnumBeeChromosome.SPECIES.ordinal()];
|
||||
ItemStack resultBee = iconStacks.get(result.getUID());
|
||||
@@ -319,11 +305,11 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
|
||||
|
||||
protected void drawUnknownMutation(IMutation combination, IAllele species, int x) {
|
||||
|
||||
drawQuestionMark(adjustToFactor(guiLeft) + x, adjustToFactor(guiTop) + getLineY());
|
||||
drawQuestionMark(guiLeft + x, guiTop + getLineY());
|
||||
|
||||
drawProbabilityArrow(combination.getBaseChance(), adjustToFactor(guiLeft) + x + 18, adjustToFactor(guiTop) + getLineY() + 4);
|
||||
drawProbabilityArrow(combination.getBaseChance(), guiLeft + x + 18, guiTop + getLineY() + 4);
|
||||
|
||||
drawQuestionMark(adjustToFactor(guiLeft) + x + 32, adjustToFactor(guiTop) + getLineY());
|
||||
drawQuestionMark(guiLeft + x + 32, guiTop + getLineY());
|
||||
}
|
||||
|
||||
protected void drawQuestionMark(int x, int y) {
|
||||
@@ -375,60 +361,64 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
|
||||
case BOTH_3:
|
||||
case BOTH_4:
|
||||
case BOTH_5:
|
||||
drawBothSymbol(x, getLineY() - 1);
|
||||
drawLine(text, x + (int) (20 * factor), textColor);
|
||||
drawBothSymbol(x - 2, getLineY() - 1);
|
||||
drawLine(text, x + 14, textColor);
|
||||
break;
|
||||
case DOWN_1:
|
||||
case DOWN_2:
|
||||
case DOWN_3:
|
||||
case DOWN_4:
|
||||
case DOWN_5:
|
||||
drawDownSymbol(x, getLineY() - 1);
|
||||
drawLine(text, x + (int) (20 * factor), textColor);
|
||||
drawDownSymbol(x - 2, getLineY() - 1);
|
||||
drawLine(text, x + 14, textColor);
|
||||
break;
|
||||
case UP_1:
|
||||
case UP_2:
|
||||
case UP_3:
|
||||
case UP_4:
|
||||
case UP_5:
|
||||
drawUpSymbol(x, getLineY() - 1);
|
||||
drawLine(text, x + (int) (20 * factor), textColor);
|
||||
drawUpSymbol(x - 2, getLineY() - 1);
|
||||
drawLine(text, x + 14, textColor);
|
||||
break;
|
||||
default:
|
||||
drawNoneSymbol(x, getLineY() - 1);
|
||||
drawLine("(0)", x + (int) (20 * factor), textColor);
|
||||
drawNoneSymbol(x - 2, getLineY() - 1);
|
||||
drawLine("(0)", x + 14, textColor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void drawDownSymbol(int x, int y) {
|
||||
Proxies.common.bindTexture(textureFile);
|
||||
drawTexturedModalRect((int) ((guiLeft + x) * (1 / factor)), (int) ((guiTop + getLineY()) * (1 / factor)), 0, 247, 15, 9);
|
||||
drawTexturedModalRect(guiLeft + x, guiTop + y, 0, 247, 15, 9);
|
||||
}
|
||||
|
||||
private void drawUpSymbol(int x, int y) {
|
||||
Proxies.common.bindTexture(textureFile);
|
||||
drawTexturedModalRect((int) ((guiLeft + x) * (1 / factor)), (int) ((guiTop + getLineY()) * (1 / factor)), 15, 247, 15, 9);
|
||||
drawTexturedModalRect(guiLeft + x, guiTop + y, 15, 247, 15, 9);
|
||||
}
|
||||
|
||||
private void drawBothSymbol(int x, int y) {
|
||||
Proxies.common.bindTexture(textureFile);
|
||||
drawTexturedModalRect((int) ((guiLeft + x) * (1 / factor)), (int) ((guiTop + getLineY()) * (1 / factor)), 30, 247, 15, 9);
|
||||
drawTexturedModalRect(guiLeft + x, guiTop + y, 30, 247, 15, 9);
|
||||
}
|
||||
|
||||
private void drawNoneSymbol(int x, int y) {
|
||||
Proxies.common.bindTexture(textureFile);
|
||||
drawTexturedModalRect((int) ((guiLeft + x) * (1 / factor)), (int) ((guiTop + getLineY()) * (1 / factor)), 45, 247, 15, 9);
|
||||
drawTexturedModalRect(guiLeft + x, guiTop + y, 45, 247, 15, 9);
|
||||
}
|
||||
|
||||
protected void drawFertilityInfo(int fertility, int x, int textColor, int texOffset) {
|
||||
// Enable correct lighting.
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
Proxies.common.bindTexture(textureFile);
|
||||
drawTexturedModalRect((int) ((guiLeft + x + 14) * (1 / factor)), (int) ((guiTop + getLineY()) * (1 / factor)), 60, 240 + texOffset, 12, 8);
|
||||
String fertilityString = Integer.toString(fertility) + " x";
|
||||
|
||||
drawLine(Integer.toString(fertility) + " x", x, textColor);
|
||||
int stringWidth = fontRendererObj.getStringWidth(fertilityString);
|
||||
|
||||
Proxies.common.bindTexture(textureFile);
|
||||
drawTexturedModalRect(guiLeft + x + stringWidth + 2, guiTop + getLineY() - 1, 60, 240 + texOffset, 12, 8);
|
||||
|
||||
drawLine(fertilityString, x, textColor);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import forestry.core.config.Defaults;
|
||||
import forestry.core.gadgets.NaturalistGame;
|
||||
@@ -223,20 +224,23 @@ public class GuiEscritoire extends GuiForestry<ContainerEscritoire, TileEscritoi
|
||||
|
||||
for (int i = 0; i <= inventory.getGame().getBountyLevel() / 4; i++) {
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GuiForestry.itemRender.renderItemAndEffectIntoGUI(mc.fontRenderer,
|
||||
mc.renderEngine, LEVEL_ITEM, guiLeft + 170 + i * 8, guiTop + 7);
|
||||
GuiForestry.itemRender.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, LEVEL_ITEM, guiLeft + 170 + i * 8, guiTop + 7);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
}
|
||||
|
||||
startPage();
|
||||
setFactor(0.5f);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
GL11.glTranslated(guiLeft + 170, guiTop + 10, 0.0);
|
||||
|
||||
newLine();
|
||||
newLine();
|
||||
String format = EnumChatFormatting.UNDERLINE + EnumChatFormatting.ITALIC.toString();
|
||||
drawLine(format + "Attempt No. " + (NaturalistGame.BOUNTY_MAX - inventory.getGame().getBountyLevel()), 171, fontColor.get("gui.mail.lettertext"));
|
||||
drawLine(format + "Attempt No. " + (NaturalistGame.BOUNTY_MAX - inventory.getGame().getBountyLevel()), 170, fontColor.get("gui.mail.lettertext"));
|
||||
newLine();
|
||||
drawSplitLine(getResearchNote(), 171, 46, fontColor.get("gui.mail.lettertext"));
|
||||
drawSplitLine(getResearchNote(), 170, 90, fontColor.get("gui.mail.lettertext"));
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
endPage();
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ import codechicken.nei.api.TaggedInventoryArea;
|
||||
|
||||
@Optional.Interface(iface = "codechicken.nei.api.INEIGuiHandler", modid = "NotEnoughItems")
|
||||
public abstract class GuiForestry<C extends Container, I extends IInventory> extends GuiContainer implements INEIGuiHandler {
|
||||
protected static final int LINE_HEIGHT = 12;
|
||||
|
||||
protected final WidgetManager widgetManager;
|
||||
protected final LedgerManager ledgerManager;
|
||||
@@ -114,16 +115,10 @@ public abstract class GuiForestry<C extends Container, I extends IInventory> ext
|
||||
protected int column1;
|
||||
protected int column2;
|
||||
private int line;
|
||||
protected float factor = 0.75f;
|
||||
|
||||
protected final void setFactor(float factor) {
|
||||
this.factor = factor;
|
||||
}
|
||||
|
||||
protected final void startPage() {
|
||||
line = 12;
|
||||
line = LINE_HEIGHT;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(factor, factor, factor);
|
||||
}
|
||||
|
||||
protected final void startPage(int column0, int column1, int column2) {
|
||||
@@ -135,20 +130,20 @@ public abstract class GuiForestry<C extends Container, I extends IInventory> ext
|
||||
startPage();
|
||||
}
|
||||
|
||||
protected final int adjustToFactor(int fixed) {
|
||||
return (int) (fixed * (1 / factor));
|
||||
}
|
||||
|
||||
protected final int getLineY() {
|
||||
return line;
|
||||
}
|
||||
|
||||
protected final void newLine() {
|
||||
line += 12 * factor;
|
||||
line += LINE_HEIGHT;
|
||||
}
|
||||
|
||||
protected final void newLineCompressed() {
|
||||
line += (LINE_HEIGHT - 2);
|
||||
}
|
||||
|
||||
protected final void newLine(int lineHeight) {
|
||||
line += lineHeight * factor;
|
||||
line += lineHeight;
|
||||
}
|
||||
|
||||
protected final void endPage() {
|
||||
@@ -159,7 +154,6 @@ public abstract class GuiForestry<C extends Container, I extends IInventory> ext
|
||||
drawLine(text0, column0, colour0);
|
||||
drawLine(text1, column1, colour1);
|
||||
drawLine(text2, column2, colour2);
|
||||
newLine();
|
||||
}
|
||||
|
||||
protected final void drawLine(String text, int x) {
|
||||
@@ -175,16 +169,15 @@ public abstract class GuiForestry<C extends Container, I extends IInventory> ext
|
||||
}
|
||||
|
||||
protected final void drawCenteredLine(String text, int x, int width, int color) {
|
||||
fontRendererObj.drawString(text, (int) ((guiLeft + x) * (1 / factor)) + (adjustToFactor(width) - fontRendererObj.getStringWidth(text)) / 2,
|
||||
(int) ((guiTop + line) * (1 / factor)), color);
|
||||
fontRendererObj.drawString(text, guiLeft + x + (width - fontRendererObj.getStringWidth(text)) / 2, guiTop + line, color);
|
||||
}
|
||||
|
||||
protected final void drawLine(String text, int x, int color) {
|
||||
fontRendererObj.drawString(text, (int) ((guiLeft + x) * (1 / factor)), (int) ((guiTop + line) * (1 / factor)), color);
|
||||
fontRendererObj.drawString(text, guiLeft + x, guiTop + line, color);
|
||||
}
|
||||
|
||||
protected final void drawSplitLine(String text, int x, int maxWidth, int color) {
|
||||
fontRendererObj.drawSplitString(text, (int) ((guiLeft + x) * (1 / factor)), (int) ((guiTop + line) * (1 / factor)), (int) (maxWidth * (1 / factor)), color);
|
||||
fontRendererObj.drawSplitString(text, guiLeft + x, guiTop + line, maxWidth, color);
|
||||
}
|
||||
|
||||
/* CORE GUI HANDLING */
|
||||
|
||||
@@ -162,7 +162,7 @@ public class GuiNaturalistInventory extends GuiForestry<Container, IPagedInvento
|
||||
|
||||
drawLine(species.getName(), x);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
drawItemStack(iconStack, adjustToFactor(guiLeft + x + 69), adjustToFactor(guiTop + getLineY() - 2));
|
||||
drawItemStack(iconStack, guiLeft + x + 69, guiTop + getLineY() - 2);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
newLine();
|
||||
@@ -196,8 +196,7 @@ public class GuiNaturalistInventory extends GuiForestry<Container, IPagedInvento
|
||||
private void drawMutationIcon(IMutation combination, IAlleleSpecies species, int x) {
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
drawItemStack(iconStacks.get(combination.getPartner(species).getUID()), adjustToFactor(guiLeft + x),
|
||||
adjustToFactor(guiTop + getLineY()));
|
||||
drawItemStack(iconStacks.get(combination.getPartner(species).getUID()), guiLeft + x, guiTop + getLineY());
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
int line = 48;
|
||||
@@ -224,7 +223,7 @@ public class GuiNaturalistInventory extends GuiForestry<Container, IPagedInvento
|
||||
}
|
||||
|
||||
Proxies.common.bindTexture(textureFile);
|
||||
drawTexturedModalRect(adjustToFactor(guiLeft + x), adjustToFactor(guiTop + getLineY()), column, line, 16, 16);
|
||||
drawTexturedModalRect(guiLeft + x, guiTop + getLineY(), column, line, 16, 16);
|
||||
|
||||
}
|
||||
|
||||
@@ -255,7 +254,7 @@ public class GuiNaturalistInventory extends GuiForestry<Container, IPagedInvento
|
||||
}
|
||||
|
||||
Proxies.common.bindTexture(textureFile);
|
||||
drawTexturedModalRect(adjustToFactor(guiLeft + x), adjustToFactor(guiTop + getLineY()), column, line, 16, 16);
|
||||
drawTexturedModalRect(guiLeft + x, guiTop + getLineY(), column, line, 16, 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -82,7 +82,7 @@ public class GuiFlutterlyzer extends GuiAlyzer {
|
||||
drawAnalyticsPage3(butterfly);
|
||||
break;
|
||||
case 4:
|
||||
drawAnalyticsPage4(butterfly);
|
||||
drawAnalyticsPageMutations(butterfly);
|
||||
break;
|
||||
case 6:
|
||||
drawAnalyticsPageClassification(butterfly);
|
||||
@@ -107,16 +107,20 @@ public class GuiFlutterlyzer extends GuiAlyzer {
|
||||
|
||||
drawRow(StringUtil.localize("gui.size"), butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.SIZE).getName(),
|
||||
butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.SIZE).getName(), butterfly, EnumButterflyChromosome.SPEED);
|
||||
newLine();
|
||||
|
||||
drawRow(StringUtil.localize("gui.lifespan"), butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.LIFESPAN).getName(),
|
||||
butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.LIFESPAN).getName(), butterfly,
|
||||
EnumButterflyChromosome.LIFESPAN);
|
||||
newLine();
|
||||
|
||||
drawRow(StringUtil.localize("gui.speed"), butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.SPEED).getName(),
|
||||
butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.SPEED).getName(), butterfly, EnumButterflyChromosome.SPEED);
|
||||
newLine();
|
||||
|
||||
drawRow(StringUtil.localize("gui.metabolism"), GenericRatings.rateMetabolism(butterfly.getGenome().getMetabolism()),
|
||||
GenericRatings.rateMetabolism(((IAlleleInteger) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.METABOLISM)).getValue()), butterfly, EnumButterflyChromosome.METABOLISM);
|
||||
newLine();
|
||||
|
||||
drawLine(StringUtil.localize("gui.fertility"), COLUMN_0);
|
||||
drawFertilityInfo(butterfly.getGenome().getFertility(), COLUMN_1, getColorCoding(butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.FERTILITY)
|
||||
@@ -129,6 +133,7 @@ public class GuiFlutterlyzer extends GuiAlyzer {
|
||||
drawRow(StringUtil.localize("gui.flowers"), butterfly.getGenome().getFlowerProvider().getDescription(),
|
||||
((IAlleleFlowers) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.FLOWER_PROVIDER)).getProvider()
|
||||
.getDescription(), butterfly, EnumButterflyChromosome.FLOWER_PROVIDER);
|
||||
newLine();
|
||||
|
||||
drawRow(StringUtil.localize("gui.effect"), butterfly.getGenome().getEffect().getName(),
|
||||
butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.EFFECT).getName(), butterfly,
|
||||
@@ -152,10 +157,11 @@ public class GuiFlutterlyzer extends GuiAlyzer {
|
||||
|
||||
drawRow(StringUtil.localize("gui.climate"), AlleleManager.climateHelper.toDisplay(butterfly.getGenome().getPrimary().getTemperature()),
|
||||
AlleleManager.climateHelper.toDisplay(butterfly.getGenome().getPrimary().getTemperature()), butterfly, EnumButterflyChromosome.SPECIES);
|
||||
newLine();
|
||||
|
||||
IAlleleTolerance tempToleranceActive = (IAlleleTolerance) butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE);
|
||||
IAlleleTolerance tempToleranceInactive = (IAlleleTolerance) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE);
|
||||
drawLine(StringUtil.localize("gui.temptol"), COLUMN_0);
|
||||
drawLine(" " + StringUtil.localize("gui.tolerance"), COLUMN_0);
|
||||
drawToleranceInfo(tempToleranceActive, COLUMN_1);
|
||||
drawToleranceInfo(tempToleranceInactive, COLUMN_2);
|
||||
|
||||
@@ -163,10 +169,11 @@ public class GuiFlutterlyzer extends GuiAlyzer {
|
||||
|
||||
drawRow(StringUtil.localize("gui.humidity"), AlleleManager.climateHelper.toDisplay(butterfly.getGenome().getPrimary().getHumidity()),
|
||||
AlleleManager.climateHelper.toDisplay(butterfly.getGenome().getPrimary().getHumidity()), butterfly, EnumButterflyChromosome.SPECIES);
|
||||
newLine();
|
||||
|
||||
IAlleleTolerance humidToleranceActive = (IAlleleTolerance) butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.HUMIDITY_TOLERANCE);
|
||||
IAlleleTolerance humidToleranceInactive = (IAlleleTolerance) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.HUMIDITY_TOLERANCE);
|
||||
drawLine(StringUtil.localize("gui.humidtol"), COLUMN_0);
|
||||
drawLine(" " + StringUtil.localize("gui.tolerance"), COLUMN_0);
|
||||
drawToleranceInfo(humidToleranceActive, COLUMN_1);
|
||||
drawToleranceInfo(humidToleranceInactive, COLUMN_2);
|
||||
|
||||
@@ -205,6 +212,7 @@ public class GuiFlutterlyzer extends GuiAlyzer {
|
||||
no);
|
||||
|
||||
drawRow(StringUtil.localize("gui.flyer"), primary, secondary, butterfly, EnumButterflyChromosome.TOLERANT_FLYER);
|
||||
newLine();
|
||||
|
||||
primary = StringUtil.readableBoolean(butterfly.getGenome().getFireResist(), yes, no);
|
||||
secondary = StringUtil.readableBoolean(((AlleleBoolean) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.FIRE_RESIST)).getValue(), yes,
|
||||
@@ -225,10 +233,9 @@ public class GuiFlutterlyzer extends GuiAlyzer {
|
||||
|
||||
int x = COLUMN_0;
|
||||
for (ItemStack stack : butterfly.getGenome().getPrimary().getButterflyLoot().keySet()) {
|
||||
itemRender.renderItemIntoGUI(fontRendererObj, mc.renderEngine, stack, (int) ((guiLeft + x) * (1 / factor)),
|
||||
(int) ((guiTop + getLineY()) * (1 / factor)));
|
||||
itemRender.renderItemIntoGUI(fontRendererObj, mc.renderEngine, stack, guiLeft + x, guiTop + getLineY());
|
||||
x += 18;
|
||||
if (x > adjustToFactor(148)) {
|
||||
if (x > 148) {
|
||||
x = COLUMN_0;
|
||||
newLine();
|
||||
}
|
||||
@@ -242,10 +249,9 @@ public class GuiFlutterlyzer extends GuiAlyzer {
|
||||
|
||||
x = COLUMN_0;
|
||||
for (ItemStack stack : butterfly.getGenome().getPrimary().getCaterpillarLoot().keySet()) {
|
||||
itemRender.renderItemIntoGUI(fontRendererObj, mc.renderEngine, stack, (int) ((guiLeft + x) * (1 / factor)),
|
||||
(int) ((guiTop + getLineY()) * (1 / factor)));
|
||||
itemRender.renderItemIntoGUI(fontRendererObj, mc.renderEngine, stack, guiLeft + x, guiTop + getLineY());
|
||||
x += 18;
|
||||
if (x > adjustToFactor(148)) {
|
||||
if (x > 148) {
|
||||
x = COLUMN_0;
|
||||
newLine();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user