Add a toggle button for the debug panel and clean up some comments

This commit is contained in:
2024-07-23 19:05:26 -07:00
parent 7009032757
commit 6c719b52cc
2 changed files with 12 additions and 5 deletions

View File

@ -45,12 +45,12 @@ extends CharacterBody3D
@export var RIGHT : String = "ui_right"
@export var FORWARD : String = "ui_up"
@export var BACKWARD : String = "ui_down"
## By default this does not pause the game, but that can be set in _process.
## By default this does not pause the game, but that can be changed in _process.
@export var PAUSE : String = "ui_cancel"
@export var CROUCH : String = "crouch"
@export var SPRINT : String = "sprint"
# Uncomment if you want full controller support
# Uncomment if you want controller support
#@export var controller_sensitivity : float = 0.035
#@export var LOOK_LEFT : String = "look_left"
#@export var LOOK_RIGHT : String = "look_right"
@ -375,7 +375,13 @@ func _process(delta):
#get_tree().paused = false
func _unhandled_input(event):
func _unhandled_input(event : InputEvent):
if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
mouseInput.x += event.relative.x
mouseInput.y += event.relative.y
# Toggle debug menu
elif event is InputEventKey:
if event.is_released():
# Where we're going, we don't need InputMap
if event.keycode == 4194338: # F7
$UserInterface/DebugPanel.visible = !$UserInterface/DebugPanel.visible