summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/PropPropEditorDialog.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-12 22:33:32 -0800
committerFuwn <[email protected]>2026-02-12 22:33:32 -0800
commitc7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch)
treedf9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/scape/PropPropEditorDialog.java
downloadworldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz
worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip
Initial commit
Diffstat (limited to 'NET/worlds/scape/PropPropEditorDialog.java')
-rw-r--r--NET/worlds/scape/PropPropEditorDialog.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/NET/worlds/scape/PropPropEditorDialog.java b/NET/worlds/scape/PropPropEditorDialog.java
new file mode 100644
index 0000000..4852b5a
--- /dev/null
+++ b/NET/worlds/scape/PropPropEditorDialog.java
@@ -0,0 +1,55 @@
+package NET.worlds.scape;
+
+class PropPropEditorDialog extends ListChooserDialog {
+ private SuperRoot _target;
+ private Property _property;
+ private boolean _nullHandling;
+
+ PropPropEditorDialog(EditTile parent, String title, Property property, SuperRoot target, boolean nullHandling) {
+ super(parent, title);
+ this._target = target;
+ this._property = property;
+ this._nullHandling = nullHandling;
+ this.ready();
+ }
+
+ @Override
+ protected String getEntry(int index) {
+ Property p = null;
+
+ try {
+ p = (Property)this._target.properties(index, 0, 0, null);
+ } catch (NoSuchPropertyException var4) {
+ }
+
+ return p == null ? null : p.getName();
+ }
+
+ @Override
+ protected int getSelected() {
+ if (this._property == null) {
+ return -1;
+ } else {
+ Property val = (Property)this._property.get();
+ return val == null ? -1 : val.getIndex();
+ }
+ }
+
+ @Override
+ protected boolean setValue(String text, int index) {
+ if (index == -1 && !this._nullHandling) {
+ return false;
+ } else {
+ Object val = null;
+
+ try {
+ val = this._target.properties(index, 0, 0, null);
+ } catch (NoSuchPropertyException var5) {
+ assert false;
+ }
+
+ this._parent.addUndoableSet(this._property, val);
+ return true;
+ }
+ }
+}