Skip to content

Commit

Permalink
Fix handling of joint 255 bool values in unused models
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Dec 26, 2024
1 parent f8cedec commit 74bdd12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions gcft_ui/bunfoe_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion gclib

0 comments on commit 74bdd12

Please sign in to comment.