mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 13:09:47 +00:00
Added missed localization
This commit is contained in:
1 parent
0b9b0c0068
commit
4d1d3d1cca
5 files changed
+53
-29
No files matched your search
@@ -7,6 +7,7 @@ import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
@@ -18,17 +19,19 @@ public class AnalystPageDescription extends ControlAnalystPage {
|
||||
int y = 4;
|
||||
|
||||
IAlleleSpecies species = ind.getGenome().getPrimary();
|
||||
String branchBinomial = (species.getBranch() != null) ? species.getBranch().getScientific() : "<Unknown>";
|
||||
String branchBinomial = (species.getBranch() != null)
|
||||
? species.getBranch().getScientific()
|
||||
: I18N.localise("genetics.gui.analyst.description.unknown");
|
||||
String desc = species.getDescription();
|
||||
String descBody = EnumChatFormatting.ITALIC.toString();
|
||||
StringBuilder descBody = new StringBuilder(EnumChatFormatting.ITALIC.toString());
|
||||
String descSig = "";
|
||||
if (desc == null || desc.isEmpty() || desc.matches("(\\w+\\.?)+")) {
|
||||
descBody += "";
|
||||
descBody.append("");
|
||||
} else {
|
||||
String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
descBody.append(descStrings[0]);
|
||||
for (int i = 1; i < descStrings.length - 1; ++i) {
|
||||
descBody += " " + descStrings[i];
|
||||
descBody.append(" ").append(descStrings[i]);
|
||||
}
|
||||
if (descStrings.length > 1) {
|
||||
descSig += descStrings[descStrings.length - 1];
|
||||
@@ -37,27 +40,36 @@ public class AnalystPageDescription extends ControlAnalystPage {
|
||||
|
||||
String authority = species.getAuthority();
|
||||
if (authority.contains("Binnie")) {
|
||||
authority = EnumChatFormatting.DARK_BLUE.toString() + EnumChatFormatting.BOLD + authority;
|
||||
authority = EnumChatFormatting.DARK_BLUE.toString() + authority;
|
||||
}
|
||||
if (authority.contains("Sengir")) {
|
||||
authority = EnumChatFormatting.DARK_GREEN.toString() + EnumChatFormatting.BOLD + authority;
|
||||
authority = EnumChatFormatting.DARK_GREEN.toString() + authority;
|
||||
}
|
||||
if (authority.contains("MysteriousAges")) {
|
||||
authority = EnumChatFormatting.DARK_PURPLE.toString() + EnumChatFormatting.BOLD + authority;
|
||||
authority = EnumChatFormatting.DARK_PURPLE.toString() + authority;
|
||||
}
|
||||
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.UNDERLINE + "Description").setColor(getColor());
|
||||
y += 16;
|
||||
new ControlTextCentered(this, y, species.getName() + EnumChatFormatting.RESET).setColor(getColor());
|
||||
y += 10;
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.ITALIC + branchBinomial + " " + species.getBinomial() + EnumChatFormatting.RESET).setColor(getColor());
|
||||
y += 20;
|
||||
new ControlTextCentered(this, y, "Discovered by " + EnumChatFormatting.BOLD + authority + EnumChatFormatting.RESET).setColor(getColor());
|
||||
y += (int) (3.0f + CraftGUI.Render.textHeight("Discovered by " + EnumChatFormatting.BOLD + authority + EnumChatFormatting.RESET, w()));
|
||||
new ControlTextCentered(this, y, "Genetic Complexity: " + species.getComplexity()).setColor(getColor());
|
||||
y += 26;
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.UNDERLINE + getTitle())
|
||||
.setColor(getColor());
|
||||
|
||||
ControlText descText = new ControlText(this, new IArea(8.0f, y, w() - 16.0f, 0.0f), descBody + EnumChatFormatting.RESET, TextJustification.TOP_CENTER);
|
||||
y += 16;
|
||||
new ControlTextCentered(this, y, species.getName() + EnumChatFormatting.RESET)
|
||||
.setColor(getColor());
|
||||
|
||||
y += 10;
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.ITALIC + branchBinomial + " " + species.getBinomial() + EnumChatFormatting.RESET)
|
||||
.setColor(getColor());
|
||||
|
||||
y += 20;
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.BOLD + I18N.localise("genetics.gui.analyst.description.discoveredBy", authority) + EnumChatFormatting.RESET)
|
||||
.setColor(getColor());
|
||||
|
||||
y += (int) (3.0f + CraftGUI.Render.textHeight(EnumChatFormatting.BOLD + I18N.localise("genetics.gui.analyst.description.discoveredBy", authority) + EnumChatFormatting.RESET, w()));
|
||||
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.description.complexity", species.getComplexity()))
|
||||
.setColor(getColor());
|
||||
|
||||
y += 26;
|
||||
ControlText descText = new ControlText(this, new IArea(8.0f, y, w() - 16.0f, 0.0f), descBody.toString() + EnumChatFormatting.RESET, TextJustification.TOP_CENTER);
|
||||
IWidget signatureText = new ControlText(this, new IArea(8.0f, y, w() - 16.0f, 0.0f), descSig + EnumChatFormatting.RESET, TextJustification.BOTTOM_RIGHT);
|
||||
descText.setColor(getColor());
|
||||
signatureText.setColor(getColor());
|
||||
@@ -68,6 +80,6 @@ public class AnalystPageDescription extends ControlAnalystPage {
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Description";
|
||||
return I18N.localise("genetics.gui.analyst.description");
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
}
|
||||
|
||||
public Collection<ItemStack> getSqueezer(ItemStack stack) {
|
||||
List<ItemStack> products = new ArrayList<ItemStack>();
|
||||
List<ItemStack> products = new ArrayList<>();
|
||||
for (Map.Entry<Object[], Object[]> recipe : RecipeManagers.squeezerManager.getRecipes().entrySet()) {
|
||||
boolean isRecipe = false;
|
||||
for (Object obj : recipe.getKey()) {
|
||||
@@ -79,7 +79,7 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
}
|
||||
|
||||
public Collection<ItemStack> getCrafting(ItemStack stack) {
|
||||
List<ItemStack> products = new ArrayList<ItemStack>();
|
||||
List<ItemStack> products = new ArrayList<>();
|
||||
for (Object recipeO : CraftingManager.getInstance().getRecipeList()) {
|
||||
if (recipeO instanceof ShapelessRecipes) {
|
||||
ShapelessRecipes recipe = (ShapelessRecipes) recipeO;
|
||||
|
||||
@@ -12,6 +12,7 @@ import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.core.texture.BinnieCoreTexture;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
@@ -52,8 +53,8 @@ public class ControlAnalystChromosome extends Control implements ITooltip {
|
||||
if (isHomozygous()) {
|
||||
tooltip.add(system.getAlleleName(chromosomeType, allele0));
|
||||
} else {
|
||||
tooltip.add("Active: " + system.getAlleleName(chromosomeType, allele0));
|
||||
tooltip.add("Inactive: " + system.getAlleleName(chromosomeType, allele1));
|
||||
tooltip.add(I18N.localise("genetics.gui.analyst.chromosome.active", system.getAlleleName(chromosomeType, allele0)));
|
||||
tooltip.add(I18N.localise("genetics.gui.analyst.chromosome.inactive", system.getAlleleName(chromosomeType, allele1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package binnie.genetics.gui;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
@@ -14,6 +15,7 @@ public abstract class ControlAnalystPage extends Control {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public abstract String getTitle();
|
||||
@@ -24,11 +26,11 @@ public abstract class ControlAnalystPage extends Control {
|
||||
float hours = minutes / 60.0f;
|
||||
DecimalFormat df = new DecimalFormat("#.0");
|
||||
if (hours > 1.0f) {
|
||||
return df.format(hours) + " hours";
|
||||
return I18N.localise("genetics.gui.analyst.page.hours", df.format(hours));
|
||||
}
|
||||
if (minutes > 1.0f) {
|
||||
return df.format(minutes) + " min.";
|
||||
return I18N.localise("genetics.gui.analyst.page.minutes", df.format(minutes));
|
||||
}
|
||||
return df.format(seconds) + " sec.";
|
||||
return I18N.localise("genetics.gui.analyst.page.seconds", df.format(seconds));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user