mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 13:09:47 +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,21 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
public class ControlBlockIconDisplay extends Control {
|
||||
TextureAtlasSprite icon;
|
||||
|
||||
public ControlBlockIconDisplay(final IWidget parent, final int x, final int y, final TextureAtlasSprite icon) {
|
||||
super(parent, x, y, 18, 18);
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
RenderUtil.drawSprite(IPoint.ZERO, this.icon);
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.util.ItemStackSet;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.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.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlProgressBase;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.brewery.BreweryLogic;
|
||||
import binnie.extratrees.machines.brewery.BreweryRecipes;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class ControlBreweryProgress extends ControlProgressBase {
|
||||
static Texture Brewery = new StandardTexture(0, 69, 34, 39, ExtraTreeTexture.Gui);
|
||||
static Texture BreweryOverlay = new StandardTexture(34, 69, 34, 39, ExtraTreeTexture.Gui);
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(ControlBreweryProgress.Brewery, IPoint.ZERO);
|
||||
final BreweryLogic logic = Machine.getInterface(BreweryLogic.class, Window.get(this).getInventory());
|
||||
if (logic == null || logic.currentCrafting == null || logic.currentCrafting.inputFluid == null) {
|
||||
return;
|
||||
}
|
||||
final int fermentedHeight = (int) (32.0f * logic.getProgress() / 100.0f);
|
||||
CraftGUI.render.limitArea(new IArea(new IPoint(1, 6).add(this.getAbsolutePosition()), new IPoint(32, 32 - fermentedHeight)), guiWidth, guiHeight);
|
||||
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
||||
RenderUtil.drawFluid(new IPoint(1, 6), logic.currentCrafting.inputFluid);
|
||||
RenderUtil.drawFluid(new IPoint(17, 6), logic.currentCrafting.inputFluid);
|
||||
RenderUtil.drawFluid(new IPoint(1, 22), logic.currentCrafting.inputFluid);
|
||||
RenderUtil.drawFluid(new IPoint(17, 22), logic.currentCrafting.inputFluid);
|
||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
CraftGUI.render.limitArea(new IArea(new IPoint(1, 38 - fermentedHeight).add(this.getAbsolutePosition()), new IPoint(32, fermentedHeight)), guiWidth, guiHeight);
|
||||
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
||||
RenderUtil.drawFluid(new IPoint(1, 6), BreweryRecipes.getOutput(logic.currentCrafting));
|
||||
RenderUtil.drawFluid(new IPoint(17, 6), BreweryRecipes.getOutput(logic.currentCrafting));
|
||||
RenderUtil.drawFluid(new IPoint(1, 22), BreweryRecipes.getOutput(logic.currentCrafting));
|
||||
RenderUtil.drawFluid(new IPoint(17, 22), BreweryRecipes.getOutput(logic.currentCrafting));
|
||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
final ItemStackSet stacks = new ItemStackSet();
|
||||
Collections.addAll(stacks, logic.currentCrafting.inputGrains);
|
||||
stacks.add(logic.currentCrafting.ingredient);
|
||||
int x = 1;
|
||||
int y = 6;
|
||||
for (final ItemStack stack : stacks) {
|
||||
RenderUtil.drawItem(new IPoint(x, y), stack);
|
||||
x += 16;
|
||||
if (x > 18) {
|
||||
x = 1;
|
||||
y += 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
}
|
||||
|
||||
protected ControlBreweryProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 34, 39);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlProgressBase;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.distillery.DistilleryLogic;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ControlDistilleryProgress extends ControlProgressBase {
|
||||
public static final Texture DISTILLERY_BASE = new StandardTexture(43, 0, 58, 66, ExtraTreeTexture.Gui);
|
||||
public static final Texture DISTILLERY_OVERLAY = new StandardTexture(139, 0, 18, 66, ExtraTreeTexture.Gui);
|
||||
public static final Texture LIQUID_FLOW = new StandardTexture(101, 0, 38, 66, ExtraTreeTexture.Gui);
|
||||
public static final Texture OUTPUT = new StandardTexture(68, 66, 17, 7, ExtraTreeTexture.Gui);
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(DISTILLERY_BASE, IPoint.ZERO);
|
||||
CraftGUI.render.texturePercentage(LIQUID_FLOW, new IArea(18, 0, 38, 66), Position.Left, this.progress);
|
||||
final DistilleryLogic component = Machine.getInterface(DistilleryLogic.class, Window.get(this).getInventory());
|
||||
FluidStack stack = null;
|
||||
if (component != null) {
|
||||
stack = component.currentFluid;
|
||||
}
|
||||
if (stack != null) {
|
||||
for (int y = 0; y < 4; ++y) {
|
||||
RenderUtil.drawFluid(new IPoint(1, 1 + y * 16), stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
DistilleryLogic distilleryLogic = Machine.getInterface(DistilleryLogic.class, Window.get(this).getInventory());
|
||||
if (distilleryLogic != null) {
|
||||
final int level = distilleryLogic.level;
|
||||
GlStateManager.enableAlpha();
|
||||
CraftGUI.render.texture(OUTPUT, new IPoint(47, 14 + level * 15));
|
||||
CraftGUI.render.texture(DISTILLERY_OVERLAY, IPoint.ZERO);
|
||||
}
|
||||
}
|
||||
|
||||
protected ControlDistilleryProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 58, 66);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
int distillationLevel = -1;
|
||||
if (new IArea(45, 8, 19, 11).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) {
|
||||
distillationLevel = 0;
|
||||
} else if (new IArea(45, 23, 19, 11).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) {
|
||||
distillationLevel = 1;
|
||||
} else if (new IArea(45, 38, 19, 11).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) {
|
||||
distillationLevel = 2;
|
||||
}
|
||||
if (distillationLevel >= 0) {
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setByte("i", (byte) distillationLevel);
|
||||
Window.get(ControlDistilleryProgress.this.getWidget()).sendClientAction("still-level", nbt);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlProgressBase;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressMachine;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressRecipes;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ControlFruitPressProgress extends ControlProgressBase {
|
||||
static Texture PressTexture = new StandardTexture(6, 0, 24, 52, ExtraTreeTexture.Gui);
|
||||
static Texture PressSlot = new StandardTexture(9, 52, 34, 17, ExtraTreeTexture.Gui);
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(ControlFruitPressProgress.PressSlot, new IPoint(3, 52));
|
||||
Slot slotFromInventory = Window.get(this).getContainer().getSlotFromInventory(Window.get(this).getInventory(), FruitPressMachine.SLOT_CURRENT);
|
||||
if (slotFromInventory == null) {
|
||||
return;
|
||||
}
|
||||
final ItemStack input = slotFromInventory.getStack();
|
||||
if (input == null || FruitPressRecipes.getOutput(input) == null) {
|
||||
return;
|
||||
}
|
||||
FluidStack fluid = FruitPressRecipes.getOutput(input);
|
||||
RenderUtil.drawFluid(new IPoint(4, 52), fluid);
|
||||
RenderUtil.drawItem(new IPoint(4, 52), input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(ControlFruitPressProgress.PressTexture, new IPoint(0, Math.round(16 * this.progress)));
|
||||
}
|
||||
|
||||
protected ControlFruitPressProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 37, 69);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
if (event.getButton() == 0) {
|
||||
final NBTTagCompound action = new NBTTagCompound();
|
||||
Window.get(ControlFruitPressProgress.this.getWidget()).sendClientAction("fruitpress-click", action);
|
||||
} else if (event.getButton() == 1) {
|
||||
final NBTTagCompound action = new NBTTagCompound();
|
||||
Window.get(ControlFruitPressProgress.this.getWidget()).sendClientAction("clear-fruit", action);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlProgressBase;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.craftgui.window.Panel;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillMachine;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillRecipes;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ControlLumbermillProgress extends ControlProgressBase {
|
||||
float oldProgress;
|
||||
float animation;
|
||||
static Texture Saw = new StandardTexture(0, 0, 6, 32, ExtraTreeTexture.Gui);
|
||||
static Texture Saw2 = new StandardTexture(2, 0, 4, 32, ExtraTreeTexture.Gui);
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
if (this.oldProgress != this.progress) {
|
||||
this.oldProgress = this.progress;
|
||||
this.animation += 5;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
GlStateManager.disableLighting();
|
||||
final int sawX = (int) (63 * this.progress);
|
||||
CraftGUI.render.texture(ControlLumbermillProgress.Saw, new IPoint(sawX, -8 + Math.round(6 * (float) Math.sin(this.animation))));
|
||||
final ItemStack item = Window.get(this).getInventory().getStackInSlot(LumbermillMachine.SLOT_LOG);
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
GlStateManager.disableLighting();
|
||||
Block block = null;
|
||||
if (item.getItem() instanceof ItemBlock) {
|
||||
block = ((ItemBlock) item.getItem()).getBlock();
|
||||
}
|
||||
if (block == null) {
|
||||
return;
|
||||
}
|
||||
//TODO RENDERING
|
||||
//final IIcon icon = block.getIcon(2, item.getItemDamage());
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
//CraftGUI.Render.iconBlock(new IPoint(1 + i * 16, 1), icon);
|
||||
}
|
||||
final ItemStack result = LumbermillRecipes.getPlankProduct(item);
|
||||
if (result == null) {
|
||||
return;
|
||||
}
|
||||
Block block2 = null;
|
||||
if (item.getItem() instanceof ItemBlock) {
|
||||
block2 = ((ItemBlock) result.getItem()).getBlock();
|
||||
}
|
||||
if (block2 == null) {
|
||||
return;
|
||||
}
|
||||
//final IIcon icon2 = block2.getIcon(2, result.getItemDamage());
|
||||
final IPoint size = this.getSize();
|
||||
final IPoint pos = this.getAbsolutePosition();
|
||||
CraftGUI.render.limitArea(new IArea(pos.add(IPoint.ZERO), new IPoint(Math.round(this.progress * 64) + 2, 18)), guiWidth, guiHeight);
|
||||
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
//TODO RENDERING
|
||||
//CraftGUI.Render.iconBlock(new IPoint(1 + j * 16, 1), icon2);
|
||||
}
|
||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
CraftGUI.render.texture(ControlLumbermillProgress.Saw2, new IPoint(sawX + 2, -8 + Math.round(6 * (float) Math.sin(this.animation))));
|
||||
}
|
||||
|
||||
protected ControlLumbermillProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 66, 18);
|
||||
this.oldProgress = 0;
|
||||
this.animation = 0;
|
||||
new Panel(this, 0, 0, 66, 18, MinecraftGUI.PanelType.Black);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.component.IComponentRecipe;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class ControlRecipeSlot extends ControlSlotBase {
|
||||
public ControlRecipeSlot(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 50);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
final TileEntity tile = (TileEntity) Window.get(ControlRecipeSlot.this.getWidget()).getInventory();
|
||||
if (tile == null || !(tile instanceof TileEntityMachine)) {
|
||||
return;
|
||||
}
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
Window.get(ControlRecipeSlot.this.getWidget()).sendClientAction("recipe", nbt);
|
||||
}
|
||||
});
|
||||
this.setRotating();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
final IComponentRecipe recipe = Machine.getInterface(IComponentRecipe.class, Window.get(this).getInventory());
|
||||
if (recipe != null && recipe.isRecipe()) {
|
||||
return recipe.getProduct();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.controls.core.IControlValue;
|
||||
import binnie.craftgui.controls.scroll.IControlScrollable;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
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.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.extratrees.api.CarpentryManager;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.IDesignCategory;
|
||||
import binnie.extratrees.carpentry.EnumDesign;
|
||||
import binnie.extratrees.machines.Designer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ControlTileSelect extends Control implements IControlValue<IDesign>, IControlScrollable {
|
||||
IDesign value;
|
||||
float shownHeight;
|
||||
|
||||
protected ControlTileSelect(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 102, 20 * (CarpentryManager.carpentryInterface.getSortedDesigns().size() / 4) + 22);
|
||||
this.value = EnumDesign.Blank;
|
||||
this.shownHeight = 92.0f;
|
||||
this.refresh("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPercentageIndex() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPercentageShown() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesign getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void movePercentage(final float percentage) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
final TileEntityMachine tile = (TileEntityMachine) Window.get(this).getInventory();
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
final Designer.ComponentWoodworkerRecipe recipe = tile.getMachine().getComponent(Designer.ComponentWoodworkerRecipe.class);
|
||||
this.setValue(recipe.getDesign());
|
||||
}
|
||||
|
||||
public void refresh(final String filterText) {
|
||||
this.deleteAllChildren();
|
||||
int cx = 2;
|
||||
int cy = 2;
|
||||
final Map<IDesignCategory, List<IDesign>> designs = new HashMap<>();
|
||||
for (final IDesignCategory category : CarpentryManager.carpentryInterface.getAllDesignCategories()) {
|
||||
designs.put(category, new ArrayList<>());
|
||||
for (final IDesign tile : category.getDesigns()) {
|
||||
if (Objects.equals(filterText, "") || tile.getName().toLowerCase().contains(filterText)) {
|
||||
designs.get(category).add(tile);
|
||||
}
|
||||
}
|
||||
if (designs.get(category).isEmpty()) {
|
||||
designs.remove(category);
|
||||
}
|
||||
}
|
||||
for (final IDesignCategory category : designs.keySet()) {
|
||||
cx = 2;
|
||||
new ControlText(this, new IPoint(cx, cy + 3), category.getName());
|
||||
cy += 16;
|
||||
for (final IDesign tile : designs.get(category)) {
|
||||
if (cx > 90) {
|
||||
cx = 2;
|
||||
cy += 20;
|
||||
}
|
||||
new ControlTile(this, cx, cy, tile);
|
||||
cx += 20;
|
||||
}
|
||||
cy += 20;
|
||||
}
|
||||
final int height = cy;
|
||||
this.setSize(new IPoint(this.getSize().x(), height));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPercentageIndex(final float index) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final IDesign value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMovementRange() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public static class ControlTile extends Control implements IControlValue<IDesign>, ITooltip {
|
||||
IDesign value;
|
||||
|
||||
protected ControlTile(final IWidget parent, final int x, final int y, final IDesign value) {
|
||||
super(parent, x, y, 18, 18);
|
||||
this.setValue(value);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
final TileEntityMachine tile = (TileEntityMachine) Window.get(ControlTile.this.getWidget()).getInventory();
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
final Designer.ComponentWoodworkerRecipe recipe = tile.getMachine().getComponent(Designer.ComponentWoodworkerRecipe.class);
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setShort("d", (short) CarpentryManager.carpentryInterface.getDesignIndex(ControlTile.this.getValue()));
|
||||
Window.get(ControlTile.this.getWidget()).sendClientAction("design", nbt);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.add(Binnie.LANGUAGE.localise(BinnieCore.instance, "gui.designer.pattern", this.getValue().getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesign getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
final ItemStack image = ((WindowWoodworker) this.getSuperParent()).getDesignerType().getDisplayStack(this.getValue());
|
||||
RenderUtil.drawItem(new IPoint(1, 1), image);
|
||||
if (((IControlValue) this.getParent()).getValue() != this.getValue()) {
|
||||
if (Window.get(this).getMousedOverWidget() == this) {
|
||||
RenderUtil.drawGradientRect(this.getArea().inset(1), 1157627903, 1157627903);
|
||||
} else {
|
||||
RenderUtil.drawGradientRect(this.getArea().inset(1), -1433892728, -1433892728);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final IDesign value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.minecraft.Dialog;
|
||||
|
||||
public class DialogBreweryRecipe extends Dialog {
|
||||
public DialogBreweryRecipe(final IWidget parent, final int w, final int h) {
|
||||
super(parent, w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialise() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
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.Window;
|
||||
import binnie.craftgui.mod.database.ControlSpeciesBox;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageAbstract;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PageFruit extends PageAbstract<ItemStack> {
|
||||
boolean treesThatBearFruit;
|
||||
|
||||
public PageFruit(final IWidget parent, final DatabaseTab tab, final boolean treesThatBearFruit) {
|
||||
super(parent, tab);
|
||||
this.treesThatBearFruit = treesThatBearFruit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final ItemStack species) {
|
||||
this.deleteAllChildren();
|
||||
final WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0, 0, this.size().x(), 24), ExtraTrees.proxy.localise("gui.database.tab.fruit." + (this.treesThatBearFruit ? "natural" : "potential")), TextJustification.MiddleCenter);
|
||||
final Collection<IAlleleSpecies> trees = this.treesThatBearFruit ? ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatBearFruit(species, database.isNEI(), database.getWorld(), database.getUsername()) : ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatCanBearFruit(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4, 24, this.size().x() - 8, this.size().y() - 4 - 24).setOptions(trees);
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageAbstract;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.DoorType;
|
||||
import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import binnie.extratrees.block.decor.FenceType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class PagePlanksOverview extends PageAbstract<ItemStack> {
|
||||
public PagePlanksOverview(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final ItemStack species) {
|
||||
this.deleteAllChildren();
|
||||
final WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0, 0, this.size().x(), 24), species.getDisplayName(), TextJustification.MiddleCenter);
|
||||
new ControlText(this, new IArea(12, 24, this.size().x() - 24, 24), ExtraTrees.proxy.localise("gui.database.planks.use"), TextJustification.MiddleLeft);
|
||||
final IPlankType type = WoodManager.get(species);
|
||||
int x = 12;
|
||||
if (type != null) {
|
||||
final ItemStack fence = WoodManager.getFence(type, new FenceType(0), 1);
|
||||
final ItemStack gate = WoodManager.getGate(type);
|
||||
final ItemStack door = WoodManager.getDoor(type, DoorType.Standard);
|
||||
if (fence != null) {
|
||||
new ControlItemDisplay(this, x, 48).setItemStack(fence);
|
||||
x += 22;
|
||||
}
|
||||
if (gate != null) {
|
||||
new ControlItemDisplay(this, x, 48).setItemStack(gate);
|
||||
x += 22;
|
||||
}
|
||||
if (door != null) {
|
||||
new ControlItemDisplay(this, x, 48).setItemStack(door);
|
||||
x += 22;
|
||||
}
|
||||
}
|
||||
final ControlText controlDescription = new ControlText(this, new IArea(8, 84, this.getSize().x() - 16, 0), "", TextJustification.MiddleCenter);
|
||||
final ControlText controlSignature = new ControlText(this, new IArea(8, 84, this.getSize().x() - 16, 0), "", TextJustification.BottomRight);
|
||||
String desc = "";
|
||||
if (type != null) {
|
||||
desc = type.getDescription();
|
||||
}
|
||||
String descBody = "§o";
|
||||
String descSig = "";
|
||||
if (desc == null || desc.length() == 0) {
|
||||
descBody += BinnieCore.proxy.localise("gui.database.nodescription");
|
||||
} else {
|
||||
final String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
for (int i = 1; i < descStrings.length - 1; ++i) {
|
||||
descBody = descBody + " " + descStrings[i];
|
||||
}
|
||||
if (descStrings.length > 1) {
|
||||
descSig += descStrings[descStrings.length - 1];
|
||||
}
|
||||
}
|
||||
controlDescription.setValue(descBody + "§r");
|
||||
controlSignature.setValue(descSig + "§r");
|
||||
final int descHeight = CraftGUI.render.textHeight(controlDescription.getValue(), controlDescription.getSize().x());
|
||||
controlSignature.setPosition(new IPoint(controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10));
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
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.Window;
|
||||
import binnie.craftgui.mod.database.ControlSpeciesBox;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageAbstract;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PagePlanksTrees extends PageAbstract<ItemStack> {
|
||||
public PagePlanksTrees(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final ItemStack species) {
|
||||
this.deleteAllChildren();
|
||||
final WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0, 0, this.size().x(), 24), species.getDisplayName(), TextJustification.MiddleCenter);
|
||||
final Collection<IAlleleSpecies> trees = ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatMakePlanks(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4, 24, this.size().x() - 8, this.size().y() - 4 - 24).setOptions(trees);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.craftgui.controls.ControlTextCentered;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.mod.database.ControlDatabaseIndividualDisplay;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.EnumDiscoveryState;
|
||||
import binnie.craftgui.mod.database.PageSpecies;
|
||||
import binnie.craftgui.window.Panel;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public class PageSpeciesImage extends PageSpecies {
|
||||
ControlDatabaseIndividualDisplay display;
|
||||
|
||||
public PageSpeciesImage(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
new Panel(this, 7, 25, 130, 120, MinecraftGUI.PanelType.Gray);
|
||||
this.display = new ControlDatabaseIndividualDisplay(this, 12, 25, 120);
|
||||
this.display.hastooltip = false;
|
||||
new ControlTextCentered(this, 8, this.getValue().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
this.display.setSpecies(species, EnumDiscoveryState.Show);
|
||||
}
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.controls.scroll.ControlScrollableContent;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageSpecies;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PageSpeciesTreeGenome extends PageSpecies {
|
||||
public PageSpeciesTreeGenome(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
this.deleteAllChildren();
|
||||
final IAllele[] template = Binnie.GENETICS.getTreeRoot().getTemplate(species.getUID());
|
||||
if (template == null) {
|
||||
return;
|
||||
}
|
||||
final ITree tree = Binnie.GENETICS.getTreeRoot().templateAsIndividual(template);
|
||||
if (tree == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final ITreeGenome genome = tree.getGenome();
|
||||
final IAlleleTreeSpecies treeSpecies = genome.getPrimary();
|
||||
final ItemStack log = treeSpecies.getWoodProvider().getWoodStack();
|
||||
final int w = 144;
|
||||
final int h = 176;
|
||||
new ControlText(this, new IArea(0, 4, w, 16), this.getValue().toString(), TextJustification.MiddleCenter);
|
||||
final ControlScrollableContent scrollable = new ControlScrollableContent(this, 4, 20, w - 8, h - 8 - 16, 12);
|
||||
final Control contents = new Control(scrollable, 0, 0, w - 8 - 12, h - 8 - 16);
|
||||
final int tw = w - 8 - 12;
|
||||
final int w2 = 65;
|
||||
final int w3 = tw - 50;
|
||||
int y = 0;
|
||||
final int th = 14;
|
||||
final int th2 = 18;
|
||||
final BreedingSystem syst = Binnie.GENETICS.treeBreedingSystem;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.PLANT) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getPlantType().toString(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), BinnieCore.proxy.localise("gui.temperature.short") + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getTemperature().getName(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
//TODO RENDERING
|
||||
//final IIcon leaf = treeSpecies.getLeafIcon(false, false);
|
||||
//IIcon fruit = null;
|
||||
int fruitColour = 16777215;
|
||||
try {
|
||||
//TODO RENDERING
|
||||
//fruit = ForestryAPI.textureManager.getIcon(genome.getFruitProvider().getIconIndex(genome, (IBlockAccess) null, 0, 0, 0, 100, false));
|
||||
fruitColour = genome.getFruitProvider().getColour(genome, null, new BlockPos(0, 0, 0), 100);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
//if (leaf != null) {
|
||||
//new ControlText(contents, new IArea(0, y, w2, th2), ExtraTrees.proxy.localise("gui.database.leaves") + " : ", TextJustification.MiddleRight);
|
||||
//TODO RENDERING
|
||||
//new ControlBlockIconDisplay(contents, w2, y, leaf).setColour(treeSpecies.getLeafColour(false));
|
||||
//if (fruit != null && !treeSpecies.getUID().equals("forestry.treeOak")) {
|
||||
//TODO RENDERING
|
||||
// new ControlBlockIconDisplay(contents, w2, y, fruit).setColour(fruitColour);
|
||||
//}
|
||||
// y += th2;
|
||||
//}
|
||||
// final ItemStack log = (genome.getFruitProvider().getProducts().length
|
||||
// > 0) ? genome.getFruitProvider().getProducts()[0] : null;
|
||||
if (log != null) {
|
||||
new ControlText(contents, new IArea(0, y, w2, th2), ExtraTrees.proxy.localise("gui.database.log") + " : ", TextJustification.MiddleRight);
|
||||
final ControlItemDisplay display = new ControlItemDisplay(contents, w2, y);
|
||||
display.setItemStack(log);
|
||||
display.setTooltip();
|
||||
y += th2;
|
||||
}
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.GROWTH) + " : ", TextJustification.MiddleRight);
|
||||
//new ControlText(contents, new IArea(w2, y, w3, th), genome.getGrowthProvider().getDescription(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.HEIGHT) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getHeight() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.FERTILITY) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
final List<ItemStack> fruits = new ArrayList<>();
|
||||
for (final ItemStack stack : genome.getFruitProvider().getProducts().keySet()) {
|
||||
fruits.add(stack);
|
||||
}
|
||||
if (!fruits.isEmpty()) {
|
||||
new ControlText(contents, new IArea(0, y, w2, th2), syst.getChromosomeShortName(EnumTreeChromosome.FRUITS) + " : ", TextJustification.MiddleRight);
|
||||
for (final ItemStack fruitw : fruits) {
|
||||
final ControlItemDisplay display2 = new ControlItemDisplay(contents, w2, y);
|
||||
display2.setItemStack(fruitw);
|
||||
display2.setTooltip();
|
||||
y += th2;
|
||||
}
|
||||
}
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.YIELD) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getYield() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.SAPPINESS) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getSappiness() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.MATURATION) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getMaturationTime() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.GIRTH) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getGirth() + "x" + genome.getGirth(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
contents.setSize(new IPoint(contents.size().x(), y));
|
||||
scrollable.setScrollableContent(contents);
|
||||
}
|
||||
|
||||
public static String tolerated(final boolean t) {
|
||||
if (t) {
|
||||
return BinnieCore.proxy.localise("gui.tolerated");
|
||||
}
|
||||
return BinnieCore.proxy.localise("gui.nottolerated");
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
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.Window;
|
||||
import binnie.craftgui.mod.database.ControlSpeciesBox;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageAbstract;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PageWood extends PageAbstract<ItemStack> {
|
||||
public PageWood(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final ItemStack species) {
|
||||
this.deleteAllChildren();
|
||||
final WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0, 0, this.size().x(), 24), this.getValue().toString(), TextJustification.MiddleCenter);
|
||||
final Collection<IAlleleSpecies> trees = ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatHaveWood(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4, 24, this.size().x() - 8, this.size().y() - 4 - 24).setOptions(trees);
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
import binnie.craftgui.controls.listbox.ControlListBox;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.mod.database.ControlItemStackOption;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.IDatabaseMode;
|
||||
import binnie.craftgui.mod.database.PageBranchOverview;
|
||||
import binnie.craftgui.mod.database.PageBranchSpecies;
|
||||
import binnie.craftgui.mod.database.PageBreeder;
|
||||
import binnie.craftgui.mod.database.PageSpeciesClassification;
|
||||
import binnie.craftgui.mod.database.PageSpeciesMutations;
|
||||
import binnie.craftgui.mod.database.PageSpeciesOverview;
|
||||
import binnie.craftgui.mod.database.PageSpeciesResultant;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowArboristDatabase extends WindowAbstractDatabase {
|
||||
ControlListBox<ItemStack> selectionBoxFruit;
|
||||
ControlListBox<ItemStack> selectionBoxWood;
|
||||
ControlListBox<ItemStack> selectionBoxPlanks;
|
||||
|
||||
public WindowArboristDatabase(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
super(player, side, nei, Binnie.GENETICS.treeBreedingSystem, 120);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
return new WindowArboristDatabase(player, side, nei);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.overview", 0));
|
||||
new PageSpeciesTreeGenome(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.genome", 0));
|
||||
new PageSpeciesClassification(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.classification", 0));
|
||||
new PageSpeciesResultant(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.resultant", 0));
|
||||
new PageSpeciesMutations(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.further", 0));
|
||||
new PageBranchOverview(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.overview", 0));
|
||||
new PageBranchSpecies(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.species", 0));
|
||||
new PageBreeder(this.getInfoPages(Mode.Breeder), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder", 0));
|
||||
this.createMode(TreeMode.Fruit, new ModeWidgets(TreeMode.Fruit, this) {
|
||||
@Override
|
||||
public void createListBox(final IArea area) {
|
||||
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12) {
|
||||
@Override
|
||||
public IWidget createOption(final ItemStack value, final int y) {
|
||||
return new ControlItemStackOption(this.getContent(), value, y);
|
||||
}
|
||||
}).setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allFruits);
|
||||
}
|
||||
});
|
||||
this.createMode(TreeMode.Wood, new ModeWidgets(TreeMode.Wood, this) {
|
||||
@Override
|
||||
public void createListBox(final IArea area) {
|
||||
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12) {
|
||||
@Override
|
||||
public IWidget createOption(final ItemStack value, final int y) {
|
||||
return new ControlItemStackOption(this.getContent(), value, y);
|
||||
}
|
||||
}).setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allWoods);
|
||||
}
|
||||
});
|
||||
this.createMode(TreeMode.Planks, new ModeWidgets(TreeMode.Planks, this) {
|
||||
@Override
|
||||
public void createListBox(final IArea area) {
|
||||
this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12) {
|
||||
@Override
|
||||
public IWidget createOption(final ItemStack value, final int y) {
|
||||
return new ControlItemStackOption(this.getContent(), value, y);
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
new PageFruit(this.getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.natural", 0), true);
|
||||
new PageFruit(this.getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.potential", 0), false);
|
||||
new PageWood(this.getInfoPages(TreeMode.Wood), new DatabaseTab(ExtraTrees.instance, "wood.natural", 0));
|
||||
new PagePlanksOverview(this.getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.overview", 0));
|
||||
new PagePlanksTrees(this.getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.natural", 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "TreeDatabase";
|
||||
}
|
||||
|
||||
enum TreeMode implements IDatabaseMode {
|
||||
Fruit,
|
||||
Wood,
|
||||
Planks;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("gui.database.mode." + this.name().toLowerCase());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.brewery.BreweryMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowBrewery extends Window {
|
||||
public WindowBrewery(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(228, 218, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Brewery";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
new ControlSlotArray(this, 42, 32, 1, 3).create(BreweryMachine.SLOT_RECIPE_GRAINS);
|
||||
new ControlSlot(this, 16, 41).assign(BreweryMachine.SLOT_RECIPE_INPUT);
|
||||
new ControlSlot(this, 105, 77).assign(BreweryMachine.SLOT_YEAST);
|
||||
new ControlLiquidTank(this, 76, 32).setTankID(BreweryMachine.TANK_INPUT);
|
||||
new ControlLiquidTank(this, 162, 32).setTankID(BreweryMachine.TANK_OUTPUT);
|
||||
new ControlEnergyBar(this, 196, 32, 16, 60, Position.Bottom);
|
||||
new ControlBreweryProgress(this, 110, 32);
|
||||
new ControlSlotArray(this, this.getSize().x() / 2 - 81, 104, 9, 1).create(BreweryMachine.SLOTS_INVENTORY);
|
||||
new ControlPlayerInventory(this);
|
||||
new ControlErrorState(this, 133, 79);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowBrewery(player, inventory, side);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.distillery.DistilleryMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowDistillery extends Window {
|
||||
public WindowDistillery(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(224, 192, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Distillery";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
int x = 16;
|
||||
new ControlLiquidTank(this, x, 35).setTankID(DistilleryMachine.TANK_INPUT);
|
||||
x += 34;
|
||||
new ControlDistilleryProgress(this, x, 32);
|
||||
x += 64;
|
||||
new ControlLiquidTank(this, x, 35).setTankID(DistilleryMachine.TANK_OUTPUT);
|
||||
x += 34;
|
||||
new ControlEnergyBar(this, x, 36, 60, 16, Position.Left);
|
||||
new ControlPlayerInventory(this);
|
||||
new ControlErrorState(this, x + 21, 62);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowDistillery(player, inventory, side);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageBranchOverview;
|
||||
import binnie.craftgui.mod.database.PageBranchSpecies;
|
||||
import binnie.craftgui.mod.database.PageBreeder;
|
||||
import binnie.craftgui.mod.database.PageSpeciesClassification;
|
||||
import binnie.craftgui.mod.database.PageSpeciesMutations;
|
||||
import binnie.craftgui.mod.database.PageSpeciesOverview;
|
||||
import binnie.craftgui.mod.database.PageSpeciesResultant;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowLepidopteristDatabase extends WindowAbstractDatabase {
|
||||
public WindowLepidopteristDatabase(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
super(player, side, nei, Binnie.GENETICS.mothBreedingSystem, 160);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
return new WindowLepidopteristDatabase(player, side, nei);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.overview", 0));
|
||||
new PageSpeciesClassification(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.classification", 0));
|
||||
new PageSpeciesImage(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.specimen", 0));
|
||||
new PageSpeciesResultant(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.resultant", 0));
|
||||
new PageSpeciesMutations(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.further", 0));
|
||||
new PageBranchOverview(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.overview", 0));
|
||||
new PageBranchSpecies(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.species", 0));
|
||||
new PageBreeder(this.getInfoPages(Mode.Breeder), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "butterfly.breeder", 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "MothDatabase";
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowLumbermill extends Window {
|
||||
public WindowLumbermill(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(220, 192, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Lumbermill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
new ControlSlot(this, 42, 43).assign(LumbermillMachine.SLOT_LOG);
|
||||
new ControlSlot(this, 148, 43).assign(LumbermillMachine.SLOT_PLANKS);
|
||||
new ControlSlot(this, 172, 28).assign(LumbermillMachine.SLOT_BARK);
|
||||
new ControlSlot(this, 172, 58).assign(LumbermillMachine.SLOT_SAWDUST);
|
||||
new ControlLumbermillProgress(this, 70, 43);
|
||||
new ControlLiquidTank(this, 16, 32);
|
||||
new ControlEnergyBar(this, 8, 112, 16, 60, Position.Bottom);
|
||||
new ControlPlayerInventory(this);
|
||||
new ControlErrorState(this, 95, 73);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowLumbermill(player, inventory, side);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.ErrorState;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.InventoryType;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressLogic;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowPress extends Window {
|
||||
public WindowPress(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(194, 192, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Press";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
new ControlSlot(this, 24, 52).assign(FruitPressMachine.SLOT_FRUIT);
|
||||
new ControlLiquidTank(this, 99, 32).setTankID(FruitPressMachine.TANK_OUTPUT);
|
||||
new ControlEnergyBar(this, 154, 32, 16, 60, Position.Bottom);
|
||||
new ControlPlayerInventory(this);
|
||||
new ControlErrorState(this, 128, 54);
|
||||
new ControlFruitPressProgress(this, 62, 24);
|
||||
((Window) this.getSuperParent()).getContainer().getOrCreateSlot(InventoryType.Machine, FruitPressMachine.SLOT_CURRENT);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowPress(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recieveGuiNBT(final Side side, final EntityPlayer player, final String name, final NBTTagCompound action) {
|
||||
final FruitPressLogic logic = Machine.getInterface(FruitPressLogic.class, this.getInventory());
|
||||
super.recieveGuiNBT(side, player, name, action);
|
||||
if (side == Side.SERVER && name.equals("fruitpress-click")) {
|
||||
if (logic.canWork() == null && (logic.canProgress() == null || logic.canProgress() instanceof ErrorState.InsufficientPower)) {
|
||||
logic.alterProgress(2.0f);
|
||||
} else if (side == Side.SERVER && name.equals("clear-fruit")) {
|
||||
logic.setProgress(0.0f);
|
||||
this.getInventory().setInventorySlotContents(FruitPressMachine.SLOT_CURRENT, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowSetSquare extends Window {
|
||||
public WindowSetSquare(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(150, 150, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side) {
|
||||
return new WindowSetSquare(player, null, side);
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.controls.ControlTextEdit;
|
||||
import binnie.craftgui.controls.scroll.ControlScrollableContent;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.events.EventHandler;
|
||||
import binnie.craftgui.events.EventTextEdit;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.window.Panel;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.Designer;
|
||||
import binnie.extratrees.machines.DesignerType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowWoodworker extends Window {
|
||||
ControlTextEdit textEdit;
|
||||
ControlTileSelect tileSelect;
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
new ControlText(this, new IArea(190, 36, 114, 10), BinnieCore.proxy.localise("gui.design"), TextJustification.TopCenter).setColour(4473924);
|
||||
new Panel(this, 188, 48, 118, 126, MinecraftGUI.PanelType.Gray);
|
||||
this.textEdit = new ControlTextEdit(this, 188, 178, 118, 12);
|
||||
final ControlScrollableContent scroll = new ControlScrollableContent(this, 190, 50, 114, 122, 12);
|
||||
scroll.setScrollableContent(this.tileSelect = new ControlTileSelect(scroll, 0, 0));
|
||||
new ControlPlayerInventory(this).setPosition(new IPoint(14, 96));
|
||||
new ControlErrorState(this, 76, 65);
|
||||
if (this.getInventory() != null) {
|
||||
final ControlSlot slotWood1 = new ControlSlot(this, 22, 34);
|
||||
slotWood1.assign(Designer.design1Slot);
|
||||
final ControlSlot slotWood2 = new ControlSlot(this, 62, 34);
|
||||
slotWood2.assign(Designer.design2Slot);
|
||||
final ControlSlot slotBeeswax = new ControlSlot(this, 42, 64);
|
||||
slotBeeswax.assign(Designer.beeswaxSlot);
|
||||
final ControlRecipeSlot slotFinished = new ControlRecipeSlot(this, 112, 34);
|
||||
}
|
||||
}
|
||||
|
||||
public WindowWoodworker(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(320, 216, player, inventory, side);
|
||||
this.addEventHandler(new EventTextEdit.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventTextEdit event) {
|
||||
WindowWoodworker.this.tileSelect.refresh(event.getValue());
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.DirectChild, this));
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowWoodworker(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Woodworker";
|
||||
}
|
||||
|
||||
public DesignerType getDesignerType() {
|
||||
return Machine.getInterface(Designer.ComponentWoodworkerRecipe.class, this.getInventory()).getDesignerType();
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package binnie.craftgui.extratrees.kitchen;
|
||||
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.window.Panel;
|
||||
|
||||
public class ControlDropDownMenu extends Panel {
|
||||
public boolean stayOpenOnChildClick;
|
||||
|
||||
public ControlDropDownMenu(final IWidget parent, final int x, final int y, final int width, final int height) {
|
||||
super(parent, x, y, width, 2, MinecraftGUI.PanelType.Gray);
|
||||
this.stayOpenOnChildClick = false;
|
||||
this.addAttribute(Attribute.CanFocus);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package binnie.craftgui.extratrees.kitchen;
|
||||
|
||||
import binnie.craftgui.controls.button.ControlButton;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
|
||||
public abstract class ControlDropdownButton extends ControlButton {
|
||||
public ControlDropdownButton(final IWidget parent, final int x, final int y, final int width, final int height, final String text) {
|
||||
super(parent, x, y, width, height, text);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
ControlDropDownMenu menu = ControlDropdownButton.this.getWidget(ControlDropDownMenu.class);
|
||||
ControlDropdownButton.this.deleteChild(ControlDropdownButton.this.getWidget(ControlDropDownMenu.class));
|
||||
if (ControlDropdownButton.this.getWidget(ControlDropDownMenu.class) == null) {
|
||||
menu = ControlDropdownButton.this.createDropDownMenu();
|
||||
Window.get(ControlDropdownButton.this.getWidget()).setFocusedWidget(menu);
|
||||
} else {
|
||||
ControlDropdownButton.this.deleteChild(ControlDropdownButton.this.getWidget(ControlDropDownMenu.class));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public abstract ControlDropDownMenu createDropDownMenu();
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
package binnie.craftgui.extratrees.kitchen;
|
||||
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
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.minecraft.Window;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
|
||||
public class ControlFluidDisplay extends Control implements ITooltip {
|
||||
FluidStack itemStack;
|
||||
public boolean hastooltip;
|
||||
|
||||
public void setTooltip() {
|
||||
this.hastooltip = true;
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
}
|
||||
|
||||
public ControlFluidDisplay(final IWidget parent, final int x, final int y) {
|
||||
this(parent, x, y, 16);
|
||||
}
|
||||
|
||||
public ControlFluidDisplay(final IWidget parent, final int x, final int y, final FluidStack stack, final boolean tooltip) {
|
||||
this(parent, x, y, 16);
|
||||
this.setItemStack(stack);
|
||||
if (tooltip) {
|
||||
this.setTooltip();
|
||||
}
|
||||
}
|
||||
|
||||
public ControlFluidDisplay(final IWidget parent, final int x, final int y, final int size) {
|
||||
super(parent, x, y, size, size);
|
||||
this.itemStack = null;
|
||||
this.hastooltip = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
if (this.itemStack == null) {
|
||||
return;
|
||||
}
|
||||
final IPoint relativeToWindow = this.getAbsolutePosition().sub(this.getSuperParent().getPosition());
|
||||
if (relativeToWindow.x() > Window.get(this).getSize().x() + 100 || relativeToWindow.y() > Window.get(this).getSize().y() + 100) {
|
||||
return;
|
||||
}
|
||||
if (this.itemStack != null) {
|
||||
final Fluid fluid = this.itemStack.getFluid();
|
||||
final int hex = fluid.getColor(this.itemStack);
|
||||
final int r = (hex & 0xFF0000) >> 16;
|
||||
final int g = (hex & 0xFF00) >> 8;
|
||||
final int b = hex & 0xFF;
|
||||
final ResourceLocation iconRL = this.itemStack.getFluid().getStill();
|
||||
TextureAtlasSprite icon = FMLClientHandler.instance().getClient().getTextureMapBlocks().getAtlasSprite(iconRL.toString());
|
||||
GlStateManager.color(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(770, 771);
|
||||
if (this.getSize().x() != 16) {
|
||||
GlStateManager.pushMatrix();
|
||||
final float scale = this.getSize().x() / 16.0f;
|
||||
GlStateManager.scale(scale, scale, 1.0f);
|
||||
RenderUtil.drawSprite(IPoint.ZERO, icon);
|
||||
GlStateManager.popMatrix();
|
||||
} else {
|
||||
RenderUtil.drawSprite(IPoint.ZERO, icon);
|
||||
}
|
||||
GlStateManager.disableBlend();
|
||||
}
|
||||
}
|
||||
|
||||
public void setItemStack(final FluidStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
if (this.hastooltip && this.itemStack != null) {
|
||||
tooltip.add(this.itemStack.getLocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package binnie.craftgui.extratrees.kitchen;
|
||||
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.ITooltip;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.events.EventWidget;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ControlSlotFluid extends Control implements ITooltip {
|
||||
ControlFluidDisplay itemDisplay;
|
||||
FluidStack fluidStack;
|
||||
|
||||
public ControlSlotFluid(final IWidget parent, final int x, final int y, final FluidStack fluid) {
|
||||
this(parent, x, y, 18, fluid);
|
||||
}
|
||||
|
||||
public ControlSlotFluid(final IWidget parent, final int x, final int y, final int size, final FluidStack fluid) {
|
||||
super(parent, x, y, size, size);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.itemDisplay = new ControlFluidDisplay(this, 1, 1, size - 2);
|
||||
this.fluidStack = fluid;
|
||||
this.addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventWidget.ChangeSize event) {
|
||||
if (ControlSlotFluid.this.itemDisplay != null) {
|
||||
ControlSlotFluid.this.itemDisplay.setSize(ControlSlotFluid.this.getSize().sub(new IPoint(2, 2)));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final int size = (int) this.getSize().x();
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, this.getArea());
|
||||
if (this.getSuperParent().getMousedOverWidget() == this) {
|
||||
RenderUtil.drawGradientRect(new IArea(new IPoint(1, 1), this.getArea().size().sub(new IPoint(2, 2))), -2130706433, -2130706433);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
this.itemDisplay.setItemStack(this.getFluidStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
final FluidStack item = this.getFluidStack();
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
tooltip.add(item.getFluid().getLocalizedName(item));
|
||||
}
|
||||
|
||||
public FluidStack getFluidStack() {
|
||||
return this.fluidStack;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package binnie.craftgui.extratrees.kitchen;
|
||||
|
||||
import binnie.craftgui.controls.core.IControlValue;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotBase;
|
||||
import binnie.extratrees.alcohol.Glassware;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ControlSlotGlassware extends ControlSlotBase implements IControlValue<Glassware> {
|
||||
Glassware glassware;
|
||||
|
||||
public ControlSlotGlassware(final IWidget parent, final int x, final int y, final Glassware glassware) {
|
||||
super(parent, x, y);
|
||||
this.glassware = glassware;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Glassware getValue() {
|
||||
return this.glassware;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final Glassware value) {
|
||||
this.glassware = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return this.glassware.get(1);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package binnie.craftgui.extratrees.kitchen;
|
||||
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ControlTankSlot extends ControlSlotFluid {
|
||||
int tankID;
|
||||
|
||||
public ControlTankSlot(final IWidget parent, final int x, final int y, final int i) {
|
||||
super(parent, x, y, null);
|
||||
this.tankID = 0;
|
||||
this.tankID = i;
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
if (event.getButton() == 0) {
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setByte("id", (byte) ControlTankSlot.this.tankID);
|
||||
Window.get(ControlTankSlot.this.getWidget()).sendClientAction("tank-click", nbt);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
this.fluidStack = Window.get(this).getContainer().getTankInfo(this.tankID).liquid;
|
||||
final int height = 16 * (((this.fluidStack == null) ? 0 : this.fluidStack.amount) / 1000);
|
||||
this.itemDisplay.setCroppedZone(this.itemDisplay, new IArea(0, 16 - height, 16, 16));
|
||||
super.onUpdateClient();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package binnie.craftgui.extratrees.kitchen;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowBottleRack extends Window {
|
||||
public WindowBottleRack(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(248, 180, player, inventory, side);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowBottleRack(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "BottleBank";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
for (int i = 0; i < 36; ++i) {
|
||||
final int x = i % 12;
|
||||
final int y = i / 12;
|
||||
new ControlTankSlot(this, 16 + x * 18, 32 + y * 18, i);
|
||||
}
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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()));
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,187 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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";
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package binnie.craftgui.genetics.machine;
|
||||
|
||||
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