forked from team-sg/hero-mark-2
pause on unfocused
This commit is contained in:
parent
0fadeb7998
commit
96b2b2a804
2 changed files with 18 additions and 0 deletions
|
@ -12,6 +12,14 @@ var time_bonus = true
|
|||
var life_bonus = true
|
||||
var collectible_bonus = false
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
match what:
|
||||
NOTIFICATION_WM_FOCUS_OUT:
|
||||
if Debug.entry == false and Game.can_pause and not get_tree().paused:
|
||||
var pause = PauseScreen.instance()
|
||||
pause.lore_entries = lore_entries
|
||||
get_parent().call_deferred("add_child", pause)
|
||||
|
||||
func _ready():
|
||||
get_tree().paused = true
|
||||
Game.can_pause = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue