Skip to content

Commit a664150

Browse files
authored
Merge pull request #402 from Maaack/fixes-input-remapping-not-enabling-options
Fixes next button in input remapping not updating disabled state
2 parents 896110c + e07b938 commit a664150

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

addons/maaacks_game_template/base/nodes/menus/options_menu/input/input_actions_list.gd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ func _get_button_by_action(action_name : String, action_group : int) -> Button:
135135
return action_button_map[key_string]
136136
return null
137137

138-
func _update_next_button_disabled_state(action_name : String, action_group : int) -> void:
139-
var button = _get_button_by_action(action_name, action_group)
138+
func _update_next_button_disabled_state(action_name : String, action_group : int, disabled: bool = false) -> void:
139+
var button = _get_button_by_action(action_name, action_group + 1)
140140
if button:
141-
button.disabled = false
141+
button.disabled = disabled
142142

143143
func _update_assigned_inputs_and_button(action_name : String, action_group : int, input_event : InputEvent) -> void:
144144
var new_readable_input_name = InputEventHelper.get_text(input_event)
@@ -313,9 +313,11 @@ func _refresh_ui_list_button_content() -> void:
313313
var group_iter : int = 0
314314
for input_event in input_events:
315315
_update_assigned_inputs_and_button(action_name, group_iter, input_event)
316+
_update_next_button_disabled_state(action_name, group_iter)
316317
group_iter += 1
317318
while group_iter < action_groups:
318319
_clear_button(action_name, group_iter)
320+
_update_next_button_disabled_state(action_name, group_iter, true)
319321
group_iter += 1
320322

321323
func _set_action_box_container_size() -> void:

0 commit comments

Comments
 (0)