mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 00:19:05 +00:00
Fix Quest Type Dialog Selection
This commit is contained in:
1 parent
32aca44443
commit
69185de3f3
2 files changed
+17
-18
No files matched your search
@@ -26,15 +26,15 @@ public class GuiNPCDialogSelection extends GuiNPCInterface implements IScrollDat
|
||||
title = "Select Dialog Category";
|
||||
this.parent = parent;
|
||||
this.dialog = dialog;
|
||||
|
||||
|
||||
|
||||
|
||||
if(dialog >= 0){
|
||||
Client.sendData(EnumPacketServer.DialogsGetFromDialog, dialog);
|
||||
selectCategory = false;
|
||||
title = "Select Dialog";
|
||||
}else
|
||||
Client.sendData(EnumPacketServer.DialogCategoriesGet, dialog);
|
||||
|
||||
|
||||
if(parent instanceof GuiSelectionListener){
|
||||
listener = (GuiSelectionListener) parent;
|
||||
}
|
||||
@@ -48,7 +48,6 @@ public class GuiNPCDialogSelection extends GuiNPCInterface implements IScrollDat
|
||||
slot = new GuiNPCStringSlot(list,this,false,18);
|
||||
slot.registerScrollButtons(4, 5);
|
||||
|
||||
|
||||
this.addButton(new GuiNpcButton(2, width / 2 -100, height - 41,98, 20, "gui.back"));
|
||||
this.addButton(new GuiNpcButton(4, width / 2 + 2, height - 41,98, 20, "gui.select"));
|
||||
}
|
||||
@@ -92,7 +91,7 @@ public class GuiNPCDialogSelection extends GuiNPCInterface implements IScrollDat
|
||||
close();
|
||||
NoppesUtil.openGUI(player, parent);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public void save() {
|
||||
if(dialog >= 0){
|
||||
@@ -113,7 +112,7 @@ public class GuiNPCDialogSelection extends GuiNPCInterface implements IScrollDat
|
||||
|
||||
@Override
|
||||
public void setSelected(String selected) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,25 +20,24 @@ import java.util.HashMap;
|
||||
public class GuiNpcQuestTypeDialog extends SubGuiInterface implements GuiSelectionListener, IGuiData
|
||||
{
|
||||
private GuiScreen parent;
|
||||
|
||||
private QuestDialog quest;
|
||||
|
||||
|
||||
private HashMap<Integer, String> data = new HashMap<Integer, String>();
|
||||
|
||||
public GuiNpcQuestTypeDialog(EntityNPCInterface npc, Quest q, GuiScreen parent) {
|
||||
this.npc = npc;
|
||||
this.parent = parent;
|
||||
title = "Quest Dialog Setup";
|
||||
|
||||
|
||||
quest = (QuestDialog) q.questInterface;
|
||||
|
||||
setBackground("menubg.png");
|
||||
xSize = 256;
|
||||
ySize = 216;
|
||||
closeOnEsc = true;
|
||||
Client.sendData(EnumPacketServer.QuestDialogGetTitle,
|
||||
quest.dialogs.containsKey(0)?quest.dialogs.get(0):-1,
|
||||
quest.dialogs.containsKey(1)?quest.dialogs.get(1):-1,
|
||||
Client.sendData(EnumPacketServer.QuestDialogGetTitle,
|
||||
quest.dialogs.containsKey(0)?quest.dialogs.get(0):-1,
|
||||
quest.dialogs.containsKey(1)?quest.dialogs.get(1):-1,
|
||||
quest.dialogs.containsKey(2)?quest.dialogs.get(2):-1);
|
||||
}
|
||||
|
||||
@@ -48,12 +47,12 @@ public class GuiNpcQuestTypeDialog extends SubGuiInterface implements GuiSelecti
|
||||
String title = "dialog.selectoption";
|
||||
if(data.containsKey(i))
|
||||
title = data.get(i);
|
||||
this.addButton(new GuiNpcButton(i + 9, guiLeft + 10, 55 + i * 22, 20, 20, "X"));
|
||||
this.addButton(new GuiNpcButton(i + 3, guiLeft + 34, 55 + i * 22, 210, 20, title));
|
||||
this.addButton(new GuiNpcButton(i + 9, guiLeft + 10, guiTop + 55 + i * 22, 20, 20, "X"));
|
||||
this.addButton(new GuiNpcButton(i + 3, guiLeft + 34, guiTop + 55 + i * 22, 210, 20, title));
|
||||
|
||||
}
|
||||
this.addButton(new GuiNpcButton(0, guiLeft + 150, guiTop + 190, 98, 20, "gui.back"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
private int selectedSlot;
|
||||
@@ -67,9 +66,10 @@ public class GuiNpcQuestTypeDialog extends SubGuiInterface implements GuiSelecti
|
||||
int id = -1;
|
||||
if(quest.dialogs.containsKey(selectedSlot))
|
||||
id = quest.dialogs.get(selectedSlot);
|
||||
GuiNPCDialogSelection gui = new GuiNPCDialogSelection(npc, parent, id);
|
||||
gui.listener = this;
|
||||
NoppesUtil.openGUI(player, gui);
|
||||
|
||||
GuiNPCDialogSelection gui = new GuiNPCDialogSelection(npc, getParent(), id);
|
||||
gui.listener = this;
|
||||
NoppesUtil.openGUI(player, gui);
|
||||
}
|
||||
if (button.id >= 9 && button.id < 15) {
|
||||
int slot = button.id - 9;
|
||||
|
||||
Reference in new issue
Block a user