mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 17:47:32 +00:00
Fix Sound Selection menu to be SubGui
This commit is contained in:
1 parent
cba87f5e3b
commit
823b9bbb27
8 files changed
+13
-15
No files matched your search
@@ -50,7 +50,7 @@ public class GuiNPCLinesEdit extends GuiNPCInterface2 implements IGuiData
|
||||
{
|
||||
GuiNpcButton button = (GuiNpcButton) guibutton;
|
||||
field = getTextField(button.id + 8);
|
||||
NoppesUtil.openGUI(player, gui = new GuiNpcSoundSelection(npc, this, field.getText()));
|
||||
setSubGui(gui = new GuiNpcSoundSelection(this, field.getText()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,19 +14,18 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class GuiNpcSoundSelection extends GuiNPCInterface{
|
||||
public class GuiNpcSoundSelection extends SubGuiInterface {
|
||||
|
||||
public GuiNPCStringSlot slot;
|
||||
private String domain;
|
||||
private GuiScreen parent;
|
||||
|
||||
|
||||
private String up = "..<" + StatCollector.translateToLocal("gui.up") + ">..";
|
||||
|
||||
private HashMap<String,List<String>> domains = new HashMap<String,List<String>>();
|
||||
|
||||
public GuiNpcSoundSelection(EntityNPCInterface npc, GuiScreen parent, String sound)
|
||||
public GuiNpcSoundSelection(GuiScreen parent, String sound)
|
||||
{
|
||||
super(npc);
|
||||
SoundHandler handler = Minecraft.getMinecraft().getSoundHandler();
|
||||
SoundRegistry registry = ObfuscationReflectionHelper.getPrivateValue(SoundHandler.class, handler, 4);
|
||||
|
||||
@@ -39,7 +38,7 @@ public class GuiNpcSoundSelection extends GuiNPCInterface{
|
||||
domains.put(location.getResourceDomain(), list);
|
||||
}
|
||||
drawDefaultBackground = false;
|
||||
this.parent = parent;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
|
||||
@@ -84,14 +84,15 @@ public class SubGuiNpcDialog extends SubGuiInterface implements ISubGuiListener,
|
||||
setSubGui(new SubGuiNpcDialogOptions(dialog));
|
||||
}
|
||||
if(id == 7 && dialog.id >= 0){
|
||||
this.setSubGui(new GuiNPCQuestSelection(this, dialog.quest));
|
||||
setSubGui(new GuiNPCQuestSelection(this, dialog.quest));
|
||||
}
|
||||
if(id == 8 && dialog.id >= 0){
|
||||
dialog.quest = -1;
|
||||
parent.dialogQuestName = "";
|
||||
initGui();
|
||||
}
|
||||
if(id == 9 && dialog.id >= 0){
|
||||
NoppesUtil.openGUI(player, new GuiNpcSoundSelection(npc, this, getTextField(2).getText()));
|
||||
setSubGui(new GuiNpcSoundSelection(this, getTextField(2).getText()));
|
||||
}
|
||||
if(id == 10){
|
||||
setSubGui(new SubGuiNpcDialogExtra(dialog));
|
||||
|
||||
@@ -115,7 +115,7 @@ public class SubGuiNpcRangeProperties extends SubGuiInterface implements ITextfi
|
||||
int id = guibutton.id;
|
||||
if(id == 7)
|
||||
{
|
||||
NoppesUtil.openGUI(player, gui = new GuiNpcSoundSelection(npc, parent, getTextField(7).getText()));
|
||||
setSubGui(gui = new GuiNpcSoundSelection(parent, getTextField(7).getText()));
|
||||
}
|
||||
if(id == 66)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GuiNPCSoundsMenu extends GuiNPCInterface2 implements ITextfieldList
|
||||
npc.advanced.disablePitch =((GuiNpcButton)button).getValue() == 0;
|
||||
else{
|
||||
selectedField = getTextField(button.id);
|
||||
NoppesUtil.openGUI(player, gui = new GuiNpcSoundSelection(npc, this, selectedField.getText()));
|
||||
setSubGui(gui = new GuiNpcSoundSelection(this, selectedField.getText()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.util.Vector;
|
||||
public class GuiNPCQuestSelection extends SubGuiInterface implements IScrollData
|
||||
{
|
||||
private GuiNPCStringSlot slot;
|
||||
private final GuiScreen parent;
|
||||
private HashMap<String,Integer> data;
|
||||
private boolean selectCategory = true;
|
||||
public GuiSelectionListener listener;
|
||||
@@ -22,7 +21,6 @@ public class GuiNPCQuestSelection extends SubGuiInterface implements IScrollData
|
||||
{
|
||||
drawDefaultBackground = false;
|
||||
title = "Select Quest Category";
|
||||
this.parent = parent;
|
||||
data = new HashMap<String, Integer>();
|
||||
this.quest = quest;
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ public class GuiNpcBard extends GuiNPCInterface2
|
||||
GuiNpcButton button = (GuiNpcButton) guibutton;
|
||||
if(button.id == 0)
|
||||
{
|
||||
gui = new GuiNpcSoundSelection(npc, this, job.song);
|
||||
NoppesUtil.openGUI(player, gui);
|
||||
|
||||
setSubGui(gui = new GuiNpcSoundSelection(this, job.song));
|
||||
job.song = "";
|
||||
MusicController.Instance.stopMusic();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class SubGuiNpcConversationLine extends SubGuiInterface implements ITextf
|
||||
protected void actionPerformed(GuiButton guibutton){
|
||||
int id = guibutton.id;
|
||||
if(id == 1){
|
||||
NoppesUtil.openGUI(player, gui = new GuiNpcSoundSelection(npc, parent, sound));
|
||||
setSubGui(gui = new GuiNpcSoundSelection(parent, sound));
|
||||
}
|
||||
if(id == 2){
|
||||
sound = "";
|
||||
|
||||
Reference in new issue
Block a user