2023-11-08 18:21:14 -06:00
|
|
|
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.controllers.data.Animation;
|
|
|
|
|
|
|
|
|
|
public class SubGuiAnimationOptions extends SubGuiInterface {
|
|
|
|
|
private final Animation animation;
|
|
|
|
|
|
|
|
|
|
public SubGuiAnimationOptions(Animation animation) {
|
|
|
|
|
this.animation = animation;
|
2023-11-08 23:10:31 -06:00
|
|
|
setBackground("smallbg.png");
|
2023-11-08 18:21:14 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void initGui() {
|
|
|
|
|
super.initGui();
|
|
|
|
|
//
|
|
|
|
|
//ticks - button
|
2023-11-08 23:10:31 -06:00
|
|
|
this.addLabel(new GuiNpcLabel(10, "animation.tickType", guiLeft + 5, guiTop + 16));
|
2023-11-08 18:21:14 -06:00
|
|
|
//
|
|
|
|
|
//whileStanding - button
|
2023-11-08 23:10:31 -06:00
|
|
|
this.addLabel(new GuiNpcLabel(11, "animation.whileStanding", guiLeft + 5, guiTop + 36));
|
|
|
|
|
this.addButton(new GuiNpcButton(11, guiLeft + 80, guiTop + 30, 30, 20, new String[]{"gui.yes", "gui.no"}, animation.whileStanding ? 0 : 1));
|
2023-11-08 18:21:14 -06:00
|
|
|
//
|
|
|
|
|
//whileAttacking - button
|
2023-11-08 23:10:31 -06:00
|
|
|
this.addLabel(new GuiNpcLabel(12, "animation.whileAttacking", guiLeft + 5, guiTop + 56));
|
|
|
|
|
this.addButton(new GuiNpcButton(12, guiLeft + 80, guiTop + 50, 30, 20, new String[]{"gui.yes", "gui.no"}, animation.whileAttacking ? 0 : 1));
|
2023-11-08 18:21:14 -06:00
|
|
|
//
|
|
|
|
|
//whileMoving - button
|
2023-11-08 23:10:31 -06:00
|
|
|
this.addLabel(new GuiNpcLabel(13, "animation.whileMoving", guiLeft + 5, guiTop + 76));
|
|
|
|
|
this.addButton(new GuiNpcButton(13, guiLeft + 80, guiTop + 70, 30, 20, new String[]{"gui.yes", "gui.no"}, animation.whileMoving ? 0 : 1));
|
2023-11-08 18:21:14 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void actionPerformed(GuiButton guibutton) {
|
|
|
|
|
super.actionPerformed(guibutton);
|
|
|
|
|
int value = ((GuiNpcButton)guibutton).getValue();
|
|
|
|
|
|
2023-11-08 21:09:07 -06:00
|
|
|
if (guibutton.id == 10) {
|
2024-03-23 23:34:01 -05:00
|
|
|
|
2023-11-08 21:09:07 -06:00
|
|
|
} else if (guibutton.id == 11) {
|
2023-11-08 18:21:14 -06:00
|
|
|
animation.whileStanding = value == 0;
|
2023-11-08 21:09:07 -06:00
|
|
|
} else if (guibutton.id == 12) {
|
2023-11-08 18:21:14 -06:00
|
|
|
animation.whileAttacking = value == 0;
|
2023-11-08 21:09:07 -06:00
|
|
|
} else if (guibutton.id == 13) {
|
2023-11-08 18:21:14 -06:00
|
|
|
animation.whileMoving = value == 0;
|
|
|
|
|
}
|
2023-11-08 23:10:31 -06:00
|
|
|
|
|
|
|
|
initGui();
|
2023-11-08 18:21:14 -06:00
|
|
|
}
|
|
|
|
|
}
|