Skip to content

Commit 20a042d

Browse files
committed
Fix an issue related to character events
This commits fix an issue related to selected portrait not being assigned when you change the portrait in the event.
1 parent 0ce77fb commit 20a042d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

addons/textalog/events/inspector.gd

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ class EditorPropertyPortraits extends EditorProperty:
418418
var options:OptionButton
419419

420420
func _option_selected(option:int) -> void:
421-
pass
421+
var value = options.get_item_metadata(option)
422+
emit_changed(get_edited_property(), value)
422423

423424

424425
func _set_read_only(value:bool) -> void:
@@ -459,15 +460,12 @@ class EditorPropertyPortraits extends EditorProperty:
459460
current_value += 1
460461

461462

462-
func set_option_button_clip(enable:bool) -> void:
463-
pass
464-
465-
466463
func _init() -> void:
467464
options = OptionButton.new()
468465
options.flat = true
469466
options.clip_text = true
470467
options.expand_icon = true
468+
options.connect("item_selected", self, "_option_selected")
471469
var _options_popup:PopupMenu = options.get_popup()
472470
_options_popup.allow_search = true
473471
add_child(options)

0 commit comments

Comments
 (0)