Incorrect game unpause
Describe the bug Game unpauses if it was paused before the console was opened.
To Reproduce Steps to reproduce the behavior:
- Pause the game via code on startup.
- Open the console.
- Observe that the game was unpaused.
Expected behavior
Game pause state should never change when pause_if_input is false.
Desktop (please complete the following information):
- OS: Windows
Additional context
More specifically, this code in res://addons/panku_console/modules/interactive_shell/module.gd:
if _is_gui_open and pause_if_input:
_was_tree_paused = core.get_tree().paused
core.get_tree().paused = true
else:
if core.get_tree().paused:
core.get_tree().paused = _was_tree_paused
Never sets the correct value for _was_tree_paused because pause_if_input is always false. It should probably be something like this instead:
if pause_if_input:
if _is_gui_open:
_was_tree_paused = core.get_tree().paused
core.get_tree().paused = true
else:
if core.get_tree().paused:
core.get_tree().paused = _was_tree_paused
Sorry, I don't have time to create a PR or check for unintended side effects of that change at the moment.
Thanks for report, you solution seems good, no side effects I can see.