diff --git a/src/main/java/noppes/npcs/client/ClientProxy.java b/src/main/java/noppes/npcs/client/ClientProxy.java index 705e261c5..bb90e0659 100644 --- a/src/main/java/noppes/npcs/client/ClientProxy.java +++ b/src/main/java/noppes/npcs/client/ClientProxy.java @@ -473,7 +473,7 @@ public class ClientProxy extends CommonProxy { animNpc.display.texture = "customnpcs:textures/entity/humanmale/AnimationBody.png"; save = false; } - return new GuiNPCManageAnimations(animNpc, save); + return new GuiNPCManageAnimations(animNpc, save, npc != null); } else if (gui == EnumGuiType.ManageLinked) return new GuiNPCManageLinked(npc); @@ -509,7 +509,7 @@ public class ClientProxy extends CommonProxy { abilityNpc = new EntityCustomNpc(Minecraft.getMinecraft().theWorld); abilityNpc.display.texture = "customnpcs:textures/entity/humanmale/AnimationBody.png"; } - return new GuiNpcManageAbilities(abilityNpc); + return new GuiNpcManageAbilities(abilityNpc, npc != null); } else if (gui == EnumGuiType.MainMenuGlobal) diff --git a/src/main/java/noppes/npcs/client/gui/global/GuiNPCManageAnimations.java b/src/main/java/noppes/npcs/client/gui/global/GuiNPCManageAnimations.java index 0141e931a..ac4675243 100644 --- a/src/main/java/noppes/npcs/client/gui/global/GuiNPCManageAnimations.java +++ b/src/main/java/noppes/npcs/client/gui/global/GuiNPCManageAnimations.java @@ -51,8 +51,8 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol // Track if current animation is built-in private boolean currentIsBuiltIn = false; - public GuiNPCManageAnimations(EntityNPCInterface npc, boolean save) { - super(npc); + public GuiNPCManageAnimations(EntityNPCInterface npc, boolean save, boolean hasMenuNpc) { + super(npc, hasMenuNpc); this.setSave(save); this.xOffset = -148 + 70; this.yOffset = -170 + 137; diff --git a/src/main/java/noppes/npcs/client/gui/global/GuiNpcManageAbilities.java b/src/main/java/noppes/npcs/client/gui/global/GuiNpcManageAbilities.java index 49857672d..5296bb615 100644 --- a/src/main/java/noppes/npcs/client/gui/global/GuiNpcManageAbilities.java +++ b/src/main/java/noppes/npcs/client/gui/global/GuiNpcManageAbilities.java @@ -66,8 +66,8 @@ public class GuiNpcManageAbilities extends GuiAbilityInterface private AbilityPreviewExecutor previewExecutor; private long prevTick = 0; - public GuiNpcManageAbilities(EntityNPCInterface npc) { - super(npc); + public GuiNpcManageAbilities(EntityNPCInterface npc, boolean hasMenuNpc) { + super(npc, hasMenuNpc); // Layout offset this.xOffset = -148 + 110; diff --git a/src/main/java/noppes/npcs/client/gui/util/GuiAbilityInterface.java b/src/main/java/noppes/npcs/client/gui/util/GuiAbilityInterface.java index ea8dcc0b5..31a093b8d 100644 --- a/src/main/java/noppes/npcs/client/gui/util/GuiAbilityInterface.java +++ b/src/main/java/noppes/npcs/client/gui/util/GuiAbilityInterface.java @@ -74,7 +74,16 @@ public class GuiAbilityInterface extends GuiNPCInterface2 { public int yOffset = 0; public GuiAbilityInterface(EntityNPCInterface npc) { - super(npc); + this(npc, true); + } + + /** + * @param npc The NPC for preview rendering + * @param hasMenuNpc If false, the top menu tabs (Display, Stats, etc.) are hidden. + * Use false when opened from the global menu without a real NPC. + */ + public GuiAbilityInterface(EntityNPCInterface npc, boolean hasMenuNpc) { + super(hasMenuNpc ? npc : null); this.npc = npc; this.playerdata = ((EntityCustomNpc) npc).modelData; this.drawDefaultBackground = false; diff --git a/src/main/java/noppes/npcs/client/gui/util/GuiModelInterface2.java b/src/main/java/noppes/npcs/client/gui/util/GuiModelInterface2.java index cef818647..5ca2edfb0 100644 --- a/src/main/java/noppes/npcs/client/gui/util/GuiModelInterface2.java +++ b/src/main/java/noppes/npcs/client/gui/util/GuiModelInterface2.java @@ -30,10 +30,18 @@ public class GuiModelInterface2 extends GuiNPCInterface2 { public EntityNPCInterface npc; public GuiModelInterface2(EntityNPCInterface npc) { - super(npc); + this(npc, true); + } + + /** + * @param npc The NPC for preview rendering + * @param hasMenuNpc If false, the top menu tabs (Display, Stats, etc.) are hidden. + * Use false when opened from the global menu without a real NPC. + */ + public GuiModelInterface2(EntityNPCInterface npc, boolean hasMenuNpc) { + super(hasMenuNpc ? npc : null); this.npc = npc; playerdata = ((EntityCustomNpc) npc).modelData; - //xSize = 380; drawDefaultBackground = false; }