mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 02:39:05 +00:00
Global event script buttons and the script GUI for an NPC are enabled/disabled/darkened based on their respective configs.
This commit is contained in:
1 parent
286f6862cb
commit
3066e1dfbc
3 files changed
+14
-4
No files matched your search
@@ -355,7 +355,7 @@ public class ClientProxy extends CommonProxy {
|
||||
else if(gui == EnumGuiType.PlayerTransporter)
|
||||
return new GuiTransportSelection(npc);
|
||||
|
||||
else if(gui == EnumGuiType.Script)
|
||||
else if(gui == EnumGuiType.Script && CustomNpcs.ScriptingEnabled)
|
||||
return new GuiScript(npc);
|
||||
|
||||
else if(gui == EnumGuiType.PlayerAnvil)
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.DataScript;
|
||||
import noppes.npcs.NoppesStringUtils;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
@@ -7,6 +7,7 @@ package noppes.npcs.client.gui.script;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -23,9 +24,17 @@ public class GuiScriptGlobal extends GuiNPCInterface {
|
||||
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.addButton(new GuiNpcButton(0, this.guiLeft + 38, this.guiTop + 20, 100, 20, "Players"));
|
||||
this.addButton(new GuiNpcButton(1, this.guiLeft + 38, this.guiTop + 50, 100, 20, "Forge"));
|
||||
this.addButton(new GuiNpcButton(2, this.guiLeft + 38, this.guiTop + 80, 100, 20, "All NPCs"));
|
||||
GuiNpcButton playerButton = new GuiNpcButton(0, this.guiLeft + 38, this.guiTop + 20, 100, 20, "Players");
|
||||
playerButton.setEnabled(CustomNpcs.GlobalPlayerScripts && CustomNpcs.ScriptingEnabled);
|
||||
this.addButton(playerButton);
|
||||
|
||||
GuiNpcButton forgeButton = new GuiNpcButton(1, this.guiLeft + 38, this.guiTop + 50, 100, 20, "Forge");
|
||||
forgeButton.setEnabled(CustomNpcs.GlobalForgeScripts && CustomNpcs.ScriptingEnabled);
|
||||
this.addButton(forgeButton);
|
||||
|
||||
GuiNpcButton npcButton = new GuiNpcButton(2, this.guiLeft + 38, this.guiTop + 80, 100, 20, "All NPCs");
|
||||
npcButton.setEnabled(CustomNpcs.GlobalNPCScripts && CustomNpcs.ScriptingEnabled);
|
||||
this.addButton(npcButton);
|
||||
}
|
||||
|
||||
public void drawScreen(int i, int j, float f) {
|
||||
|
||||
Reference in new issue
Block a user