This commit is contained in:
Nedelosk committed 2017-07-31 01:28:14 +02:00
1 parent 687c440c69
commit afb9460ff9
9 files changed
+41 -29

No files matched your search

@@ -67,9 +67,7 @@ public class ControlItemDisplay extends Control implements ITooltip {
RenderUtil.drawItem(Point.ZERO, this.itemStack, this.rotating);
GlStateManager.popMatrix();
} else {
GlStateManager.disableBlend();
RenderUtil.drawItem(Point.ZERO, this.itemStack, this.rotating);
GlStateManager.enableBlend();
}
GlStateManager.enableAlpha();
}
@@ -4,6 +4,7 @@ import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -395,7 +396,11 @@ public class WindowAnalyst extends Window {
public void onRenderBackground(int guiWidth, int guiHeight) {
boolean active = value == leftPage.getContent() || value == rightPage.getContent();
RenderUtil.setColour((active ? -16777216 : 1140850688) + value.getColor());
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
CraftGUI.render.texture(CraftGUITexture.TabSolid, getArea().inset(1));
GlStateManager.disableBlend();
GlStateManager.popMatrix();
RenderUtil.setColour(value.getColor());
CraftGUI.render.texture(CraftGUITexture.TabOutline, getArea().inset(1));
super.onRenderBackground(guiWidth, guiHeight);
@@ -12,4 +12,8 @@ public class AnalystConstants {
public static final String KARYOGRAM_KEY = KEY + ".karyogram";
public static final String MUTATIONS_KEY = KEY + ".mutations";
public static final String SPECIMEN_KEY = KEY + ".specimen";
public static final String WOOD_KEY = KEY + ".wood";
public static final String GROWTH_KEY = KEY + ".growth";
public static final String FRUIT_KEY = KEY + ".fruit";
public static final String CLIMATE_KEY = KEY + ".climate";
}
@@ -1,7 +1,6 @@
package binnie.genetics.gui.analyst;
import java.text.DecimalFormat;
import java.util.Locale;
import net.minecraft.util.text.TextFormatting;
@@ -174,10 +173,10 @@ public class AnalystPageBiology extends ControlAnalystPage {
.setColor(getColor());
y += 34;
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.BIOLOGY_KEY + ".planTypes")).setColor(getColor());
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.BIOLOGY_KEY + ".plantTypes")).setColor(getColor());
y += 12;
new ControlTextCentered(this, y, TextFormatting.ITALIC + tree.getGenome().getPrimary().getPlantType().toString().toLowerCase(Locale.ENGLISH))
new ControlTextCentered(this, y, TextFormatting.ITALIC + tree.getGenome().getPrimary().getPlantType().toString())
.setColor(getColor());
}
if (ind instanceof IFlower) {
@@ -27,6 +27,7 @@ import binnie.core.craftgui.geometry.Point;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.genetics.Tolerance;
import binnie.core.util.I18N;
import binnie.genetics.gui.analyst.AnalystConstants;
import binnie.genetics.gui.analyst.ControlAnalystPage;
import binnie.genetics.gui.analyst.ControlBiome;
import binnie.genetics.gui.analyst.ControlToleranceBar;
@@ -54,17 +55,17 @@ public class AnalystPageClimate extends ControlAnalystPage {
int y = 4;
new ControlTextCentered(this, y, TextFormatting.UNDERLINE + getTitle()).setColor(getColor());
y += 16;
new ControlText(this, new Area(4, y, width() - 8, 14), I18N.localise("genetics.gui.analyst.climate.temp"), TextJustification.MIDDLE_CENTER).setColor(getColor());
new ControlText(this, new Area(4, y, width() - 8, 14), I18N.localise(AnalystConstants.CLIMATE_KEY + ".temp"), TextJustification.MIDDLE_CENTER).setColor(getColor());
y += 12;
createTemperatureBar(this, (width() - 100) / 2, y, 100, 10, temp, tempTol);
y += 16;
if (!(ind instanceof IFlower)) {
new ControlText(this, new Area(4, y, width() - 8, 14), I18N.localise("genetics.gui.analyst.climate.hum"), TextJustification.MIDDLE_CENTER).setColor(getColor());
new ControlText(this, new Area(4, y, width() - 8, 14), I18N.localise(AnalystConstants.CLIMATE_KEY + ".hum"), TextJustification.MIDDLE_CENTER).setColor(getColor());
y += 12;
createHumidity(this, (width() - 100) / 2, y, 100, 10, humid, humidTol);
y += 16;
}
new ControlText(this, new Area(4, y, width() - 8, 14), I18N.localise("genetics.gui.analyst.climate.biomes"), TextJustification.MIDDLE_CENTER).setColor(getColor());
new ControlText(this, new Area(4, y, width() - 8, 14), I18N.localise(AnalystConstants.CLIMATE_KEY + ".biomes"), TextJustification.MIDDLE_CENTER).setColor(getColor());
y += 12;
List<Biome> biomes = new ArrayList<>();
for (Biome biome : Biome.EXPLORATION_BIOMES_LIST) { //TODO check
@@ -128,6 +129,6 @@ public class AnalystPageClimate extends ControlAnalystPage {
@Override
public String getTitle() {
return I18N.localise("genetics.gui.analyst.climate.title");
return I18N.localise(AnalystConstants.CLIMATE_KEY + ".title");
}
}
@@ -27,6 +27,7 @@ import binnie.core.craftgui.geometry.Point;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
import binnie.core.util.I18N;
import binnie.core.util.UniqueItemStackSet;
import binnie.genetics.gui.analyst.AnalystConstants;
import binnie.genetics.gui.analyst.AnalystPageProduce;
public class AnalystPageFruit extends AnalystPageProduce {
@@ -37,7 +38,7 @@ public class AnalystPageFruit extends AnalystPageProduce {
int y = 4;
new ControlTextCentered(this, y, TextFormatting.UNDERLINE + getTitle()).setColor(getColor());
y += 12;
new ControlTextCentered(this, y, TextFormatting.ITALIC + I18N.localise("genetics.gui.analyst.fruit.yield") + ": " + Binnie.GENETICS.treeBreedingSystem.getAlleleName(EnumTreeChromosome.YIELD, ind.getGenome().getActiveAllele(EnumTreeChromosome.YIELD))).setColor(getColor());
new ControlTextCentered(this, y, TextFormatting.ITALIC + I18N.localise(AnalystConstants.FRUIT_KEY + ".yield") + ": " + Binnie.GENETICS.treeBreedingSystem.getAlleleName(EnumTreeChromosome.YIELD, ind.getGenome().getActiveAllele(EnumTreeChromosome.YIELD))).setColor(getColor());
y += 20;
Collection<ItemStack> products = new UniqueItemStackSet();
Collection<ItemStack> specialties = new UniqueItemStackSet();
@@ -55,7 +56,7 @@ public class AnalystPageFruit extends AnalystPageProduce {
throw Throwables.propagate(e);
}
if (products.size() > 0) {
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.fruit.natural")).setColor(getColor());
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.FRUIT_KEY + ".natural")).setColor(getColor());
y += 10;
int w = products.size() * 18 - 2;
int i = 0;
@@ -67,7 +68,7 @@ public class AnalystPageFruit extends AnalystPageProduce {
y += 26;
}
if (specialties.size() > 0) {
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.fruit.specialty")).setColor(getColor());
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.FRUIT_KEY + ".specialty")).setColor(getColor());
y += 10;
int w = products.size() * 18 - 2;
int i = 0;
@@ -84,14 +85,14 @@ public class AnalystPageFruit extends AnalystPageProduce {
Collection<ItemStack> refinedProducts = new UniqueItemStackSet();
refinedProducts.addAll(getAllProductsAndFluids(allProducts));
if (refinedProducts.size() > 0) {
y = getRefined(I18N.localise("genetics.gui.analyst.fruit.refined"), y, refinedProducts);
y = getRefined(I18N.localise(AnalystConstants.FRUIT_KEY + ".refined"), y, refinedProducts);
y += 8;
}
if (products.size() == 0 && specialties.size() == 0) {
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.fruit.noFruits")).setColor(getColor());
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.FRUIT_KEY + ".noFruits")).setColor(getColor());
y += 28;
}
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.fruit.possible")).setColor(getColor());
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.FRUIT_KEY + ".possible")).setColor(getColor());
y += 12;
Collection<IAllele> fruitAlleles = Binnie.GENETICS.getChromosomeMap(Binnie.GENETICS.getTreeRoot()).get(EnumTreeChromosome.FRUITS);
for (IFruitFamily fam : ind.getGenome().getPrimary().getSuitableFruit()) {
@@ -125,6 +126,6 @@ public class AnalystPageFruit extends AnalystPageProduce {
@Override
public String getTitle() {
return I18N.localise("genetics.gui.analyst.fruit.title");
return I18N.localise(AnalystConstants.FRUIT_KEY + ".title");
}
}
@@ -12,6 +12,7 @@ import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.geometry.Area;
import binnie.core.util.I18N;
import binnie.genetics.gui.analyst.AnalystConstants;
import binnie.genetics.gui.analyst.ControlAnalystPage;
public class AnalystPageGrowth extends ControlAnalystPage {
@@ -25,18 +26,18 @@ public class AnalystPageGrowth extends ControlAnalystPage {
if (ind instanceof ITree) {
ITree tree = (ITree) ind;
int mat = tree.getGenome().getMaturationTime();
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.growth.mature")).setColor(getColor());
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.GROWTH_KEY + ".mature")).setColor(getColor());
y += 12;
new ControlTextCentered(this, y, TextFormatting.BOLD + getTimeString(Math.round(1373.3999f * mat))).setColor(getColor());
y += 22;
new ControlTextCentered(this, y, TextFormatting.ITALIC + I18N.localise("genetics.gui.analyst.growth.height") + ": " + Binnie.GENETICS.treeBreedingSystem.getAlleleName(EnumTreeChromosome.HEIGHT, ind.getGenome().getActiveAllele(EnumTreeChromosome.HEIGHT))).setColor(getColor());
new ControlTextCentered(this, y, TextFormatting.ITALIC + I18N.localise(AnalystConstants.GROWTH_KEY + ".height") + ": " + Binnie.GENETICS.treeBreedingSystem.getAlleleName(EnumTreeChromosome.HEIGHT, ind.getGenome().getActiveAllele(EnumTreeChromosome.HEIGHT))).setColor(getColor());
y += 12;
new ControlTextCentered(this, y, TextFormatting.ITALIC + I18N.localise("genetics.gui.analyst.growth.girth") + ": " + Binnie.GENETICS.treeBreedingSystem.getAlleleName(EnumTreeChromosome.GIRTH, ind.getGenome().getActiveAllele(EnumTreeChromosome.GIRTH))).setColor(getColor());
new ControlTextCentered(this, y, TextFormatting.ITALIC + I18N.localise(AnalystConstants.GROWTH_KEY + ".girth") + ": " + Binnie.GENETICS.treeBreedingSystem.getAlleleName(EnumTreeChromosome.GIRTH, ind.getGenome().getActiveAllele(EnumTreeChromosome.GIRTH))).setColor(getColor());
}
}
@Override
public String getTitle() {
return I18N.localise("genetics.gui.analyst.growth.title");
return I18N.localise(AnalystConstants.GROWTH_KEY + ".title");
}
}
@@ -22,6 +22,7 @@ import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
import binnie.core.util.I18N;
import binnie.core.util.UniqueItemStackSet;
import binnie.genetics.gui.analyst.AnalystConstants;
import binnie.genetics.gui.analyst.AnalystPageProduce;
import binnie.genetics.item.ModuleItems;
@@ -35,9 +36,9 @@ public class AnalystPageWood extends AnalystPageProduce {
new ControlTextCentered(this, y, TextFormatting.UNDERLINE + getTitle()).setColor(getColor());
y += 12;
if (((IAlleleBoolean) ind.getGenome().getActiveAllele(EnumTreeChromosome.FIREPROOF)).getValue()) {
new ControlIconDisplay(this, (width() - 16) / 2, y, ModuleItems.iconNoFire).addTooltip(I18N.localise("genetics.gui.analyst.wood.fireproof"));
new ControlIconDisplay(this, (width() - 16) / 2, y, ModuleItems.iconNoFire).addTooltip(I18N.localise(AnalystConstants.WOOD_KEY + ".fireproof"));
} else {
new ControlIconDisplay(this, (width() - 16) / 2, y, ModuleItems.iconFire).addTooltip(I18N.localise("genetics.gui.analyst.wood.flammable"));
new ControlIconDisplay(this, (width() - 16) / 2, y, ModuleItems.iconFire).addTooltip(I18N.localise(AnalystConstants.WOOD_KEY + ".flammable"));
}
y += 30;
Collection<ItemStack> products = new UniqueItemStackSet();
@@ -47,9 +48,10 @@ public class AnalystPageWood extends AnalystPageProduce {
if (!stackWood.isEmpty()) {
products.add(stackWood);
}
products.addAll(ind.getGenome().getFruitProvider().getProducts().keySet());
//Why ?
//products.addAll(ind.getGenome().getFruitProvider().getProducts().keySet());
if (products.size() > 0) {
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.wood.logs")).setColor(getColor());
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.WOOD_KEY + ".logs")).setColor(getColor());
y += 10;
int w = products.size() * 18 - 2;
int i = 0;
@@ -57,6 +59,7 @@ public class AnalystPageWood extends AnalystPageProduce {
ControlItemDisplay d = new ControlItemDisplay(this, (width() - w) / 2 + 18 * i, y);
d.setTooltip();
d.setItemStack(stack);
i++;
}
y += 26;
}
@@ -65,11 +68,11 @@ public class AnalystPageWood extends AnalystPageProduce {
Collection<ItemStack> refinedProducts = new UniqueItemStackSet();
refinedProducts.addAll(getAllProductsAndFluids(allProducts));
if (refinedProducts.size() > 0) {
y = getRefined(I18N.localise("genetics.gui.analyst.wood.refined"), y, refinedProducts);
y = getRefined(I18N.localise(AnalystConstants.WOOD_KEY + ".refined"), y, refinedProducts);
y += 8;
}
if (products.size() == 0) {
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.wood.noFruits")).setColor(getColor());
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.WOOD_KEY + ".noFruits")).setColor(getColor());
y += 28;
}
setSize(new Point(width(), y + 8));
@@ -77,6 +80,6 @@ public class AnalystPageWood extends AnalystPageProduce {
@Override
public String getTitle() {
return I18N.localise("genetics.gui.analyst.wood.title");
return I18N.localise(AnalystConstants.WOOD_KEY + ".title");
}
}