mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-23 13:39:44 +00:00
Move some craftguis
This commit is contained in:
1 parent
fff40b966d
commit
49d80c847e
57 files changed
+114
-99
No files matched your search
@@ -1,19 +1,19 @@
|
||||
package binnie.genetics.core;
|
||||
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.craftgui.genetics.machine.WindowAcclimatiser;
|
||||
import binnie.craftgui.genetics.machine.WindowAnalyser;
|
||||
import binnie.craftgui.genetics.machine.WindowGeneBank;
|
||||
import binnie.craftgui.genetics.machine.WindowGeneBankNEI;
|
||||
import binnie.craftgui.genetics.machine.WindowGenepool;
|
||||
import binnie.craftgui.genetics.machine.WindowIncubator;
|
||||
import binnie.craftgui.genetics.machine.WindowInoculator;
|
||||
import binnie.craftgui.genetics.machine.WindowIsolator;
|
||||
import binnie.craftgui.genetics.machine.WindowPolymeriser;
|
||||
import binnie.craftgui.genetics.machine.WindowSequencer;
|
||||
import binnie.craftgui.genetics.machine.WindowSplicer;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.genetics.gui.WindowAnalyst;
|
||||
import binnie.genetics.machine.craftgui.WindowAcclimatiser;
|
||||
import binnie.genetics.machine.craftgui.WindowAnalyser;
|
||||
import binnie.genetics.machine.craftgui.WindowGeneBank;
|
||||
import binnie.genetics.machine.craftgui.WindowGeneBankNEI;
|
||||
import binnie.genetics.machine.craftgui.WindowGenepool;
|
||||
import binnie.genetics.machine.craftgui.WindowIncubator;
|
||||
import binnie.genetics.machine.craftgui.WindowInoculator;
|
||||
import binnie.genetics.machine.craftgui.WindowIsolator;
|
||||
import binnie.genetics.machine.craftgui.WindowPolymeriser;
|
||||
import binnie.genetics.machine.craftgui.WindowSequencer;
|
||||
import binnie.genetics.machine.craftgui.WindowSplicer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@@ -10,8 +10,8 @@ import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.geometry.CraftGUIUtil;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.extratrees.kitchen.ControlFluidDisplay;
|
||||
import binnie.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.extratrees.kitchen.craftgui.ControlFluidDisplay;
|
||||
import binnie.genetics.Genetics;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.apiculture.IBee;
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.controls.core.IControlValue;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.ITooltip;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.genetics.api.IGene;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
import binnie.genetics.genetics.Engineering;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ControlGene extends Control implements IControlValue<IGene>, ITooltip {
|
||||
IGene gene;
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
final String cName = Binnie.GENETICS.getSystem(this.gene.getSpeciesRoot()).getChromosomeName(this.gene.getChromosome());
|
||||
tooltip.add(cName + ": " + this.gene.getName());
|
||||
if (this.isMouseOver() && this.canFill(Window.get(this).getHeldItemStack())) {
|
||||
tooltip.add("Left click to assign gene");
|
||||
final IGene existingGene = Engineering.getGene(Window.get(this).getHeldItemStack(), this.gene.getChromosome().ordinal());
|
||||
if (existingGene == null) {
|
||||
return;
|
||||
}
|
||||
final String dName = Binnie.GENETICS.getSystem(this.gene.getSpeciesRoot()).getChromosomeName(this.gene.getChromosome());
|
||||
tooltip.add("Will replace " + dName + ": " + existingGene.getName());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canFill(final ItemStack stack) {
|
||||
return stack != null && stack.stackSize == 1 && Engineering.isGeneAcceptor(stack) && Engineering.canAcceptGene(stack, this.getValue());
|
||||
}
|
||||
|
||||
protected ControlGene(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 16, 16);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
if (ControlGene.this.canFill(Window.get(ControlGene.this.getWidget()).getHeldItemStack())) {
|
||||
final NBTTagCompound action = new NBTTagCompound();
|
||||
final NBTTagCompound geneNBT = new NBTTagCompound();
|
||||
ControlGene.this.getValue().writeToNBT(geneNBT);
|
||||
action.setTag("gene", geneNBT);
|
||||
Window.get(ControlGene.this.getWidget()).sendClientAction("gene-select", action);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGene getValue() {
|
||||
return this.gene;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final IGene value) {
|
||||
this.gene = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
if (this.isMouseOver() && this.canFill(Window.get(this).getHeldItemStack())) {
|
||||
RenderUtil.drawSolidRect(this.getArea(), -1);
|
||||
RenderUtil.drawSolidRect(this.getArea().inset(1), -12303292);
|
||||
}
|
||||
RenderUtil.setColour(-1);
|
||||
RenderUtil.drawSprite(IPoint.ZERO, BinnieCore.proxy.getTextureAtlasSprite(GeneticsTexture.dnaIcon.getResourceLocation()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.core.genetics.Gene;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.controls.core.IControlValue;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.genetics.genetics.GeneTracker;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ControlGeneScroll extends Control implements IControlValue<BreedingSystem> {
|
||||
private String filter;
|
||||
private BreedingSystem system;
|
||||
|
||||
protected ControlGeneScroll(final IWidget parent, final int x, final int y, final int w, final int h) {
|
||||
super(parent, x, y, w, h);
|
||||
this.filter = "";
|
||||
this.system = null;
|
||||
}
|
||||
|
||||
public void setFilter(final String filter) {
|
||||
this.filter = filter.toLowerCase();
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
public void setGenes(final BreedingSystem system) {
|
||||
this.system = system;
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
public void refresh() {
|
||||
this.deleteAllChildren();
|
||||
final GeneTracker tracker = GeneTracker.getTracker(Window.get(this).getWorld(), Window.get(this).getUsername());
|
||||
final Map<IChromosomeType, List<IAllele>> genes = Binnie.GENETICS.getChromosomeMap(this.system.getSpeciesRoot());
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
final boolean isNEI = ((WindowGeneBank) Window.get(this)).isNei;
|
||||
for (final Map.Entry<IChromosomeType, List<IAllele>> entry : genes.entrySet()) {
|
||||
final List<IAllele> discovered = new ArrayList<>();
|
||||
for (final IAllele allele : entry.getValue()) {
|
||||
final Gene gene = new Gene(allele, entry.getKey(), this.system.getSpeciesRoot());
|
||||
if ((isNEI || tracker.isSequenced(new Gene(allele, entry.getKey(), this.system.getSpeciesRoot()))) && gene.getName().toLowerCase().contains(this.filter)) {
|
||||
discovered.add(allele);
|
||||
}
|
||||
}
|
||||
if (discovered.size() == 0) {
|
||||
continue;
|
||||
}
|
||||
x = 0;
|
||||
new ControlText(this, new IPoint(x, y), this.system.getChromosomeName(entry.getKey()));
|
||||
y += 12;
|
||||
for (final IAllele allele : discovered) {
|
||||
if (x + 18 > this.getSize().x()) {
|
||||
y += 20;
|
||||
x = 0;
|
||||
}
|
||||
new ControlGene(this, x, y).setValue(new Gene(allele, entry.getKey(), this.system.getSpeciesRoot()));
|
||||
x += 18;
|
||||
}
|
||||
y += 24;
|
||||
}
|
||||
this.setSize(new IPoint(this.getSize().x(), y));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final BreedingSystem system) {
|
||||
this.setGenes(system);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BreedingSystem getValue() {
|
||||
return this.system;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.minecraft.control.ControlMachineProgress;
|
||||
|
||||
public class ControlProcessTemporary extends ControlMachineProgress {
|
||||
public ControlProcessTemporary(final IWidget parent, final int x, final int y, final int width, final int height) {
|
||||
super(parent, x, y, null, null, null);
|
||||
this.setSize(new IPoint(width, height));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
RenderUtil.drawSolidRect(this.getArea(), -4868683);
|
||||
final int w = Math.round(this.getSize().y() * this.progress / 100.0f);
|
||||
RenderUtil.drawSolidRect(new IArea(this.getArea().x(), this.getArea().y(), w, this.getArea().h()), -65536);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlProgressBase;
|
||||
import binnie.craftgui.window.Panel;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class ControlSequencerProgress extends ControlProgressBase {
|
||||
ControlText textControl;
|
||||
|
||||
public ControlSequencerProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 100, 52);
|
||||
final Panel panel = new Panel(this, 0, 0, 100, 52, MinecraftGUI.PanelType.Gray);
|
||||
this.textControl = new ControlText(panel, new IArea(4, 4, 92, 44), "", TextJustification.MiddleCenter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
final ItemStack stack = Machine.getMachine(Window.get(this).getInventory()).getMachineUtil().getStack(5);
|
||||
if (stack == null) {
|
||||
this.textControl.setValue("");
|
||||
} else {
|
||||
final Random rand = new Random(stack.getDisplayName().length());
|
||||
String text = "";
|
||||
final String[] codes = {"A", "T", "G", "C"};
|
||||
final String[] colors = {"a", "d", "b", "c"};
|
||||
for (int i = 0; i < 65; ++i) {
|
||||
final int k = rand.nextInt(4);
|
||||
final String code = codes[k];
|
||||
if (rand.nextFloat() < this.progress) {
|
||||
final String col = "�" + colors[k];
|
||||
text = text + "�r" + col + "�l" + code;
|
||||
} else {
|
||||
text = text + "�r�7�k�l" + code;
|
||||
}
|
||||
}
|
||||
this.textControl.setValue(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.minecraft.control.ControlProgressBase;
|
||||
|
||||
public class ControlSplicerProgress extends ControlProgressBase {
|
||||
float strength;
|
||||
|
||||
public ControlSplicerProgress(final IWidget parent, final int x, final int y, final int w, final int h) {
|
||||
super(parent, x, y, w, h);
|
||||
this.strength = 0.0f;
|
||||
this.strength = 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final float progress = this.getProcess().getCurrentProgress() / 100.0f;
|
||||
final float n = this.getProcess().getProcessTime() / 12.0f;
|
||||
final int spacing = 10;
|
||||
final float range = this.w();
|
||||
final int h = 8;
|
||||
final float ooy = -((n - 1.0f) * spacing) - range / 2.0f;
|
||||
final float ddy = (n - 1.0f) * spacing + range;
|
||||
final int oy = Math.round(ooy + ddy * progress);
|
||||
for (int i = 0; i < n; ++i) {
|
||||
final int seed = 432523;
|
||||
final int[] colours = {10027008, 30464, 255, 10057472};
|
||||
int c1 = colours[(int) Math.abs(13.0 * Math.sin(i) + 48.0 * Math.cos(i) + 25.0 * Math.sin(7 * i)) % 4];
|
||||
int c2 = colours[(int) Math.abs(23.0 * Math.sin(i) + 28.0 * Math.cos(i) + 15.0 * Math.sin(7 * i)) % 4];
|
||||
int c3 = colours[(int) Math.abs(43.0 * Math.sin(i) + 38.0 * Math.cos(i) + 55.0 * Math.sin(7 * i)) % 4];
|
||||
int c4 = colours[(int) Math.abs(3.0 * Math.sin(i) + 18.0 * Math.cos(i) + 35.0 * Math.sin(7 * i)) % 4];
|
||||
final int y = oy + i * spacing;
|
||||
if (y > -range / 2.0f && y < range / 2.0f) {
|
||||
final float percentView = (float) Math.sqrt(1.0f - Math.abs(2.0f * y / range));
|
||||
final float offMovement = (this.h() - 2.0f * h) / 2.0f;
|
||||
final int alpha = 16777216 * (int) (255.0f * percentView);
|
||||
c1 += alpha;
|
||||
c2 += alpha;
|
||||
c3 += alpha;
|
||||
c4 += alpha;
|
||||
int viewAmount = Math.round(offMovement * percentView);
|
||||
RenderUtil.drawSolidRectWithAlpha(new IArea(this.w() / 2 + y, viewAmount, 4, h / 2), c1);
|
||||
RenderUtil.drawSolidRectWithAlpha(new IArea(this.w() / 2 + y, viewAmount + 4, 4, h / 2), (y < 0) ? c2 : c3);
|
||||
RenderUtil.drawSolidRectWithAlpha(new IArea(this.w() / 2 + y, this.h() - viewAmount - 8, 4, h / 2), (y < 0) ? c3 : c2);
|
||||
RenderUtil.drawSolidRectWithAlpha(new IArea(this.w() / 2 + y, this.h() - viewAmount - 4, 4, h / 2), c4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.machine.acclimatiser.Acclimatiser;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowAcclimatiser extends WindowMachine {
|
||||
static Texture ProgressBase = new StandardTexture(64, 0, 130, 21, ExtraBeeTexture.GUIProgress.getTexture());
|
||||
static Texture Progress = new StandardTexture(64, 21, 130, 21, ExtraBeeTexture.GUIProgress.getTexture());
|
||||
public static final int[] slotReserve = new int[]{0, 1, 2, 3};
|
||||
public static final int slotTarget = 4;
|
||||
public static final int[] slotAcclimatiser = new int[]{5, 6, 7};
|
||||
public static final int[] slotDone = new int[]{8, 9, 10, 11};
|
||||
|
||||
public WindowAcclimatiser(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(280, 198, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
super.initialiseClient();
|
||||
int x = 16;
|
||||
final int y = 32;
|
||||
new ControlSlotArray(this, x, y, 2, 2).create(Acclimatiser.SLOT_RESERVE);
|
||||
x += 54;
|
||||
new ControlSlot(this, x + 18, y).assign(4);
|
||||
new ControlSlotArray(this, x, y + 18 + 18, 3, 1).create(Acclimatiser.SLOT_ACCLIMATISER);
|
||||
x += 72;
|
||||
new ControlSlotArray(this, x, y, 2, 2).create(Acclimatiser.SLOT_DRONE);
|
||||
new ControlEnergyBar(this, 21, 115, 16, 60, Position.Bottom);
|
||||
new ControlErrorState(this, 181, 83);
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Genetics.proxy.localise("machine.labMachine.acclimatiser");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Acclimatiser";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.GUIIcon;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlProgress;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotCharge;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.craftgui.window.Panel;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
import binnie.genetics.machine.analyser.Analyser;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowAnalyser extends WindowMachine {
|
||||
static Texture ProgressBase = new StandardTexture(0, 218, 142, 17, ExtraBeeTexture.GUIProgress.getTexture());
|
||||
static Texture Progress = new StandardTexture(0, 201, 142, 17, ExtraBeeTexture.GUIProgress.getTexture());
|
||||
|
||||
public WindowAnalyser(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(220, 210, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
super.initialiseClient();
|
||||
WindowAnalyser.ProgressBase = new StandardTexture(0, 51, 66, 40, GeneticsTexture.GUIProcess.getTexture());
|
||||
WindowAnalyser.Progress = new StandardTexture(66, 51, 66, 40, GeneticsTexture.GUIProcess.getTexture());
|
||||
int x = 16;
|
||||
final int y = 32;
|
||||
new ControlSlotArray(this, x, y, 2, 3).create(Analyser.SLOT_RESERVE);
|
||||
x += 28;
|
||||
new ControlSlot(this, x, y + 54 + 8).assign(13);
|
||||
new ControlSlotCharge(this, x + 20, y + 54 + 8, 13).setColour(10040319);
|
||||
new ControlEnergyBar(this, x + 24 + 16, y + 54 + 8 + 1, 60, 16, Position.Left);
|
||||
new ControlErrorState(this, x + 24 + 16 + 60 + 16, y + 54 + 8 + 1);
|
||||
x -= 28;
|
||||
new ControlIconDisplay(this, x + 36 + 2, y + 18, GUIIcon.ArrowRight.getIcon().getResourceLocation());
|
||||
x += 56;
|
||||
new Panel(this, x, y, 76, 50, MinecraftGUI.PanelType.Tinted);
|
||||
new ControlProgress(this, x + 5, y + 5, WindowAnalyser.ProgressBase, WindowAnalyser.Progress, Position.Left);
|
||||
new ControlSlot(this, x + 38 - 9, y + 25 - 9).assign(6);
|
||||
new ControlIconDisplay(this, x + 76 + 2, y + 18, GUIIcon.ArrowRight.getIcon().getResourceLocation());
|
||||
x += 96;
|
||||
new ControlSlotArray(this, x, y, 2, 3).create(Analyser.SLOT_FINISHED);
|
||||
x += 52;
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Genetics.proxy.localise("machine.labMachine.analyser");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Analyser";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.core.genetics.Gene;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.controls.ControlTextEdit;
|
||||
import binnie.craftgui.controls.scroll.ControlScrollableContent;
|
||||
import binnie.craftgui.controls.tab.ControlTab;
|
||||
import binnie.craftgui.controls.tab.ControlTabBar;
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.events.EventHandler;
|
||||
import binnie.craftgui.events.EventTextEdit;
|
||||
import binnie.craftgui.events.EventValueChanged;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlTabIcon;
|
||||
import binnie.craftgui.window.Panel;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.genetics.Engineering;
|
||||
import binnie.genetics.genetics.GeneTracker;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class WindowGeneBank extends WindowMachine {
|
||||
// public static IIcon[] iconsDNA;
|
||||
public boolean isNei;
|
||||
ControlGeneScroll genes;
|
||||
|
||||
@Override
|
||||
public void recieveGuiNBT(final Side side, final EntityPlayer player, final String name, final NBTTagCompound action) {
|
||||
super.recieveGuiNBT(side, player, name, action);
|
||||
if (side == Side.SERVER && name.equals("gene-select")) {
|
||||
final Gene gene = new Gene(action.getCompoundTag("gene"));
|
||||
if (gene != null && !gene.isCorrupted()) {
|
||||
final ItemStack held = this.getHeldItemStack();
|
||||
final ItemStack converted = Engineering.addGene(held, gene);
|
||||
this.getPlayer().inventory.setItemStack(converted);
|
||||
this.getPlayer().inventory.markDirty();
|
||||
if (this.getPlayer() instanceof EntityPlayerMP) {
|
||||
((EntityPlayerMP) this.getPlayer()).sendContainerToPlayer(player.inventoryContainer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public WindowGeneBank(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
this(player, inventory, side, false);
|
||||
}
|
||||
|
||||
public WindowGeneBank(final EntityPlayer player, final IInventory inventory, final Side side, final boolean isNEI) {
|
||||
super(320, 224, player, inventory, side);
|
||||
this.isNei = isNEI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseServer() {
|
||||
final GeneTracker tracker = GeneTracker.getTracker(this.getWorld(), this.getUsername());
|
||||
if (tracker != null) {
|
||||
tracker.synchToPlayer(this.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Gene Bank");
|
||||
this.addEventHandler(new EventValueChanged.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventValueChanged event) {
|
||||
if (event.value instanceof BreedingSystem) {
|
||||
WindowGeneBank.this.genes.setValue((BreedingSystem) event.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
int boxX = 100;
|
||||
int x = 16;
|
||||
final int y = 32;
|
||||
new ControlPlayerInventory(this, x, y);
|
||||
x += 124;
|
||||
boxX = x;
|
||||
final int geneBoxWidth = 120;
|
||||
new Panel(this, boxX + 24, 32, geneBoxWidth, 120, MinecraftGUI.PanelType.Black);
|
||||
new Panel(this, boxX + 24 + geneBoxWidth, 32, 14, 120, MinecraftGUI.PanelType.Gray);
|
||||
final ControlScrollableContent scroll = new ControlScrollableContent(this, boxX + 24 + 2, 34, geneBoxWidth + 10, 116, 12);
|
||||
final ControlTextEdit edit = new ControlTextEdit(this, boxX + 27 + geneBoxWidth - 70, 18, 80, 12);
|
||||
this.addEventHandler(new EventTextEdit.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventTextEdit event) {
|
||||
WindowGeneBank.this.genes.setFilter(event.getValue());
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.Self, edit));
|
||||
scroll.setScrollableContent(this.genes = new ControlGeneScroll(scroll, 1, 1, geneBoxWidth, 116));
|
||||
this.genes.setGenes(Binnie.GENETICS.beeBreedingSystem);
|
||||
final ControlTabBar<BreedingSystem> tabBar = new ControlTabBar<BreedingSystem>(this, boxX, 32, 24, 120, Position.Left) {
|
||||
@Override
|
||||
public ControlTab<BreedingSystem> createTab(final int x, final int y, final int w, final int h, final BreedingSystem value) {
|
||||
return new ControlTabIcon<BreedingSystem>(this, x, y, w, h, value) {
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.add(this.getValue().toString());
|
||||
int totalGenes = 0;
|
||||
int seqGenes = 0;
|
||||
final GeneTracker tracker = GeneTracker.getTracker(WindowGeneBank.this.getWorld(), WindowGeneBank.this.getUsername());
|
||||
final Map<IChromosomeType, List<IAllele>> genes = Binnie.GENETICS.getChromosomeMap(this.getValue().getSpeciesRoot());
|
||||
for (final Map.Entry<IChromosomeType, List<IAllele>> entry : genes.entrySet()) {
|
||||
totalGenes += entry.getValue().size();
|
||||
for (final IAllele allele : entry.getValue()) {
|
||||
final Gene gene = new Gene(allele, entry.getKey(), this.getValue().getSpeciesRoot());
|
||||
if (tracker.isSequenced(gene)) {
|
||||
++seqGenes;
|
||||
}
|
||||
}
|
||||
}
|
||||
tooltip.add("" + seqGenes + "/" + totalGenes + " Genes");
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
tabBar.setValues(Binnie.GENETICS.getActiveSystems());
|
||||
tabBar.setValue(Binnie.GENETICS.beeBreedingSystem);
|
||||
boxX -= 8;
|
||||
final ControlTabBar<String> infoTabs = new ControlTabBar<>(this, boxX + 8, 160, 16, 50, Position.Left);
|
||||
infoTabs.setValues(Arrays.asList("Stats", "Ranking"));
|
||||
infoTabs.setValue("Info");
|
||||
final Panel panelProject = new Panel(this, boxX + 24, 160, geneBoxWidth + 20, 50, MinecraftGUI.PanelType.Black);
|
||||
int totalGenes = 0;
|
||||
int seqGenes = 0;
|
||||
for (final BreedingSystem system : Binnie.GENETICS.getActiveSystems()) {
|
||||
final GeneTracker tracker = GeneTracker.getTracker(this.getWorld(), this.getUsername());
|
||||
final Map<IChromosomeType, List<IAllele>> genes = Binnie.GENETICS.getChromosomeMap(system.getSpeciesRoot());
|
||||
for (final Map.Entry<IChromosomeType, List<IAllele>> entry : genes.entrySet()) {
|
||||
totalGenes += entry.getValue().size();
|
||||
for (final IAllele allele : entry.getValue()) {
|
||||
final Gene gene = new Gene(allele, entry.getKey(), system.getSpeciesRoot());
|
||||
if (tracker.isSequenced(gene)) {
|
||||
++seqGenes;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
new ControlText(panelProject, new IPoint(4, 4), "§nFull Genome Project");
|
||||
new ControlText(panelProject, new IPoint(4, 18), "§oSequenced §r" + seqGenes + "/" + totalGenes + " §oGenes");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Gene Bank";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "GeneBank";
|
||||
}
|
||||
|
||||
public static class ChromosomeType {
|
||||
IChromosomeType chromosome;
|
||||
BreedingSystem system;
|
||||
|
||||
public ChromosomeType(final IChromosomeType chromosome, final BreedingSystem system) {
|
||||
this.chromosome = chromosome;
|
||||
this.system = system;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.system.getChromosomeName(this.chromosome);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowGeneBankNEI extends WindowGeneBank {
|
||||
public WindowGeneBankNEI(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(player, inventory, side, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.genetics.Genetics;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowGeneProject extends Window {
|
||||
public WindowGeneProject(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(100, 100, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "GeneProjects";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Gene Projects");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.GUIIcon;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlMachineProgress;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotCharge;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.machine.genepool.Genepool;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowGenepool extends WindowMachine {
|
||||
static Texture ProgressBase = new StandardTexture(64, 0, 130, 21, ExtraBeeTexture.GUIProgress.getTexture());
|
||||
static Texture Progress = new StandardTexture(64, 21, 130, 21, ExtraBeeTexture.GUIProgress.getTexture());
|
||||
|
||||
public WindowGenepool(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(280, 198, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
super.initialiseClient();
|
||||
int x = 16;
|
||||
final int y = 32;
|
||||
new ControlLiquidTank(this, x, y).setTankID(1);
|
||||
x += 26;
|
||||
new ControlSlotArray(this, x, y + 3, 2, 3).create(Genepool.SLOT_RESERVE);
|
||||
x += 38;
|
||||
new ControlIconDisplay(this, x, y + 3 + 18 + 1, GUIIcon.ArrowRight.getIcon().getResourceLocation());
|
||||
x += 18;
|
||||
new ControlSlot(this, x, y + 3 + 18).assign(0);
|
||||
x += 18;
|
||||
new ControlMachineProgress(this, x, y + 19, WindowGenepool.ProgressBase, WindowGenepool.Progress, Position.Left);
|
||||
x += 130;
|
||||
new ControlLiquidTank(this, x, y).setTankID(0);
|
||||
new ControlEnergyBar(this, 21, 115, 16, 60, Position.Bottom);
|
||||
new ControlSlot(this, 121, 82).assign(7);
|
||||
new ControlSlotCharge(this, 143, 82, 7).setColour(15722671);
|
||||
new ControlErrorState(this, 181, 83);
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Genetics.proxy.localise("machine.labMachine.genepool");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Genepool";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.genetics.Genetics;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowGenomeAssembler extends WindowMachine {
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowGenomeAssembler(player, inventory, side);
|
||||
}
|
||||
|
||||
public WindowGenomeAssembler(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(320, 240, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Genome Assembler";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "GenomeAssembler";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.GUIIcon;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlMachineProgress;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
import binnie.genetics.machine.incubator.Incubator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowIncubator extends WindowMachine {
|
||||
static Texture ProgressBase = new StandardTexture(0, 91, 38, 32, GeneticsTexture.GUIProcess);
|
||||
static Texture Progress = new StandardTexture(38, 91, 38, 32, GeneticsTexture.GUIProcess);
|
||||
|
||||
public WindowIncubator(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(228, 196, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
super.initialiseClient();
|
||||
int x = 16;
|
||||
final int y = 32;
|
||||
new ControlLiquidTank(this, x, y).setTankID(0);
|
||||
x += 26;
|
||||
new ControlSlotArray(this, x, y + 3, 1, 3).create(Incubator.SLOT_QUEUE);
|
||||
x += 20;
|
||||
new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ArrowRight.getIcon().getResourceLocation());
|
||||
x += 18;
|
||||
new ControlMachineProgress(this, x, y + 6, WindowIncubator.ProgressBase, WindowIncubator.Progress, Position.Left);
|
||||
new ControlSlot(this, x + 11, y + 3 + 10).assign(3);
|
||||
x += 40;
|
||||
new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ArrowRight.getIcon().getResourceLocation());
|
||||
x += 18;
|
||||
new ControlSlotArray(this, x, y + 3, 1, 3).create(Incubator.SLOT_OUTPUT);
|
||||
x += 26;
|
||||
new ControlLiquidTank(this, x, y).setTankID(1);
|
||||
x += 34;
|
||||
new ControlEnergyBar(this, x, y + 3, 16, 54, Position.Bottom);
|
||||
new ControlErrorState(this, 91, 82);
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Genetics.proxy.localise("machine.labMachine.incubator");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Incubator";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.core.geometry.CraftGUIUtil;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.GUIIcon;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlMachineProgress;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
import binnie.genetics.machine.inoculator.Inoculator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowInoculator extends WindowMachine {
|
||||
static Texture ProgressBase = new StandardTexture(0, 72, 142, 72, GeneticsTexture.GUIProcess2.getTexture());
|
||||
static Texture Progress = new StandardTexture(0, 0, 142, 72, GeneticsTexture.GUIProcess2.getTexture());
|
||||
|
||||
public WindowInoculator(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(266, 240, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
super.initialiseClient();
|
||||
int x = 16;
|
||||
final int y = 32;
|
||||
new ControlLiquidTank(this, x, y + 18 + 16).setTankID(0);
|
||||
CraftGUIUtil.horizontalGrid(x, y,
|
||||
new ControlSlotArray(this, 0, 0, 2, 1).create(Inoculator.SLOT_SERUM_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowRight.getIcon().getResourceLocation()),
|
||||
new ControlSlot(this, 0, 0).assign(0),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowRight.getIcon().getResourceLocation()),
|
||||
new ControlSlotArray(this, 0, 0, 2, 1).create(Inoculator.SLOT_SERUM_EXPENDED)
|
||||
);
|
||||
x += 18;
|
||||
new ControlMachineProgress(this, x, y + 24, WindowInoculator.ProgressBase, WindowInoculator.Progress, Position.Left);
|
||||
new ControlEnergyBar(this, 91, 118, 60, 16, Position.Left);
|
||||
new ControlErrorState(this, 161, 118);
|
||||
x += 142;
|
||||
CraftGUIUtil.verticalGrid(x, y, TextJustification.MiddleLeft, 8,
|
||||
new ControlSlotArray(this, x, y, 4, 1).create(Inoculator.SLOT_RESERVE),
|
||||
new ControlSlot(this, x, y + 18 + 8).assign(9),
|
||||
new ControlSlotArray(this, x, y + 18 + 8 + 18 + 8, 4, 1).create(Inoculator.SLOT_FINISHED)
|
||||
);
|
||||
new ControlIconDisplay(this, x + 18, y + 18 + 2, GUIIcon.ArrowUpLeft.getIcon().getResourceLocation());
|
||||
new ControlIconDisplay(this, x + 18, y + 18 + 18, GUIIcon.ArrowLeftDown.getIcon().getResourceLocation());
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Genetics.proxy.localise("machine.machine.inoculator");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Inoculator";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.GUIIcon;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlProgress;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotCharge;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.machine.isolator.Isolator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowIsolator extends WindowMachine {
|
||||
static Texture ProgressBase = new StandardTexture(0, 218, 142, 17, ExtraBeeTexture.GUIProgress.getTexture());
|
||||
static Texture Progress = new StandardTexture(0, 201, 142, 17, ExtraBeeTexture.GUIProgress.getTexture());
|
||||
|
||||
public WindowIsolator(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(330, 208, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
super.initialiseClient();
|
||||
int x = 16;
|
||||
final int y = 32;
|
||||
new ControlLiquidTank(this, x, y).setTankID(0);
|
||||
x += 26;
|
||||
new ControlSlotArray(this, x, y + 3, 1, 3).create(Isolator.SLOT_RESERVE);
|
||||
x += 20;
|
||||
new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ArrowRight.getIcon().getResourceLocation());
|
||||
x += 18;
|
||||
new ControlSlot(this, x, y + 3).assign(5);
|
||||
new ControlSlot(this, x, y + 36 + 3).assign(0);
|
||||
new ControlSlotCharge(this, x + 18 + 2, y + 36 + 3, 0).setColour(15722671);
|
||||
x += 18;
|
||||
new ControlProgress(this, x, y + 3, WindowIsolator.ProgressBase, WindowIsolator.Progress, Position.Left);
|
||||
x += 142;
|
||||
new ControlSlot(this, x, y + 3).assign(6);
|
||||
new ControlSlot(this, x, y + 3 + 36).assign(1);
|
||||
new ControlIconDisplay(this, x + 1, y + 3 + 19, GUIIcon.ArrowUp.getIcon().getResourceLocation());
|
||||
x += 20;
|
||||
new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ArrowRight.getIcon().getResourceLocation());
|
||||
x += 18;
|
||||
new ControlSlotArray(this, x, y + 3, 2, 3).create(Isolator.SLOT_FINISHED);
|
||||
new ControlEnergyBar(this, 260, 130, 16, 60, Position.Bottom);
|
||||
new ControlErrorState(this, 153, 81);
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Genetics.proxy.localise("machine.machine.isolator");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Isolator";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public abstract class WindowMachine extends Window {
|
||||
public WindowMachine(final int width, final int height, final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(width, height, player, inventory, side);
|
||||
}
|
||||
|
||||
public abstract String getTitle();
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(this.getTitle());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.GUIIcon;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlMachineProgress;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotCharge;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
import binnie.genetics.machine.polymeriser.Polymeriser;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowPolymeriser extends WindowMachine {
|
||||
static Texture ProgressBase = new StandardTexture(76, 170, 160, 79, GeneticsTexture.GUIProcess.getTexture());
|
||||
static Texture Progress = new StandardTexture(76, 91, 160, 79, GeneticsTexture.GUIProcess.getTexture());
|
||||
|
||||
public WindowPolymeriser(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(278, 212, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
super.initialiseClient();
|
||||
int x = 16;
|
||||
final int y = 38;
|
||||
new ControlSlotArray(this, x, y, 1, 4).create(Polymeriser.SLOT_SERUM_RESERVE);
|
||||
new ControlIconDisplay(this, x + 18, y + 1, GUIIcon.ArrowRight.getIcon().getResourceLocation());
|
||||
x += 34;
|
||||
new ControlMachineProgress(this, x + 18, y - 6, WindowPolymeriser.ProgressBase, WindowPolymeriser.Progress, Position.Left);
|
||||
new ControlSlot(this, x, y).assign(0);
|
||||
new ControlLiquidTank(this, x, y + 18 + 16, true).setTankID(0);
|
||||
new ControlLiquidTank(this, x, y + 18 + 16 + 18 + 8, true).setTankID(1);
|
||||
new ControlEnergyBar(this, x + 120, 96, 64, 16, Position.Left);
|
||||
x += 40;
|
||||
new ControlSlot(this, x + 30, y + 18 + 8).assign(1);
|
||||
new ControlSlotCharge(this, x + 30 + 20, y + 18 + 8, 1).setColour(16766976);
|
||||
x += 138;
|
||||
new ControlSlotArray(this, x, y + 9, 2, 2).create(Polymeriser.SLOT_SERUM_FINISHED);
|
||||
final ControlErrorState errorState = new ControlErrorState(this, 244, 97);
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Genetics.proxy.localise("machine.machine.polymeriser");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Polymeriser";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.core.geometry.CraftGUIUtil;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.GUIIcon;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotCharge;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.machine.sequencer.Sequencer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowSequencer extends WindowMachine {
|
||||
static Texture ProgressBase = new StandardTexture(64, 114, 98, 9, ExtraBeeTexture.GUIProgress.getTexture());
|
||||
static Texture Progress = new StandardTexture(64, 123, 98, 9, ExtraBeeTexture.GUIProgress.getTexture());
|
||||
ControlText slotText;
|
||||
|
||||
public WindowSequencer(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(226, 224, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recieveGuiNBT(final Side side, final EntityPlayer player, final String name, final NBTTagCompound action) {
|
||||
if (side == Side.CLIENT && name.equals("username")) {
|
||||
this.slotText.setValue(TextFormatting.DARK_GRAY + String.format(Genetics.proxy.localise("machine.machine.sequencer.texts.sequenced.by"), action.getString("username")));
|
||||
}
|
||||
super.recieveGuiNBT(side, player, name, action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
super.initialiseClient();
|
||||
int x = 16;
|
||||
int y = 32;
|
||||
CraftGUIUtil.horizontalGrid(x, y, TextJustification.MiddleCenter, 2,
|
||||
new ControlSlotArray(this, 0, 0, 2, 2).create(Sequencer.SLOT_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowRight.getIcon().getResourceLocation()),
|
||||
new ControlSequencerProgress(this, 0, 0),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowRight.getIcon().getResourceLocation()),
|
||||
new ControlSlot(this, 0, 0).assign(6)
|
||||
);
|
||||
final ControlSlot slotTarget = new ControlSlot(this, x + 96, y + 16);
|
||||
slotTarget.assign(5);
|
||||
x = 34;
|
||||
y = 92;
|
||||
this.slotText = new ControlText(this, new IArea(0, y, this.w(), 12), TextFormatting.DARK_GRAY + Genetics.proxy.localise("machine.machine.sequencer.texts.userless"), TextJustification.MiddleCenter);
|
||||
y += 20;
|
||||
final ControlSlot slotDye = new ControlSlot(this, x, y);
|
||||
slotDye.assign(0);
|
||||
x += 20;
|
||||
new ControlSlotCharge(this, x, y, 0).setColour(16750848);
|
||||
x += 32;
|
||||
new ControlEnergyBar(this, x, y, 60, 16, Position.Left);
|
||||
x += 92;
|
||||
final ControlErrorState errorState = new ControlErrorState(this, x, y + 1);
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Genetics.proxy.localise("machine.machine.sequencer");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Sequencer";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package binnie.genetics.machine.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.core.geometry.CraftGUIUtil;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.GUIIcon;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
import binnie.genetics.machine.inoculator.Inoculator;
|
||||
import binnie.genetics.machine.splicer.Splicer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowSplicer extends WindowMachine {
|
||||
static Texture ProgressBase = new StandardTexture(0, 72, 142, 72, GeneticsTexture.GUIProcess2.getTexture());
|
||||
static Texture Progress = new StandardTexture(0, 0, 142, 72, GeneticsTexture.GUIProcess2.getTexture());
|
||||
|
||||
public WindowSplicer(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(280, 240, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
super.initialiseClient();
|
||||
int x = 16;
|
||||
new ControlSplicerProgress(this, 84, 32, this.w() - 172, 102);
|
||||
CraftGUIUtil.horizontalGrid(x, 62,
|
||||
new ControlSlotArray(this, 0, 0, 2, 1).create(Splicer.SLOT_SERUM_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowRight.getIcon().getResourceLocation()),
|
||||
new ControlSlot(this, 0, 0).assign(0)
|
||||
);
|
||||
new ControlSlotArray(this, x + 12, 84, 2, 1).create(Splicer.SLOT_SERUM_EXPENDED);
|
||||
new ControlIconDisplay(this, x + 12 + 36 + 4, 86, GUIIcon.ArrowUpLeft.getIcon().getResourceLocation());
|
||||
new ControlEnergyBar(this, 196, 64, 60, 16, Position.Left);
|
||||
new ControlErrorState(this, 218, 86);
|
||||
x += 142;
|
||||
CraftGUIUtil.verticalGrid((this.w() - 72) / 2, 32, TextJustification.MiddleCenter, 4,
|
||||
new ControlSlotArray(this, 0, 0, 4, 1).create(Inoculator.SLOT_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowDown.getIcon().getResourceLocation()),
|
||||
new ControlSlot(this, 0, 0).assign(9),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ArrowDown.getIcon().getResourceLocation()),
|
||||
new ControlSlotArray(this, 0, 0, 4, 1).create(Inoculator.SLOT_FINISHED)
|
||||
);
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Genetics.proxy.localise("machine.advMachine.splicer");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Inoculator";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user