Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.controls.core.Control;
import binnie.core.craftgui.minecraft.InventoryType;
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
import binnie.core.network.packet.MessageCraftGUI;

public class ControlPlayerInventory extends Control {
Expand All @@ -24,19 +25,21 @@ public ControlPlayerInventory(IWidget parent, boolean wide) {
slots = new ArrayList<>();
for (int row = 0; row < 3; ++row) {
for (int column = 0; column < 9; ++column) {
ControlSlot slot = new ControlSlot(this, (wide ? 58 : 0) + column * 18, row * 18);
ControlSlot slot = new ControlSlot(this, (wide ? 58 : 0) + column * 18, row * 18)
.setSlotTexture(CraftGUITexture.SlotInventory);
slots.add(slot);
}
}

if (wide) {
for (int i1 = 0; i1 < 9; ++i1) {
ControlSlot slot2 = new ControlSlot(this, i1 % 3 * 18, i1 / 3 * 18);
ControlSlot slot2 = new ControlSlot(this, i1 % 3 * 18, i1 / 3 * 18)
.setSlotTexture(CraftGUITexture.SlotInventory);
slots.add(slot2);
}
} else {
for (int i1 = 0; i1 < 9; ++i1) {
ControlSlot slot2 = new ControlSlot(this, i1 * 18, 58.0f);
ControlSlot slot2 = new ControlSlot(this, i1 * 18, 58.0f).setSlotTexture(CraftGUITexture.SlotInventory);
slots.add(slot2);
}
}
Expand All @@ -51,7 +54,8 @@ public ControlPlayerInventory(IWidget parent, int x, int y) {
slots = new ArrayList<>();
for (int row = 0; row < 6; ++row) {
for (int column = 0; column < 6; ++column) {
ControlSlot slot = new ControlSlot(this, column * 18, row * 18);
ControlSlot slot = new ControlSlot(this, column * 18, row * 18)
.setSlotTexture(CraftGUITexture.SlotInventory);
slots.add(slot);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ public class ControlSlot extends ControlSlotBase {
}

public Slot slot;
private CraftGUITexture slotTexture;

public ControlSlot(IWidget parent, float x, float y) {
super(parent, x, y);
slot = null;
slotTexture = CraftGUITexture.Slot;
addSelfEventHandler(new EventMouse.Down.Handler() {

@Override
Expand Down Expand Up @@ -80,11 +82,17 @@ public void onEvent(EventMouse.Down event) {
public ControlSlot(IWidget parent, int x, int y, Slot slot) {
super(parent, x, y);
this.slot = slot;
slotTexture = CraftGUITexture.Slot;
}

public ControlSlot setSlotTexture(CraftGUITexture texture) {
slotTexture = texture == null ? CraftGUITexture.Slot : texture;
return this;
}

@Override
public void onRenderBackground() {
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
CraftGUI.render.texture(slotTexture, IPoint.ZERO);
if (slot == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public enum CraftGUITexture {
Button("button"),
ButtonHighlighted("button.highlighted"),
Slot("slot"),
SlotInventory("slot.inventory"),
SlotBorder("slot.border"),
SlotOverlay("slot.overlay"),
SlotCharge("slot.charge"),
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/binnie/core/machines/MachinePackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public String getDisplayName() {
return I18N.localise(group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID());
}

public String getGuiDisplayName() {
String guiKey = group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID() + ".title";
return I18N.canLocalise(guiKey) ? I18N.localise(guiKey) : getDisplayName();
}

public Integer getMetadata() {
return metadata;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public WindowCompartment(EntityPlayer player, IInventory inventory, Side side) {

@Override
public void initialiseClient() {
setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
setTitle(Machine.getMachine(getInventory()).getPackage().getGuiDisplayName());
int x = 16;
int y = 32;
ComponentCompartmentInventory inv = Machine.getMachine(getInventory())
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/binnie/extrabees/gui/WindowAlvearyFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import binnie.core.machines.Machine;
import binnie.core.machines.TileEntityMachine;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.util.I18N;
import binnie.extrabees.ExtraBees;
import cpw.mods.fml.relauncher.Side;

Expand All @@ -35,7 +34,7 @@ public static Window create(EntityPlayer player, IInventory inventory, Side side

@Override
public void initialiseClient() {
setTitle(I18N.localise("extrabees.machine.alveay.frame"));
setTitle(machine.getPackage().getGuiDisplayName());
final NBTTagList actions = new NBTTagList();
playerInventory = new ControlPlayerInventory(this).create(actions);
new ControlSlot(this, 79.0f, 30.0f).assign(actions, InventoryType.Machine, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import binnie.core.machines.Machine;
import binnie.core.machines.TileEntityMachine;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.util.I18N;
import binnie.extrabees.ExtraBees;
import binnie.extrabees.apiary.machine.hatchery.AlvearyHatchery;
import cpw.mods.fml.relauncher.Side;
Expand All @@ -37,7 +36,7 @@ public static Window create(EntityPlayer player, IInventory inventory, Side side
@Override
public void initialiseClient() {
final NBTTagList actions = new NBTTagList();
setTitle(I18N.localise("extrabees.machine.alveay.hatchery"));
setTitle(machine.getPackage().getGuiDisplayName());
playerInventory = new ControlPlayerInventory(this).create(actions);
new ControlSlotArray(this, 43, 30, 5, 1).create(actions, InventoryType.Machine, AlvearyHatchery.SLOT_LARVAE);
MessageCraftGUI.sendToServer(actions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static Window create(EntityPlayer player, IInventory inventory, Side side
public void initialiseClient() {
final NBTTagList actions = new NBTTagList();

setTitle(I18N.localise("extrabees.machine.alveay.mutator"));
setTitle(machine.getPackage().getGuiDisplayName());
playerInventory = new ControlPlayerInventory(this).create(actions);
new ControlSlot(this, 79.0f, 30.0f).assign(actions, InventoryType.Machine, AlvearyMutator.SLOT_MUTATOR);
new ControlText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import binnie.core.machines.Machine;
import binnie.core.machines.TileEntityMachine;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.util.I18N;
import binnie.extrabees.ExtraBees;
import binnie.extrabees.apiary.machine.stimulator.AlvearyStimulator;
import cpw.mods.fml.relauncher.Side;
Expand All @@ -39,7 +38,7 @@ public static Window create(EntityPlayer player, IInventory inventory, Side side
@Override
public void initialiseClient() {
final NBTTagList actions = new NBTTagList();
setTitle(I18N.localise("extrabees.machine.alveay.stimulator"));
setTitle(machine.getPackage().getGuiDisplayName());
playerInventory = new ControlPlayerInventory(this).create(actions);
new ControlSlot(this, 41.0f, 28.0f).assign(actions, InventoryType.Machine, AlvearyStimulator.SLOT_CIRCUIT);
new ControlEnergyBar(this, 75, 29, 60, 16, Position.LEFT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected String getName() {
public void initialiseClient() {
final NBTTagList actions = new NBTTagList();

setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
setTitle(Machine.getMachine(getInventory()).getPackage().getGuiDisplayName());
new ControlSlot(this, 42.0f, 43.0f).assign(actions, InventoryType.Machine, Lumbermill.SLOT_WOOD);
new ControlSlot(this, 148.0f, 43.0f).assign(actions, InventoryType.Machine, Lumbermill.SLOT_PLANKS);
new ControlSlot(this, 172.0f, 28.0f).assign(actions, InventoryType.Machine, Lumbermill.SLOT_BARK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static Window create(EntityPlayer player, IInventory inventory, Side side
public void initialiseClient() {
final NBTTagList actions = new NBTTagList();

setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
setTitle(Machine.getMachine(getInventory()).getPackage().getGuiDisplayName());
new ControlText(
this,
new IArea(190.0f, 36.0f, 114.0f, 10.0f),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void initialiseClient() {

@Override
public String getTitle() {
return I18N.localise("genetics.machine.labMachine.acclimatiser");
return I18N.localise("gui.genetics.machine.labMachine.acclimatiser.title");
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/binnie/genetics/craftgui/WindowAnalyser.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void initialiseClient() {

@Override
public String getTitle() {
return I18N.localise("genetics.machine.labMachine.analyser");
return I18N.localise("gui.genetics.machine.labMachine.analyser.title");
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/binnie/genetics/craftgui/WindowGenepool.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void initialiseClient() {

@Override
public String getTitle() {
return I18N.localise("genetics.machine.labMachine.genepool");
return I18N.localise("gui.genetics.machine.labMachine.genepool.title");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void initialiseClient() {

@Override
public String getTitle() {
return I18N.localise("genetics.machine.labMachine.incubator");
return I18N.localise("gui.genetics.machine.labMachine.incubator.title");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void initialiseClient() {

@Override
public String getTitle() {
return I18N.localise("genetics.machine.machine.inoculator");
return I18N.localise("gui.genetics.machine.machine.inoculator.title");
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/binnie/genetics/craftgui/WindowIsolator.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void initialiseClient() {

@Override
public String getTitle() {
return I18N.localise("genetics.machine.machine.isolator");
return I18N.localise("gui.genetics.machine.machine.isolator.title");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void initialiseClient() {

@Override
public String getTitle() {
return I18N.localise("genetics.machine.machine.polymeriser");
return I18N.localise("gui.genetics.machine.machine.polymeriser.title");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void initialiseClient() {

@Override
public String getTitle() {
return I18N.localise("genetics.machine.machine.sequencer");
return I18N.localise("gui.genetics.machine.machine.sequencer.title");
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/binnie/genetics/craftgui/WindowSplicer.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void initialiseClient() {

@Override
public String getTitle() {
return I18N.localise("genetics.machine.advMachine.splicer");
return I18N.localise("gui.genetics.machine.advMachine.splicer.title");
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/binnie/genetics/gui/WindowAnalyst.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ public void initialiseServer() {
public void initialiseClient() {
if (isDatabase) {
if (isMaster) {
setTitle(I18N.localise("genetics.item.registry.1.name"));
setTitle(I18N.localise("genetics.gui.registry.1.title"));
} else {
setTitle(I18N.localise("genetics.item.registry.0.name"));
setTitle(I18N.localise("genetics.gui.registry.title"));
}
} else {
setTitle(I18N.localise("genetics.item.analyst.name"));
setTitle(I18N.localise("genetics.gui.analyst.title"));
}

getWindowInventory().createSlot(0);
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/assets/binniecore/gui/stylesheet.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
"uv": "4 4 18 18",
"padding": "2"
},
{
"name": "slot.inventory",
"sheet": "slots",
"uv": "76 4 18 18",
"padding": "2"
},
{
"name": "slot.border",
"sheet": "slots",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/main/resources/assets/genetics/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ genetics.item.registry.1.name=Master Registry
genetics.item.serum.name=%s Serum
genetics.item.serumArray.name=%s Serum Array

genetics.gui.registry.title=Registry
genetics.gui.registry.1.title=Master Registry
genetics.gui.analyst.title=Analyst

genetics.item.sequence=DNA Sequence
genetics.item.sequence.0=Very Faint
genetics.item.sequence.1=Faint
Expand All @@ -59,6 +63,7 @@ genetics.sequence.partially=Partially Sequenced (%d%%)

tile.machine.name=Isolator
genetics.machine.machine.isolator=Isolator
gui.genetics.machine.machine.isolator.title=Isolator
genetics.machine.machine.isolator.info=The Isolator takes a random allele from a bee, tree or other individual and copies it into an empty sequence vial. This requires the use of ethanol as a solvent and an enzyme to cut up the DNA. The unsequenced serums can then be amplified in a Polymeriser and sequenced in a Sequencer. This process has a small chance to destroy the individual.
genetics.machine.isolator.error.noIndividual=No individual to isolate
genetics.machine.isolator.error.noRoom=No room for DNA sequences
Expand All @@ -67,6 +72,7 @@ genetics.machine.isolator.error.noLiquid=Insufficient ethanol
genetics.machine.isolator.error.noEnzyme=No enzyme

genetics.machine.machine.sequencer=Sequencer
gui.genetics.machine.machine.sequencer.title=Sequencer
genetics.machine.machine.sequencer.info=The Sequencer takes unsequenced serums and determines which allele is present in them. This process is slow and requires the use of fluorescent dye.
genetics.machine.sequencer.unsequencedDNA=Unsequenced DNA
genetics.machine.sequencer.error.noSequence=No DNA sequence
Expand All @@ -78,6 +84,7 @@ genetics.machine.sequencer.gui.sequensedBy=Genes will be sequenced by %s
genetics.machine.sequencer.gui.willNotSave=Userless. Will not save sequences

genetics.machine.machine.polymeriser=Polymeriser
gui.genetics.machine.machine.polymeriser.title=Polymeriser
genetics.machine.machine.polymeriser.info=The Polymeriser fills empty serums with Raw DNA and replicating bacteria. This process can be accelerated using gold nuggets.
genetics.machine.polymeriser.error.noItem=No item to replicate
genetics.machine.polymeriser.error.itemFilled=Item Filled
Expand All @@ -88,6 +95,7 @@ genetics.machine.polymeriser.replicatingWithGenes=Replicating with %d genes
genetics.machine.polymeriser.unfilledSerum=Unfilled Serum

genetics.machine.machine.inoculator=Inoculator
gui.genetics.machine.machine.inoculator.title=Inoculator
genetics.machine.machine.inoculator.info=The Inoculator uses serums to add genes to breedable individuals. This process is very slow and requires a Bacteria Vector, but is always successful.
genetics.machine.inoculator.error.noIndividual=No Individual to Inoculate
genetics.machine.inoculator.error.noSerum=No Serum
Expand All @@ -105,6 +113,7 @@ genetics.machine.inoculator.inoculableIndividual=Inoculable Individual
genetics.machine.inoculator.serums=Serum Vials & Arrays

genetics.machine.labMachine.genepool=Genepool
gui.genetics.machine.labMachine.genepool.title=Genepool
genetics.machine.labMachine.genepool.info=The Genepool uses enzymes and ethanol to break down living things into DNA. During this process, all genetic information is lost and the source of the DNA is destroyed.
genetics.machine.genepool.error.noIndividual=No Individual
genetics.machine.genepool.error.noRoom=Not enough room in Tank
Expand All @@ -115,6 +124,7 @@ tile.labMachine.name=Lab Stand
genetics.machine.labMachine.labMachine=Lab Stand

genetics.machine.labMachine.analyser=Analyzer
gui.genetics.machine.labMachine.analyser.title=Analyzer
genetics.machine.labMachine.analyser.info=The Analyzer takes breedable individuals and DNA sequencers and analyzes them to determine the genes present. This requires DNA Dye, created from purple dye and glowstone
genetics.machine.analyser.dnaDye=DNA Dye
genetics.machine.analyser.unanalysedItem=Unanalyzed Item
Expand All @@ -125,13 +135,15 @@ genetics.machine.analyser.error.insufficientDye=Not enough DNA dye to analyze
genetics.machine.analyser.error.noItem=No item to analyze

genetics.machine.labMachine.incubator=Incubator
gui.genetics.machine.labMachine.incubator.title=Incubator
genetics.machine.labMachine.incubator.info=The Incubator combines liquids and items and allows them to sit at an ideal temperature to encourage bacterial growth.
genetics.machine.incubator.error.noRecipe.title=No Recipe
genetics.machine.incubator.error.noRecipe=There is no valid recipe
genetics.machine.incubator.error.noLiquid=Not enough incubation liquid
genetics.machine.incubator.error.noRoom=No room for output

genetics.machine.labMachine.acclimatiser=Acclimatiser
gui.genetics.machine.labMachine.acclimatiser.title=Acclimatiser
genetics.machine.labMachine.acclimatiser.info=The Acclimatiser uses acclimatizing items to adjust the temperature and humidity tolerance of individuals. This process has only a small chance to succeed.
genetics.machine.acclimatiser.acclimatizingItems=Acclimatizing Items
genetics.machine.acclimatiser.error.noIndividual=No Individual to Acclimatise
Expand All @@ -140,6 +152,7 @@ genetics.machine.acclimatiser.error.invalidAcclimatizingItems=Cannot Acclimatise

tile.advMachine.name=Splicer
genetics.machine.advMachine.splicer=Splicer
gui.genetics.machine.advMachine.splicer.title=Splicer
genetics.machine.advMachine.splicer.info=The Splicer is an incredibly powerful machine that is used to insert genes into individuals. This process is fast, but requires monumental amounts of power.
genetics.machine.splicer.error.noIndividual=No Individual to Splice
genetics.machine.splicer.error.noSerum=No Serum
Expand Down