generated from krampus/template-godot4
Screen rumble stops on pause
This commit is contained in:
parent
682850738a
commit
960ff79b34
|
@ -63,6 +63,8 @@ config/accessibility/enable_hit_lag=true
|
|||
|
||||
WorldGroup="Singleton group for the active world instance, if any."
|
||||
GameGroup="Singleton group for the active game instance, if any."
|
||||
DemoCamera=""
|
||||
PlayerSpawn=""
|
||||
|
||||
[gui]
|
||||
|
||||
|
|
|
@ -162,6 +162,7 @@ libraries = {
|
|||
|
||||
[node name="Rumbler" type="Control" parent="RootControl"]
|
||||
unique_name_in_owner = true
|
||||
process_mode = 1
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
|
|
|
@ -234,6 +234,9 @@ unique_name_in_owner = true
|
|||
[node name="GfolfGirl" parent="PlayerPivot" instance=ExtResource("3_e4aur")]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -0.555968, 0, 0.0999683)
|
||||
|
||||
[node name="DemoCamera" type="Camera3D" parent="PlayerPivot" groups=["DemoCamera"]]
|
||||
transform = Transform3D(-0.124487, 0.584637, 0.801687, 0, 0.807972, -0.589221, -0.992221, -0.0733503, -0.100582, 0.395614, 0.0284514, -0.0394773)
|
||||
|
||||
[node name="Direction" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ func _reset_position() -> void:
|
|||
func _process(_delta: float) -> void:
|
||||
if _hit_lag_frames >= 0:
|
||||
if _hit_lag_frames == 0:
|
||||
content.process_mode = Node.PROCESS_MODE_INHERIT
|
||||
get_tree().paused = false
|
||||
else:
|
||||
content.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
get_tree().paused = true
|
||||
_hit_lag_frames -= 1
|
||||
|
|
|
@ -6,15 +6,18 @@ extends Control
|
|||
|
||||
|
||||
func _ready() -> void:
|
||||
print_debug("Pause menu _ready()")
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
print_debug("Pause menu _exit_tree()")
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
|
||||
func _unhandled_key_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("pause"):
|
||||
get_viewport().set_input_as_handled()
|
||||
resume()
|
||||
|
||||
|
||||
|
@ -27,6 +30,7 @@ func _hide() -> void:
|
|||
|
||||
|
||||
func resume() -> void:
|
||||
print_debug("Pause menu resume()")
|
||||
queue_free()
|
||||
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ var _prev_camera: Camera3D
|
|||
|
||||
func _unhandled_key_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("pause"):
|
||||
get_viewport().set_input_as_handled()
|
||||
pause()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue