- Fix Sub GUI interactions for Built-In Abilities

- Allow Status Effect Selection from DBC Addon End
This commit is contained in:
Kam committed 2026-02-19 15:39:06 -05:00
1 parent a94219cd0d
commit 024718e7f4
10 files changed
+197 -41

No files matched your search

@@ -6,7 +6,7 @@ import noppes.npcs.client.gui.util.GuiNpcLabel;
/**
* Choice dialog for adding an entry to a chain.
* Options: From NPC Slots (optional), Load Preset, Create New.
* Options: By Reference, Create New, Built-in, From NPC Slots (optional).
*/
public class SubGuiChainedEntrySource extends SubGuiSimpleChoice {
@@ -14,6 +14,7 @@ public class SubGuiChainedEntrySource extends SubGuiSimpleChoice {
public static final int SOURCE_NPC_SLOTS = 0;
public static final int SOURCE_LOAD_PRESET = 1;
public static final int SOURCE_CREATE_NEW = 2;
public static final int SOURCE_BUILT_IN = 3;
private final boolean showNpcOption;
@@ -25,7 +26,7 @@ public class SubGuiChainedEntrySource extends SubGuiSimpleChoice {
this.showNpcOption = showNpcOption;
setBackground("menubg.png");
xSize = 200;
ySize = showNpcOption ? 110 : 88;
ySize = showNpcOption ? 132 : 110;
}
@Override
@@ -36,21 +37,24 @@ public class SubGuiChainedEntrySource extends SubGuiSimpleChoice {
addLabel(new GuiNpcLabel(0, "ability.entrySource", guiLeft + 10, y));
y += 20;
if (showNpcOption) {
addButton(new GuiNpcButton(0, guiLeft + 10, y, 180, 20, "ability.fromNpc"));
y += 22;
}
addButton(new GuiNpcButton(1, guiLeft + 10, y, 180, 20, "ability.byReference"));
addButton(new GuiNpcButton(SOURCE_LOAD_PRESET, guiLeft + 10, y, 180, 20, "ability.byReference"));
y += 22;
addButton(new GuiNpcButton(2, guiLeft + 10, y, 180, 20, "ability.createNew"));
addButton(new GuiNpcButton(SOURCE_CREATE_NEW, guiLeft + 10, y, 180, 20, "ability.createNew"));
y += 22;
addButton(new GuiNpcButton(SOURCE_BUILT_IN, guiLeft + 10, y, 180, 20, "gui.builtin"));
if (showNpcOption) {
y += 22;
addButton(new GuiNpcButton(SOURCE_NPC_SLOTS, guiLeft + 10, y, 180, 20, "ability.fromNpc"));
}
}
@Override
public void buttonEvent(GuiButton guibutton) {
int id = guibutton.id;
if (id >= 0 && id <= 2) {
if (id >= 0 && id <= 3) {
setResult(id);
close();
}