mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 22:45:09 +00:00
Loads of changes from the animation branch
This commit is contained in:
1 parent
990419a411
commit
572077b7e5
13 files changed
+1091
-692
No files matched your search
@@ -1,18 +1,15 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.SubGuiInterface;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
|
||||
public class SubGuiAnimationOptions extends SubGuiInterface {
|
||||
public class SubGuiAnimationOptions extends SubGuiInterface implements ITextfieldListener {
|
||||
private final Animation animation;
|
||||
|
||||
public SubGuiAnimationOptions(Animation animation) {
|
||||
this.animation = animation;
|
||||
setBackground("smallbg.png");
|
||||
this.closeOnEsc = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -20,8 +17,10 @@ public class SubGuiAnimationOptions extends SubGuiInterface {
|
||||
super.initGui();
|
||||
//
|
||||
//ticks - button
|
||||
this.addLabel(new GuiNpcLabel(10, "animation.tickType", guiLeft + 5, guiTop + 16));
|
||||
this.addButton(new GuiNpcButton(10, guiLeft + 60, guiTop + 10, 75, 20, new String[]{"animation.renderTicks", "animation.mcTicks"}, animation.renderTicks ? 0 : 1));
|
||||
this.addLabel(new GuiNpcLabel(10, "animation.tickDuration", guiLeft + 5, guiTop + 16));
|
||||
this.addTextField(new GuiNpcTextField(10, this, guiLeft + 80, guiTop + 12, 40, 15, animation.tickDuration + ""));
|
||||
this.getTextField(10).integersOnly = true;
|
||||
this.getTextField(10).setMinMaxDefault(1, Integer.MAX_VALUE, 50);
|
||||
//
|
||||
//whileStanding - button
|
||||
this.addLabel(new GuiNpcLabel(11, "animation.whileStanding", guiLeft + 5, guiTop + 36));
|
||||
@@ -41,9 +40,7 @@ public class SubGuiAnimationOptions extends SubGuiInterface {
|
||||
super.actionPerformed(guibutton);
|
||||
int value = ((GuiNpcButton)guibutton).getValue();
|
||||
|
||||
if (guibutton.id == 10) {
|
||||
animation.renderTicks = value == 0;
|
||||
} else if (guibutton.id == 11) {
|
||||
if (guibutton.id == 11) {
|
||||
animation.whileStanding = value == 0;
|
||||
} else if (guibutton.id == 12) {
|
||||
animation.whileAttacking = value == 0;
|
||||
@@ -53,4 +50,11 @@ public class SubGuiAnimationOptions extends SubGuiInterface {
|
||||
|
||||
initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unFocused(GuiNpcTextField textfield) {
|
||||
if (textfield.id == 10) {
|
||||
animation.tickDuration = textfield.getInteger();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user