hide hud on pause and dead camera

This commit is contained in:
derek
2024-10-31 15:20:49 -05:00
parent 1b55bb993d
commit ec63e57c62
8 changed files with 104 additions and 55 deletions

View File

@@ -37,6 +37,7 @@ var last_hit : Node
var respawn_position
var respawn_cam_rotation
var respawn_rot
var engine_time_scale_cache : float = 1.0
# Called when the node enters the scene tree for the first time.
func _ready():
@@ -144,6 +145,8 @@ func die():
get_tree().get_root().add_child(instance_dead)
instance_dead.camera.current = true
player.dead = true
player.crt_filter.visible = true
player.toggle_hud()
player.gun.visible = false
player.crosshair.visible = false
@@ -157,14 +160,15 @@ func pickup_spawn():
func pause_menu():
if paused:
Engine.time_scale = 1
Engine.time_scale = engine_time_scale_cache
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
player.crosshair.visible = true
player.toggle_hud()
player.pause_menu.hide()
else:
engine_time_scale_cache = Engine.time_scale
Engine.time_scale = 0
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
player.crosshair.visible = false
player.toggle_hud()
player.pause_menu.show()
paused = !paused