mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 21:32:19 +00:00
Added ConditionItem and increased the max amount of conditions an ability can hold to 5
This commit is contained in:
1 parent
fb938c2b7d
commit
36babe51cc
6 files changed
+244
-18
No files matched your search
@@ -32,6 +32,7 @@ import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static kamkeel.npcs.controllers.data.ability.conditions.AbilityCondition.MAX_CONDITIONS;
|
||||
|
||||
/**
|
||||
* SubGui for editing a {@link ChainedAbility}.
|
||||
@@ -70,9 +71,9 @@ public class SubGuiChainedAbilityConfig extends SubGuiInterface implements IText
|
||||
// Actual ID = COND_BASE + i * COND_STRIDE + offset
|
||||
// offset 0 = name/click, 1 = edit, 2 = delete
|
||||
private static final int COND_BASE = 50;
|
||||
private static final int COND_END = 80;
|
||||
private static final int COND_STRIDE = 10;
|
||||
private static final int BTN_ADD_COND = 80;
|
||||
private static final int COND_END = COND_BASE + MAX_CONDITIONS * COND_STRIDE; // 50 + N*10
|
||||
private static final int BTN_ADD_COND = COND_END;
|
||||
|
||||
// ── Layout constants ──────────────────────────────────────────────────────
|
||||
private static final int L_LABEL_X = 5;
|
||||
@@ -427,7 +428,7 @@ public class SubGuiChainedAbilityConfig extends SubGuiInterface implements IText
|
||||
sw.addLabel(new GuiNpcLabel(labelCounter, "ability.conditions", L_LABEL_X, y + 2, 0xFFFF55));
|
||||
y += 15;
|
||||
|
||||
for (int i = 0; i < conditions.size() && i < 3; i++) {
|
||||
for (int i = 0; i < conditions.size() && i < MAX_CONDITIONS; i++) {
|
||||
AbilityCondition cond = conditions.get(i);
|
||||
String condName = getConditionDisplayName(cond);
|
||||
sw.addButton(new GuiNpcButton(COND_BASE + i * COND_STRIDE, L_LABEL_X, y, 140, 20, condName));
|
||||
@@ -436,7 +437,7 @@ public class SubGuiChainedAbilityConfig extends SubGuiInterface implements IText
|
||||
y += 22;
|
||||
}
|
||||
|
||||
if (conditions.size() < 3) {
|
||||
if (conditions.size() < MAX_CONDITIONS) {
|
||||
sw.addButton(new GuiNpcButton(BTN_ADD_COND, L_LABEL_X, y, 50, 20, "gui.add"));
|
||||
y += ROW_H;
|
||||
}
|
||||
@@ -615,7 +616,7 @@ public class SubGuiChainedAbilityConfig extends SubGuiInterface implements IText
|
||||
return true;
|
||||
}
|
||||
if (id == BTN_ADD_COND) {
|
||||
if (conditions.size() < 3) {
|
||||
if (conditions.size() < MAX_CONDITIONS) {
|
||||
editingConditionIndex = conditions.size();
|
||||
setSubGui(new SubGuiConditionEdit(null));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user