mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 20:09:49 +00:00
Full Imports and Code Format Optimization
This commit is contained in:
1 parent
250edf099c
commit
6815f579a7
1192 files changed
+60344
-62167
No files matched your search
@@ -8,76 +8,76 @@ import noppes.npcs.client.gui.select.GuiSoundSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class GuiNPCSoundsMenu extends GuiNPCInterface2 implements ITextfieldListener, ISubGuiListener
|
||||
{
|
||||
private GuiNpcTextField selectedField;
|
||||
public GuiNPCSoundsMenu(EntityNPCInterface npc){
|
||||
super(npc);
|
||||
public class GuiNPCSoundsMenu extends GuiNPCInterface2 implements ITextfieldListener, ISubGuiListener {
|
||||
private GuiNpcTextField selectedField;
|
||||
|
||||
public GuiNPCSoundsMenu(EntityNPCInterface npc) {
|
||||
super(npc);
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
addLabel(new GuiNpcLabel(0,"advanced.idlesound", guiLeft + 5, guiTop + 20));
|
||||
addTextField(new GuiNpcTextField(0,this, fontRendererObj, guiLeft + 80, guiTop + 15, 200, 20, npc.advanced.idleSound));
|
||||
addLabel(new GuiNpcLabel(0, "advanced.idlesound", guiLeft + 5, guiTop + 20));
|
||||
addTextField(new GuiNpcTextField(0, this, fontRendererObj, guiLeft + 80, guiTop + 15, 200, 20, npc.advanced.idleSound));
|
||||
addButton(new GuiNpcButton(0, guiLeft + 290, guiTop + 15, 80, 20, "gui.selectSound"));
|
||||
|
||||
addLabel(new GuiNpcLabel(2,"advanced.angersound", guiLeft + 5, guiTop + 45));
|
||||
addTextField(new GuiNpcTextField(2,this, fontRendererObj, guiLeft + 80, guiTop + 40, 200, 20, npc.advanced.angrySound));
|
||||
addLabel(new GuiNpcLabel(2, "advanced.angersound", guiLeft + 5, guiTop + 45));
|
||||
addTextField(new GuiNpcTextField(2, this, fontRendererObj, guiLeft + 80, guiTop + 40, 200, 20, npc.advanced.angrySound));
|
||||
addButton(new GuiNpcButton(2, guiLeft + 290, guiTop + 40, 80, 20, "gui.selectSound"));
|
||||
|
||||
addLabel(new GuiNpcLabel(3,"advanced.hurtsound", guiLeft + 5, guiTop + 70));
|
||||
addTextField(new GuiNpcTextField(3,this, fontRendererObj, guiLeft + 80, guiTop + 65, 200, 20, npc.advanced.hurtSound));
|
||||
addLabel(new GuiNpcLabel(3, "advanced.hurtsound", guiLeft + 5, guiTop + 70));
|
||||
addTextField(new GuiNpcTextField(3, this, fontRendererObj, guiLeft + 80, guiTop + 65, 200, 20, npc.advanced.hurtSound));
|
||||
addButton(new GuiNpcButton(3, guiLeft + 290, guiTop + 65, 80, 20, "gui.selectSound"));
|
||||
|
||||
addLabel(new GuiNpcLabel(4,"advanced.deathsound", guiLeft + 5, guiTop + 95));
|
||||
addTextField(new GuiNpcTextField(4,this, fontRendererObj, guiLeft + 80, guiTop + 90, 200, 20, npc.advanced.deathSound));
|
||||
addLabel(new GuiNpcLabel(4, "advanced.deathsound", guiLeft + 5, guiTop + 95));
|
||||
addTextField(new GuiNpcTextField(4, this, fontRendererObj, guiLeft + 80, guiTop + 90, 200, 20, npc.advanced.deathSound));
|
||||
addButton(new GuiNpcButton(4, guiLeft + 290, guiTop + 90, 80, 20, "gui.selectSound"));
|
||||
|
||||
addLabel(new GuiNpcLabel(5,"advanced.stepsound", guiLeft + 5, guiTop + 120));
|
||||
addTextField(new GuiNpcTextField(5,this, fontRendererObj, guiLeft + 80, guiTop + 115, 200, 20, npc.advanced.stepSound));
|
||||
addLabel(new GuiNpcLabel(5, "advanced.stepsound", guiLeft + 5, guiTop + 120));
|
||||
addTextField(new GuiNpcTextField(5, this, fontRendererObj, guiLeft + 80, guiTop + 115, 200, 20, npc.advanced.stepSound));
|
||||
addButton(new GuiNpcButton(5, guiLeft + 290, guiTop + 115, 80, 20, "gui.selectSound"));
|
||||
|
||||
addLabel(new GuiNpcLabel(6,"advanced.haspitch", guiLeft + 5, guiTop + 150));
|
||||
addButton(new GuiNpcButton(6, guiLeft + 120, guiTop + 145, 80, 20, new String[]{"gui.no","gui.yes"}, npc.advanced.disablePitch?0:1));
|
||||
addLabel(new GuiNpcLabel(6, "advanced.haspitch", guiLeft + 5, guiTop + 150));
|
||||
addButton(new GuiNpcButton(6, guiLeft + 120, guiTop + 145, 80, 20, new String[]{"gui.no", "gui.yes"}, npc.advanced.disablePitch ? 0 : 1));
|
||||
|
||||
}
|
||||
public void buttonEvent(GuiButton button){
|
||||
if(button.id == 6)
|
||||
npc.advanced.disablePitch =((GuiNpcButton)button).getValue() == 0;
|
||||
else{
|
||||
|
||||
public void buttonEvent(GuiButton button) {
|
||||
if (button.id == 6)
|
||||
npc.advanced.disablePitch = ((GuiNpcButton) button).getValue() == 0;
|
||||
else {
|
||||
selectedField = getTextField(button.id);
|
||||
setSubGui(new GuiSoundSelection(selectedField.getText()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unFocused(GuiNpcTextField textfield) {
|
||||
if(textfield.id == 0)
|
||||
npc.advanced.idleSound = textfield.getText();
|
||||
if(textfield.id == 2)
|
||||
npc.advanced.angrySound = textfield.getText();
|
||||
if(textfield.id == 3)
|
||||
npc.advanced.hurtSound = textfield.getText();
|
||||
if(textfield.id == 4)
|
||||
npc.advanced.deathSound = textfield.getText();
|
||||
if(textfield.id == 5)
|
||||
npc.advanced.stepSound = textfield.getText();
|
||||
}
|
||||
@Override
|
||||
public void unFocused(GuiNpcTextField textfield) {
|
||||
if (textfield.id == 0)
|
||||
npc.advanced.idleSound = textfield.getText();
|
||||
if (textfield.id == 2)
|
||||
npc.advanced.angrySound = textfield.getText();
|
||||
if (textfield.id == 3)
|
||||
npc.advanced.hurtSound = textfield.getText();
|
||||
if (textfield.id == 4)
|
||||
npc.advanced.deathSound = textfield.getText();
|
||||
if (textfield.id == 5)
|
||||
npc.advanced.stepSound = textfield.getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subGuiClosed(SubGuiInterface subgui) {
|
||||
GuiSoundSelection gss = (GuiSoundSelection) subgui;
|
||||
if(gss.selectedResource != null) {
|
||||
if (gss.selectedResource != null) {
|
||||
selectedField.setText(gss.selectedResource.toString());
|
||||
unFocused(selectedField);
|
||||
initGui();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
@Override
|
||||
public void save() {
|
||||
PacketClient.sendClient(new MainmenuAdvancedSavePacket(npc.advanced.writeToNBT(new NBTTagCompound())));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user