mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 12:09:39 +00:00
Fixed all the x-alyzer GUIs, this time with custom everything names!
This commit is contained in:
1 parent
9fc315c5f0
commit
063b3d1545
5 files changed
+40
-11
No files matched your search
@@ -32,6 +32,7 @@ import forestry.core.gui.GuiAlyzer;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.core.utils.Vect;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class GuiBeealyzer extends GuiAlyzer {
|
||||
|
||||
@@ -145,7 +146,10 @@ public class GuiBeealyzer extends GuiAlyzer {
|
||||
newLine();
|
||||
newLine();
|
||||
|
||||
drawSpeciesRow(StringUtil.localize("gui.species"), bee, EnumBeeChromosome.SPECIES);
|
||||
String customPrimaryBeeKey = "bees.custom.beealyzer." + bee.getGenome().getPrimary().getUnlocalizedName().replace("bees.species.","");
|
||||
String customSecondaryBeeKey = "bees.custom.beealyzer." + bee.getGenome().getSecondary().getUnlocalizedName().replace("bees.species.","");
|
||||
|
||||
drawSpeciesRow(StringUtil.localize("gui.species"), bee, EnumBeeChromosome.SPECIES, checkCustomName(customPrimaryBeeKey), checkCustomName(customSecondaryBeeKey));
|
||||
|
||||
drawRow(StringUtil.localize("gui.lifespan"), bee.getGenome().getActiveAllele(EnumBeeChromosome.LIFESPAN.ordinal()).getName(),
|
||||
bee.getGenome().getInactiveAllele(EnumBeeChromosome.LIFESPAN.ordinal()).getName(), bee,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.arboriculture.genetics;
|
||||
|
||||
import forestry.core.utils.StringUtil;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
@@ -38,7 +39,7 @@ public class GrowthProvider implements IGrowthProvider {
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Light";
|
||||
return StringUtil.localize("gui.growth.normal");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ package forestry.arboriculture.genetics;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import forestry.core.utils.StringUtil;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.arboriculture.EnumGrowthConditions;
|
||||
@@ -41,7 +42,7 @@ public class GrowthProviderTropical extends GrowthProvider {
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Tropical";
|
||||
return StringUtil.localize("gui.growth.tropical");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import java.util.Locale;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
@@ -146,7 +147,10 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
newLine();
|
||||
newLine();*/
|
||||
|
||||
drawSpeciesRow(StringUtil.localize("gui.species"), tree, EnumTreeChromosome.SPECIES);
|
||||
String customPrimaryTreeKey = "trees.custom.treealyzer." + tree.getGenome().getPrimary().getUnlocalizedName().replace("trees.species.","");
|
||||
String customSecondaryTreeKey = "trees.custom.treealyzer." + tree.getGenome().getSecondary().getUnlocalizedName().replace("trees.species.","");
|
||||
|
||||
drawSpeciesRow(StringUtil.localize("gui.species"), tree, EnumTreeChromosome.SPECIES, checkCustomName(customPrimaryTreeKey), checkCustomName(customSecondaryTreeKey));
|
||||
newLine();
|
||||
|
||||
drawLine(StringUtil.localize("gui.saplings"), COLUMN_0);
|
||||
@@ -264,9 +268,9 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
newLine();
|
||||
|
||||
if (families0.length > i)
|
||||
drawLine(StringUtil.localize(families0[i].getName()), COLUMN_1, speciesDominance0);
|
||||
drawLine(families0[i].getName(), COLUMN_1, speciesDominance0);
|
||||
if (families1.length > i)
|
||||
drawLine(StringUtil.localize(families1[i].getName()), COLUMN_2, speciesDominance1);
|
||||
drawLine(families1[i].getName(), COLUMN_2, speciesDominance1);
|
||||
|
||||
}
|
||||
|
||||
@@ -296,9 +300,9 @@ public class GuiTreealyzer extends GuiAlyzer {
|
||||
IFruitFamily secondary = ((IAlleleFruit) tree.getGenome().getInactiveAllele(EnumTreeChromosome.FRUITS.ordinal())).getProvider().getFamily();
|
||||
|
||||
if (primary != null)
|
||||
drawLine(StringUtil.localize(primary.getName()), COLUMN_1, fruitDominance0);
|
||||
drawLine(primary.getName(), COLUMN_1, fruitDominance0);
|
||||
if (secondary != null)
|
||||
drawLine(StringUtil.localize(secondary.getName()), COLUMN_2, fruitDominance1);
|
||||
drawLine(secondary.getName(), COLUMN_2, fruitDominance1);
|
||||
|
||||
endPage();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
@@ -85,7 +86,7 @@ public abstract class GuiAlyzer extends GuiForestry<TileForestry> {
|
||||
getColorCoding(individual.getGenome().getInactiveAllele(chromosome.ordinal()).isDominant()));
|
||||
}
|
||||
|
||||
protected final void drawSpeciesRow(String text0, IIndividual individual, Enum<?> chromosome) {
|
||||
protected final void drawSpeciesRow(String text0, IIndividual individual, Enum<?> chromosome, String customPrimaryName, String customSecondaryName) {
|
||||
IAlleleSpecies primary = individual.getGenome().getPrimary();
|
||||
IAlleleSpecies secondary = individual.getGenome().getSecondary();
|
||||
|
||||
@@ -97,14 +98,32 @@ public abstract class GuiAlyzer extends GuiForestry<TileForestry> {
|
||||
drawItemStack(iconStacks.get(secondary.getUID()), adjustToFactor(guiLeft + column2 + columnwidth + 4), adjustToFactor(guiTop + getLineY()));
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
drawSplitLine(primary.getName(), column1, columnwidth, individual, chromosome, false);
|
||||
drawSplitLine(secondary.getName(), column2, columnwidth, individual, chromosome, true);
|
||||
String primaryName;
|
||||
String secondaryName;
|
||||
|
||||
primaryName = customPrimaryName == null ? primary.getName() : customPrimaryName;
|
||||
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, Enum<?> chromosome){
|
||||
drawSpeciesRow(text0, individual, chromosome, null, null);
|
||||
}
|
||||
|
||||
protected final String checkCustomName(String key){
|
||||
if(StatCollector.canTranslate("for." + key)){
|
||||
return StringUtil.localize(key);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected final void drawAnalyticsPageClassification(IIndividual individual) {
|
||||
|
||||
startPage();
|
||||
|
||||
Reference in new issue
Block a user