From 0983a8dba1ef2f6dff0e3cf36e1d0f847e472fef Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 3 Mar 2024 05:49:06 -0500 Subject: [PATCH] Keep Recent Tab Open --- .../gui/player/inventory/GuiCNPCInventory.java | 2 +- .../client/tabs/InventoryTabCustomNpc.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) 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 d47d69780..9777cd999 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 @@ -12,7 +12,7 @@ import tconstruct.client.tabs.TabRegistry; public class GuiCNPCInventory extends GuiNPCInterface { private final ResourceLocation resource = new ResourceLocation("customnpcs","textures/gui/standardbg.png"); - protected static int activeTab = 0; + public static int activeTab = 0; private Minecraft mc = Minecraft.getMinecraft(); public GuiCNPCInventory() { diff --git a/src/main/java/tconstruct/client/tabs/InventoryTabCustomNpc.java b/src/main/java/tconstruct/client/tabs/InventoryTabCustomNpc.java index bdc1df795..d4ed35488 100644 --- a/src/main/java/tconstruct/client/tabs/InventoryTabCustomNpc.java +++ b/src/main/java/tconstruct/client/tabs/InventoryTabCustomNpc.java @@ -5,6 +5,8 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import noppes.npcs.CustomItems; import noppes.npcs.client.gui.player.inventory.GuiCNPCInventory; +import noppes.npcs.client.gui.player.inventory.GuiFaction; +import noppes.npcs.client.gui.player.inventory.GuiParty; import noppes.npcs.client.gui.player.inventory.GuiQuestLog; public class InventoryTabCustomNpc extends AbstractTab { @@ -31,7 +33,17 @@ public class InventoryTabCustomNpc extends AbstractTab { if(mc.currentScreen instanceof GuiCNPCInventory) return; - mc.displayGuiScreen(new GuiQuestLog(mc.thePlayer)); + switch (GuiCNPCInventory.activeTab){ + case 0: + mc.displayGuiScreen(new GuiQuestLog(mc.thePlayer)); + break; + case 1: + mc.displayGuiScreen(new GuiParty(mc.thePlayer)); + break; + case 2: + mc.displayGuiScreen(new GuiFaction()); + break; + } } }; t.start();