aboutsummaryrefslogtreecommitdiff
path: root/src/Java/binnie/craftgui/extratrees
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-01-20 14:24:34 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-01-20 14:24:34 +1000
commit869c206c4fcc8001bd2e1d66f704290331813835 (patch)
tree96735ce8fe4665e2759c3374221d6f06f4527df2 /src/Java/binnie/craftgui/extratrees
parentec2c72827f01dd4bb2174137f1ab162f9ddaab62 (diff)
downloadGT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.tar.gz
GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.tar.bz2
GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.zip
Initial Commit
Diffstat (limited to 'src/Java/binnie/craftgui/extratrees')
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/ControlBlockIconDisplay.java25
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/ControlBreweryProgress.java115
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java104
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/ControlFruitPressProgress.java90
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/ControlLumbermillProgress.java96
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/ControlRecipeSlot.java42
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/ControlTileSelect.java197
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/DialogBreweryRecipe.java17
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/PageFruit.java47
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksOverview.java103
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksTrees.java40
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesImage.java31
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesTreeGenome.java175
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/PageWood.java40
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/WindowArboristDatabase.java133
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/WindowBrewery.java61
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/WindowDistillery.java59
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/WindowLepidopteristDatabase.java57
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/WindowLumbermill.java56
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/WindowPress.java77
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/WindowSetSquare.java35
-rw-r--r--src/Java/binnie/craftgui/extratrees/dictionary/WindowWoodworker.java110
-rw-r--r--src/Java/binnie/craftgui/extratrees/kitchen/ControlDropDownMenu.java18
-rw-r--r--src/Java/binnie/craftgui/extratrees/kitchen/ControlDropdownButton.java36
-rw-r--r--src/Java/binnie/craftgui/extratrees/kitchen/ControlFluidDisplay.java103
-rw-r--r--src/Java/binnie/craftgui/extratrees/kitchen/ControlSlotFluid.java77
-rw-r--r--src/Java/binnie/craftgui/extratrees/kitchen/ControlSlotGlassware.java35
-rw-r--r--src/Java/binnie/craftgui/extratrees/kitchen/ControlTankSlot.java49
-rw-r--r--src/Java/binnie/craftgui/extratrees/kitchen/WindowBottleRack.java48
29 files changed, 2076 insertions, 0 deletions
diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlBlockIconDisplay.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlBlockIconDisplay.java
new file mode 100644
index 0000000000..58b93a2782
--- /dev/null
+++ b/src/Java/binnie/craftgui/extratrees/dictionary/ControlBlockIconDisplay.java
@@ -0,0 +1,25 @@
+package binnie.craftgui.extratrees.dictionary;
+
+import binnie.craftgui.controls.core.Control;
+import binnie.craftgui.core.CraftGUI;
+import binnie.craftgui.core.IWidget;
+import binnie.craftgui.core.geometry.IPoint;
+import binnie.craftgui.core.renderer.Renderer;
+import net.minecraft.util.IIcon;
+
+public class ControlBlockIconDisplay
+ extends Control
+{
+ IIcon icon;
+
+ public ControlBlockIconDisplay(IWidget parent, float x, float y, IIcon icon)
+ {
+ super(parent, x, y, 18.0F, 18.0F);
+ this.icon = icon;
+ }
+
+ public void onRenderBackground()
+ {
+ CraftGUI.Render.iconBlock(IPoint.ZERO, this.icon);
+ }
+}
diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlBreweryProgress.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlBreweryProgress.java
new file mode 100644
index 0000000000..d6d18d3a69
--- /dev/null
+++ b/src/Java/binnie/craftgui/extratrees/dictionary/ControlBreweryProgress.java
@@ -0,0 +1,115 @@
+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.Renderer;
+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;
+import binnie.extratrees.machines.Brewery.BreweryCrafting;
+import binnie.extratrees.machines.Brewery.ComponentBreweryLogic;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import org.lwjgl.opengl.GL11;
+
+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);
+
+ public void onRenderBackground()
+ {
+ CraftGUI.Render.texture(Brewery, new IPoint(0.0F, 0.0F));
+
+ Brewery.ComponentBreweryLogic logic = (Brewery.ComponentBreweryLogic)Machine.getInterface(Brewery.ComponentBreweryLogic.class, Window.get(this).getInventory());
+ if (logic.currentCrafting == null) {
+ return;
+ }
+ if (logic.currentCrafting.currentInput == null) {
+ return;
+ }
+ int fermentedHeight = (int)(32.0F * logic.getProgress() / 100.0F);
+
+ CraftGUI.Render.limitArea(new IArea(new IPoint(1.0F, 6.0F).add(getAbsolutePosition()), new IPoint(32.0F, 32 - fermentedHeight)));
+
+ GL11.glEnable(3089);
+
+ renderFluid(logic.currentCrafting.currentInput, new IPoint(1.0F, 6.0F));
+ renderFluid(logic.currentCrafting.currentInput, new IPoint(17.0F, 6.0F));
+ renderFluid(logic.currentCrafting.currentInput, new IPoint(1.0F, 22.0F));
+ renderFluid(logic.currentCrafting.currentInput, new IPoint(17.0F, 22.0F));
+
+ GL11.glDisable(3089);
+
+ CraftGUI.Render.limitArea(new IArea(new IPoint(1.0F, 38 - fermentedHeight).add(getAbsolutePosition()), new IPoint(32.0F, fermentedHeight)));
+
+
+ GL11.glEnable(3089);
+
+ renderFluid(Brewery.getOutput(logic.currentCrafting), new IPoint(1.0F, 6.0F));
+ renderFluid(Brewery.getOutput(logic.currentCrafting), new IPoint(17.0F, 6.0F));
+ renderFluid(Brewery.getOutput(logic.currentCrafting), new IPoint(1.0F, 22.0F));
+ renderFluid(Brewery.getOutput(logic.currentCrafting), new IPoint(17.0F, 22.0F));
+
+ GL11.glDisable(3089);
+
+ ItemStackSet stacks = new ItemStackSet();
+ for (ItemStack stack : logic.currentCrafting.inputs) {
+ stacks.add(stack);
+ }
+ stacks.add(logic.currentCrafting.ingr);
+
+ int x = 1;
+ int y = 6;
+ for (ItemStack stack : stacks)
+ {
+ CraftGUI.Render.item(new IPoint(x, y), stack);
+ x += 16;
+ if (x > 18)
+ {
+ x = 1;
+ y += 16;
+ }
+ }
+ }
+
+ public void onRenderForeground() {}
+
+ protected ControlBreweryProgress(IWidget parent, float x, float y)
+ {
+ super(parent, x, y, 34.0F, 39.0F);
+ addAttribute(Attribute.MouseOver);
+ }
+
+ public void renderFluid(FluidStack fluid, IPoint pos)
+ {
+ int hex = fluid.getFluid().getColor(fluid);
+
+ int r = (hex & 0xFF0000) >> 16;
+ int g = (hex & 0xFF00) >> 8;
+ int b = hex & 0xFF;
+
+ IIcon icon = fluid.getFluid().getIcon();
+
+ GL11.glColor4f(r / 255.0F, g / 255.0F, b / 255.0F, 1.0F);
+
+ GL11.glEnable(3042);
+
+ GL11.glBlendFunc(770, 771);
+
+ CraftGUI.Render.iconBlock(pos, fluid.getFluid().getIcon());
+
+ GL11.glDisable(3042);
+ }
+}
diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java
new file mode 100644
index 0000000000..5a44b09ca3
--- /dev/null
+++ b/src/Java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java
@@ -0,0 +1,104 @@
+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.Renderer;
+import binnie.craftgui.events.EventMouse.Down;
+import binnie.craftgui.events.EventMouse.Down.Handler;
+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.ComponentDistilleryLogic;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.IIcon;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import org.lwjgl.opengl.GL11;
+
+public class ControlDistilleryProgress
+ extends ControlProgressBase
+{
+ static Texture DistilleryBase = new StandardTexture(43, 0, 58, 66, ExtraTreeTexture.Gui);
+ static Texture DistilleryOverlay = new StandardTexture(139, 0, 18, 66, ExtraTreeTexture.Gui);
+ static Texture LiquidFlow = new StandardTexture(101, 0, 38, 66, ExtraTreeTexture.Gui);
+ static Texture Output = new StandardTexture(68, 66, 17, 7, ExtraTreeTexture.Gui);
+
+ public void onRenderBackground()
+ {
+ CraftGUI.Render.texture(DistilleryBase, new IPoint(0.0F, 0.0F));
+ CraftGUI.Render.texturePercentage(LiquidFlow, new IArea(18.0F, 0.0F, 38.0F, 66.0F), Position.Left, this.progress);
+
+ Distillery.ComponentDistilleryLogic component = (Distillery.ComponentDistilleryLogic)Machine.getInterface(Distillery.ComponentDistilleryLogic.class, Window.get(this).getInventory());
+
+
+ FluidStack stack = null;
+ if (component != null) {
+ stack = component.currentFluid;
+ }
+ if (stack != null) {
+ for (int y = 0; y < 4; y++) {
+ renderFluid(stack, new IPoint(1.0F, 1 + y * 16));
+ }
+ }
+ }
+
+ public void onRenderForeground()
+ {
+ int level = ((Distillery.ComponentDistilleryLogic)Machine.getInterface(Distillery.ComponentDistilleryLogic.class, Window.get(this).getInventory())).level;
+ CraftGUI.Render.texture(Output, new IPoint(47.0F, 14 + level * 15));
+ CraftGUI.Render.texture(DistilleryOverlay, new IPoint(0.0F, 0.0F));
+ }
+
+ protected ControlDistilleryProgress(IWidget parent, float x, float y)
+ {
+ super(parent, x, y, 58.0F, 66.0F);
+
+ addSelfEventHandler(new EventMouse.Down.Handler()
+ {
+ public void onEvent(EventMouse.Down event)
+ {
+ int distillationLevel = -1;
+ if (new IArea(45.0F, 8.0F, 19.0F, 11.0F).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) {
+ distillationLevel = 0;
+ } else if (new IArea(45.0F, 23.0F, 19.0F, 11.0F).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) {
+ distillationLevel = 1;
+ } else if (new IArea(45.0F, 38.0F, 19.0F, 11.0F).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) {
+ distillationLevel = 2;
+ }
+ if (distillationLevel >= 0)
+ {
+ NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setByte("i", (byte)distillationLevel);
+ Window.get(ControlDistilleryProgress.this.getWidget()).sendClientAction("still-level", nbt);
+ }
+ }
+ });
+ }
+
+ public void renderFluid(FluidStack fluid, IPoint pos)
+ {
+ int hex = fluid.getFluid().getColor(fluid);
+
+ int r = (hex & 0xFF0000) >> 16;
+ int g = (hex & 0xFF00) >> 8;
+ int b = hex & 0xFF;
+
+ IIcon icon = fluid.getFluid().getIcon();
+
+ GL11.glColor4f(r / 255.0F, g / 255.0F, b / 255.0F, 1.0F);
+
+ GL11.glEnable(3042);
+
+ GL11.glBlendFunc(770, 771);
+
+ CraftGUI.Render.iconBlock(pos, fluid.getFluid().getIcon());
+
+ GL11.glDisable(3042);
+ }
+}
diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlFruitPressProgress.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlFruitPressProgress.java
new file mode 100644
index 0000000000..79d21a3025
--- /dev/null
+++ b/src/Java/binnie/craftgui/extratrees/dictionary/ControlFruitPressProgress.java
@@ -0,0 +1,90 @@
+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.Renderer;
+import binnie.craftgui.events.EventMouse.Down;
+import binnie.craftgui.events.EventMouse.Down.Handler;
+import binnie.craftgui.minecraft.ContainerCraftGUI;
+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.Press;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.IIcon;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import org.lwjgl.opengl.GL11;
+
+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);
+
+ public void onRenderBackground()
+ {
+ CraftGUI.Render.texture(PressSlot, new IPoint(3.0F, 52.0F));
+
+ ItemStack input = Window.get(this).getContainer().getSlotFromInventory(Window.get(this).getInventory(), Press.slotCurrent).getStack();
+ if ((input == null) || (Press.getOutput(input) == null)) {
+ return;
+ }
+ Fluid fluid = Press.getOutput(input).getFluid();
+
+ int hex = fluid.getColor(Press.getOutput(input));
+
+ int r = (hex & 0xFF0000) >> 16;
+ int g = (hex & 0xFF00) >> 8;
+ int b = hex & 0xFF;
+
+ IIcon icon = fluid.getIcon();
+
+ GL11.glColor4f(r / 255.0F, g / 255.0F, b / 255.0F, 1.0F);
+
+ GL11.glEnable(3042);
+
+ GL11.glBlendFunc(770, 771);
+
+ CraftGUI.Render.iconBlock(new IPoint(4.0F, 52.0F), fluid.getIcon());
+
+ GL11.glDisable(3042);
+
+ icon = input.getIconIndex();
+ CraftGUI.Render.iconItem(new IPoint(4.0F, 52.0F), icon);
+ }
+
+ public void onRenderForeground()
+ {
+ CraftGUI.Render.texture(PressTexture, new IPoint(0.0F, 16.0F * this.progress));
+ }
+
+ protected ControlFruitPressProgress(IWidget parent, float x, float y)
+ {
+ super(parent, x, y, 37.0F, 69.0F);
+ addAttribute(Attribute.MouseOver);
+
+ addSelfEventHandler(new EventMouse.Down.Handler()
+ {
+ public void onEvent(EventMouse.Down event)
+ {
+ if (event.getButton() == 0)
+ {
+ NBTTagCompound action = new NBTTagCompound();
+ Window.get(ControlFruitPressProgress.this.getWidget()).sendClientAction("fruitpress-click", action);
+ }
+ else if (event.getButton() == 1)
+ {
+ NBTTagCompound action = new NBTTagCompound();
+ Window.get(ControlFruitPressProgress.this.getWidget()).sendClientAction("clear-fruit", action);
+ }
+ }
+ });
+ }
+}
diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlLumbermillProgress.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlLumbermillProgress.java
new file mode 100644
index 0000000000..b315c23927
--- /dev/null
+++ b/src/Java/binnie/craftgui/extratrees/dictionary/ControlLumbermillProgress.java
@@ -0,0 +1,96 @@
+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.core.renderer.Renderer;
+import binnie.craftgui.minecraft.MinecraftGUI.PanelType;
+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;
+import net.minecraft.block.Block;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import org.lwjgl.opengl.GL11;
+
+public class ControlLumbermillProgress
+ extends ControlProgressBase
+{
+ public void onUpdateClient()
+ {
+ super.onUpdateClient();
+ if (this.oldProgress != this.progress)
+ {
+ this.oldProgress = this.progress;
+ this.animation += 5.0F;
+ }
+ }
+
+ float oldProgress = 0.0F;
+ float animation = 0.0F;
+ static Texture Saw = new StandardTexture(0, 0, 6, 32, ExtraTreeTexture.Gui);
+ static Texture Saw2 = new StandardTexture(2, 0, 4, 32, ExtraTreeTexture.Gui);
+
+ public void onRenderForeground()
+ {
+ GL11.glDisable(2896);
+ int sawX = (int)(63.0F * this.progress);
+
+ CraftGUI.Render.texture(Saw, new IPoint(sawX, -8.0F + 6.0F * (float)Math.sin(this.animation)));
+
+ ItemStack item = Window.get(this).getInventory().getStackInSlot(Lumbermill.slotWood);
+ if (item == null) {
+ return;
+ }
+ GL11.glDisable(2896);
+
+ Block block = null;
+ if ((item.getItem() instanceof ItemBlock)) {
+ block = ((ItemBlock)item.getItem()).field_150939_a;
+ }
+ if (block == null) {
+ return;
+ }
+ IIcon icon = block.getIcon(2, item.getItemDamage());
+ for (int i = 0; i < 4; i++) {
+ CraftGUI.Render.iconBlock(new IPoint(1 + i * 16, 1.0F), icon);
+ }
+ ItemStack result = Lumbermill.getPlankProduct(item);
+ if (result == null) {
+ return;
+ }
+ Block block2 = null;
+ if ((item.getItem() instanceof ItemBlock)) {
+ block2 = ((ItemBlock)result.getItem()).field_150939_a;
+ }
+ if (block2 == null) {
+ return;
+ }
+ IIcon icon2 = block2.getIcon(2, result.getItemDamage());
+
+ IPoint size = getSize();
+ IPoint pos = getAbsolutePosition();
+ CraftGUI.Render.limitArea(new IArea(pos.add(new IPoint(0.0F, 0.0F)), new IPoint(this.progress * 64.0F + 2.0F, 18.0F)));
+
+ GL11.glEnable(3089);
+ for (int i = 0; i < 4; i++) {
+ CraftGUI.Render.iconBlock(new IPoint(1 + i * 16, 1.0F), icon2);
+ }
+ GL11.glDisable(3089);
+
+ CraftGUI.Render.texture(Saw2, new IPoint(sawX + 2, -8.0F + 6.0F * (float)Math.sin(this.animation)));
+ }
+
+ protected ControlLumbermillProgress(IWidget parent, float x, float y)
+ {
+ super(parent, x, y, 66.0F, 18.0F);
+ new Panel(this, 0.0F, 0.0F, 66.0F, 18.0F, MinecraftGUI.PanelType.Black);
+ }
+}
diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlRecipeSlot.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlRecipeSlot.java
new file mode 100644
index 0000000000..d65e825cb8
--- /dev/null
+++ b/src/Java/binnie/craftgui/extratrees/dictionary/ControlRecipeSlot.java
@@ -0,0 +1,42 @@
+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.Down;
+import binnie.craftgui.events.EventMouse.Down.Handler;
+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(IWidget parent, int x, int y)
+ {
+ super(parent, x, y, 50);
+
+ addSelfEventHandler(new EventMouse.Down.Handler()
+ {
+ public void onEvent(EventMouse.Down event)
+ {
+ TileEntity tile = (TileEntity)Window.get(ControlRecipeSlot.this.getWidget()).getInventory();
+ if ((tile == null) || (!(tile instanceof TileEntityMachine))) {
+ return;
+ }
+ NBTTagCompound nbt = new NBTTagCompound();
+ Window.get(ControlRecipeSlot.this.getWidget()).sendClientAction("recipe", nbt);
+ }
+ });
+ setRotating();
+ }
+
+ public ItemStack getItemStack()
+ {
+ IComponentRecipe recipe = (IComponentRecipe)Machine.getInterface(IComponentRecipe.class, Window.get(this).getInventory());
+ return recipe.isRecipe() ? recipe.getProduct() : null;
+ }
+}
diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlTileSelect.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlTileSelect.java
new file mode 100644
index 0000000000..cc5c79c529
--- /dev/null
+++ b/src/Java/binnie/craftgui/extratrees/dictionary/ControlTileSelect.java
@@ -0,0 +1,197 @@
+package binnie.craftgui.extratrees.dictionary;
+
+import binnie.Binnie;
+import binnie.core.BinnieCore;
+import binnie.core.language.ManagerLanguage;
+import binnie.core.machines.Machine;
+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.IArea;
+import binnie.craftgui.core.geometry.IPoint;
+import binnie.craftgui.core.renderer.Renderer;
+import binnie.craftgui.events.EventMouse.Down;
+import binnie.craftgui.events.EventMouse.Down.Handler;
+import binnie.craftgui.minecraft.Window;
+import binnie.craftgui.resource.minecraft.CraftGUITexture;
+import binnie.extratrees.api.CarpentryManager;
+import binnie.extratrees.api.ICarpentryInterface;
+import binnie.extratrees.api.IDesign;
+import binnie.extratrees.api.IDesignCategory;
+import binnie.extratrees.carpentry.EnumDesign;
+import binnie.extratrees.machines.Designer.ComponentWoodworkerRecipe;
+import binnie.extratrees.machines.DesignerType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
+public class ControlTileSelect
+ extends Control
+ implements IControlValue<IDesign>, IControlScrollable
+{
+ public static class ControlTile
+ extends Control
+ implements IControlValue<IDesign>, ITooltip
+ {
+ IDesign value;
+
+ protected ControlTile(IWidget parent, float x, float y, IDesign value)
+ {
+ super(x, y, 18.0F, 18.0F);
+ setValue(value);
+ addAttribute(Attribute.MouseOver);
+
+ addSelfEventHandler(new EventMouse.Down.Handler()
+ {
+ public void onEvent(EventMouse.Down event)
+ {
+ TileEntityMachine tile = (TileEntityMachine)Window.get(ControlTileSelect.ControlTile.this.getWidget()).getInventory();
+ if (tile == null) {
+ return;
+ }
+ Designer.ComponentWoodworkerRecipe recipe = (Designer.ComponentWoodworkerRecipe)tile.getMachine().getComponent(Designer.ComponentWoodworkerRecipe.class);
+
+ NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setShort("d", (short)CarpentryManager.carpentryInterface.getDesignIndex(ControlTileSelect.ControlTile.this.getValue()));
+
+ Window.get(ControlTileSelect.ControlTile.this.getWidget()).sendClientAction("design", nbt);
+ }
+ });
+ }
+
+ public void getTooltip(Tooltip tooltip)
+ {
+ tooltip.add(Binnie.Language.localise(BinnieCore.instance, "gui.designer.pattern", new Object[] { getValue().getName() }));
+ }
+
+ public IDesign getValue()
+ {
+ return this.value;
+ }
+
+ public void onRenderBackground()
+ {
+ CraftGUI.Render.texture(CraftGUITexture.Slot, IPoint.ZERO);
+ }
+
+ public void onRenderForeground()
+ {
+ ItemStack image = ((WindowWoodworker)getSuperParent()).getDesignerType().getDisplayStack(getValue());
+ CraftGUI.Render.item(new IPoint(1.0F, 1.0F), image);
+ if (((IControlValue)getParent()).getValue() != getValue()) {
+ if (Window.get(this).getMousedOverWidget() == this) {
+ CraftGUI.Render.gradientRect(getArea().inset(1), 1157627903, 1157627903);
+ } else {
+ CraftGUI.Render.gradientRect(getArea().inset(1), -1433892728, -1433892728);
+ }
+ }
+ }
+
+ public void setValue(IDesign value)
+ {
+ this.value = value;
+ }
+ }
+
+ IDesign value = EnumDesign.Blank;
+ float shownHeight = 92.0F;
+
+ protected ControlTileSelect(IWidget parent, float x, float y)
+ {
+ super(parent, x, y, 102.0F, 20 * (CarpentryManager.carpentryInterface.getSortedDesigns().size() / 4) + 22);
+
+ refresh("");
+ }
+
+ public float getPercentageIndex()
+ {
+ return 0.0F;
+ }
+
+ public float getPercentageShown()
+ {
+ return 0.0F;
+ }
+
+ public IDesign getValue()
+ {
+ return this.value;
+ }
+
+ public void movePercentage(float percentage) {}
+
+ public void onUpdateClient()
+ {
+ super.onUpdateClient();
+ TileEntityMachine tile = (TileEntityMachine)Window.get(this).getInventory();
+ if (tile == null) {
+ return;
+ }
+ Designer.ComponentWoodworkerRecipe recipe = (Designer.ComponentWoodworkerRecipe)tile.getMachine().getComponent(Designer.ComponentWoodworkerRecipe.class);
+
+ setValue(recipe.getDesign());
+ }
+
+ public void refresh(String filterText)
+ {
+ deleteAllChildren();
+ int cx = 2;
+ int cy = 2;
+
+ Map<IDesignCategory, List<IDesign>> designs = new HashMap();
+ for (IDesignCategory category : CarpentryManager.carpentryInterface.getAllDesignCategories())
+ {
+ designs.put(category, new ArrayList());
+ for (IDesign tile : category.getDesigns()) {
+ if ((filterText == "") || (tile.getName().toLowerCase().contains(filterText))) {
+ ((List)designs.get(category)).add(tile);
+ }
+ }
+ if (((List)designs.get(category)).isEmpty()) {
+ designs.remove(category);
+ }
+ }
+ for (IDesignCategory category : designs.keySet())
+ {
+ cx = 2;
+ new ControlText(this, new IPoint(cx, cy + 3), category.getName());
+ cy += 16;
+ for (IDesign tile : (List)designs.get(category))
+ {
+ if (cx > 90)
+ {
+ cx = 2;
+ cy += 20;
+ }
+ new ControlTile(this, cx, cy, tile);
+ cx += 20;
+ }
+ cy += 20;
+ }
+ int height = cy;
+
+ setSize(new IPoint(getSize().x(), height));
+ }
+
+ public void setPercentageIndex(float index) {}
+
+ public void setValue(IDesign value)
+ {
+ this.value = value;
+ }
+
+ public float getMovementRange()
+ {
+ return 0.0F;
+ }
+}
diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/DialogBreweryRecipe.java b/src/Java/binnie/craftgui/extratrees/dictionary/DialogBreweryRecipe.java
new file mode 100644
index 0000000000..f761aaea29
--- /dev/null
+++ b/src/Java/binnie/craftgui/extratrees/dictionary/DialogBreweryRecipe.java
@@ -0,0 +1,17 @@
+package binnie.craftgui.extratrees.dictionary;
+
+import binnie.craftgui.core.IWidget;
+import binnie.craftgui.minecraft.Dialog;
+
+public class DialogBreweryRecipe
+ extends Dialog
+{
+ public DialogBreweryRecipe(IWidget parent, float w, float h)
+ {
+ super(parent, w, h);
+ }
+
+ public void initialise() {}
+
+ public void onClose() {}
+}
diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PageFruit.java b/src/Java/binnie/craftgui/extratrees/dictionary/PageFruit.java
new file mode 100644
index 0000000000..c6983deef9
--- /dev/null
+++ b/src/Java/binnie/craftgui/extratrees/dictionary/PageFruit.java
@@ -0,0 +1,47 @@
+package binnie.craftgui.extratrees.dictionary;