mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 13:49:05 +00:00
Field Def Size Fixes
This commit is contained in:
1 parent
675c4ef4f9
commit
3bbde1f748
3 files changed
+20
-6
No files matched your search
@@ -187,19 +187,27 @@ public class FieldDef {
|
||||
idSetter.accept(-1);
|
||||
} else {
|
||||
idSetter.accept(sel.selectedAnimationId);
|
||||
nameSetter.accept("");
|
||||
String customName = sel.getSelectedName();
|
||||
nameSetter.accept(customName != null ? customName : "");
|
||||
}
|
||||
})
|
||||
.buttonLabel(() -> {
|
||||
String name = nameGetter.get();
|
||||
if (name != null && !name.isEmpty()) return name;
|
||||
int id = idGetter.get();
|
||||
if (id < 0 && name != null && !name.isEmpty()) {
|
||||
// Built-in animation: show just the name
|
||||
return name;
|
||||
}
|
||||
if (id >= 0) {
|
||||
// Custom animation: show (X) Name
|
||||
if (name != null && !name.isEmpty()) {
|
||||
return "(" + id + ") " + name;
|
||||
}
|
||||
Animation anim = AnimationController.Instance != null
|
||||
? (Animation) AnimationController.Instance.get(id) : null;
|
||||
String animName = anim != null ? anim.getName() : "";
|
||||
return animName != null && !animName.isEmpty()
|
||||
? "(ID: " + id + ") " + animName : "ID: " + id;
|
||||
? "(" + id + ") " + animName : String.valueOf(id);
|
||||
}
|
||||
return "gui.none";
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user