diff --git a/lang b/lang index 0a10dcbeb..9e9f4e67d 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 0a10dcbebcb4d4f331ba10b1bc77e9f71fda0403 +Subproject commit 9e9f4e67d17a7372c6ba4f0425a87eb5ebda1c43 diff --git a/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java b/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java index 7ad854ced..7a1d43539 100755 --- a/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java +++ b/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java @@ -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); } } diff --git a/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java b/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java index 66b6ea163..9f004cff9 100755 --- a/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java +++ b/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java @@ -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(); } diff --git a/src/main/java/forestry/core/config/Config.java b/src/main/java/forestry/core/config/Config.java index 14f6bddb9..08ee283b1 100755 --- a/src/main/java/forestry/core/config/Config.java +++ b/src/main/java/forestry/core/config/Config.java @@ -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"); diff --git a/src/main/java/forestry/core/gui/GuiAlyzer.java b/src/main/java/forestry/core/gui/GuiAlyzer.java index a141a0276..d14eee27d 100755 --- a/src/main/java/forestry/core/gui/GuiAlyzer.java +++ b/src/main/java/forestry/core/gui/GuiAlyzer.java @@ -45,8 +45,8 @@ import forestry.core.utils.StringUtil; public abstract class GuiAlyzer extends GuiForestry { 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 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 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 } 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 } 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 } - 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 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 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 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 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); } } diff --git a/src/main/java/forestry/core/gui/GuiEscritoire.java b/src/main/java/forestry/core/gui/GuiEscritoire.java index 77cee81d9..af9646186 100755 --- a/src/main/java/forestry/core/gui/GuiEscritoire.java +++ b/src/main/java/forestry/core/gui/GuiEscritoire.java @@ -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 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 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 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 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 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 */ diff --git a/src/main/java/forestry/core/gui/GuiNaturalistInventory.java b/src/main/java/forestry/core/gui/GuiNaturalistInventory.java index a570b053c..84240b72f 100755 --- a/src/main/java/forestry/core/gui/GuiNaturalistInventory.java +++ b/src/main/java/forestry/core/gui/GuiNaturalistInventory.java @@ -162,7 +162,7 @@ public class GuiNaturalistInventory extends GuiForestry 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(); }