diff --git a/gcft_ui/bunfoe_editor.py b/gcft_ui/bunfoe_editor.py index 55aea80..6e862d5 100644 --- a/gcft_ui/bunfoe_editor.py +++ b/gcft_ui/bunfoe_editor.py @@ -209,7 +209,7 @@ def add_all_sequence_elements_to_new_layout(self, field: Field) -> QLayout: if not all(at == arg_type for at in type_args): # Can't use a dynamic layout if the args aren't all the same type. use_static_layout = True - elif issubclass(arg_type, RGBA) or issubclass(arg_type, bool): + elif issubclass(arg_type, RGBA) or arg_type == bool or issubclass(arg_type, fs.MappedBool): # The widgets for these types are small and simple, so allow showing multiple at once. use_static_layout = True # if len(type_args) > 4: @@ -309,7 +309,7 @@ def make_widget_for_type(self, field_type: typing.Type, access_path: list[tuple] widget = self.make_spinbox_for_int(field_type) elif issubclass(field_type, float): widget = self.make_spinbox_for_float(field_type) - elif issubclass(field_type, bool): + elif field_type == bool or issubclass(field_type, fs.MappedBool): widget = self.make_checkbox_for_bool(field_type) elif issubclass(field_type, fs.u16Rot): widget = self.make_spinbox_for_rotation(field_type) @@ -349,8 +349,8 @@ def set_widget_value(self, widget: QWidget, value, field_type: typing.Type, inst assert issubclass(field_type, float) widget.setValue(value) elif isinstance(widget, QCheckBox): - assert issubclass(field_type, bool) - widget.setChecked(value) + assert field_type == bool or issubclass(field_type, fs.MappedBool) + widget.setChecked(bool(value)) elif isinstance(widget, QLineEdit): assert issubclass(field_type, str) widget.setText(value) diff --git a/gclib b/gclib index 6a38188..30f1781 160000 --- a/gclib +++ b/gclib @@ -1 +1 @@ -Subproject commit 6a381885c5fee079cf877e4e35233aed180f7950 +Subproject commit 30f17814c45d645eea28afb29777951cf25ee6f7