feat: pause menu is just now menu and does not pause
This commit is contained in:
@@ -149,6 +149,6 @@ func apply_video_settings() -> void:
|
|||||||
var screen_size = DisplayServer.screen_get_size(screen)
|
var screen_size = DisplayServer.screen_get_size(screen)
|
||||||
var window_size = DisplayServer.window_get_size()
|
var window_size = DisplayServer.window_get_size()
|
||||||
# Simple centering heuristic
|
# Simple centering heuristic
|
||||||
DisplayServer.window_set_position((screen_size - window_size) / 2)
|
DisplayServer.window_set_position(Vector2i((screen_size - window_size) / 2.0))
|
||||||
|
|
||||||
Engine.max_fps = fps_cap
|
Engine.max_fps = fps_cap
|
||||||
|
|||||||
+1
-3
@@ -66,13 +66,11 @@ func _input(event: InputEvent) -> void:
|
|||||||
|
|
||||||
func _pause() -> void:
|
func _pause() -> void:
|
||||||
visible = true
|
visible = true
|
||||||
get_tree().paused = true
|
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
_show_main_menu()
|
_show_main_menu()
|
||||||
|
|
||||||
func _resume() -> void:
|
func _resume() -> void:
|
||||||
visible = false
|
visible = false
|
||||||
get_tree().paused = false
|
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||||
|
|
||||||
func _respawn() -> void:
|
func _respawn() -> void:
|
||||||
@@ -95,7 +93,7 @@ func _build_ui() -> void:
|
|||||||
main_center.add_child(main_vbox)
|
main_center.add_child(main_vbox)
|
||||||
|
|
||||||
var title = Label.new()
|
var title = Label.new()
|
||||||
title.text = "PAUSED"
|
title.text = "MENU"
|
||||||
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||||
title.add_theme_font_size_override("font_size", 48)
|
title.add_theme_font_size_override("font_size", 48)
|
||||||
main_vbox.add_child(title)
|
main_vbox.add_child(title)
|
||||||
|
|||||||
Reference in New Issue
Block a user