diff options
| author | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
| commit | c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch) | |
| tree | df9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/scape/PropPropEditorDialog.java | |
| download | worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip | |
Initial commit
Diffstat (limited to 'NET/worlds/scape/PropPropEditorDialog.java')
| -rw-r--r-- | NET/worlds/scape/PropPropEditorDialog.java | 55 |
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; + } + } +} |