From 655fe13839934cab7b8c56d17b7e1b154b9247cd Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 16 Apr 2024 03:04:03 -0400 Subject: [PATCH] Inventory GUI Button DBC --- .../java/kamkeel/addon/client/DBCClient.java | 6 +++++- .../gui/player/inventory/GuiCNPCInventory.java | 16 ++++++++++++++++ .../client/tabs/InventoryTabCustomNpc.java | 5 +++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/java/kamkeel/addon/client/DBCClient.java b/src/main/java/kamkeel/addon/client/DBCClient.java index 69605ff8b..07c0120fa 100644 --- a/src/main/java/kamkeel/addon/client/DBCClient.java +++ b/src/main/java/kamkeel/addon/client/DBCClient.java @@ -6,6 +6,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import noppes.npcs.client.gui.mainmenu.GuiNpcStats; import noppes.npcs.client.gui.model.GuiCreationScreen; +import noppes.npcs.client.gui.player.inventory.GuiCNPCInventory; import noppes.npcs.client.gui.util.GuiNPCInterface2; import noppes.npcs.client.gui.util.GuiNpcButton; import noppes.npcs.client.model.ModelMPM; @@ -29,11 +30,14 @@ public class DBCClient { // Stat Buttons public void showDBCStatButtons(GuiNpcStats stats, EntityLivingBase entity){} public void showDBCStatActionPerformed(GuiNpcStats stats, GuiNpcButton btn){} - + // Render Auras public void renderDBCAuras(EntityNPCInterface npcInterface){} // Manage Custom Forms public GuiNPCInterface2 manageCustomForms(EntityNPCInterface npcInterface){ return null; } + + // Inventory GUI + public GuiCNPCInventory inventoryGUI(){ return null; } } diff --git a/src/main/java/noppes/npcs/client/gui/player/inventory/GuiCNPCInventory.java b/src/main/java/noppes/npcs/client/gui/player/inventory/GuiCNPCInventory.java index 9771961d8..9d87b353d 100644 --- a/src/main/java/noppes/npcs/client/gui/player/inventory/GuiCNPCInventory.java +++ b/src/main/java/noppes/npcs/client/gui/player/inventory/GuiCNPCInventory.java @@ -1,5 +1,7 @@ package noppes.npcs.client.gui.player.inventory; +import cpw.mods.fml.common.Loader; +import kamkeel.addon.client.DBCClient; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; @@ -55,6 +57,16 @@ public class GuiCNPCInventory extends GuiNPCInterface { addButton(factionButton); } + if(Loader.isModLoaded("npcdbc")){ + y += 21; + GuiMenuSideButton dbcButton = new GuiMenuSideButton(200, guiLeft + xSize + 37, this.guiTop + y, 22, 22, ""); + dbcButton.rightSided = true; + dbcButton.active = activeTab == 200; + dbcButton.renderIconPosX = 64; + dbcButton.renderResource = specialIcons; + addButton(dbcButton); + } + y += 21; GuiMenuSideButton clientButton = new GuiMenuSideButton(103, guiLeft + xSize + 37, this.guiTop + y, 22, 22, ""); clientButton.rightSided = true; @@ -83,6 +95,10 @@ public class GuiCNPCInventory extends GuiNPCInterface { activeTab = 3; mc.displayGuiScreen(new GuiSettings()); } + if (guibutton.id == 200 && activeTab != 200) { + activeTab = 200; + mc.displayGuiScreen(DBCClient.Instance.inventoryGUI()); + } } } diff --git a/src/main/java/tconstruct/client/tabs/InventoryTabCustomNpc.java b/src/main/java/tconstruct/client/tabs/InventoryTabCustomNpc.java index 726d6030e..381ffc71f 100644 --- a/src/main/java/tconstruct/client/tabs/InventoryTabCustomNpc.java +++ b/src/main/java/tconstruct/client/tabs/InventoryTabCustomNpc.java @@ -1,5 +1,7 @@ package tconstruct.client.tabs; +import kamkeel.addon.DBCAddon; +import kamkeel.addon.client.DBCClient; import net.minecraft.client.Minecraft; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -40,6 +42,9 @@ public class InventoryTabCustomNpc extends AbstractTab { case 3: mc.displayGuiScreen(new GuiSettings()); break; + case 200: + mc.displayGuiScreen(DBCClient.Instance.inventoryGUI()); + break; } } };