Skip to content

Commit

Permalink
Merge pull request #9 from ARPGLTD/FixInvertAxis
Browse files Browse the repository at this point in the history
Reload config after resuming from pause
  • Loading branch information
Phazorknight authored Jan 1, 2024
2 parents c497d26 + b89268b commit 8e2bea1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions COGITO/Scripts/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ func _ready():
randomize()

Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
config = load(OptionsConstants.config_file_name)
if config != null:
INVERT_Y_AXIS = config.get_value(OptionsConstants.section_name, OptionsConstants.invert_vertical_axis_key, true)


if pause_menu:
get_node(pause_menu).close_pause_menu()
else:
Expand Down Expand Up @@ -173,9 +170,15 @@ func _on_resume_movement():
is_movement_paused = false
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

# reload options user may have changed while paused.
func _reload_options():
var err = config.load(OptionsConstants.config_file_name)
if err == 0:
INVERT_Y_AXIS = config.get_value(OptionsConstants.section_name, OptionsConstants.invert_vertical_axis_key, true)

# Signal from Pause Menu
func _on_pause_menu_resume():
_reload_options()
_on_resume_movement()

# Signal from Inventory
Expand Down

0 comments on commit 8e2bea1

Please sign in to comment.