mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Fix Sound Selection
This commit is contained in:
1 parent
823b9bbb27
commit
cce4e7bcc7
3 files changed
+21
-6
No files matched your search
@@ -11,13 +11,15 @@ import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.controllers.MusicController;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class GuiNpcSoundSelection extends SubGuiInterface {
|
||||
|
||||
public GuiNPCStringSlot slot;
|
||||
private String domain;
|
||||
public String domain;
|
||||
private final GuiScreen parent;
|
||||
|
||||
|
||||
private String up = "..<" + StatCollector.translateToLocal("gui.up") + ">..";
|
||||
@@ -86,13 +88,14 @@ public class GuiNpcSoundSelection extends SubGuiInterface {
|
||||
initGui();
|
||||
}
|
||||
else{
|
||||
System.out.println("OK");
|
||||
if(parent instanceof GuiNPCInterface){
|
||||
((GuiNPCInterface)parent).elementClicked();
|
||||
}
|
||||
else if(parent instanceof GuiNPCInterface2){
|
||||
else if(this.parent instanceof GuiNPCInterface2){
|
||||
((GuiNPCInterface2)parent).elementClicked();
|
||||
}
|
||||
displayGuiScreen(parent);
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +121,13 @@ public class GuiNpcSoundSelection extends SubGuiInterface {
|
||||
public void save() {
|
||||
|
||||
}
|
||||
|
||||
public void close() {
|
||||
this.save();
|
||||
super.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getSelected(){
|
||||
if(slot.selected == null || slot.selected.isEmpty())
|
||||
return "";
|
||||
|
||||
@@ -12,7 +12,6 @@ import noppes.npcs.controllers.data.Quest;
|
||||
|
||||
public class SubGuiNpcAvailabilityQuest extends SubGuiInterface implements GuiSelectionListener, IGuiData {
|
||||
private Availability availabitily;
|
||||
private boolean selectFaction = false;
|
||||
private int slot = 0;
|
||||
|
||||
public SubGuiNpcAvailabilityQuest(Availability availabitily){
|
||||
|
||||
@@ -16,6 +16,7 @@ public class SubGuiNpcDialog extends SubGuiInterface implements ISubGuiListener,
|
||||
public int dialogCategoryID;
|
||||
public Dialog dialog;
|
||||
private final GuiNPCManageDialogs parent;
|
||||
private GuiNpcSoundSelection gui;
|
||||
|
||||
public SubGuiNpcDialog(GuiNPCManageDialogs parent, Dialog dialog, int catId)
|
||||
{
|
||||
@@ -92,7 +93,7 @@ public class SubGuiNpcDialog extends SubGuiInterface implements ISubGuiListener,
|
||||
initGui();
|
||||
}
|
||||
if(id == 9 && dialog.id >= 0){
|
||||
setSubGui(new GuiNpcSoundSelection(this, getTextField(2).getText()));
|
||||
setSubGui(gui = new GuiNpcSoundSelection(this, getTextField(2).getText()));
|
||||
}
|
||||
if(id == 10){
|
||||
setSubGui(new SubGuiNpcDialogExtra(dialog));
|
||||
@@ -138,6 +139,12 @@ public class SubGuiNpcDialog extends SubGuiInterface implements ISubGuiListener,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void elementClicked(){
|
||||
getTextField(2).setText(gui.getSelected());
|
||||
unFocused(getTextField(2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selected(int ob, String name) {
|
||||
dialog.quest = ob;
|
||||
|
||||
Reference in new issue
Block a user