Reapply "Revert Animation Events"

This reverts commit 4113bcc6e9.
This commit is contained in:
Kam committed 2024-08-22 16:47:45 -04:00
1 parent 22169c81a0
commit 934cc3d7cd
31 files changed
+206 -694

No files matched your search

@@ -19,42 +19,36 @@ public class SubGuiAnimationFrame extends SubGuiInterface implements ITextfieldL
//
//customized - button, enables all the following options.
this.addLabel(new GuiNpcLabel(10, "animation.customized", guiLeft + 5, guiTop + 16));
this.addButton(new GuiNpcButton(10, guiLeft + 75, guiTop + 10, 30, 20, new String[]{"gui.yes", "gui.no"}, editingFrame.isCustomized() ? 0 : 1));
this.addButton(new GuiNpcButton(10, guiLeft + 65, guiTop + 10, 30, 20, new String[]{"gui.yes", "gui.no"}, editingFrame.isCustomized() ? 0 : 1));
if (editingFrame.isCustomized()) {
//
//speed - textfield
this.addLabel(new GuiNpcLabel(11, "stats.speed", guiLeft + 5, guiTop + 42));
this.addTextField(new GuiNpcTextField(11, this, guiLeft + 75, guiTop + 37, 30, 15, editingFrame.speed + ""));
this.addLabel(new GuiNpcLabel(11, "stats.speed", guiLeft + 5, guiTop + 36));
this.addTextField(new GuiNpcTextField(11, this, guiLeft + 65, guiTop + 32, 30, 15, editingFrame.speed + ""));
this.getTextField(11).floatsOnly = true;
this.getTextField(11).setMinMaxDefaultFloat(0, Float.MAX_VALUE, 1.0F);
//
//smooth - button
this.addLabel(new GuiNpcLabel(12, "animation.smoothing", guiLeft + 5, guiTop + 63));
this.addButton(new GuiNpcButton(12, guiLeft + 75, guiTop + 55, 60, 20, new String[]{"animation.smooth", "animation.linear", "gui.none"}, editingFrame.smooth));
this.addLabel(new GuiNpcLabel(12, "animation.smoothing", guiLeft + 5, guiTop + 58));
this.addButton(new GuiNpcButton(12, guiLeft + 65, guiTop + 52, 60, 20, new String[]{"animation.smooth", "animation.linear", "gui.none"}, editingFrame.smooth));
//
//tick duration - textfield
this.addLabel(new GuiNpcLabel(13, "animation.tickDuration", guiLeft + 5, guiTop + 84));
this.addTextField(new GuiNpcTextField(13, this, guiLeft + 75, guiTop + 79, 40, 15, editingFrame.tickDuration + ""));
this.getTextField(13).integersOnly = true;
this.getTextField(13).setMinMaxDefault(1, Integer.MAX_VALUE, 50);
//ticks - button
this.addLabel(new GuiNpcLabel(13, "animation.tickType", guiLeft + 5, guiTop + 78));
this.addButton(new GuiNpcButton(13, guiLeft + 65, guiTop + 72, 75, 20, new String[]{"animation.renderTicks", "animation.mcTicks"}, editingFrame.renderTicks ? 0 : 1));
}
this.addLabel(new GuiNpcLabel(14, "Comment", guiLeft + 5, guiTop + 106));
this.addTextField(new GuiNpcTextField(14, this, guiLeft + 50, guiTop + 101, 120, 15, editingFrame.getComment()));
}
@Override
protected void actionPerformed(GuiButton guibutton) {
super.actionPerformed(guibutton);
if (this.editingFrame == null) {
return;
}
int value = ((GuiNpcButton)guibutton).getValue();
if (guibutton.id == 10) {
if (guibutton.id == 10 && editingFrame != null) {
editingFrame.setCustomized(!editingFrame.isCustomized());
} else if (guibutton.id == 12) {
} else if (guibutton.id == 12 && editingFrame != null) {
editingFrame.smooth = (byte) value;
} else if (guibutton.id == 13 && editingFrame != null) {
editingFrame.renderTicks = value == 0;
}
initGui();
@@ -62,16 +56,8 @@ public class SubGuiAnimationFrame extends SubGuiInterface implements ITextfieldL
@Override
public void unFocused(GuiNpcTextField textfield) {
if (this.editingFrame == null) {
return;
}
if (textfield.id == 11) {
if (textfield.id == 11 && this.editingFrame != null) {
this.editingFrame.speed = textfield.getFloat();
} else if (textfield.id == 13) {
this.editingFrame.tickDuration = textfield.getInteger();
} else if (textfield.id == 14) {
this.editingFrame.setComment(textfield.getText());
}
}
}