Fix Chained Abilities not Saving

This commit is contained in:
Kam committed 2026-02-21 18:18:56 -05:00
1 parent 26da3ae2f9
commit b4334c2835
2 files changed
+10 -1

No files matched your search

@@ -563,6 +563,8 @@ public class SubGuiChainedAbilityConfig extends SubGuiInterface implements IText
return true;
case 2: // Up
if (entryIndex > 0) {
// Commit any focused delay field before reordering
GuiNpcTextField.unfocus();
ChainedAbilityEntry entry = entries.remove(entryIndex);
entries.add(entryIndex - 1, entry);
// Can't be concurrent at position 0
@@ -574,12 +576,16 @@ public class SubGuiChainedAbilityConfig extends SubGuiInterface implements IText
return true;
case 3: // Down
if (entryIndex < entries.size() - 1) {
// Commit any focused delay field before reordering
GuiNpcTextField.unfocus();
ChainedAbilityEntry entry = entries.remove(entryIndex);
entries.add(entryIndex + 1, entry);
initGui();
}
return true;
case 4: // Delete
// Commit any focused delay field before removing
GuiNpcTextField.unfocus();
entries.remove(entryIndex);
initGui();
return true;
@@ -96,7 +96,10 @@ public class GuiMenuTopButton extends GuiNpcButton {
@Override
public boolean mousePressed(Minecraft minecraft, int i, int j) {
boolean bo = !active && getVisible() && hover;
int h = this.height - (active ? 0 : 2);
boolean bo = !active && getVisible()
&& i >= xPosition && j >= yPosition
&& i < xPosition + getWidth() && j < yPosition + h;
if (bo && listener != null) {
listener.actionPerformed(this);
return false;