fix most of the script errors and warnings, fixed a couple tiny bugs in the process :)
This commit is contained in:
parent
9435089f21
commit
72733db609
23 changed files with 55 additions and 63 deletions
|
@ -22,15 +22,15 @@ func _init() -> void:
|
|||
|
||||
|
||||
func get_key(action: String) -> int:
|
||||
var scancode = cfg.get_value(action, "keyboard")
|
||||
if scancode == null:
|
||||
var scancode = cfg.get_value(action, "keyboard", -1)
|
||||
if scancode == -1:
|
||||
scancode = _get_default_key(action)
|
||||
return scancode
|
||||
|
||||
|
||||
func get_button(action: String) -> int:
|
||||
var button_index = cfg.get_value(action, "gamepad")
|
||||
if button_index == null:
|
||||
var button_index = cfg.get_value(action, "gamepad", -1)
|
||||
if button_index == -1:
|
||||
button_index = _get_default_button(action)
|
||||
return button_index
|
||||
|
||||
|
@ -58,8 +58,8 @@ func _apply_saved_bindings() -> void:
|
|||
|
||||
|
||||
func _configure_action_key(action: String) -> void:
|
||||
var scancode = cfg.get_value(action, "keyboard")
|
||||
if scancode == null:
|
||||
var scancode = cfg.get_value(action, "keyboard", -1)
|
||||
if scancode == -1:
|
||||
scancode = _get_default_key(action)
|
||||
_apply_action_key(action, scancode)
|
||||
var linked_action = LINKED_ACTIONS.get(action)
|
||||
|
@ -68,8 +68,8 @@ func _configure_action_key(action: String) -> void:
|
|||
|
||||
|
||||
func _configure_action_button(action: String) -> void:
|
||||
var button_index = cfg.get_value(action, "gamepad")
|
||||
if button_index == null:
|
||||
var button_index = cfg.get_value(action, "gamepad", -1)
|
||||
if button_index == -1:
|
||||
button_index = _get_default_button(action)
|
||||
_apply_action_button(action, button_index)
|
||||
var linked_action = LINKED_ACTIONS.get(action)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue