From 4d599e9c4d0668656b3993781945611f3d67870b Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Wed, 4 Nov 2015 16:09:49 +0100 Subject: [PATCH 01/13] Testing around.... --- src/main/java/de/skate702/craftingkeys/config/GuiConfig.java | 1 - .../java/de/skate702/craftingkeys/config/GuiConfigHandler.java | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java index 5a19500..3996341 100644 --- a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java +++ b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java @@ -16,7 +16,6 @@ public class GuiConfig extends GuiScreen { public void initGui() { buttonList.add((new GuiButton(0, width / 2 - 58, height / 2 - 84, 19, 18, "Q"))); - } @Override diff --git a/src/main/java/de/skate702/craftingkeys/config/GuiConfigHandler.java b/src/main/java/de/skate702/craftingkeys/config/GuiConfigHandler.java index 5de57c7..d06a476 100644 --- a/src/main/java/de/skate702/craftingkeys/config/GuiConfigHandler.java +++ b/src/main/java/de/skate702/craftingkeys/config/GuiConfigHandler.java @@ -20,3 +20,4 @@ public class GuiConfigHandler implements IGuiHandler { return null; } } + From 74a9bc86c5b83f2fde0d2e3152741e07890891b8 Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Wed, 4 Nov 2015 16:09:49 +0100 Subject: [PATCH 02/13] Testing around.... --- .../java/de/skate702/craftingkeys/config/GuiConfigHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/skate702/craftingkeys/config/GuiConfigHandler.java b/src/main/java/de/skate702/craftingkeys/config/GuiConfigHandler.java index 5de57c7..d06a476 100644 --- a/src/main/java/de/skate702/craftingkeys/config/GuiConfigHandler.java +++ b/src/main/java/de/skate702/craftingkeys/config/GuiConfigHandler.java @@ -20,3 +20,4 @@ public class GuiConfigHandler implements IGuiHandler { return null; } } + From e79372ee6d06137ecef69282291b0e5ee9e146a3 Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Wed, 4 Nov 2015 19:46:14 +0100 Subject: [PATCH 03/13] Improved GUI with own idea and started to add a language localizer for getting the translation from the language file --- .../craftingkeys/config/ConfigGui.java | 1 + .../craftingkeys/config/GuiConfig.java | 224 +++++++++++++----- .../craftingkeys/util/LanguageLocalizer.java | 17 ++ 3 files changed, 177 insertions(+), 65 deletions(-) create mode 100644 src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java diff --git a/src/main/java/de/skate702/craftingkeys/config/ConfigGui.java b/src/main/java/de/skate702/craftingkeys/config/ConfigGui.java index 2a1d7fb..6808e2a 100644 --- a/src/main/java/de/skate702/craftingkeys/config/ConfigGui.java +++ b/src/main/java/de/skate702/craftingkeys/config/ConfigGui.java @@ -5,6 +5,7 @@ import cpw.mods.fml.client.config.GuiConfig; import cpw.mods.fml.client.config.IConfigElement; import de.skate702.craftingkeys.CraftingKeys; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.util.StatCollector; import net.minecraftforge.common.config.ConfigElement; import java.util.ArrayList; diff --git a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java index 06faaa5..b4ca6f4 100644 --- a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java +++ b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java @@ -13,101 +13,195 @@ public class GuiConfig extends GuiScreen { private static final Color pureWhite = new Color(255, 255, 255, 255); private static final Color lightGray = new Color(128, 128, 128, 255); private static final Color highlight = new Color(86, 144, 72, 255); - private int craftingBasePosition; - private int craftingBaseOffset; + private int guiBasePosition; + private int guiBaseOffset; + private GuiType guiType; + + //TODO:Give all buttons the name you think are good for the eventhandling + private int buttonSaveID = 901; + private int buttonAbortID = 902; + private int buttonSpaceID = 903; + private int buttonShiftID = 904; + + private int buttonCraftingID = 301; + private int buttonBrewingstandID = 302; + private int buttonDispenserID = 303; + private int buttonFurnaceID = 304; + private int buttonEnchantmentID = 305; + private int buttonInventoryID = 306; + private int buttonVillagerID = 307; + + public enum GuiType{ + CRAFTING, + FURNACE, + BREWINGSTAND, + ENCHANTMENT, + INVENTORY, + VILAGER, + DISPENSER; + } @Override public void initGui() { // Fill vars - craftingBasePosition = width / 2 - craftingBaseOffset; - craftingBaseOffset = 35; - - // Add crafting Buttons - buttonList.add((new GuiButton(0, craftingBasePosition - 60, height / 2 - 87, 20, 20, "Q"))); - buttonList.add((new GuiButton(1, craftingBasePosition - 41, height / 2 - 87, 20, 20, "W"))); - buttonList.add((new GuiButton(2, craftingBasePosition - 22, height / 2 - 87, 20, 20, "E"))); - buttonList.add((new GuiButton(3, craftingBasePosition - 60, height / 2 - 68, 20, 20, "A"))); - buttonList.add((new GuiButton(4, craftingBasePosition - 41, height / 2 - 68, 20, 20, "S"))); - buttonList.add((new GuiButton(5, craftingBasePosition - 22, height / 2 - 68, 20, 20, "D"))); - buttonList.add((new GuiButton(6, craftingBasePosition - 60, height / 2 - 49, 20, 20, "Y"))); - buttonList.add((new GuiButton(7, craftingBasePosition - 41, height / 2 - 49, 20, 20, "X"))); - buttonList.add((new GuiButton(8, craftingBasePosition - 22, height / 2 - 49, 20, 20, "C"))); - - buttonList.add((new GuiButton(9, craftingBasePosition + 34, height / 2 - 67, 22, 20, "Ctrl"))); - buttonList.add((new GuiButton(10, craftingBasePosition + 105, height / 2 - 84, 50, 20, "Shift"))); - buttonList.add((new GuiButton(11, craftingBasePosition + 105, height / 2 - 46, 50, 20, "Space"))); - - // Add control buttons - buttonList.add((new GuiButton(12, width - 53, 3, 50, 20, "Abort"))); - buttonList.add((new GuiButton(13, width - 53, 26, 50, 20, "Save"))); + guiBaseOffset = 35; + guiBasePosition = width / 2 - guiBaseOffset; + //Button Init + addStandardButtons(); + guiType = GuiType.CRAFTING; + addCraftingButtons(); } + /* + Hallo Skate vielleicht gefällt dir ja meine Idee - mit Buttons - oben das GUI auszuwechseln. + */ + @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { - // Fill vars - int infoPositionLeft = 20; - int infoPositionRight = width - 194; - int infoPositionHeight = height / 2 + 25; - - // Reset the GL-Color to pure white + //Setting up GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - // Init the Background drawDefaultBackground(); //drawWorldBackground(0); - - // Title + //Title drawCenteredString(fontRendererObj, "Crafting Keys Config", width / 2, height / 2 - 115, pureWhite.getRGB()); + // Info-text and fake line + drawCenteredString(fontRendererObj, "Configure your keys here. Click \"Save\" when finished!", width / 2, height / 2 - 10, pureWhite.getRGB()); + drawCenteredString(fontRendererObj, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", width / 2, height / 2 + 8, lightGray.getRGB()); + drawCenteredString(fontRendererObj, "Use the buttons to set the GUI which you want to edit the Keybindings for!", width / 2, height / 2 + 23, pureWhite.getRGB()); + // Key Info + drawCenteredString(fontRendererObj, "Stack Key", guiBasePosition + 130, height / 2 - 96, pureWhite.getRGB()); + drawCenteredString(fontRendererObj, "Drop Key", guiBasePosition + 130, height / 2 - 58, pureWhite.getRGB()); - // Crafting Table texture - mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/crafting_table.png")); - drawTexturedModalRect(craftingBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + //drawHorizontalLine(craftingBasePosition - 100, width / 2 + 100 + craftingBaseOffset, height / 2 - 20, pureWhite.getRGB()); - // Key Info - drawCenteredString(fontRendererObj, "Stack Key", craftingBasePosition + 130, height / 2 - 96, pureWhite.getRGB()); - drawCenteredString(fontRendererObj, "Drop Key", craftingBasePosition + 130, height / 2 - 58, pureWhite.getRGB()); + // Insert Gui by selected Type + if(guiType == GuiType.CRAFTING){ + genCraftingInfo(); + }else if(guiType == GuiType.FURNACE){ + genFurnaceInfo(); + }else if(guiType == GuiType.BREWINGSTAND){ + genBrewingStandInfo(); + }else if(guiType == GuiType.DISPENSER){ - // Line under crafting table texture - drawHorizontalLine(craftingBasePosition - 100, width / 2 + 100 + craftingBaseOffset, - height / 2 - 20, pureWhite.getRGB()); + }else if(guiType == GuiType.ENCHANTMENT){ - // Info-text and fake line - drawCenteredString(fontRendererObj, "Configure your keys here. Click \"Save\" when finished!", - width / 2, height / 2 - 10, pureWhite.getRGB()); - drawCenteredString(fontRendererObj, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", - width / 2, height / 2 + 8, lightGray.getRGB()); + }else if(guiType == GuiType.INVENTORY){ - // Insert Info screens - genFurnaceInfo(infoPositionRight, infoPositionHeight); - genBrewingStandInfo(infoPositionLeft, infoPositionHeight); + }else if(guiType == GuiType.VILAGER){ + + } super.drawScreen(mouseX, mouseY, partialTicks); } + //TODO: Set here the buttons with the function + @Override + public void actionPerformed(GuiButton button) { + if (button.id == buttonAbortID) { - private void genFurnaceInfo(int xBase, int yBase) { - GL11.glColor4f(0.5F, 0.5F, 0.5F, 1.0F); + }else if (button.id == buttonSaveID) { + + }else if(button.id == buttonCraftingID){ + guiType = GuiType.CRAFTING; + addCraftingButtons(); + }else if(button.id == buttonInventoryID) { + guiType = GuiType.INVENTORY; + }else if(button.id == buttonEnchantmentID){ + guiType = GuiType.ENCHANTMENT; + }else if(button.id == buttonBrewingstandID){ + guiType = GuiType.BREWINGSTAND; + addBrewingStandButtons(); + }else if(button.id == buttonDispenserID){ + guiType = GuiType.DISPENSER; + }else if(button.id == buttonFurnaceID){ + guiType = GuiType.FURNACE; + addFurnaceButtons(); + }else if(button.id == buttonVillagerID){ + guiType = GuiType.VILAGER; + } + } + + //GUI GENERATORS: + /* + TODO: Fix everything for changing the gui... + TODO: Create buttons + TODO: Create generators for all other textures + */ + + private void genCraftingInfo(){ + mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/crafting_table.png")); + drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + } + + private void addCraftingButtons(){ + buttonList.clear(); + buttonList.add((new GuiButton(0, guiBasePosition - 60, height / 2 - 87, 20, 20, "Q"))); + buttonList.add((new GuiButton(1, guiBasePosition - 41, height / 2 - 87, 20, 20, "W"))); + buttonList.add((new GuiButton(2, guiBasePosition - 22, height / 2 - 87, 20, 20, "E"))); + buttonList.add((new GuiButton(3, guiBasePosition - 60, height / 2 - 68, 20, 20, "A"))); + buttonList.add((new GuiButton(4, guiBasePosition - 41, height / 2 - 68, 20, 20, "S"))); + buttonList.add((new GuiButton(5, guiBasePosition - 22, height / 2 - 68, 20, 20, "D"))); + buttonList.add((new GuiButton(6, guiBasePosition - 60, height / 2 - 49, 20, 20, "Y"))); + buttonList.add((new GuiButton(7, guiBasePosition - 41, height / 2 - 49, 20, 20, "X"))); + buttonList.add((new GuiButton(8, guiBasePosition - 22, height / 2 - 49, 20, 20, "C"))); + buttonList.add((new GuiButton(9, guiBasePosition + 34, height / 2 - 67, 22, 20, "Ctrl"))); + addStandardButtons(); + } + + private void genFurnaceInfo() { + GL11.glColor4f(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/furnace.png")); - drawTexturedModalRect(xBase, yBase, 1, 0, 174, 80); - drawString(fontRendererObj, "Furnace", xBase + 5, yBase + 5, lightGray.getRGB()); + drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + + /*drawString(fontRendererObj, "Furnace", xBase + 5, yBase + 5, lightGray.getRGB()); drawCenteredString(fontRendererObj, "W", xBase + 63, yBase + 21, highlight.getRGB()); drawCenteredString(fontRendererObj, "S", xBase + 63, yBase + 57, highlight.getRGB()); - drawCenteredString(fontRendererObj, "Ctrl", xBase + 123, yBase + 39, highlight.getRGB()); + drawCenteredString(fontRendererObj, "Ctrl", xBase + 123, yBase + 39, highlight.getRGB());*/ } - private void genBrewingStandInfo(int xBase, int yBase) { - GL11.glColor4f(0.5F, 0.5F, 0.5F, 1.0F); + private void addFurnaceButtons(){ + buttonList.clear(); + + + + addStandardButtons(); + } + + private void genBrewingStandInfo() { + GL11.glColor4f(1F, 1F, 1F, 1.0F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/brewing_stand.png")); - drawTexturedModalRect(xBase, yBase, 1, 0, 174, 80); - drawString(fontRendererObj, "Brewing Stand", xBase + 5, yBase + 5, lightGray.getRGB()); - drawCenteredString(fontRendererObj, "W", xBase + 86, yBase + 21, highlight.getRGB()); - drawCenteredString(fontRendererObj, "S", xBase + 86, yBase + 58, highlight.getRGB()); - drawCenteredString(fontRendererObj, "A", xBase + 63, yBase + 50, highlight.getRGB()); - drawCenteredString(fontRendererObj, "D", xBase + 109, yBase + 50, highlight.getRGB()); + drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + + /*drawString(fontRendererObj, "Brewing Stand", guiBasePosition + 5, height / 2 - 100 + 5, lightGray.getRGB()); + drawCenteredString(fontRendererObj, "W", guiBasePosition + 86, height / 2 - 100 + 21, highlight.getRGB()); + drawCenteredString(fontRendererObj, "S", guiBasePosition + 86, height / 2 - 100 + 58, highlight.getRGB()); + drawCenteredString(fontRendererObj, "A", guiBasePosition + 63, height / 2 - 100 + 50, highlight.getRGB()); + drawCenteredString(fontRendererObj, "D", guiBasePosition + 109, height / 2 - 100 + 50, highlight.getRGB());*/ } - // TODO: generators for all other textures. But... I hate this job. Does anyone wants to do this? - // TODO: We need volunteers! Let's go! Make a pull request. THANK YOU! + public void addBrewingStandButtons(){ + + } + + + private void addStandardButtons(){ + // Add control buttons + buttonList.add((new GuiButton(buttonAbortID, width - 53, 3, 50, 20, "Abort"))); + buttonList.add((new GuiButton(buttonSaveID, width - 53, 26, 50, 20, "Save"))); + //I don't know if you need to change those for every gui + buttonList.add((new GuiButton(buttonShiftID, guiBasePosition + 105, height / 2 - 84, 50, 20, "Shift"))); + buttonList.add((new GuiButton(buttonSpaceID, guiBasePosition + 105, height / 2 - 46, 50, 20, "Space"))); + //Add Switch Buttons + buttonList.add((new GuiButton(buttonCraftingID, 15, height / 2 + 40, 70, 20, "Crafting"))); + buttonList.add((new GuiButton(buttonInventoryID, 15 + 70 + 5, height / 2 + 40, 70, 20, "Inventory"))); + buttonList.add((new GuiButton(buttonFurnaceID, 15 + 2*70 + 2*5, height / 2 + 40, 70, 20, "Furnace"))); + buttonList.add((new GuiButton(buttonBrewingstandID, 15 + 3*70 + 3*5, height / 2 + 40, 90, 20, "Brewing Stand"))); + buttonList.add((new GuiButton(buttonDispenserID, 15 + 4*70 + 20 + 4*5, height / 2 + 40, 70, 20, "Dispenser"))); + buttonList.add((new GuiButton(buttonVillagerID, 15, height / 2 + 40 + 20 + 4, 70, 20, "Villager"))); + buttonList.add((new GuiButton(buttonEnchantmentID, 15 + 70 + 5, height / 2 + 40 + 20 + 4, 70, 20, "Enchantment"))); + } + + //TODO:Get strings from language file(Localizer)... } diff --git a/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java b/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java new file mode 100644 index 0000000..d1cffc0 --- /dev/null +++ b/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java @@ -0,0 +1,17 @@ +package de.skate702.craftingkeys.util; + +import net.minecraft.util.StatCollector; + +/** + * Created by Tobi on 04.11.2015. + */ +public class LanguageLocalizer { + //TODO: Finish localizer + public static String localizeIfPossible(String unloc){ + String localized = ""; + if(StatCollector.canTranslate(unloc)){ + localized = StatCollector.translateToLocal(unloc); + } + return localized; + } +} From 8dbffd4dc973ec52676f19449e6d62c2062fada9 Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Wed, 4 Nov 2015 19:50:43 +0100 Subject: [PATCH 04/13] Just removed a comment. --- .../java/de/skate702/craftingkeys/util/LanguageLocalizer.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java b/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java index d1cffc0..b49c0e1 100644 --- a/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java +++ b/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java @@ -2,9 +2,6 @@ package de.skate702.craftingkeys.util; import net.minecraft.util.StatCollector; -/** - * Created by Tobi on 04.11.2015. - */ public class LanguageLocalizer { //TODO: Finish localizer public static String localizeIfPossible(String unloc){ From 9aacabba580d2abff7b9660eaa994dede6ace037 Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Thu, 5 Nov 2015 09:44:02 +0100 Subject: [PATCH 05/13] Finished language localizer and added a description to it. --- .../de/skate702/craftingkeys/CraftingKeys.java | 1 + .../craftingkeys/util/LanguageLocalizer.java | 14 ++++++++------ .../resources/assets/craftingkeys/lang/de_DE.lang | 2 +- .../resources/assets/craftingkeys/lang/en_US.lang | 4 +++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/skate702/craftingkeys/CraftingKeys.java b/src/main/java/de/skate702/craftingkeys/CraftingKeys.java index 3956de1..d8bf1bc 100644 --- a/src/main/java/de/skate702/craftingkeys/CraftingKeys.java +++ b/src/main/java/de/skate702/craftingkeys/CraftingKeys.java @@ -17,6 +17,7 @@ import de.skate702.craftingkeys.config.GuiConfig; import de.skate702.craftingkeys.config.GuiConfigHandler; import de.skate702.craftingkeys.manager.*; import de.skate702.craftingkeys.proxies.CraftingKeysProxy; +import de.skate702.craftingkeys.util.LanguageLocalizer; import de.skate702.craftingkeys.util.Logger; import de.skate702.craftingkeys.util.Util; import net.minecraft.client.gui.GuiEnchantment; diff --git a/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java b/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java index b49c0e1..f423298 100644 --- a/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java +++ b/src/main/java/de/skate702/craftingkeys/util/LanguageLocalizer.java @@ -3,12 +3,14 @@ package de.skate702.craftingkeys.util; import net.minecraft.util.StatCollector; public class LanguageLocalizer { - //TODO: Finish localizer - public static String localizeIfPossible(String unloc){ - String localized = ""; - if(StatCollector.canTranslate(unloc)){ - localized = StatCollector.translateToLocal(unloc); - } + /** + *If another language than de_DE or en_US is selected the English one is used... + * + * @param unloc The unlocalized string which is in the definded in the language file + * @return localized The localized String + */ + public static String localize(String unloc){ + String localized = StatCollector.translateToLocal(unloc); return localized; } } diff --git a/src/main/resources/assets/craftingkeys/lang/de_DE.lang b/src/main/resources/assets/craftingkeys/lang/de_DE.lang index afced74..ffe9858 100644 --- a/src/main/resources/assets/craftingkeys/lang/de_DE.lang +++ b/src/main/resources/assets/craftingkeys/lang/de_DE.lang @@ -26,4 +26,4 @@ de.skate702.craftingkeys.config.other.tooltip=Saemtliche anderen Einstellungen s # Warning de.skate702.craftingkeys.warn.line1=Achtung: Crafting-Keys befindet sich in der Alpha! de.skate702.craftingkeys.warn.line2=Es gibt noch viele Fehler, und es fehlen noch einige Funktionen. -de.skate702.craftingkeys.warn.line3=Mehr Info's findest du auf: https://github.com/0xSeb/CraftingKeys! +de.skate702.craftingkeys.warn.line3=Mehr Info's findest du auf: https://github.com/0xSeb/CraftingKeys! \ No newline at end of file diff --git a/src/main/resources/assets/craftingkeys/lang/en_US.lang b/src/main/resources/assets/craftingkeys/lang/en_US.lang index 4c01586..92e8d28 100644 --- a/src/main/resources/assets/craftingkeys/lang/en_US.lang +++ b/src/main/resources/assets/craftingkeys/lang/en_US.lang @@ -26,4 +26,6 @@ de.skate702.craftingkeys.config.other.tooltip=All other settings are here! # Warning de.skate702.craftingkeys.warn.line1=Warning: Crafting Keys is still in development! de.skate702.craftingkeys.warn.line2=This mod is not complete and there are some errors left. -de.skate702.craftingkeys.warn.line3=More Information: https://github.com/0xSeb/CraftingKeys! \ No newline at end of file +de.skate702.craftingkeys.warn.line3=More Information: https://github.com/0xSeb/CraftingKeys! + +test.test=TEST \ No newline at end of file From d03dab36dd98f5e3d362f6b10eebc1423a329d5e Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Thu, 5 Nov 2015 09:45:23 +0100 Subject: [PATCH 06/13] Finished language localizer and added a description to it. --- src/main/resources/assets/craftingkeys/lang/en_US.lang | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/resources/assets/craftingkeys/lang/en_US.lang b/src/main/resources/assets/craftingkeys/lang/en_US.lang index 92e8d28..88f3c5a 100644 --- a/src/main/resources/assets/craftingkeys/lang/en_US.lang +++ b/src/main/resources/assets/craftingkeys/lang/en_US.lang @@ -27,5 +27,3 @@ de.skate702.craftingkeys.config.other.tooltip=All other settings are here! de.skate702.craftingkeys.warn.line1=Warning: Crafting Keys is still in development! de.skate702.craftingkeys.warn.line2=This mod is not complete and there are some errors left. de.skate702.craftingkeys.warn.line3=More Information: https://github.com/0xSeb/CraftingKeys! - -test.test=TEST \ No newline at end of file From fbb8211f8f42532693c335971df5440e37dc8ced Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Thu, 5 Nov 2015 11:32:10 +0100 Subject: [PATCH 07/13] Started add an CraftingManager for anvils and added some generators to GuiConfig. --- .../skate702/craftingkeys/CraftingKeys.java | 11 ++- .../craftingkeys/config/GuiConfig.java | 96 +++++++++++++++---- .../craftingkeys/manager/AnvilManager.java | 52 ++++++++++ 3 files changed, 135 insertions(+), 24 deletions(-) create mode 100644 src/main/java/de/skate702/craftingkeys/manager/AnvilManager.java diff --git a/src/main/java/de/skate702/craftingkeys/CraftingKeys.java b/src/main/java/de/skate702/craftingkeys/CraftingKeys.java index d8bf1bc..1bb5951 100644 --- a/src/main/java/de/skate702/craftingkeys/CraftingKeys.java +++ b/src/main/java/de/skate702/craftingkeys/CraftingKeys.java @@ -20,10 +20,7 @@ import de.skate702.craftingkeys.proxies.CraftingKeysProxy; import de.skate702.craftingkeys.util.LanguageLocalizer; import de.skate702.craftingkeys.util.Logger; import de.skate702.craftingkeys.util.Util; -import net.minecraft.client.gui.GuiEnchantment; -import net.minecraft.client.gui.GuiMainMenu; -import net.minecraft.client.gui.GuiMerchant; -import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.*; import net.minecraft.client.gui.inventory.*; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.common.MinecraftForge; @@ -113,7 +110,7 @@ public class CraftingKeys { @SubscribeEvent public void onGuiOpened(GuiOpenEvent event) { if (event.gui instanceof GuiMainMenu) { - event.gui = new GuiConfig(); // Delete this! + //event.gui = new GuiConfig(); // Delete this! } } @@ -176,6 +173,10 @@ public class CraftingKeys { ((GuiEnchantment) currentScreen).inventorySlots); con.acceptKey(); + } else if (currentScreen instanceof GuiRepair){ + ContainerManager con = AnvilManager.getInstance( + ((GuiRepair) currentScreen).inventorySlots); + con.acceptKey(); } } diff --git a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java index b4ca6f4..d6c4161 100644 --- a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java +++ b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java @@ -20,8 +20,8 @@ public class GuiConfig extends GuiScreen { //TODO:Give all buttons the name you think are good for the eventhandling private int buttonSaveID = 901; private int buttonAbortID = 902; - private int buttonSpaceID = 903; - private int buttonShiftID = 904; + private int buttonDropID = 903; + private int buttonStackID = 904; private int buttonCraftingID = 301; private int buttonBrewingstandID = 302; @@ -84,17 +84,18 @@ public class GuiConfig extends GuiScreen { }else if(guiType == GuiType.BREWINGSTAND){ genBrewingStandInfo(); }else if(guiType == GuiType.DISPENSER){ - + genDispenserInfo(); }else if(guiType == GuiType.ENCHANTMENT){ - + genEnchantmentInfo(); }else if(guiType == GuiType.INVENTORY){ - + genInventoryInfo(); }else if(guiType == GuiType.VILAGER){ - + genVillagerInfo(); } super.drawScreen(mouseX, mouseY, partialTicks); } + //TODO: Set here the buttons with the function @Override public void actionPerformed(GuiButton button) { @@ -107,18 +108,22 @@ public class GuiConfig extends GuiScreen { addCraftingButtons(); }else if(button.id == buttonInventoryID) { guiType = GuiType.INVENTORY; + addInventoryButtons(); }else if(button.id == buttonEnchantmentID){ guiType = GuiType.ENCHANTMENT; + addEnchantmentButtons(); }else if(button.id == buttonBrewingstandID){ guiType = GuiType.BREWINGSTAND; addBrewingStandButtons(); }else if(button.id == buttonDispenserID){ guiType = GuiType.DISPENSER; + addDispenserButtons(); }else if(button.id == buttonFurnaceID){ guiType = GuiType.FURNACE; addFurnaceButtons(); }else if(button.id == buttonVillagerID){ guiType = GuiType.VILAGER; + addVillagerButtons(); } } @@ -130,8 +135,10 @@ public class GuiConfig extends GuiScreen { */ private void genCraftingInfo(){ + GL11.glColor4f(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/crafting_table.png")); drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + drawString(fontRendererObj, "Crafting Table", guiBasePosition - 33, height / 2 - 100 + 3, lightGray.getRGB()); } private void addCraftingButtons(){ @@ -149,11 +156,13 @@ public class GuiConfig extends GuiScreen { addStandardButtons(); } + private void genFurnaceInfo() { GL11.glColor4f(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/furnace.png")); drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + drawString(fontRendererObj, "Furnace", guiBasePosition - 15, height / 2 - 100 + 3, lightGray.getRGB()); /*drawString(fontRendererObj, "Furnace", xBase + 5, yBase + 5, lightGray.getRGB()); drawCenteredString(fontRendererObj, "W", xBase + 63, yBase + 21, highlight.getRGB()); drawCenteredString(fontRendererObj, "S", xBase + 63, yBase + 57, highlight.getRGB()); @@ -162,36 +171,85 @@ public class GuiConfig extends GuiScreen { private void addFurnaceButtons(){ buttonList.clear(); - - - addStandardButtons(); } + private void genBrewingStandInfo() { - GL11.glColor4f(1F, 1F, 1F, 1.0F); + GL11.glColor4f(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/brewing_stand.png")); drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); - /*drawString(fontRendererObj, "Brewing Stand", guiBasePosition + 5, height / 2 - 100 + 5, lightGray.getRGB()); - drawCenteredString(fontRendererObj, "W", guiBasePosition + 86, height / 2 - 100 + 21, highlight.getRGB()); + drawString(fontRendererObj, "Brewing Stand", guiBasePosition - 33, height / 2 - 100 + 3, lightGray.getRGB()); + /*drawCenteredString(fontRendererObj, "W", guiBasePosition + 86, height / 2 - 100 + 21, highlight.getRGB()); drawCenteredString(fontRendererObj, "S", guiBasePosition + 86, height / 2 - 100 + 58, highlight.getRGB()); drawCenteredString(fontRendererObj, "A", guiBasePosition + 63, height / 2 - 100 + 50, highlight.getRGB()); drawCenteredString(fontRendererObj, "D", guiBasePosition + 109, height / 2 - 100 + 50, highlight.getRGB());*/ } - public void addBrewingStandButtons(){ - + private void addBrewingStandButtons(){ + buttonList.clear(); + addStandardButtons(); } + private void genEnchantmentInfo(){ + GL11.glColor4f(1F, 1F, 1F, 1F); + mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/enchanting_table.png")); + drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + drawString(fontRendererObj, "Enchanting", guiBasePosition - 20, height / 2 - 100 + 3, lightGray.getRGB()); + } + + private void addEnchantmentButtons(){ + buttonList.clear(); + addStandardButtons(); + } + + + private void genVillagerInfo(){ + GL11.glColor4f(1F, 1F, 1F, 1F); + mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/villager.png")); + drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + drawString(fontRendererObj, "Villager", guiBasePosition - 17, height / 2 - 100 + 5, lightGray.getRGB()); + } + + private void addVillagerButtons(){ + buttonList.clear(); + addStandardButtons(); + } + + + private void genInventoryInfo(){ + GL11.glColor4f(1F, 1F, 1F, 1F); + } + + private void addInventoryButtons(){ + buttonList.clear(); + addStandardButtons(); + } + + + private void genDispenserInfo(){ + GL11.glColor4f(1F, 1F, 1F, 1F); + mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/dispenser.png")); + drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + drawString(fontRendererObj, "Dispenser", guiBasePosition - 23, height / 2 - 100 + 5, lightGray.getRGB()); + } + + private void addDispenserButtons(){ + buttonList.clear(); + addStandardButtons(); + } + + + private void addStandardButtons(){ // Add control buttons buttonList.add((new GuiButton(buttonAbortID, width - 53, 3, 50, 20, "Abort"))); buttonList.add((new GuiButton(buttonSaveID, width - 53, 26, 50, 20, "Save"))); - //I don't know if you need to change those for every gui - buttonList.add((new GuiButton(buttonShiftID, guiBasePosition + 105, height / 2 - 84, 50, 20, "Shift"))); - buttonList.add((new GuiButton(buttonSpaceID, guiBasePosition + 105, height / 2 - 46, 50, 20, "Space"))); + //I don't know if you want to change those for every gui + buttonList.add((new GuiButton(buttonStackID, guiBasePosition + 105, height / 2 - 84, 50, 20, "Shift"))); + buttonList.add((new GuiButton(buttonDropID, guiBasePosition + 105, height / 2 - 46, 50, 20, "Space"))); //Add Switch Buttons buttonList.add((new GuiButton(buttonCraftingID, 15, height / 2 + 40, 70, 20, "Crafting"))); buttonList.add((new GuiButton(buttonInventoryID, 15 + 70 + 5, height / 2 + 40, 70, 20, "Inventory"))); @@ -199,9 +257,9 @@ public class GuiConfig extends GuiScreen { buttonList.add((new GuiButton(buttonBrewingstandID, 15 + 3*70 + 3*5, height / 2 + 40, 90, 20, "Brewing Stand"))); buttonList.add((new GuiButton(buttonDispenserID, 15 + 4*70 + 20 + 4*5, height / 2 + 40, 70, 20, "Dispenser"))); buttonList.add((new GuiButton(buttonVillagerID, 15, height / 2 + 40 + 20 + 4, 70, 20, "Villager"))); - buttonList.add((new GuiButton(buttonEnchantmentID, 15 + 70 + 5, height / 2 + 40 + 20 + 4, 70, 20, "Enchantment"))); + buttonList.add((new GuiButton(buttonEnchantmentID, 15 + 70 + 5, height / 2 + 40 + 20 + 4, 70, 20, "Enchanting"))); } //TODO:Get strings from language file(Localizer)... - + //TODO:Add things that make this GUI to an Config ... :P } diff --git a/src/main/java/de/skate702/craftingkeys/manager/AnvilManager.java b/src/main/java/de/skate702/craftingkeys/manager/AnvilManager.java new file mode 100644 index 0000000..c60d2d8 --- /dev/null +++ b/src/main/java/de/skate702/craftingkeys/manager/AnvilManager.java @@ -0,0 +1,52 @@ +package de.skate702.craftingkeys.manager; + +import de.skate702.craftingkeys.util.Logger; +import net.minecraft.inventory.Container; + +public class AnvilManager extends ContainerManager { + //TODO:Get it to work...It's just a copy of the brewingManager + private static AnvilManager instance = null; + + private AnvilManager(Container container) { + super(container); + } + + public static AnvilManager getInstance(Container container) { + if (instance == null) { + instance = new AnvilManager(container); + } else { + instance.container = container; + } + return instance; + } + + @Override + protected int specificKeyToSlotIndex() { + return mapKeyToSlot(-1, 3, -1, 0, 1, 2, -1, -1, -1); + } + + @Override + protected int getInventoryStartIndex() { + return 4; + } + + @Override + protected int getInteractionSlotIndex() { + return -1; + } + + @Override + protected void onInteractionKeyPressed() { + Logger.info("onInteractionKeyPressed()", "Brewing stands have no interaction!"); + } + + @Override + protected int[] getDropSlots() { + return new int[]{0, 1, 2, 3}; + } + + @Override + protected void interact() { + + } +} From afe627704a3328f6f91c9f94f5c6d48ac37348d1 Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Thu, 5 Nov 2015 11:56:27 +0100 Subject: [PATCH 08/13] Finished AnvilManager --- .../craftingkeys/manager/AnvilManager.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/skate702/craftingkeys/manager/AnvilManager.java b/src/main/java/de/skate702/craftingkeys/manager/AnvilManager.java index c60d2d8..69fcca4 100644 --- a/src/main/java/de/skate702/craftingkeys/manager/AnvilManager.java +++ b/src/main/java/de/skate702/craftingkeys/manager/AnvilManager.java @@ -4,7 +4,6 @@ import de.skate702.craftingkeys.util.Logger; import net.minecraft.inventory.Container; public class AnvilManager extends ContainerManager { - //TODO:Get it to work...It's just a copy of the brewingManager private static AnvilManager instance = null; private AnvilManager(Container container) { @@ -22,31 +21,33 @@ public class AnvilManager extends ContainerManager { @Override protected int specificKeyToSlotIndex() { - return mapKeyToSlot(-1, 3, -1, 0, 1, 2, -1, -1, -1); + return mapKeyToSlot(-1, -1, -1, 0, 1, -1 , -1, -1, -1); } @Override protected int getInventoryStartIndex() { - return 4; + return 3; } @Override protected int getInteractionSlotIndex() { - return -1; + return 2; } @Override protected void onInteractionKeyPressed() { - Logger.info("onInteractionKeyPressed()", "Brewing stands have no interaction!"); + interact(); } @Override protected int[] getDropSlots() { - return new int[]{0, 1, 2, 3}; + return new int[]{0, 1}; } @Override protected void interact() { - + leftClick(2); } + + } From a99f570b5b7ab35d0ee0e38803167792bb2a38dc Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Thu, 5 Nov 2015 12:26:02 +0100 Subject: [PATCH 09/13] Started Fixing... --- .../skate702/craftingkeys/CraftingKeys.java | 2 +- .../craftingkeys/config/GuiConfig.java | 162 +++++++----------- 2 files changed, 59 insertions(+), 105 deletions(-) diff --git a/src/main/java/de/skate702/craftingkeys/CraftingKeys.java b/src/main/java/de/skate702/craftingkeys/CraftingKeys.java index 1bb5951..e267183 100644 --- a/src/main/java/de/skate702/craftingkeys/CraftingKeys.java +++ b/src/main/java/de/skate702/craftingkeys/CraftingKeys.java @@ -110,7 +110,7 @@ public class CraftingKeys { @SubscribeEvent public void onGuiOpened(GuiOpenEvent event) { if (event.gui instanceof GuiMainMenu) { - //event.gui = new GuiConfig(); // Delete this! + event.gui = new GuiConfig(); // Delete this! } } diff --git a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java index d6c4161..70f371c 100644 --- a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java +++ b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java @@ -15,7 +15,10 @@ public class GuiConfig extends GuiScreen { private static final Color highlight = new Color(86, 144, 72, 255); private int guiBasePosition; private int guiBaseOffset; - private GuiType guiType; + + private int guiShowBasePosition; + private int guiShowBaseHeight; + private GuiType guiShowType; //TODO:Give all buttons the name you think are good for the eventhandling private int buttonSaveID = 901; @@ -32,7 +35,6 @@ public class GuiConfig extends GuiScreen { private int buttonVillagerID = 307; public enum GuiType{ - CRAFTING, FURNACE, BREWINGSTAND, ENCHANTMENT, @@ -48,14 +50,16 @@ public class GuiConfig extends GuiScreen { guiBaseOffset = 35; guiBasePosition = width / 2 - guiBaseOffset; + guiShowBasePosition = width / 2 - 35; + guiShowBaseHeight = height / 2 + 35; + //Button Init addStandardButtons(); - guiType = GuiType.CRAFTING; - addCraftingButtons(); + guiShowType = GuiType.FURNACE; } /* - Hallo Skate vielleicht gefällt dir ja meine Idee - mit Buttons - oben das GUI auszuwechseln. + Hallo Skate vielleicht gefällt dir ja meine Idee - mit Buttons - oben das GUI auszuwechseln... Ups das war wohl von dir nicht so gedacht ich fix das liber mal... */ @Override @@ -69,27 +73,26 @@ public class GuiConfig extends GuiScreen { // Info-text and fake line drawCenteredString(fontRendererObj, "Configure your keys here. Click \"Save\" when finished!", width / 2, height / 2 - 10, pureWhite.getRGB()); drawCenteredString(fontRendererObj, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", width / 2, height / 2 + 8, lightGray.getRGB()); - drawCenteredString(fontRendererObj, "Use the buttons to set the GUI which you want to edit the Keybindings for!", width / 2, height / 2 + 23, pureWhite.getRGB()); + drawCenteredString(fontRendererObj, "Use the buttons to set the GUI which you want to see the Keybindings for!", width / 2, height / 2 + 23, pureWhite.getRGB()); // Key Info drawCenteredString(fontRendererObj, "Stack Key", guiBasePosition + 130, height / 2 - 96, pureWhite.getRGB()); drawCenteredString(fontRendererObj, "Drop Key", guiBasePosition + 130, height / 2 - 58, pureWhite.getRGB()); //drawHorizontalLine(craftingBasePosition - 100, width / 2 + 100 + craftingBaseOffset, height / 2 - 20, pureWhite.getRGB()); + drawCraftingTable(); // Insert Gui by selected Type - if(guiType == GuiType.CRAFTING){ - genCraftingInfo(); - }else if(guiType == GuiType.FURNACE){ + if(guiShowType == GuiType.FURNACE){ genFurnaceInfo(); - }else if(guiType == GuiType.BREWINGSTAND){ + }else if(guiShowType == GuiType.BREWINGSTAND){ genBrewingStandInfo(); - }else if(guiType == GuiType.DISPENSER){ + }else if(guiShowType == GuiType.DISPENSER){ genDispenserInfo(); - }else if(guiType == GuiType.ENCHANTMENT){ + }else if(guiShowType == GuiType.ENCHANTMENT){ genEnchantmentInfo(); - }else if(guiType == GuiType.INVENTORY){ + }else if(guiShowType == GuiType.INVENTORY){ genInventoryInfo(); - }else if(guiType == GuiType.VILAGER){ + }else if(guiShowType == GuiType.VILAGER){ genVillagerInfo(); } @@ -103,145 +106,82 @@ public class GuiConfig extends GuiScreen { }else if (button.id == buttonSaveID) { - }else if(button.id == buttonCraftingID){ - guiType = GuiType.CRAFTING; - addCraftingButtons(); }else if(button.id == buttonInventoryID) { - guiType = GuiType.INVENTORY; - addInventoryButtons(); + guiShowType = GuiType.INVENTORY; }else if(button.id == buttonEnchantmentID){ - guiType = GuiType.ENCHANTMENT; - addEnchantmentButtons(); + guiShowType = GuiType.ENCHANTMENT; }else if(button.id == buttonBrewingstandID){ - guiType = GuiType.BREWINGSTAND; - addBrewingStandButtons(); + guiShowType = GuiType.BREWINGSTAND; }else if(button.id == buttonDispenserID){ - guiType = GuiType.DISPENSER; - addDispenserButtons(); + guiShowType = GuiType.DISPENSER; }else if(button.id == buttonFurnaceID){ - guiType = GuiType.FURNACE; - addFurnaceButtons(); + guiShowType = GuiType.FURNACE; }else if(button.id == buttonVillagerID){ - guiType = GuiType.VILAGER; - addVillagerButtons(); + guiShowType = GuiType.VILAGER; } } //GUI GENERATORS: /* - TODO: Fix everything for changing the gui... - TODO: Create buttons - TODO: Create generators for all other textures + TODO: Create generators for the Inventory */ - private void genCraftingInfo(){ + private void drawCraftingTable(){ GL11.glColor4f(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/crafting_table.png")); drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); drawString(fontRendererObj, "Crafting Table", guiBasePosition - 33, height / 2 - 100 + 3, lightGray.getRGB()); } - private void addCraftingButtons(){ - buttonList.clear(); - buttonList.add((new GuiButton(0, guiBasePosition - 60, height / 2 - 87, 20, 20, "Q"))); - buttonList.add((new GuiButton(1, guiBasePosition - 41, height / 2 - 87, 20, 20, "W"))); - buttonList.add((new GuiButton(2, guiBasePosition - 22, height / 2 - 87, 20, 20, "E"))); - buttonList.add((new GuiButton(3, guiBasePosition - 60, height / 2 - 68, 20, 20, "A"))); - buttonList.add((new GuiButton(4, guiBasePosition - 41, height / 2 - 68, 20, 20, "S"))); - buttonList.add((new GuiButton(5, guiBasePosition - 22, height / 2 - 68, 20, 20, "D"))); - buttonList.add((new GuiButton(6, guiBasePosition - 60, height / 2 - 49, 20, 20, "Y"))); - buttonList.add((new GuiButton(7, guiBasePosition - 41, height / 2 - 49, 20, 20, "X"))); - buttonList.add((new GuiButton(8, guiBasePosition - 22, height / 2 - 49, 20, 20, "C"))); - buttonList.add((new GuiButton(9, guiBasePosition + 34, height / 2 - 67, 22, 20, "Ctrl"))); - addStandardButtons(); - } - - private void genFurnaceInfo() { - GL11.glColor4f(1F, 1F, 1F, 1F); + GL11.glColor4f(0.5F, 0.5F, 0.5F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/furnace.png")); - drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + drawTexturedModalRect(guiShowBasePosition - 86, guiShowBaseHeight, 1, 0, 174, 80); - drawString(fontRendererObj, "Furnace", guiBasePosition - 15, height / 2 - 100 + 3, lightGray.getRGB()); - /*drawString(fontRendererObj, "Furnace", xBase + 5, yBase + 5, lightGray.getRGB()); + drawString(fontRendererObj, "Furnace", guiShowBasePosition - 15, guiShowBaseHeight + 3, lightGray.getRGB()); + /* drawCenteredString(fontRendererObj, "W", xBase + 63, yBase + 21, highlight.getRGB()); drawCenteredString(fontRendererObj, "S", xBase + 63, yBase + 57, highlight.getRGB()); drawCenteredString(fontRendererObj, "Ctrl", xBase + 123, yBase + 39, highlight.getRGB());*/ } - private void addFurnaceButtons(){ - buttonList.clear(); - addStandardButtons(); - } - - private void genBrewingStandInfo() { - GL11.glColor4f(1F, 1F, 1F, 1F); + GL11.glColor4f(0.5F, 0.5F, 0.5F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/brewing_stand.png")); - drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); + drawTexturedModalRect(guiShowBasePosition - 86, guiShowBaseHeight, 1, 0, 174, 80); - drawString(fontRendererObj, "Brewing Stand", guiBasePosition - 33, height / 2 - 100 + 3, lightGray.getRGB()); + drawString(fontRendererObj, "Brewing Stand", guiShowBasePosition - 33, guiShowBaseHeight + 3, lightGray.getRGB()); /*drawCenteredString(fontRendererObj, "W", guiBasePosition + 86, height / 2 - 100 + 21, highlight.getRGB()); drawCenteredString(fontRendererObj, "S", guiBasePosition + 86, height / 2 - 100 + 58, highlight.getRGB()); drawCenteredString(fontRendererObj, "A", guiBasePosition + 63, height / 2 - 100 + 50, highlight.getRGB()); drawCenteredString(fontRendererObj, "D", guiBasePosition + 109, height / 2 - 100 + 50, highlight.getRGB());*/ } - private void addBrewingStandButtons(){ - buttonList.clear(); - addStandardButtons(); - } - - private void genEnchantmentInfo(){ - GL11.glColor4f(1F, 1F, 1F, 1F); + GL11.glColor4f(0.5F, 0.5F, 0.5F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/enchanting_table.png")); - drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); - drawString(fontRendererObj, "Enchanting", guiBasePosition - 20, height / 2 - 100 + 3, lightGray.getRGB()); + drawTexturedModalRect(guiShowBasePosition - 86, guiShowBaseHeight, 1, 0, 174, 80); + drawString(fontRendererObj, "Enchanting", guiShowBasePosition - 20, guiShowBaseHeight + 3, lightGray.getRGB()); } - private void addEnchantmentButtons(){ - buttonList.clear(); - addStandardButtons(); - } - - private void genVillagerInfo(){ - GL11.glColor4f(1F, 1F, 1F, 1F); + GL11.glColor4f(0.5F, 0.5F, 0.5F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/villager.png")); - drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); - drawString(fontRendererObj, "Villager", guiBasePosition - 17, height / 2 - 100 + 5, lightGray.getRGB()); + drawTexturedModalRect(guiShowBasePosition - 86, guiShowBaseHeight, 1, 0, 174, 80); + drawString(fontRendererObj, "Villager", guiShowBasePosition - 17, guiShowBaseHeight + 3, lightGray.getRGB()); } - private void addVillagerButtons(){ - buttonList.clear(); - addStandardButtons(); - } - - private void genInventoryInfo(){ - GL11.glColor4f(1F, 1F, 1F, 1F); + GL11.glColor4f(0.5F, 0.5F, 0.5F, 1F); } - private void addInventoryButtons(){ - buttonList.clear(); - addStandardButtons(); - } - - private void genDispenserInfo(){ - GL11.glColor4f(1F, 1F, 1F, 1F); + GL11.glColor4f(0.5F, 0.5F, 0.5F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/dispenser.png")); - drawTexturedModalRect(guiBasePosition - 86, height / 2 - 100, 1, 0, 174, 80); - drawString(fontRendererObj, "Dispenser", guiBasePosition - 23, height / 2 - 100 + 5, lightGray.getRGB()); + drawTexturedModalRect(guiShowBasePosition - 86, guiShowBaseHeight, 1, 0, 174, 80); + drawString(fontRendererObj, "Dispenser", guiShowBasePosition - 23, guiShowBaseHeight + 3, lightGray.getRGB()); } - private void addDispenserButtons(){ - buttonList.clear(); - addStandardButtons(); - } - - private void addStandardButtons(){ // Add control buttons @@ -251,15 +191,29 @@ public class GuiConfig extends GuiScreen { buttonList.add((new GuiButton(buttonStackID, guiBasePosition + 105, height / 2 - 84, 50, 20, "Shift"))); buttonList.add((new GuiButton(buttonDropID, guiBasePosition + 105, height / 2 - 46, 50, 20, "Space"))); //Add Switch Buttons - buttonList.add((new GuiButton(buttonCraftingID, 15, height / 2 + 40, 70, 20, "Crafting"))); buttonList.add((new GuiButton(buttonInventoryID, 15 + 70 + 5, height / 2 + 40, 70, 20, "Inventory"))); buttonList.add((new GuiButton(buttonFurnaceID, 15 + 2*70 + 2*5, height / 2 + 40, 70, 20, "Furnace"))); buttonList.add((new GuiButton(buttonBrewingstandID, 15 + 3*70 + 3*5, height / 2 + 40, 90, 20, "Brewing Stand"))); buttonList.add((new GuiButton(buttonDispenserID, 15 + 4*70 + 20 + 4*5, height / 2 + 40, 70, 20, "Dispenser"))); buttonList.add((new GuiButton(buttonVillagerID, 15, height / 2 + 40 + 20 + 4, 70, 20, "Villager"))); buttonList.add((new GuiButton(buttonEnchantmentID, 15 + 70 + 5, height / 2 + 40 + 20 + 4, 70, 20, "Enchanting"))); + //Adding Crafting Buttons + addCraftingButtons(); + } + + private void addCraftingButtons(){ + buttonList.add((new GuiButton(0, guiBasePosition - 60, height / 2 - 87, 20, 20, "Q"))); + buttonList.add((new GuiButton(1, guiBasePosition - 41, height / 2 - 87, 20, 20, "W"))); + buttonList.add((new GuiButton(2, guiBasePosition - 22, height / 2 - 87, 20, 20, "E"))); + buttonList.add((new GuiButton(3, guiBasePosition - 60, height / 2 - 68, 20, 20, "A"))); + buttonList.add((new GuiButton(4, guiBasePosition - 41, height / 2 - 68, 20, 20, "S"))); + buttonList.add((new GuiButton(5, guiBasePosition - 22, height / 2 - 68, 20, 20, "D"))); + buttonList.add((new GuiButton(6, guiBasePosition - 60, height / 2 - 49, 20, 20, "Y"))); + buttonList.add((new GuiButton(7, guiBasePosition - 41, height / 2 - 49, 20, 20, "X"))); + buttonList.add((new GuiButton(8, guiBasePosition - 22, height / 2 - 49, 20, 20, "C"))); + buttonList.add((new GuiButton(9, guiBasePosition + 34, height / 2 - 67, 22, 20, "Ctrl"))); } //TODO:Get strings from language file(Localizer)... - //TODO:Add things that make this GUI to an Config ... :P + //TODO:Add things that make this GUI an Config ... :P } From 9033dff6f6ef783ddafda5152de7f89b6f8b7b38 Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Thu, 5 Nov 2015 12:48:38 +0100 Subject: [PATCH 10/13] Finished fixing. It works now --- .../craftingkeys/config/GuiConfig.java | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java index 70f371c..2b002df 100644 --- a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java +++ b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java @@ -26,7 +26,7 @@ public class GuiConfig extends GuiScreen { private int buttonDropID = 903; private int buttonStackID = 904; - private int buttonCraftingID = 301; + private int buttonAnvilID = 301; private int buttonBrewingstandID = 302; private int buttonDispenserID = 303; private int buttonFurnaceID = 304; @@ -35,6 +35,7 @@ public class GuiConfig extends GuiScreen { private int buttonVillagerID = 307; public enum GuiType{ + ANVIL, FURNACE, BREWINGSTAND, ENCHANTMENT, @@ -58,9 +59,6 @@ public class GuiConfig extends GuiScreen { guiShowType = GuiType.FURNACE; } - /* - Hallo Skate vielleicht gefällt dir ja meine Idee - mit Buttons - oben das GUI auszuwechseln... Ups das war wohl von dir nicht so gedacht ich fix das liber mal... - */ @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { @@ -94,6 +92,8 @@ public class GuiConfig extends GuiScreen { genInventoryInfo(); }else if(guiShowType == GuiType.VILAGER){ genVillagerInfo(); + }else if(guiShowType == GuiType.ANVIL){ + genAnvilInfo(); } super.drawScreen(mouseX, mouseY, partialTicks); @@ -118,6 +118,8 @@ public class GuiConfig extends GuiScreen { guiShowType = GuiType.FURNACE; }else if(button.id == buttonVillagerID){ guiShowType = GuiType.VILAGER; + }else if(button.id == buttonAnvilID){ + guiShowType = GuiType.ANVIL; } } @@ -164,6 +166,13 @@ public class GuiConfig extends GuiScreen { drawString(fontRendererObj, "Enchanting", guiShowBasePosition - 20, guiShowBaseHeight + 3, lightGray.getRGB()); } + private void genAnvilInfo(){ + GL11.glColor4f(0.5F, 0.5F, 0.5F, 1F); + mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/anvil.png")); + drawTexturedModalRect(guiShowBasePosition - 86, guiShowBaseHeight, 1, 0, 174, 80); + drawString(fontRendererObj, "Anvil", guiShowBasePosition - 17, guiShowBaseHeight + 3, lightGray.getRGB()); + } + private void genVillagerInfo(){ GL11.glColor4f(0.5F, 0.5F, 0.5F, 1F); mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/villager.png")); @@ -191,12 +200,14 @@ public class GuiConfig extends GuiScreen { buttonList.add((new GuiButton(buttonStackID, guiBasePosition + 105, height / 2 - 84, 50, 20, "Shift"))); buttonList.add((new GuiButton(buttonDropID, guiBasePosition + 105, height / 2 - 46, 50, 20, "Space"))); //Add Switch Buttons - buttonList.add((new GuiButton(buttonInventoryID, 15 + 70 + 5, height / 2 + 40, 70, 20, "Inventory"))); - buttonList.add((new GuiButton(buttonFurnaceID, 15 + 2*70 + 2*5, height / 2 + 40, 70, 20, "Furnace"))); - buttonList.add((new GuiButton(buttonBrewingstandID, 15 + 3*70 + 3*5, height / 2 + 40, 90, 20, "Brewing Stand"))); - buttonList.add((new GuiButton(buttonDispenserID, 15 + 4*70 + 20 + 4*5, height / 2 + 40, 70, 20, "Dispenser"))); - buttonList.add((new GuiButton(buttonVillagerID, 15, height / 2 + 40 + 20 + 4, 70, 20, "Villager"))); - buttonList.add((new GuiButton(buttonEnchantmentID, 15 + 70 + 5, height / 2 + 40 + 20 + 4, 70, 20, "Enchanting"))); + buttonList.add((new GuiButton(buttonInventoryID, guiShowBasePosition - 86 - 70 - 5, guiShowBaseHeight, 70, 20, "Inventory"))); + buttonList.add((new GuiButton(buttonFurnaceID, guiShowBasePosition - 86 - 70 - 5, guiShowBaseHeight + 20 + 1, 70, 20, "Furnace"))); + buttonList.add((new GuiButton(buttonBrewingstandID, guiShowBasePosition + 86 + 5, guiShowBaseHeight, 90, 20, "Brewing Stand"))); + buttonList.add((new GuiButton(buttonDispenserID, guiShowBasePosition - 86 - 70 - 5, guiShowBaseHeight + 2*20 + 2*1, 70, 20, "Dispenser"))); + buttonList.add((new GuiButton(buttonVillagerID, guiShowBasePosition + 86 + 5, guiShowBaseHeight + 20 + 1, 70, 20, "Villager"))); + buttonList.add((new GuiButton(buttonEnchantmentID, guiShowBasePosition + 86 + 5, guiShowBaseHeight + 2*20 + 2*1, 70, 20, "Enchanting"))); + buttonList.add((new GuiButton(buttonAnvilID, guiShowBasePosition - 86 - 70 - 5, guiShowBaseHeight + 3*20 + 3*1, 70, 20, "Anvil"))); + //Adding Crafting Buttons addCraftingButtons(); } From 9effebec1a9e0445facdf313b5a216ab386753e1 Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Thu, 5 Nov 2015 13:07:01 +0100 Subject: [PATCH 11/13] Just added a few cosmetic things. --- .../craftingkeys/config/GuiConfig.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java index 2b002df..85aaeaf 100644 --- a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java +++ b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java @@ -71,12 +71,12 @@ public class GuiConfig extends GuiScreen { // Info-text and fake line drawCenteredString(fontRendererObj, "Configure your keys here. Click \"Save\" when finished!", width / 2, height / 2 - 10, pureWhite.getRGB()); drawCenteredString(fontRendererObj, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", width / 2, height / 2 + 8, lightGray.getRGB()); - drawCenteredString(fontRendererObj, "Use the buttons to set the GUI which you want to see the Keybindings for!", width / 2, height / 2 + 23, pureWhite.getRGB()); + drawCenteredString(fontRendererObj, "Use the buttons to select the GUI which you want to see the Keybindings for!", width / 2, height / 2 + 23, pureWhite.getRGB()); // Key Info drawCenteredString(fontRendererObj, "Stack Key", guiBasePosition + 130, height / 2 - 96, pureWhite.getRGB()); drawCenteredString(fontRendererObj, "Drop Key", guiBasePosition + 130, height / 2 - 58, pureWhite.getRGB()); - - //drawHorizontalLine(craftingBasePosition - 100, width / 2 + 100 + craftingBaseOffset, height / 2 - 20, pureWhite.getRGB()); + //Draw line to let it look better + drawHorizontalLine(guiBasePosition - 86, guiBasePosition + 85, height / 2 - 20, pureWhite.getRGB()); drawCraftingTable(); // Insert Gui by selected Type @@ -95,6 +95,8 @@ public class GuiConfig extends GuiScreen { }else if(guiShowType == GuiType.ANVIL){ genAnvilInfo(); } + //Draw line to let it look better + drawHorizontalLine(guiShowBasePosition - 86, guiShowBasePosition + 85, guiShowBaseHeight + 80, lightGray.getRGB()); super.drawScreen(mouseX, mouseY, partialTicks); } @@ -141,10 +143,10 @@ public class GuiConfig extends GuiScreen { drawTexturedModalRect(guiShowBasePosition - 86, guiShowBaseHeight, 1, 0, 174, 80); drawString(fontRendererObj, "Furnace", guiShowBasePosition - 15, guiShowBaseHeight + 3, lightGray.getRGB()); - /* - drawCenteredString(fontRendererObj, "W", xBase + 63, yBase + 21, highlight.getRGB()); - drawCenteredString(fontRendererObj, "S", xBase + 63, yBase + 57, highlight.getRGB()); - drawCenteredString(fontRendererObj, "Ctrl", xBase + 123, yBase + 39, highlight.getRGB());*/ + + drawCenteredString(fontRendererObj, "W", guiShowBasePosition - 86 + 63, guiShowBaseHeight + 21, highlight.getRGB()); + drawCenteredString(fontRendererObj, "S", guiShowBasePosition - 86 + 63, guiShowBaseHeight + 57, highlight.getRGB()); + drawCenteredString(fontRendererObj, "Ctrl", guiShowBasePosition - 86 + 123, guiShowBaseHeight + 39, highlight.getRGB()); } private void genBrewingStandInfo() { @@ -153,10 +155,11 @@ public class GuiConfig extends GuiScreen { drawTexturedModalRect(guiShowBasePosition - 86, guiShowBaseHeight, 1, 0, 174, 80); drawString(fontRendererObj, "Brewing Stand", guiShowBasePosition - 33, guiShowBaseHeight + 3, lightGray.getRGB()); - /*drawCenteredString(fontRendererObj, "W", guiBasePosition + 86, height / 2 - 100 + 21, highlight.getRGB()); - drawCenteredString(fontRendererObj, "S", guiBasePosition + 86, height / 2 - 100 + 58, highlight.getRGB()); - drawCenteredString(fontRendererObj, "A", guiBasePosition + 63, height / 2 - 100 + 50, highlight.getRGB()); - drawCenteredString(fontRendererObj, "D", guiBasePosition + 109, height / 2 - 100 + 50, highlight.getRGB());*/ + + drawCenteredString(fontRendererObj, "W", guiBasePosition, guiShowBaseHeight + 21, highlight.getRGB()); + drawCenteredString(fontRendererObj, "S", guiBasePosition, guiShowBaseHeight + 58, highlight.getRGB()); + drawCenteredString(fontRendererObj, "A", guiBasePosition - 86 + 63, guiShowBaseHeight + 50, highlight.getRGB()); + drawCenteredString(fontRendererObj, "D", guiBasePosition - 86 + 109, guiShowBaseHeight + 50, highlight.getRGB()); } private void genEnchantmentInfo(){ From e489b7b52c165c240df2bd95c7abbeadc8e89c83 Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Thu, 5 Nov 2015 13:51:26 +0100 Subject: [PATCH 12/13] Added a bit localization to the GuiConfig. --- .../de/skate702/craftingkeys/config/GuiConfig.java | 11 ++++++----- .../resources/assets/craftingkeys/lang/de_DE.lang | 9 ++++++++- .../resources/assets/craftingkeys/lang/en_US.lang | 7 +++++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java index 85aaeaf..af3da14 100644 --- a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java +++ b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java @@ -1,5 +1,6 @@ package de.skate702.craftingkeys.config; +import de.skate702.craftingkeys.util.LanguageLocalizer; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.ResourceLocation; @@ -67,11 +68,11 @@ public class GuiConfig extends GuiScreen { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); drawDefaultBackground(); //drawWorldBackground(0); //Title - drawCenteredString(fontRendererObj, "Crafting Keys Config", width / 2, height / 2 - 115, pureWhite.getRGB()); + drawCenteredString(fontRendererObj, LanguageLocalizer.localize("craftingkeys.config.title"), width / 2, height / 2 - 115, pureWhite.getRGB()); // Info-text and fake line - drawCenteredString(fontRendererObj, "Configure your keys here. Click \"Save\" when finished!", width / 2, height / 2 - 10, pureWhite.getRGB()); + drawCenteredString(fontRendererObj, LanguageLocalizer.localize("craftingkeys.config.description"), width / 2, height / 2 - 10, pureWhite.getRGB()); drawCenteredString(fontRendererObj, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", width / 2, height / 2 + 8, lightGray.getRGB()); - drawCenteredString(fontRendererObj, "Use the buttons to select the GUI which you want to see the Keybindings for!", width / 2, height / 2 + 23, pureWhite.getRGB()); + drawCenteredString(fontRendererObj, LanguageLocalizer.localize("craftingkeys.config.usage"), width / 2, height / 2 + 23, pureWhite.getRGB()); // Key Info drawCenteredString(fontRendererObj, "Stack Key", guiBasePosition + 130, height / 2 - 96, pureWhite.getRGB()); drawCenteredString(fontRendererObj, "Drop Key", guiBasePosition + 130, height / 2 - 58, pureWhite.getRGB()); @@ -197,8 +198,8 @@ public class GuiConfig extends GuiScreen { private void addStandardButtons(){ // Add control buttons - buttonList.add((new GuiButton(buttonAbortID, width - 53, 3, 50, 20, "Abort"))); - buttonList.add((new GuiButton(buttonSaveID, width - 53, 26, 50, 20, "Save"))); + buttonList.add((new GuiButton(buttonAbortID, width - 53, 3, 50, 20, LanguageLocalizer.localize("craftingkeys.config.button.abort")))); + buttonList.add((new GuiButton(buttonSaveID, width - 53, 26, 50, 20, LanguageLocalizer.localize("craftingkeys.config.button.save")))); //I don't know if you want to change those for every gui buttonList.add((new GuiButton(buttonStackID, guiBasePosition + 105, height / 2 - 84, 50, 20, "Shift"))); buttonList.add((new GuiButton(buttonDropID, guiBasePosition + 105, height / 2 - 46, 50, 20, "Space"))); diff --git a/src/main/resources/assets/craftingkeys/lang/de_DE.lang b/src/main/resources/assets/craftingkeys/lang/de_DE.lang index ffe9858..e7fbf82 100644 --- a/src/main/resources/assets/craftingkeys/lang/de_DE.lang +++ b/src/main/resources/assets/craftingkeys/lang/de_DE.lang @@ -26,4 +26,11 @@ de.skate702.craftingkeys.config.other.tooltip=Saemtliche anderen Einstellungen s # Warning de.skate702.craftingkeys.warn.line1=Achtung: Crafting-Keys befindet sich in der Alpha! de.skate702.craftingkeys.warn.line2=Es gibt noch viele Fehler, und es fehlen noch einige Funktionen. -de.skate702.craftingkeys.warn.line3=Mehr Info's findest du auf: https://github.com/0xSeb/CraftingKeys! \ No newline at end of file +de.skate702.craftingkeys.warn.line3=Mehr Info's findest du auf: https://github.com/0xSeb/CraftingKeys! + +craftingkeys.config.title=Crafting Keys Konfiguration +craftingkeys.config.description=Konfiguriere hier deine Tastenbelegung und klicke dann auf "Sichern". +craftingkeys.config.button.save=Sichern +craftingkeys.config.button.abort=Abbruch +craftingkeys.config.usage=Waehle das GUI, fuer das du die Tastenbelegung sehen moechtest. + diff --git a/src/main/resources/assets/craftingkeys/lang/en_US.lang b/src/main/resources/assets/craftingkeys/lang/en_US.lang index 88f3c5a..2513ed9 100644 --- a/src/main/resources/assets/craftingkeys/lang/en_US.lang +++ b/src/main/resources/assets/craftingkeys/lang/en_US.lang @@ -27,3 +27,10 @@ de.skate702.craftingkeys.config.other.tooltip=All other settings are here! de.skate702.craftingkeys.warn.line1=Warning: Crafting Keys is still in development! de.skate702.craftingkeys.warn.line2=This mod is not complete and there are some errors left. de.skate702.craftingkeys.warn.line3=More Information: https://github.com/0xSeb/CraftingKeys! + +craftingkeys.config.title=Crafting Keys Config +craftingkeys.config.description=Configure your keys here. Click "Save" when finished! +craftingkeys.config.button.save=Save +craftingkeys.config.button.abort=Abort +craftingkeys.config.usage=Use the buttons to select the GUI which you want to see the Keybindings for! + From dd4bebfc1ad94342bd05df59738fa8b8f15e6a83 Mon Sep 17 00:00:00 2001 From: tosta3000 Date: Thu, 5 Nov 2015 14:10:49 +0100 Subject: [PATCH 13/13] Added Inventory-Generator. --- .../java/de/skate702/craftingkeys/config/GuiConfig.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java index af3da14..4be5f03 100644 --- a/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java +++ b/src/main/java/de/skate702/craftingkeys/config/GuiConfig.java @@ -55,9 +55,10 @@ public class GuiConfig extends GuiScreen { guiShowBasePosition = width / 2 - 35; guiShowBaseHeight = height / 2 + 35; + guiShowType = GuiType.FURNACE; + //Button Init addStandardButtons(); - guiShowType = GuiType.FURNACE; } @@ -128,7 +129,7 @@ public class GuiConfig extends GuiScreen { //GUI GENERATORS: /* - TODO: Create generators for the Inventory + TODO: Create strings for showing the Keybindings */ private void drawCraftingTable(){ @@ -186,6 +187,9 @@ public class GuiConfig extends GuiScreen { private void genInventoryInfo(){ GL11.glColor4f(0.5F, 0.5F, 0.5F, 1F); + mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/inventory.png")); + drawTexturedModalRect(guiShowBasePosition - 86, guiShowBaseHeight, 1, 0, 174, 80); + drawString(fontRendererObj, "Inventory", guiShowBasePosition - 20, guiShowBaseHeight + 3, lightGray.getRGB()); } private void genDispenserInfo(){