Fix GUI Tabs

This commit is contained in:
Kam committed 2026-02-03 16:24:47 -05:00
1 parent 769109d046
commit c80dd448cb
5 files changed
+26 -9

No files matched your search

@@ -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)
@@ -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;
@@ -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;
@@ -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;
@@ -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;
}