Added global data menu to the NPC wand when right clicking the air

This commit is contained in:
Luis C.M committed 2023-03-15 22:24:47 -05:00
1 parent daada3cb8a
commit c12bb6508c
7 files changed
+34 -21

No files matched your search

@@ -46,6 +46,7 @@ import noppes.npcs.client.gui.player.companion.GuiNpcCompanionInv;
import noppes.npcs.client.gui.player.companion.GuiNpcCompanionStats;
import noppes.npcs.client.gui.player.companion.GuiNpcCompanionTalents;
import noppes.npcs.client.gui.questtypes.GuiNpcQuestTypeItem;
import noppes.npcs.client.gui.GuiNpcRemoteEditor;
import noppes.npcs.client.gui.roles.*;
import noppes.npcs.client.gui.script.GuiScriptGlobal;
import noppes.npcs.client.gui.script.GuiScriptItem;
@@ -248,10 +249,16 @@ public class ClientProxy extends CommonProxy {
return new GuiNPCManageTags(npc);
else if (gui == EnumGuiType.ManageAnimations) {
EntityCustomNpc animNpc = new EntityCustomNpc(npc.worldObj);
animNpc.copyDataFrom(npc,true);
animNpc.display.showName = 1;
animNpc.display.showBossBar = 0;
EntityCustomNpc animNpc;
if (npc != null) {
animNpc = new EntityCustomNpc(npc.worldObj);
animNpc.copyDataFrom(npc, true);
animNpc.display.showName = 1;
animNpc.display.showBossBar = 0;
} else {
animNpc = new EntityCustomNpc(Minecraft.getMinecraft().theWorld);
animNpc.display.texture = "customnpcs:textures/entity/humanmale/AnimationBody.png";
}
return new GuiNPCManageAnimations(animNpc);
}
@@ -7,6 +7,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.StatCollector;
import noppes.npcs.client.Client;
import noppes.npcs.client.NoppesUtil;
import noppes.npcs.client.gui.mainmenu.GuiNPCGlobalMainMenu;
import noppes.npcs.client.gui.util.*;
import noppes.npcs.constants.EnumPacketServer;
import noppes.npcs.entity.EntityNPCInterface;
@@ -43,9 +44,10 @@ public class GuiNpcRemoteEditor extends GuiNPCInterface implements IScrollData,
this.addButton(new GuiNpcButton(0, guiLeft + 170, guiTop + 6,82,20, "selectServer.edit"));
this.addButton(new GuiNpcButton(1, guiLeft + 170, guiTop + 28,82,20, "selectWorld.deleteButton"));
this.addButton(new GuiNpcButton(2, guiLeft + 170, guiTop + 50,82,20, "remote.reset"));
this.addButton(new GuiNpcButton(3, guiLeft + 170, guiTop + 132,82,20, "remote.freeze"));
this.addButton(new GuiNpcButton(4, guiLeft + 170, guiTop + 72,82,20, "remote.tp"));
this.addButton(new GuiNpcButton(5, guiLeft + 170, guiTop + 110,82,20, "remote.resetall"));
this.addButton(new GuiNpcButton(3, guiLeft + 170, guiTop + 132,82,20, "remote.freeze"));
this.addButton(new GuiNpcButton(6, guiLeft + 170, guiTop + 165,82,20, "menu.global"));
}
@Override
@@ -69,6 +71,9 @@ public class GuiNpcRemoteEditor extends GuiNPCInterface implements IScrollData,
((EntityNPCInterface)entity).reset();
}
}
if(id == 6){
NoppesUtil.openGUI(player, new GuiNPCGlobalMainMenu(null));
}
if(!data.containsKey(scroll.getSelected()))
return;
@@ -35,7 +35,6 @@ public class GuiNPCManageAnimations extends GuiModelInterface implements IScroll
Client.sendData(EnumPacketServer.AnimationListGet);
xOffset -= 20;
yOffset = -45;
npc.display.texture = "customnpcs:textures/entity/humanmale/AnimationBody.png";
AnimationData data = npc.display.animationData;
data.setEnabled(true);
@@ -21,7 +21,7 @@ public class GuiNpcManagePlayerData extends GuiNPCInterface2 implements IScrollD
private EnumPlayerData selection = EnumPlayerData.Players;
private String search = "";
public GuiNpcManagePlayerData(EntityNPCInterface npc,GuiNPCInterface2 parent)
public GuiNpcManagePlayerData(EntityNPCInterface npc)
{
super(npc);
Client.sendData(EnumPacketServer.PlayerDataGet,selection);
@@ -58,7 +58,7 @@ public class GuiNPCGlobalMainMenu extends GuiNPCInterface2{
NoppesUtil.requestOpenGUI(EnumGuiType.ManageTransport);
}
if (id == 13) {
NoppesUtil.openGUI(player, new GuiNpcManagePlayerData(npc, this));
NoppesUtil.openGUI(player, new GuiNpcManagePlayerData(npc));
}
if (id == 14) {
NoppesUtil.requestOpenGUI(EnumGuiType.ManageRecipes, 4, 0, 0);
@@ -32,18 +32,20 @@ public class GuiNpcMenu implements GuiYesNoCallback{
{
Keyboard.enableRepeatEvents(true);
GuiMenuTopButton display = new GuiMenuTopButton(1,guiLeft + 4, guiTop - 17, "menu.display");
GuiMenuTopButton stats = new GuiMenuTopButton(2,display.xPosition + display.getWidth() , guiTop - 17, "menu.stats");
GuiMenuTopButton ai = new GuiMenuTopButton(6,stats.xPosition + stats.getWidth() , guiTop - 17, "menu.ai");
GuiMenuTopButton inv = new GuiMenuTopButton(3,ai.xPosition + ai.getWidth() , guiTop - 17, "menu.inventory");
GuiMenuTopButton advanced = new GuiMenuTopButton(4,inv.xPosition + inv.getWidth() , guiTop - 17, "menu.advanced");
GuiMenuTopButton global = new GuiMenuTopButton(5,advanced.xPosition + advanced.getWidth() , guiTop - 17, "menu.global");
GuiMenuTopButton close = new GuiMenuTopButton(0,guiLeft + width - 22, guiTop - 17, "X");
GuiMenuTopButton delete = new GuiMenuTopButton(66,guiLeft + width - 72, guiTop - 17,"selectWorld.deleteButton");
delete.xPosition = close.xPosition - delete.getWidth();
topButtons = new GuiMenuTopButton[]{display,stats,ai,inv,advanced,global,close,delete};
GuiMenuTopButton close = new GuiMenuTopButton(0,guiLeft + width - 22, guiTop - 17, "X");
if (npc != null) {
GuiMenuTopButton display = new GuiMenuTopButton(1, guiLeft + 4, guiTop - 17, "menu.display");
GuiMenuTopButton stats = new GuiMenuTopButton(2, display.xPosition + display.getWidth(), guiTop - 17, "menu.stats");
GuiMenuTopButton ai = new GuiMenuTopButton(6, stats.xPosition + stats.getWidth(), guiTop - 17, "menu.ai");
GuiMenuTopButton inv = new GuiMenuTopButton(3, ai.xPosition + ai.getWidth(), guiTop - 17, "menu.inventory");
GuiMenuTopButton advanced = new GuiMenuTopButton(4, inv.xPosition + inv.getWidth(), guiTop - 17, "menu.advanced");
GuiMenuTopButton global = new GuiMenuTopButton(5, advanced.xPosition + advanced.getWidth(), guiTop - 17, "menu.global");
GuiMenuTopButton delete = new GuiMenuTopButton(66,guiLeft + width - 72, guiTop - 17,"selectWorld.deleteButton");
delete.xPosition = close.xPosition - delete.getWidth();
topButtons = new GuiMenuTopButton[]{display,stats,ai,inv,advanced,global,close,delete};
} else {
topButtons = new GuiMenuTopButton[]{close};
}
for(GuiMenuTopButton button : topButtons)
button.active = button.id == activeMenu;