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/BooleanPropertyEditor.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 NET/worlds/scape/BooleanPropertyEditor.java (limited to 'NET/worlds/scape/BooleanPropertyEditor.java') diff --git a/NET/worlds/scape/BooleanPropertyEditor.java b/NET/worlds/scape/BooleanPropertyEditor.java new file mode 100644 index 0000000..83db263 --- /dev/null +++ b/NET/worlds/scape/BooleanPropertyEditor.java @@ -0,0 +1,26 @@ +package NET.worlds.scape; + +import NET.worlds.console.PolledDialog; + +public class BooleanPropertyEditor extends PropEditor { + private String[] choices; + private String falseName; + private String trueName; + + private BooleanPropertyEditor(Property property, String falseName, String trueName) { + super(property); + this.falseName = falseName; + this.trueName = trueName; + } + + @Override + public PolledDialog edit(EditTile parent, String title) { + String[] choices = new String[]{this.falseName, this.trueName}; + return new BooleanFieldEditorDialog(parent, title, this.property, choices); + } + + public static Property make(Property property, String falseName, String trueName) { + property.setPropertyType(0); + return property.setEditor(new BooleanPropertyEditor(property, falseName, trueName)); + } +} -- cgit v1.2.3