Skip to content

Commit

Permalink
Add a toggle button for the debug panel and clean up some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Zakarya committed Jul 24, 2024
1 parent 7009032 commit 6c719b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 9 additions & 3 deletions addons/fpc/character.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
5 changes: 3 additions & 2 deletions addons/fpc/character.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,15 @@ libraries = {
}

[node name="Head" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
transform = Transform3D(-0.730162, 0, -0.683274, 0, 1, 0, 0.683274, 0, -0.730162, 0, 1.5, 0)

[node name="Camera" type="Camera3D" parent="Head"]

[node name="HeadbobAnimation" type="AnimationPlayer" parent="Head"]
libraries = {
"": SubResource("AnimationLibrary_o0unb")
}
blend_times = [&"RESET", &"RESET", 0.5, &"RESET", &"walk", 0.5, &"walk", &"RESET", 0.5]
blend_times = [&"walk", &"RESET", 0.5, &"RESET", &"walk", 0.5, &"RESET", &"RESET", 0.5]

[node name="JumpAnimation" type="AnimationPlayer" parent="Head"]
libraries = {
Expand Down Expand Up @@ -423,3 +423,4 @@ target_position = Vector3(0, 0.5, 0)

[node name="EditorModule" type="Node" parent="."]
script = ExtResource("3_v3ckk")
head_y_rotation = -136.9

0 comments on commit 6c719b5

Please sign in to comment.