mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Made quest selection GUI a sub gui
This commit is contained in:
1 parent
ec5e0c3086
commit
cba87f5e3b
6 files changed
+24
-35
No files matched your search
@@ -4,7 +4,6 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.global.GuiNPCQuestSelection;
|
||||
import noppes.npcs.client.gui.player.GuiMailmanWrite;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
@@ -69,7 +68,7 @@ public class SubGuiMailmanSendSetup extends SubGuiInterface implements ITextfiel
|
||||
Client.sendData(EnumPacketServer.MailOpenSetup, mail.writeNBT());
|
||||
}
|
||||
if(id == 3){
|
||||
NoppesUtil.openGUI(player, questSelection = new GuiNPCQuestSelection(npc, getParent(), mail.questId));
|
||||
this.setSubGui(questSelection = new GuiNPCQuestSelection(getParent(), mail.questId));
|
||||
questSelection.listener = this;
|
||||
}
|
||||
if(id == 4){
|
||||
|
||||
@@ -3,7 +3,6 @@ package noppes.npcs.client.gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.global.GuiNPCQuestSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumAvailabilityQuest;
|
||||
@@ -111,27 +110,27 @@ public class SubGuiNpcAvailabilityQuest extends SubGuiInterface implements GuiSe
|
||||
|
||||
if(button.id == 10){
|
||||
slot = 1;
|
||||
GuiNPCQuestSelection gui = new GuiNPCQuestSelection(npc, getParent(), availabitily.questId);
|
||||
GuiNPCQuestSelection gui = new GuiNPCQuestSelection(getParent(), availabitily.questId);
|
||||
gui.listener = this;
|
||||
NoppesUtil.openGUI(player, gui);
|
||||
this.setSubGui(gui);
|
||||
}
|
||||
if(button.id == 11){
|
||||
slot = 2;
|
||||
GuiNPCQuestSelection gui = new GuiNPCQuestSelection(npc, getParent(), availabitily.quest2Id);
|
||||
GuiNPCQuestSelection gui = new GuiNPCQuestSelection(getParent(), availabitily.quest2Id);
|
||||
gui.listener = this;
|
||||
NoppesUtil.openGUI(player, gui);
|
||||
this.setSubGui(gui);
|
||||
}
|
||||
if(button.id == 12){
|
||||
slot = 3;
|
||||
GuiNPCQuestSelection gui = new GuiNPCQuestSelection(npc, getParent(), availabitily.quest3Id);
|
||||
GuiNPCQuestSelection gui = new GuiNPCQuestSelection(getParent(), availabitily.quest3Id);
|
||||
gui.listener = this;
|
||||
NoppesUtil.openGUI(player, gui);
|
||||
this.setSubGui(gui);
|
||||
}
|
||||
if(button.id == 13){
|
||||
slot = 4;
|
||||
GuiNPCQuestSelection gui = new GuiNPCQuestSelection(npc, getParent(), availabitily.quest4Id);
|
||||
GuiNPCQuestSelection gui = new GuiNPCQuestSelection(getParent(), availabitily.quest4Id);
|
||||
gui.listener = this;
|
||||
NoppesUtil.openGUI(player, gui);
|
||||
this.setSubGui(gui);
|
||||
}
|
||||
|
||||
if(button.id == 20){
|
||||
|
||||
@@ -1,25 +1,14 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.GuiNpcSoundSelection;
|
||||
import noppes.npcs.client.gui.SubGuiEditText;
|
||||
import noppes.npcs.client.gui.SubGuiNpcTextArea;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageDialogs;
|
||||
import noppes.npcs.client.gui.global.GuiNPCQuestSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.DialogCategory;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
public class SubGuiNpcDialog extends SubGuiInterface implements ISubGuiListener, GuiSelectionListener,ITextfieldListener
|
||||
{
|
||||
@@ -95,7 +84,7 @@ public class SubGuiNpcDialog extends SubGuiInterface implements ISubGuiListener,
|
||||
setSubGui(new SubGuiNpcDialogOptions(dialog));
|
||||
}
|
||||
if(id == 7 && dialog.id >= 0){
|
||||
NoppesUtil.openGUI(player, new GuiNPCQuestSelection(npc, this, dialog.quest));
|
||||
this.setSubGui(new GuiNPCQuestSelection(this, dialog.quest));
|
||||
}
|
||||
if(id == 8 && dialog.id >= 0){
|
||||
dialog.quest = -1;
|
||||
@@ -151,6 +140,8 @@ public class SubGuiNpcDialog extends SubGuiInterface implements ISubGuiListener,
|
||||
@Override
|
||||
public void selected(int ob, String name) {
|
||||
dialog.quest = ob;
|
||||
parent.dialogQuestName = name;
|
||||
initGui();
|
||||
Client.sendData(EnumPacketServer.DialogSave, this.dialogCategoryID, dialog.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,26 +3,23 @@ package noppes.npcs.client.gui.global;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
public class GuiNPCQuestSelection extends GuiNPCInterface implements IScrollData
|
||||
public class GuiNPCQuestSelection extends SubGuiInterface implements IScrollData
|
||||
{
|
||||
private GuiNPCStringSlot slot;
|
||||
private GuiScreen parent;
|
||||
private final GuiScreen parent;
|
||||
private HashMap<String,Integer> data;
|
||||
private boolean selectCategory = true;
|
||||
public GuiSelectionListener listener;
|
||||
private int quest;
|
||||
|
||||
public GuiNPCQuestSelection(EntityNPCInterface npc,GuiScreen parent,int quest)
|
||||
public GuiNPCQuestSelection(GuiScreen parent, int quest)
|
||||
{
|
||||
super(npc);
|
||||
drawDefaultBackground = false;
|
||||
title = "Select Quest Category";
|
||||
this.parent = parent;
|
||||
@@ -67,7 +64,6 @@ public class GuiNPCQuestSelection extends GuiNPCInterface implements IScrollData
|
||||
{
|
||||
if(selectCategory){
|
||||
close();
|
||||
NoppesUtil.openGUI(player, parent);
|
||||
}else{
|
||||
title = "Select Dialog Category";
|
||||
selectCategory = true;
|
||||
@@ -95,10 +91,16 @@ public class GuiNPCQuestSelection extends GuiNPCInterface implements IScrollData
|
||||
else{
|
||||
quest = data.get(slot.selected);
|
||||
close();
|
||||
NoppesUtil.openGUI(player, parent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
this.save();
|
||||
super.close();
|
||||
}
|
||||
|
||||
public void save() {
|
||||
if(quest >= 0){
|
||||
if(listener != null){
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package noppes.npcs.client.gui.global;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.SubGuiMailmanSendSetup;
|
||||
import noppes.npcs.client.gui.SubGuiNpcCommand;
|
||||
import noppes.npcs.client.gui.SubGuiNpcFactionOptions;
|
||||
@@ -55,7 +54,7 @@ public class SubGuiNpcQuestAdvanced extends SubGuiInterface implements ITextfiel
|
||||
}
|
||||
|
||||
if(button.id == 11 && quest.id >= 0){
|
||||
NoppesUtil.openGUI(player, new GuiNPCQuestSelection(npc, getParent(), quest.nextQuestid));
|
||||
this.setSubGui(new GuiNPCQuestSelection(getParent(), quest.nextQuestid));
|
||||
}
|
||||
|
||||
if(button.id == 12 && quest.id >= 0){
|
||||
|
||||
@@ -3,7 +3,6 @@ package noppes.npcs.client.gui.roles;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.SubGuiNpcAvailability;
|
||||
import noppes.npcs.client.gui.global.GuiNPCQuestSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
@@ -77,7 +76,7 @@ public class GuiNpcConversation extends GuiNPCInterface2 implements ITextfieldLi
|
||||
setSubGui(new SubGuiNpcConversationLine(line.text, line.sound));
|
||||
}
|
||||
if(button.id == 51){
|
||||
NoppesUtil.openGUI(player, questSelection = new GuiNPCQuestSelection(npc, this, job.quest));
|
||||
this.setSubGui(questSelection = new GuiNPCQuestSelection(this, job.quest));
|
||||
}
|
||||
if(button.id == 52){
|
||||
job.quest = -1;
|
||||
|
||||
Reference in new issue
Block a user