Revert Animation Events

This commit is contained in:
Kam committed 2024-05-26 19:26:47 -04:00
1 parent 4c46496c82
commit 1ffddd3ce9
31 files changed
+208 -696

No files matched your search

@@ -1,10 +1,12 @@
package noppes.npcs.client.gui;
import net.minecraft.client.gui.GuiButton;
import noppes.npcs.client.gui.util.*;
import noppes.npcs.client.gui.util.GuiNpcButton;
import noppes.npcs.client.gui.util.GuiNpcLabel;
import noppes.npcs.client.gui.util.SubGuiInterface;
import noppes.npcs.controllers.data.Animation;
public class SubGuiAnimationOptions extends SubGuiInterface implements ITextfieldListener {
public class SubGuiAnimationOptions extends SubGuiInterface {
private final Animation animation;
public SubGuiAnimationOptions(Animation animation) {
@@ -17,10 +19,8 @@ public class SubGuiAnimationOptions extends SubGuiInterface implements ITextfiel
super.initGui();
//
//ticks - button
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);
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));
//
//whileStanding - button
this.addLabel(new GuiNpcLabel(11, "animation.whileStanding", guiLeft + 5, guiTop + 36));
@@ -40,7 +40,9 @@ public class SubGuiAnimationOptions extends SubGuiInterface implements ITextfiel
super.actionPerformed(guibutton);
int value = ((GuiNpcButton)guibutton).getValue();
if (guibutton.id == 11) {
if (guibutton.id == 10) {
animation.renderTicks = value == 0;
} else if (guibutton.id == 11) {
animation.whileStanding = value == 0;
} else if (guibutton.id == 12) {
animation.whileAttacking = value == 0;
@@ -50,11 +52,4 @@ public class SubGuiAnimationOptions extends SubGuiInterface implements ITextfiel
initGui();
}
@Override
public void unFocused(GuiNpcTextField textfield) {
if (textfield.id == 10) {
animation.tickDuration = textfield.getInteger();
}
}
}