Feature/refactoring (#85)

* Added some localization

* Added some localization

* Fix modid

* Added some localization
This commit is contained in:
Alexander Kornilov authored and mezz committed 2017-05-31 21:06:11 -07:00
1 parent b5a6919f7f
commit 0c15ee9943
35 files changed
+361 -189

No files matched your search

@@ -17,6 +17,7 @@ import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
import binnie.core.craftgui.resource.Texture;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.core.util.I18N;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.genetics.machine.sequencer.Sequencer;
@@ -27,8 +28,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
public class WindowSequencer extends WindowMachine {
protected static Texture ProgressBase = new StandardTexture(64, 114, 98, 9, ExtraBeeTexture.GUIProgress.getTexture());
protected static Texture Progress = new StandardTexture(64, 123, 98, 9, ExtraBeeTexture.GUIProgress.getTexture());
protected static Texture progressBase = new StandardTexture(64, 114, 98, 9, ExtraBeeTexture.GUIProgress.getTexture());
protected static Texture progress = new StandardTexture(64, 123, 98, 9, ExtraBeeTexture.GUIProgress.getTexture());
protected ControlText slotText;
@@ -43,14 +44,17 @@ public class WindowSequencer extends WindowMachine {
@Override
public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound nbt) {
if (side == Side.CLIENT && name.equals("username")) {
slotText.setValue(EnumChatFormatting.DARK_GRAY + "Genes will be sequenced by " + nbt.getString("username"));
slotText.setValue(
EnumChatFormatting.DARK_GRAY
+ I18N.localise(Genetics.instance, "machine.sequencer.gui.sequensedBy", nbt.getString("username"))
);
}
super.recieveGuiNBT(side, player, name, nbt);
}
@Override
public void initialiseClient() {
setTitle("Sequencer");
super.initialiseClient();
int x = 16;
int y = 32;
CraftGUIUtil.horizontalGrid(x, y, TextJustification.MiddleCenter, 2.0f, new ControlSlotArray(this, 0, 0, 2, 2).create(Sequencer.SLOT_RESERVE), new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()), new ControlSequencerProgress(this, 0, 0), new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()), new ControlSlot(this, 0.0f, 0.0f).assign(6));
@@ -58,7 +62,7 @@ public class WindowSequencer extends WindowMachine {
slotTarget.assign(5);
x = 34;
y = 92;
slotText = new ControlText(this, new IArea(0.0f, y, w(), 12.0f), EnumChatFormatting.DARK_GRAY + "Userless. Will not save sequences", TextJustification.MiddleCenter);
slotText = new ControlText(this, new IArea(0.0f, y, w(), 12.0f), EnumChatFormatting.DARK_GRAY + I18N.localise(Genetics.instance, "machine.sequencer.gui.willNotSave"), TextJustification.MiddleCenter);
y += 20;
ControlSlot slotDye = new ControlSlot(this, x, y);
slotDye.assign(0);
@@ -67,13 +71,13 @@ public class WindowSequencer extends WindowMachine {
x += 32;
new ControlEnergyBar(this, x, y, 60, 16, Position.LEFT);
x += 92;
ControlErrorState errorState = new ControlErrorState(this, x, y + 1);
new ControlErrorState(this, x, y + 1);
new ControlPlayerInventory(this);
}
@Override
public String getTitle() {
return "Incubator";
return I18N.localise(Genetics.instance, "machine.machine.sequencer");
}
@Override
@@ -83,6 +87,6 @@ public class WindowSequencer extends WindowMachine {
@Override
protected String getName() {
return "Sequencer";
return getTitle();
}
}