mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 18:57:32 +00:00
Fix Chained Abilities not Saving
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user