mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 05:02:34 +00:00
Added missed localization
This commit is contained in:
1 parent
b5989356ce
commit
5928473316
2 files changed
+40
-11
No files matched your search
@@ -10,6 +10,7 @@ import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.core.util.UniqueItemStackSet;
|
||||
import binnie.extratrees.craftgui.ControlFluidDisplay;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
@@ -31,14 +32,19 @@ import java.util.Map;
|
||||
public class AnalystPageProducts extends AnalystPageProduce {
|
||||
public AnalystPageProducts(IWidget parent, IArea area, IBee ind) {
|
||||
super(parent, area);
|
||||
setColor(13382400);
|
||||
setColor(0xcc3300);
|
||||
IBeeGenome genome = ind.getGenome();
|
||||
float speed = genome.getSpeed();
|
||||
float modeSpeed = Binnie.Genetics.getBeeRoot().getBeekeepingMode(BinnieCore.proxy.getWorld()).getBeeModifier().getProductionModifier(genome, 1.0f);
|
||||
int y = 4;
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.UNDERLINE + "Produce").setColor(getColor());
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.UNDERLINE + getTitle())
|
||||
.setColor(getColor());
|
||||
|
||||
y += 12;
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.ITALIC + "Rate: " + Binnie.Genetics.beeBreedingSystem.getAlleleName(EnumBeeChromosome.SPEED, ind.getGenome().getActiveAllele(EnumBeeChromosome.SPEED))).setColor(getColor());
|
||||
String alleleName = Binnie.Genetics.beeBreedingSystem.getAlleleName(EnumBeeChromosome.SPEED, ind.getGenome().getActiveAllele(EnumBeeChromosome.SPEED));
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.ITALIC + I18N.localise("genetics.gui.analyst.produce.rate", alleleName))
|
||||
.setColor(getColor());
|
||||
|
||||
y += 20;
|
||||
Collection<ItemStack> refinedProducts = new UniqueItemStackSet();
|
||||
Collection<ItemStack> productList = new UniqueItemStackSet();
|
||||
@@ -46,7 +52,9 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
products.putAll(genome.getPrimary().getProductChances());
|
||||
products.putAll(genome.getSecondary().getProductChances());
|
||||
if (!products.isEmpty()) {
|
||||
new ControlTextCentered(this, y, "Natural Products").setColor(getColor());
|
||||
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.produce.natural"))
|
||||
.setColor(getColor());
|
||||
|
||||
y += 12;
|
||||
for (Map.Entry<ItemStack, Float> entry : products.entrySet()) {
|
||||
if (!productList.add(entry.getKey())) {
|
||||
@@ -58,9 +66,10 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
}
|
||||
y += 12;
|
||||
}
|
||||
|
||||
products = genome.getPrimary().getSpecialtyChances();
|
||||
if (!products.isEmpty()) {
|
||||
new ControlTextCentered(this, y, "Specialty Products").setColor(getColor());
|
||||
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.produce.speciality")).setColor(getColor());
|
||||
y += 12;
|
||||
for (Map.Entry<ItemStack, Float> entry : products.entrySet()) {
|
||||
refinedProducts.addAll(getAllProducts(entry.getKey()));
|
||||
@@ -69,19 +78,24 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
}
|
||||
y += 12;
|
||||
}
|
||||
new ControlTextCentered(this, y, "Refined Products").setColor(getColor());
|
||||
|
||||
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.produce.refined"))
|
||||
.setColor(getColor());
|
||||
|
||||
y += 12;
|
||||
Collection<ItemStack> level2Products = new UniqueItemStackSet();
|
||||
for (ItemStack stack : refinedProducts) {
|
||||
level2Products.addAll(getAllProducts(stack));
|
||||
}
|
||||
|
||||
refinedProducts.addAll(level2Products);
|
||||
level2Products = new UniqueItemStackSet();
|
||||
for (ItemStack stack : refinedProducts) {
|
||||
level2Products.addAll(getAllProducts(stack));
|
||||
}
|
||||
|
||||
refinedProducts.addAll(level2Products);
|
||||
Collection<FluidStack> allFluids = new ArrayList<FluidStack>();
|
||||
Collection<FluidStack> allFluids = new ArrayList<>();
|
||||
for (ItemStack stack2 : refinedProducts) {
|
||||
for (FluidStack addition : getAllFluids(stack2)) {
|
||||
boolean alreadyIn = false;
|
||||
@@ -95,6 +109,7 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int maxBiomePerLine = (int) ((w() + 2.0f - 16.0f) / 18.0f);
|
||||
float biomeListX = (w() - (Math.min(maxBiomePerLine, allFluids.size() + refinedProducts.size()) * 18 - 2)) / 2.0f;
|
||||
int dx = 0;
|
||||
@@ -109,26 +124,31 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
display.setTooltip();
|
||||
dx += 18;
|
||||
}
|
||||
|
||||
for (FluidStack soilStack2 : allFluids) {
|
||||
if (dx >= 18 * maxBiomePerLine) {
|
||||
dx = 0;
|
||||
dy += 18;
|
||||
}
|
||||
|
||||
ItemStack container = null;
|
||||
for (FluidContainerRegistry.FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
|
||||
if (data.emptyContainer.isItemEqual(new ItemStack(Items.glass_bottle)) && data.fluid.isFluidEqual(soilStack2)) {
|
||||
container = data.filledContainer;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data.emptyContainer.isItemEqual(new ItemStack(Items.bucket)) && data.fluid.isFluidEqual(soilStack2)) {
|
||||
container = data.filledContainer;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data.fluid.isFluidEqual(soilStack2)) {
|
||||
container = data.filledContainer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (container == null) {
|
||||
ControlFluidDisplay display2 = new ControlFluidDisplay(this, biomeListX + dx, y + dy);
|
||||
display2.setItemStack(soilStack2);
|
||||
@@ -150,16 +170,17 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
super.getTooltip(tooltip);
|
||||
Collection<ItemStack> products = getCentrifuge(key);
|
||||
if (!products.isEmpty()) {
|
||||
tooltip.add("Centrifuges to give: ");
|
||||
tooltip.add(I18N.localise("genetics.gui.analyst.produce.centrifuge") + " ");
|
||||
for (ItemStack prod : products) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
prod.writeToNBT(nbt);
|
||||
tooltip.add(prod, prod.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
Collection<ItemStack> liquids = getSqueezer(key);
|
||||
if (!liquids.isEmpty()) {
|
||||
tooltip.add("Squeezes to give: ");
|
||||
tooltip.add(I18N.localise("genetics.gui.analyst.produce.squeezes") + " ");
|
||||
for (ItemStack prod2 : liquids) {
|
||||
NBTTagCompound nbt2 = new NBTTagCompound();
|
||||
prod2.writeToNBT(nbt2);
|
||||
@@ -168,17 +189,18 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
item.setTooltip();
|
||||
ControlText textWidget = new ControlTextCentered(this, y + 4, "");
|
||||
textWidget.setColor(getColor());
|
||||
CraftGUIUtil.moveWidget(textWidget, new IPoint(12.0f, 0.0f));
|
||||
item.setItemStack(key);
|
||||
float time = (int) (PluginApiculture.ticksPerBeeWorkCycle * 100.0 / (speed * value));
|
||||
textWidget.setValue("Every " + getTimeString(time));
|
||||
textWidget.setValue(I18N.localise("genetics.gui.analyst.produce.everyTime", getTimeString(time)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Produce";
|
||||
return I18N.localise("genetics.gui.analyst.produce");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user