🔧 Settings, Maps and Environments management

This commit is contained in:
anyreso 2024-04-28 06:15:19 +00:00
parent 31e6c0910a
commit 5d896e1dd3
31 changed files with 1917 additions and 381 deletions

View file

@ -4,7 +4,21 @@
[ext_resource type="StyleBox" uid="uid://bq7rjpm38pao7" path="res://interfaces/hud/vitals/health_foreground.tres" id="2_6ejsl"]
[sub_resource type="GDScript" id="GDScript_2vxif"]
script/source = "class_name HUD extends CanvasLayer
script/source = "# This file is part of open-fpsz.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
class_name HUD extends CanvasLayer
@export_category(\"Vitals\")
@export var _health_bar : ProgressBar
@ -39,15 +53,15 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta : float) -> void:
var velocity_xz : Vector3 = player.linear_velocity
velocity_xz.y = 0
text = \"\"
text += \"fps: %s\\n\" % str(Engine.get_frames_per_second())
text += \"fps: %d (%.2f mspf)\\n\" % [Engine.get_frames_per_second(), 1000.0 / Engine.get_frames_per_second()]
text += \"position: %d, %d, %d\\n\" % [player.position.x, player.position.y, player.position.z]
text += \"speed: %d km/h\\n\" % (player.linear_velocity.length() * 3.6)
var velocity_xz := Vector3(player.linear_velocity.x, 0., player.linear_velocity.z)
text += \"speed_xz: %d km/h\\n\" % (velocity_xz.length() * 3.6)
var viewport_render_size : Vector2i = get_viewport().size * get_viewport().scaling_3d_scale
text += \"3D viewport resolution: %d × %d (%d%%)\\n\" \\
% [viewport_render_size.x, viewport_render_size.y, round(get_viewport().scaling_3d_scale * 100)]
"
[sub_resource type="Shader" id="Shader_gaah5"]

File diff suppressed because it is too large Load diff