Skip to content

Commit

Permalink
Check on existence of signals before binding (mbrlabs#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrApplejuice authored Jul 11, 2022
1 parent b017256 commit 85b65a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lorien/UI/Dialogs/KeyBindingsList.gd
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ func _new_keybinding_entry(action_name: String, readable_name: String, events: A
new_line.remove_child(child)
_grid.add_child(child)

child.connect("modified_binding", self, "_modify_keybinding", [action_name])
child.connect("bind_new_key", self, "_bind_new_key", [action_name])
if child.has_signal("modified_binding"):
child.connect("modified_binding", self, "_modify_keybinding", [action_name])
if child.has_signal("bind_new_key"):
child.connect("bind_new_key", self, "_bind_new_key", [action_name])

# -------------------------------------------------------------------------------------------------
func _modify_keybinding(bindings_data: Dictionary, action_name: String) -> void:
Expand Down

0 comments on commit 85b65a8

Please sign in to comment.