From 2c6fb0d15b973eabe16a6a8487a77274a098eaaa Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 6 May 2023 15:26:30 -0400 Subject: [PATCH] Add NPC name to NPC Quick Tags --- .../npcs/client/gui/GuiNpcMobSpawnerAdd.java | 2 +- .../npcs/client/gui/SubGuiClonerNPCTags.java | 20 +++++++++++-------- .../assets/customnpcs/lang/en_US.lang | 1 + 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/noppes/npcs/client/gui/GuiNpcMobSpawnerAdd.java b/src/main/java/noppes/npcs/client/gui/GuiNpcMobSpawnerAdd.java index fe9d3cb62..2c24abd26 100644 --- a/src/main/java/noppes/npcs/client/gui/GuiNpcMobSpawnerAdd.java +++ b/src/main/java/noppes/npcs/client/gui/GuiNpcMobSpawnerAdd.java @@ -88,7 +88,7 @@ public class GuiNpcMobSpawnerAdd extends GuiNPCInterface implements GuiYesNoCall } if (id == 5) { if(toClone instanceof EntityNPCInterface){ - this.setSubGui(new SubGuiClonerNPCTags()); + this.setSubGui(new SubGuiClonerNPCTags((EntityNPCInterface) toClone)); } } } diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiClonerNPCTags.java b/src/main/java/noppes/npcs/client/gui/SubGuiClonerNPCTags.java index 3c76b3950..dae125f6a 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiClonerNPCTags.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiClonerNPCTags.java @@ -21,8 +21,9 @@ public class SubGuiClonerNPCTags extends SubGuiInterface implements IGuiData,ISc private final ArrayList allTags = new ArrayList<>(); private final ArrayList tagNames = new ArrayList<>(); private String search = ""; + private EntityNPCInterface npc; - public SubGuiClonerNPCTags() + public SubGuiClonerNPCTags(EntityNPCInterface npc) { Client.sendData(EnumPacketServer.TagsGet); Client.sendData(EnumPacketServer.NpcTagsGet); @@ -30,33 +31,36 @@ public class SubGuiClonerNPCTags extends SubGuiInterface implements IGuiData,ISc xSize = 305; ySize = 220; closeOnEsc = false; + this.npc = npc; } public void initGui() { super.initGui(); - addLabel(new GuiNpcLabel(1, StatCollector.translateToLocal("tags.allTags"), guiLeft + 10, guiTop + 11)); + addLabel(new GuiNpcLabel(5, npc.display.name + " " + StatCollector.translateToLocal("tags.tags"), guiLeft + 10, guiTop + 8)); + + addLabel(new GuiNpcLabel(1, StatCollector.translateToLocal("tags.allTags"), guiLeft + 10, guiTop + 22)); if(scrollTags == null){ scrollTags = new GuiCustomScroll(this,0); - scrollTags.setSize(110, 155); + scrollTags.setSize(110, 145); } scrollTags.guiLeft = guiLeft + 10; - scrollTags.guiTop = guiTop + 24; + scrollTags.guiTop = guiTop + 34; this.addScroll(scrollTags); addTextField(new GuiNpcTextField(4, this, fontRendererObj, guiLeft + 10, guiTop + 24 + 160, 110, 20, search)); - addLabel(new GuiNpcLabel(2, StatCollector.translateToLocal("tags.selectedTags"), guiLeft + 185, guiTop + 11)); + addLabel(new GuiNpcLabel(2, StatCollector.translateToLocal("tags.selectedTags"), guiLeft + 185, guiTop + 22)); if(npcTags == null){ npcTags = new GuiCustomScroll(this,1); - npcTags.setSize(110, 180); + npcTags.setSize(110, 170); } npcTags.guiLeft = guiLeft + 185; - npcTags.guiTop = guiTop + 24; + npcTags.guiTop = guiTop + 34; npcTags.setList(tagNames); this.addScroll(npcTags); - addButton(new GuiNpcButton(66, guiLeft + 125, guiTop + 24, 55, 20, "gui.save")); + addButton(new GuiNpcButton(66, guiLeft + 125, guiTop + 34, 55, 20, "gui.save")); addButton(new GuiNpcButton(10, guiLeft + 125, guiTop + 90, 55, 20, ">")); addButton(new GuiNpcButton(11, guiLeft + 125, guiTop + 112, 55, 20, "<")); diff --git a/src/main/resources/assets/customnpcs/lang/en_US.lang b/src/main/resources/assets/customnpcs/lang/en_US.lang index 73d1cddaa..77cd3adaa 100644 --- a/src/main/resources/assets/customnpcs/lang/en_US.lang +++ b/src/main/resources/assets/customnpcs/lang/en_US.lang @@ -419,6 +419,7 @@ cloner.date=Date tags.allTags=All Tags tags.selectedTags=Selected Tags +tags.tags=Tags global.banks=Banks global.transport=Transport