From c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 12 Feb 2026 22:33:32 -0800 Subject: Initial commit --- NET/worlds/scape/PropPropEditorDialog.java | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 NET/worlds/scape/PropPropEditorDialog.java (limited to 'NET/worlds/scape/PropPropEditorDialog.java') 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; + } + } +} -- cgit v1.2.3