diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-01-20 14:24:34 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-01-20 14:24:34 +1000 |
commit | 869c206c4fcc8001bd2e1d66f704290331813835 (patch) | |
tree | 96735ce8fe4665e2759c3374221d6f06f4527df2 /src/Java/binnie/craftgui/extratrees/dictionary | |
parent | ec2c72827f01dd4bb2174137f1ab162f9ddaab62 (diff) | |
download | GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.tar.gz GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.tar.bz2 GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.zip |
Initial Commit
Diffstat (limited to 'src/Java/binnie/craftgui/extratrees/dictionary')
22 files changed, 1710 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; + +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.IPoint; +import binnie.craftgui.core.geometry.TextJustification; +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 binnie.extratrees.proxy.Proxy; +import forestry.api.genetics.IAlleleSpecies; +import java.util.Collection; +import net.minecraft.item.ItemStack; + +public class PageFruit + extends PageAbstract<ItemStack> +{ + boolean treesThatBearFruit; + + public PageFruit(IWidget parent, DatabaseTab tab, boolean treesThatBearFruit) + { + super(parent, tab); + this.treesThatBearFruit = treesThatBearFruit; + } + + public void onValueChanged(ItemStack species) + { + deleteAllChildren(); + WindowAbstractDatabase database = (WindowAbstractDatabase)WindowAbstractDatabase.get(this); + new ControlText(this, new IArea(0.0F, 0.0F, size().x(), 24.0F), ExtraTrees.proxy.localise("gui.database.tab.fruit." + (this.treesThatBearFruit ? "natural" : "potential")), TextJustification.MiddleCenter); + + + 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.0F, 24.0F, size().x() - 8.0F, size().y() - 4.0F - 24.0F).setOptions(trees); + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksOverview.java b/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksOverview.java new file mode 100644 index 0000000000..f27fa6967b --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksOverview.java @@ -0,0 +1,103 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.core.BinnieCore; +import binnie.core.proxy.BinnieProxy; +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.core.renderer.Renderer; +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 binnie.extratrees.proxy.Proxy; +import net.minecraft.item.ItemStack; + +public class PagePlanksOverview + extends PageAbstract<ItemStack> +{ + public PagePlanksOverview(IWidget parent, DatabaseTab tab) + { + super(parent, tab); + } + + public void onValueChanged(ItemStack species) + { + deleteAllChildren(); + WindowAbstractDatabase database = (WindowAbstractDatabase)WindowAbstractDatabase.get(this); + new ControlText(this, new IArea(0.0F, 0.0F, size().x(), 24.0F), species.getDisplayName(), TextJustification.MiddleCenter); + + + + new ControlText(this, new IArea(12.0F, 24.0F, size().x() - 24.0F, 24.0F), ExtraTrees.proxy.localise("gui.database.planks.use"), TextJustification.MiddleLeft); + + + IPlankType type = WoodManager.get(species); + + int x = 12; + if (type != null) + { + ItemStack fence = WoodManager.getFence(type, new FenceType(0), 1); + ItemStack gate = WoodManager.getGate(type); + ItemStack door = WoodManager.getDoor(type, DoorType.Standard); + if (fence != null) + { + new ControlItemDisplay(this, x, 48.0F).setItemStack(fence); + x += 22; + } + if (gate != null) + { + new ControlItemDisplay(this, x, 48.0F).setItemStack(gate); + x += 22; + } + if (door != null) + { + new ControlItemDisplay(this, x, 48.0F).setItemStack(door); + x += 22; + } + } + ControlText controlDescription = new ControlText(this, new IArea(8.0F, 84.0F, getSize().x() - 16.0F, 0.0F), "", TextJustification.MiddleCenter); + + + ControlText controlSignature = new ControlText(this, new IArea(8.0F, 84.0F, getSize().x() - 16.0F, 0.0F), "", TextJustification.BottomRight); + + + + String desc = ""; + if (type != null) { + desc = type.getDescription(); + } + String descBody = "§o"; + String descSig = ""; + if ((desc == null) || (desc.length() == 0)) + { + descBody = descBody + BinnieCore.proxy.localise("gui.database.nodescription"); + } + else + { + String[] descStrings = desc.split("\\|"); + descBody = descBody + descStrings[0]; + for (int i = 1; i < descStrings.length - 1; i++) { + descBody = descBody + " " + descStrings[i]; + } + if (descStrings.length > 1) { + descSig = descSig + descStrings[(descStrings.length - 1)]; + } + } + controlDescription.setValue(descBody + "§r"); + controlSignature.setValue(descSig + "§r"); + + float descHeight = CraftGUI.Render.textHeight(controlDescription.getValue(), controlDescription.getSize().x()); + + + controlSignature.setPosition(new IPoint(controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10.0F)); + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksTrees.java b/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksTrees.java new file mode 100644 index 0000000000..8702edbe95 --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksTrees.java @@ -0,0 +1,40 @@ +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.IPoint; +import binnie.craftgui.core.geometry.TextJustification; +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 java.util.Collection; +import net.minecraft.item.ItemStack; + +public class PagePlanksTrees + extends PageAbstract<ItemStack> +{ + public PagePlanksTrees(IWidget parent, DatabaseTab tab) + { + super(parent, tab); + } + + public void onValueChanged(ItemStack species) + { + deleteAllChildren(); + WindowAbstractDatabase database = (WindowAbstractDatabase)WindowAbstractDatabase.get(this); + new ControlText(this, new IArea(0.0F, 0.0F, size().x(), 24.0F), species.getDisplayName(), TextJustification.MiddleCenter); + + + + Collection<IAlleleSpecies> trees = ((TreeBreedingSystem)database.getBreedingSystem()).getTreesThatMakePlanks(species, database.isNEI(), database.getWorld(), database.getUsername()); + + + + + new ControlSpeciesBox(this, 4.0F, 24.0F, size().x() - 8.0F, size().y() - 4.0F - 24.0F).setOptions(trees); + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesImage.java b/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesImage.java new file mode 100644 index 0000000000..d6fd929447 --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesImage.java @@ -0,0 +1,31 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.craftgui.controls.ControlTextCentered; +import binnie.craftgui.core.IWidget; +import binnie.craftgui.minecraft.MinecraftGUI.PanelType; +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(IWidget parent, DatabaseTab tab) + { + super(parent, tab); + new Panel(this, 7.0F, 25.0F, 130.0F, 120.0F, MinecraftGUI.PanelType.Gray); + this.display = new ControlDatabaseIndividualDisplay(this, 12.0F, 25.0F, 120.0F); + this.display.hastooltip = false; + new ControlTextCentered(this, 8.0F, ((DatabaseTab)getValue()).toString()); + } + + public void onValueChanged(IAlleleSpecies species) + { + this.display.setSpecies(species, EnumDiscoveryState.Show); + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesTreeGenome.java b/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesTreeGenome.java new file mode 100644 index 0000000000..22a1a67b29 --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesTreeGenome.java @@ -0,0 +1,175 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.Binnie; +import binnie.core.BinnieCore; +import binnie.core.genetics.BreedingSystem; +import binnie.core.genetics.ManagerGenetics; +import binnie.core.proxy.BinnieProxy; +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 binnie.extratrees.proxy.Proxy; +import forestry.api.arboriculture.EnumTreeChromosome; +import forestry.api.arboriculture.IAlleleTreeSpecies; +import forestry.api.arboriculture.IFruitProvider; +import forestry.api.arboriculture.IGrowthProvider; +import forestry.api.arboriculture.ITree; +import forestry.api.arboriculture.ITreeGenome; +import forestry.api.arboriculture.ITreeRoot; +import forestry.api.core.EnumTemperature; +import forestry.api.core.ForestryAPI; +import forestry.api.core.ITextureManager; +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IAlleleSpecies; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.EnumPlantType; + +public class PageSpeciesTreeGenome + extends PageSpecies +{ + public PageSpeciesTreeGenome(IWidget parent, DatabaseTab tab) + { + super(parent, tab); + } + + public void onValueChanged(IAlleleSpecies species) + { + deleteAllChildren(); + IAllele[] template = Binnie.Genetics.getTreeRoot().getTemplate(species.getUID()); + if (template == null) { + return; + } + ITree tree = Binnie.Genetics.getTreeRoot().templateAsIndividual(template); + if (tree == null) { + return; + } + ITreeGenome genome = tree.getGenome(); + IAlleleTreeSpecies treeSpecies = genome.getPrimary(); + + int w = 144; + int h = 176; + + new ControlText(this, new IArea(0.0F, 4.0F, w, 16.0F), ((DatabaseTab)getValue()).toString(), TextJustification.MiddleCenter); + + ControlScrollableContent scrollable = new ControlScrollableContent(this, 4.0F, 20.0F, w - 8, h - 8 - 16, 12.0F); + + Control contents = new Control(scrollable, 0.0F, 0.0F, w - 8 - 12, h - 8 - 16); + + int tw = w - 8 - 12; + int w1 = 65; + int w2 = tw - 50; + int y = 0; + int th = 14; + int th2 = 18; + + BreedingSystem syst = Binnie.Genetics.treeBreedingSystem; + + new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.PLANT) + " : ", TextJustification.MiddleRight); + new ControlText(contents, new IArea(w1, y, w2, th), treeSpecies.getPlantType().toString(), TextJustification.MiddleLeft); + + y += th; + + new ControlText(contents, new IArea(0.0F, y, w1, th), BinnieCore.proxy.localise("gui.temperature.short") + " : ", TextJustification.MiddleRight); + new ControlText(contents, new IArea(w1, y, w2, th), treeSpecies.getTemperature().getName(), TextJustification.MiddleLeft); + + y += th; + + IIcon leaf = ForestryAPI.textureManager.getIcon(treeSpecies.getLeafIconIndex(tree, false)); + + IIcon fruit = null; + int fruitColour = 16777215; + try + { + fruit = ForestryAPI.textureManager.getIcon(genome.getFruitProvider().getIconIndex(genome, null, 0, 0, 0, 100, false)); + fruitColour = genome.getFruitProvider().getColour(genome, null, 0, 0, 0, 100); + } + catch (Exception e) {} + if (leaf != null) + { + new ControlText(contents, new IArea(0.0F, y, w1, th2), ExtraTrees.proxy.localise("gui.database.leaves") + " : ", TextJustification.MiddleRight); + + new ControlBlockIconDisplay(contents, w1, y, leaf).setColour(treeSpecies.getLeafColour(tree)); + if ((fruit != null) && (!treeSpecies.getUID().equals("forestry.treeOak"))) { + new ControlBlockIconDisplay(contents, w1, y, fruit).setColour(fruitColour); + } + y += th2; + } + ItemStack log = treeSpecies.getLogStacks().length > 0 ? treeSpecies.getLogStacks()[0] : null; + if (log != null) + { + new ControlText(contents, new IArea(0.0F, y, w1, th2), ExtraTrees.proxy.localise("gui.database.log") + " : ", TextJustification.MiddleRight); + + ControlItemDisplay display = new ControlItemDisplay(contents, w1, y); + display.setItemStack(log); + display.setTooltip(); + + y += th2; + } + new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.GROWTH) + " : ", TextJustification.MiddleRight); + new ControlText(contents, new IArea(w1, y, w2, th), genome.getGrowthProvider().getDescription(), TextJustification.MiddleLeft); + y += th; + + new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.HEIGHT) + " : ", TextJustification.MiddleRight); + new ControlText(contents, new IArea(w1, y, w2, th), genome.getHeight() + "x", TextJustification.MiddleLeft); + y += th; + + new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.FERTILITY) + " : ", TextJustification.MiddleRight); + new ControlText(contents, new IArea(w1, y, w2, th), genome.getFertility() + "x", TextJustification.MiddleLeft); + y += th; + + List<ItemStack> fruits = new ArrayList(); + for (ItemStack stack : genome.getFruitProvider().getProducts()) { + fruits.add(stack); + } + if (!fruits.isEmpty()) + { + new ControlText(contents, new IArea(0.0F, y, w1, th2), syst.getChromosomeShortName(EnumTreeChromosome.FRUITS) + " : ", TextJustification.MiddleRight); + for (ItemStack fruitw : fruits) + { + ControlItemDisplay display = new ControlItemDisplay(contents, w1, y); + display.setItemStack(fruitw); + display.setTooltip(); + + y += th2; + } + } + new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.YIELD) + " : ", TextJustification.MiddleRight); + new ControlText(contents, new IArea(w1, y, w2, th), genome.getYield() + "x", TextJustification.MiddleLeft); + y += th; + + new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.SAPPINESS) + " : ", TextJustification.MiddleRight); + new ControlText(contents, new IArea(w1, y, w2, th), genome.getSappiness() + "x", TextJustification.MiddleLeft); + y += th; + + new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.MATURATION) + " : ", TextJustification.MiddleRight); + new ControlText(contents, new IArea(w1, y, w2, th), genome.getMaturationTime() + "x", TextJustification.MiddleLeft); + y += th; + + new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.GIRTH) + " : ", TextJustification.MiddleRight); + new ControlText(contents, new IArea(w1, y, w2, 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(boolean t) + { + if (t) { + return BinnieCore.proxy.localise("gui.tolerated"); + } + return BinnieCore.proxy.localise("gui.nottolerated"); + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PageWood.java b/src/Java/binnie/craftgui/extratrees/dictionary/PageWood.java new file mode 100644 index 0000000000..e7e80a1456 --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/PageWood.java @@ -0,0 +1,40 @@ +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.IPoint; +import binnie.craftgui.core.geometry.TextJustification; +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 java.util.Collection; +import net.minecraft.item.ItemStack; + +public class PageWood + extends PageAbstract<ItemStack> +{ + public PageWood(IWidget parent, DatabaseTab tab) + { + super(parent, tab); + } + + public void onValueChanged(ItemStack species) + { + deleteAllChildren(); + WindowAbstractDatabase database = (WindowAbstractDatabase)WindowAbstractDatabase.get(this); + new ControlText(this, new IArea(0.0F, 0.0F, size().x(), 24.0F), ((DatabaseTab)getValue()).toString(), TextJustification.MiddleCenter); + + + + Collection<IAlleleSpecies> trees = ((TreeBreedingSystem)database.getBreedingSystem()).getTreesThatHaveWood(species, database.isNEI(), database.getWorld(), database.getUsername()); + + + + + new ControlSpeciesBox(this, 4.0F, 24.0F, size().x() - 8.0F, size().y() - 4.0F - 24.0F).setOptions(trees); + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowArboristDatabase.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowArboristDatabase.java new file mode 100644 index 0000000000..e8096c6d77 --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/WindowArboristDatabase.java @@ -0,0 +1,133 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.Binnie; +import binnie.core.AbstractMod; +import binnie.core.genetics.ManagerGenetics; +import binnie.core.genetics.TreeBreedingSystem; +import binnie.craftgui.controls.listbox.ControlList; +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.craftgui.mod.database.WindowAbstractDatabase.Mode; +import binnie.craftgui.mod.database.WindowAbstractDatabase.ModeWidgets; +import binnie.extratrees.ExtraTrees; +import binnie.extratrees.proxy.Proxy; +import cpw.mods.fml.relauncher.Side; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class WindowArboristDatabase + extends WindowAbstractDatabase +{ + ControlListBox<ItemStack> selectionBoxFruit; + ControlListBox<ItemStack> selectionBoxWood; + ControlListBox<ItemStack> selectionBoxPlanks; + + static enum TreeMode + implements IDatabaseMode + { + Fruit, Wood, Planks; + + private TreeMode() {} + + public String getName() + { + return ExtraTrees.proxy.localise("gui.database.mode." + name().toLowerCase()); + } + } + + public WindowArboristDatabase(EntityPlayer player, Side side, boolean nei) + { + super(player, side, nei, Binnie.Genetics.treeBreedingSystem, 120.0F); + } + + public static Window create(EntityPlayer player, Side side, boolean nei) + { + return new WindowArboristDatabase(player, side, nei); + } + + protected void addTabs() + { + new PageSpeciesOverview(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.overview", 0)); + new PageSpeciesTreeGenome(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.genome", 0)); + new PageSpeciesClassification(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.classification", 0)); + new PageSpeciesResultant(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.resultant", 0)); + new PageSpeciesMutations(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.further", 0)); + + new PageBranchOverview(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.overview", 0)); + new PageBranchSpecies(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.species", 0)); + + new PageBreeder(getInfoPages(WindowAbstractDatabase.Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder", 0)); + + createMode(TreeMode.Fruit, new WindowAbstractDatabase.ModeWidgets(TreeMode.Fruit, this) + { + public void createListBox(IArea area) + { + this.listBox = new ControlListBox(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0F) + { + public IWidget createOption(ItemStack value, int y) + { + return new ControlItemStackOption((ControlList)getContent(), value, y); + } + }; + this.listBox.setOptions(((TreeBreedingSystem)WindowArboristDatabase.this.getBreedingSystem()).allFruits); + } + }); + createMode(TreeMode.Wood, new WindowAbstractDatabase.ModeWidgets(TreeMode.Wood, this) + { + public void createListBox(IArea area) + { + this.listBox = new ControlListBox(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0F) + { + public IWidget createOption(ItemStack value, int y) + { + return new ControlItemStackOption((ControlList)getContent(), value, y); + } + }; + this.listBox.setOptions(((TreeBreedingSystem)WindowArboristDatabase.this.getBreedingSystem()).allWoods); + } + }); + createMode(TreeMode.Planks, new WindowAbstractDatabase.ModeWidgets(TreeMode.Planks, this) + { + public void createListBox(IArea area) + { + this.listBox = new ControlListBox(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0F) + { + public IWidget createOption(ItemStack value, int y) + { + return new ControlItemStackOption((ControlList)getContent(), value, y); + } + }; + } + }); + new PageFruit(getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.natural", 0), true); + new PageFruit(getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.potential", 0), false); + + new PageWood(getInfoPages(TreeMode.Wood), new DatabaseTab(ExtraTrees.instance, "wood.natural", 0)); + + new PagePlanksOverview(getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.overview", 0)); + new PagePlanksTrees(getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.natural", 1)); + } + + protected AbstractMod getMod() + { + return ExtraTrees.instance; + } + + protected String getName() + { + return "TreeDatabase"; + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowBrewery.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowBrewery.java new file mode 100644 index 0000000000..89e4118880 --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/WindowBrewery.java @@ -0,0 +1,61 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.core.AbstractMod; +import binnie.core.machines.IMachine; +import binnie.core.machines.Machine; +import binnie.core.machines.MachinePackage; +import binnie.craftgui.core.geometry.IPoint; +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; +import cpw.mods.fml.relauncher.Side; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; + +public class WindowBrewery + extends Window +{ + public WindowBrewery(EntityPlayer player, IInventory inventory, Side side) + { + super(228.0F, 218.0F, player, inventory, side); + } + + protected AbstractMod getMod() + { + return ExtraTrees.instance; + } + + protected String getName() + { + return "Brewery"; + } + + public void initialiseClient() + { + setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); + new ControlSlotArray(this, 42, 32, 1, 3).create(Brewery.slotRecipeGrains); + new ControlSlot(this, 16.0F, 41.0F).assign(Brewery.slotRecipeInput); + new ControlSlot(this, 105.0F, 77.0F).assign(Brewery.slotRecipeYeast); + new ControlLiquidTank(this, 76, 32).setTankID(Brewery.tankInput); + new ControlLiquidTank(this, 162, 32).setTankID(Brewery.tankOutput); + new ControlEnergyBar(this, 196, 32, 16, 60, Position.Bottom); + new ControlBreweryProgress(this, 110.0F, 32.0F); + + new ControlSlotArray(this, (int)(getSize().x() / 2.0F - 81.0F), 104, 9, 1).create(Brewery.slotInventory); + + new ControlPlayerInventory(this); + new ControlErrorState(this, 133.0F, 79.0F); + } + + public static Window create(EntityPlayer player, IInventory inventory, Side side) + { + return new WindowBrewery(player, inventory, side); + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowDistillery.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowDistillery.java new file mode 100644 index 0000000000..2d002c2755 --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/WindowDistillery.java @@ -0,0 +1,59 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.core.AbstractMod; +import binnie.core.machines.IMachine; +import binnie.core.machines.Machine; +import binnie.core.machines.MachinePackage; +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; +import cpw.mods.fml.relauncher.Side; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; + +public class WindowDistillery + extends Window +{ + public WindowDistillery(EntityPlayer player, IInventory inventory, Side side) + { + super(224.0F, 192.0F, player, inventory, side); + } + + protected AbstractMod getMod() + { + return ExtraTrees.instance; + } + + protected String getName() + { + return "Distillery"; + } + + public void initialiseClient() + { + setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); + + int x = 16; + + new ControlLiquidTank(this, x, 35).setTankID(Distillery.tankInput); + x += 34; + new ControlDistilleryProgress(this, x, 32.0F); + x += 64; + new ControlLiquidTank(this, x, 35).setTankID(Distillery.tankOutput); + x += 34; + new ControlEnergyBar(this, x, 36, 60, 16, Position.Left); + + new ControlPlayerInventory(this); + new ControlErrorState(this, x + 21, 62.0F); + } + + public static Window create(EntityPlayer player, IInventory inventory, Side side) + { + return new WindowDistillery(player, inventory, side); + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowLepidopteristDatabase.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowLepidopteristDatabase.java new file mode 100644 index 0000000000..5d5b6511ef --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/WindowLepidopteristDatabase.java @@ -0,0 +1,57 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.Binnie; +import binnie.core.AbstractMod; +import binnie.core.genetics.ManagerGenetics; +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.craftgui.mod.database.WindowAbstractDatabase.Mode; +import binnie.extratrees.ExtraTrees; +import cpw.mods.fml.relauncher.Side; +import net.minecraft.entity.player.EntityPlayer; + +public class WindowLepidopteristDatabase + extends WindowAbstractDatabase +{ + public WindowLepidopteristDatabase(EntityPlayer player, Side side, boolean nei) + { + super(player, side, nei, Binnie.Genetics.mothBreedingSystem, 160.0F); + } + + public static Window create(EntityPlayer player, Side side, boolean nei) + { + return new WindowLepidopteristDatabase(player, side, nei); + } + + protected void addTabs() + { + new PageSpeciesOverview(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.overview", 0)); + new PageSpeciesClassification(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.classification", 0)); + new PageSpeciesImage(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.specimen", 0)); + new PageSpeciesResultant(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.resultant", 0)); + new PageSpeciesMutations(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.further", 0)); + + new PageBranchOverview(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.overview", 0)); + new PageBranchSpecies(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.species", 0)); + + new PageBreeder(getInfoPages(WindowAbstractDatabase.Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "butterfly.breeder", 0)); + } + + protected AbstractMod getMod() + { + return ExtraTrees.instance; + } + + protected String getName() + { + return "MothDatabase"; + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowLumbermill.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowLumbermill.java new file mode 100644 index 0000000000..dc9bca1253 --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/WindowLumbermill.java @@ -0,0 +1,56 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.core.AbstractMod; +import binnie.core.machines.IMachine; +import binnie.core.machines.Machine; +import binnie.core.machines.MachinePackage; +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; +import cpw.mods.fml.relauncher.Side; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; + +public class WindowLumbermill + extends Window +{ + public WindowLumbermill(EntityPlayer player, IInventory inventory, Side side) + { + super(220.0F, 192.0F, player, inventory, side); + } + + protected AbstractMod getMod() + { + return ExtraTrees.instance; + } + + protected String getName() + { + return "Lumbermill"; + } + + public void initialiseClient() + { + setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); + new ControlSlot(this, 42.0F, 43.0F).assign(Lumbermill.slotWood); + new ControlSlot(this, 148.0F, 43.0F).assign(Lumbermill.slotPlanks); + new ControlSlot(this, 172.0F, 28.0F).assign(Lumbermill.slotBark); + new ControlSlot(this, 172.0F, 58.0F).assign(Lumbermill.slotSawdust); + new ControlLumbermillProgress(this, 70.0F, 43.0F); + new ControlLiquidTank(this, 16, 32); + new ControlEnergyBar(this, 8, 112, 16, 60, Position.Bottom); + new ControlPlayerInventory(this); + new ControlErrorState(this, 95.0F, 73.0F); + } + + public static Window create(EntityPlayer player, IInventory inventory, Side side) + { + return new WindowLumbermill(player, inventory, side); + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowPress.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowPress.java new file mode 100644 index 0000000000..773bc70323 --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/WindowPress.java @@ -0,0 +1,77 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.core.AbstractMod; +import binnie.core.machines.IMachine; +import binnie.core.machines.Machine; +import binnie.core.machines.MachinePackage; +import binnie.core.machines.power.ErrorState.InsufficientPower; +import binnie.craftgui.core.geometry.Position; +import binnie.craftgui.minecraft.ContainerCraftGUI; +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.Press; +import binnie.extratrees.machines.Press.ComponentFruitPressLogic; +import cpw.mods.fml.relauncher.Side; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.nbt.NBTTagCompound; + +public class WindowPress + extends Window +{ + public WindowPress(EntityPlayer player, IInventory inventory, Side side) + { + super(194.0F, 192.0F, player, inventory, side); + } + + protected AbstractMod getMod() + { + return ExtraTrees.instance; + } + + protected String getName() + { + return "Press"; + } + + public void initialiseClient() + { + setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); + new ControlSlot(this, 24.0F, 52.0F).assign(Press.slotFruit); + new ControlLiquidTank(this, 99, 32).setTankID(Press.tankWater); + new ControlEnergyBar(this, 154, 32, 16, 60, Position.Bottom); + new ControlPlayerInventory(this); + new ControlErrorState(this, 128.0F, 54.0F); + new ControlFruitPressProgress(this, 62.0F, 24.0F); + + ((Window)getSuperParent()).getContainer().getOrCreateSlot(InventoryType.Machine, Press.slotCurrent); + } + + public static Window create(EntityPlayer player, IInventory inventory, Side side) + { + return new WindowPress(player, inventory, side); + } + + public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound action) + { + Press.ComponentFruitPressLogic logic = (Press.ComponentFruitPressLogic)Machine.getInterface(Press.ComponentFruitPressLogic.class, 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); + getInventory().setInventorySlotContents(Press.slotCurrent, null); + } + } + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowSetSquare.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowSetSquare.java new file mode 100644 index 0000000000..ba444d7b0f --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/WindowSetSquare.java @@ -0,0 +1,35 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.core.AbstractMod; +import binnie.craftgui.minecraft.Window; +import binnie.extratrees.ExtraTrees; +import cpw.mods.fml.relauncher.Side; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.world.World; + +public class WindowSetSquare + extends Window +{ + public WindowSetSquare(EntityPlayer player, IInventory inventory, Side side) + { + super(150.0F, 150.0F, player, inventory, side); + } + + protected AbstractMod getMod() + { + return ExtraTrees.instance; + } + + protected String getName() + { + return null; + } + + public void initialiseClient() {} + + public static Window create(EntityPlayer player, World world, int x, int y, int z, Side side) + { + return new WindowSetSquare(player, null, side); + } +} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowWoodworker.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowWoodworker.java new file mode 100644 index 0000000000..9e9c6fb7d0 --- /dev/null +++ b/src/Java/binnie/craftgui/extratrees/dictionary/WindowWoodworker.java @@ -0,0 +1,110 @@ +package binnie.craftgui.extratrees.dictionary; + +import binnie.core.AbstractMod; +import binnie.core.BinnieCore; +import binnie.core.machines.IMachine; +import binnie.core.machines.Machine; +import binnie.core.machines.MachinePackage; +import binnie.core.proxy.BinnieProxy; +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.Origin; +import binnie.craftgui.events.EventTextEdit; +import binnie.craftgui.events.EventTextEdit.Handler; +import binnie.craftgui.minecraft.MinecraftGUI.PanelType; +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.Designer.ComponentWoodworkerRecipe; +import binnie.extratrees.machines.DesignerType; +import cpw.mods.fml.relauncher.Side; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; + +public class WindowWoodworker + extends Window +{ + ControlTextEdit textEdit; + ControlTileSelect tileSelect; + + public void initialiseClient() + { + setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); + + new ControlText(this, new IArea(190.0F, 36.0F, 114.0F, 10.0F), BinnieCore.proxy.localise("gui.design"), TextJustification.TopCenter).setColour(4473924); + + new Panel(this, 188.0F, 48.0F, 118.0F, 126.0F, MinecraftGUI.PanelType.Gray); + + this.textEdit = new ControlTextEdit(this, 188.0F, 178.0F, 118.0F, 12.0F); + + ControlScrollableContent scroll = new ControlScrollableContent(this, 190.0F, 50.0F, 114.0F, 122.0F, 12.0F); + + + + this.tileSelect = new ControlTileSelect(scroll, 0.0F, 0.0F); + + scroll.setScrollableContent(this.tileSelect); + + + + + + new ControlPlayerInventory(this).setPosition(new IPoint(14.0F, 96.0F)); + + new ControlErrorState(this, 76.0F, 65.0F); + ControlRecipeSlot slotFinished; + if (getInventory() != null) + { + ControlSlot slotWood1 = new ControlSlot(this, 22.0F, 34.0F); + slotWood1.assign(Designer.design1Slot); + ControlSlot slotWood2 = new ControlSlot(this, 62.0F, 34.0F); + slotWood2.assign(Designer.design2Slot); + + ControlSlot slotBeeswax = new ControlSlot(this, 42.0F, 64.0F); + slotBeeswax.assign(Designer.beeswaxSlot); + + slotFinished = new ControlRecipeSlot(this, 112, 34); + } + } + + public WindowWoodworker(EntityPlayer player, IInventory inventory, Side side) + { + super(320.0F, 216.0F, player, inventory, side); + + addEventHandler(new EventTextEdit.Handler() + { + public void onEvent(EventTextEdit event) + { + WindowWoodworker.this.tileSelect.refresh((String)event.getValue()); + } + }.setOrigin(EventHandler.Origin.DirectChild, this)); + } + + public static Window create(EntityPlayer player, IInventory inventory, Side side) + { + return new WindowWoodworker(player, inventory, side); + } + + protected AbstractMod getMod() + { + return ExtraTrees.instance; + } + + protected String getName() + { + return "Woodworker"; + } + + public DesignerType getDesignerType() + { + return ((Designer.ComponentWoodworkerRecipe)Machine.getInterface(Designer.ComponentWoodworkerRecipe.class, getInventory())).getDesignerType(); + } +} |