Minor Bug Fix to GuiModelAnimation

- Fixed setAnimFile to setAttackAnim
- iSubGuiListener so that when you close the GUI the names on the textfields properly update
This commit is contained in:
Kam committed 2024-01-24 18:44:50 -05:00
1 parent 27c9b92f3d
commit 96d73aafdb
1 file changed
+8 -2
@@ -9,9 +9,10 @@ import noppes.npcs.client.gui.util.*;
import noppes.npcs.entity.EntityNPCInterface;
import software.bernie.geckolib3.resource.GeckoLibCache;
public class SubGuiModelAnimation extends SubGuiInterface implements ITextfieldListener {
public class SubGuiModelAnimation extends SubGuiInterface implements ITextfieldListener, ISubGuiListener {
public SubGuiModelAnimation(EntityNPCInterface npc){
this.npc = npc;
closeOnEsc = true;
}
@Override
@@ -60,7 +61,7 @@ public class SubGuiModelAnimation extends SubGuiInterface implements ITextfieldL
if(button.id==4){
setSubGui(new GuiStringSelection(this,"Selecting geckolib attack animation:",
AnimationFileUtil.getAnimationList(getModelData(npc).getAnimFile()),
(name)-> getModelData(npc).setAnimFile(name)));
(name)-> getModelData(npc).setAttackAnim(name)));
}
if(button.id==5){
setSubGui(new GuiStringSelection(this,"Selecting geckolib hurt animation:",
@@ -110,4 +111,9 @@ public class SubGuiModelAnimation extends SubGuiInterface implements ITextfieldL
textfield.setText(getModelData(npc).getHurtAnim());
}
}
@Override
public void subGuiClosed(SubGuiInterface subGuiInterface) {
initGui();
}
}