mirror of
https://gitlab.com/open-fpsz/open-fpsz.git
synced 2026-01-19 19:44:46 +00:00
205 lines
7.4 KiB
Plaintext
205 lines
7.4 KiB
Plaintext
[gd_scene load_steps=13 format=3 uid="uid://bcv81ku26xo"]
|
||
|
||
[ext_resource type="Script" path="res://interfaces/hud/timer_label.gd" id="1_6qrx6"]
|
||
[ext_resource type="StyleBox" uid="uid://dcn1ll2ra4lwn" path="res://interfaces/hud/vitals/background.tres" id="1_gmv44"]
|
||
[ext_resource type="Script" path="res://interfaces/hud/hud.gd" id="1_yev76"]
|
||
[ext_resource type="StyleBox" uid="uid://bq7rjpm38pao7" path="res://interfaces/hud/vitals/health_foreground.tres" id="2_6ejsl"]
|
||
[ext_resource type="Theme" uid="uid://bec7g0fax3c8o" path="res://interfaces/global_theme.tres" id="2_gbqw5"]
|
||
[ext_resource type="Texture2D" uid="uid://1mwcg0cd0msw" path="res://interfaces/hud/throw_force_texture.svg" id="6_rrus8"]
|
||
|
||
[sub_resource type="Shader" id="Shader_gaah5"]
|
||
code = "shader_type canvas_item;
|
||
|
||
uniform vec4 color : source_color;
|
||
|
||
float circle(vec2 pos, float radius, float feather) {
|
||
return smoothstep(radius, radius - feather, length(pos - vec2(.5)));
|
||
}
|
||
|
||
void fragment() {
|
||
// draw reticle
|
||
float alpha = circle(UV, .5, .04);
|
||
COLOR = vec4(texture(TEXTURE, UV).rgb, alpha);
|
||
}"
|
||
|
||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_7blp5"]
|
||
shader = SubResource("Shader_gaah5")
|
||
shader_parameter/color = Color(1, 1, 1, 1)
|
||
|
||
[sub_resource type="SystemFont" id="SystemFont_oo638"]
|
||
subpixel_positioning = 0
|
||
|
||
[sub_resource type="GDScript" id="GDScript_w8l21"]
|
||
script/source = "extends Label
|
||
|
||
@onready var player : Player = owner.get_parent()
|
||
|
||
# Called when the node enters the scene tree for the first time.
|
||
func _ready() -> void:
|
||
if not OS.is_debug_build():
|
||
queue_free()
|
||
|
||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
func _process(_delta : float) -> void:
|
||
text = \"\"
|
||
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)]
|
||
text += \"health: %d\\n\" % player.health.value
|
||
text += \"energy: %d\" % player.energy
|
||
"
|
||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_f23s3"]
|
||
bg_color = Color(0.0901961, 0.87451, 0.760784, 0.65098)
|
||
corner_radius_top_left = 3
|
||
corner_radius_top_right = 3
|
||
corner_radius_bottom_right = 3
|
||
corner_radius_bottom_left = 3
|
||
anti_aliasing = false
|
||
|
||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_2pxd4"]
|
||
properties/0/path = NodePath("MarginContainer/Multiplayer/TimerLabel:text")
|
||
properties/0/spawn = true
|
||
properties/0/replication_mode = 2
|
||
properties/1/path = NodePath("MarginContainer/Multiplayer/ObjectiveLabel:visible")
|
||
properties/1/spawn = true
|
||
properties/1/replication_mode = 2
|
||
|
||
[node name="HUD" type="CanvasLayer" node_paths=PackedStringArray("health_bar", "energy_bar", "timer_label", "objective_label", "debug_label", "ammo_label", "throw_progress")]
|
||
script = ExtResource("1_yev76")
|
||
health_bar = NodePath("MarginContainer/HBoxContainer/VBoxContainer/HealthBar")
|
||
energy_bar = NodePath("MarginContainer/HBoxContainer/VBoxContainer/EnergyBar")
|
||
timer_label = NodePath("MarginContainer/Multiplayer/TimerLabel")
|
||
objective_label = NodePath("MarginContainer/Multiplayer/ObjectiveLabel")
|
||
debug_label = NodePath("MarginContainer/DebugLabel")
|
||
ammo_label = NodePath("MarginContainer/HBoxContainer/HBoxContainer/AmmoLabel")
|
||
throw_progress = NodePath("MarginContainer/CenterContainer/TextureProgressBar")
|
||
|
||
[node name="Reticle" type="ColorRect" parent="."]
|
||
material = SubResource("ShaderMaterial_7blp5")
|
||
anchors_preset = 8
|
||
anchor_left = 0.5
|
||
anchor_top = 0.5
|
||
anchor_right = 0.5
|
||
anchor_bottom = 0.5
|
||
offset_left = -1.5
|
||
offset_top = -1.5
|
||
offset_right = 1.5
|
||
offset_bottom = 1.5
|
||
grow_horizontal = 2
|
||
grow_vertical = 2
|
||
mouse_filter = 2
|
||
|
||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||
anchors_preset = 15
|
||
anchor_right = 1.0
|
||
anchor_bottom = 1.0
|
||
grow_horizontal = 2
|
||
grow_vertical = 2
|
||
theme = ExtResource("2_gbqw5")
|
||
theme_override_constants/margin_left = 24
|
||
theme_override_constants/margin_top = 24
|
||
theme_override_constants/margin_right = 24
|
||
theme_override_constants/margin_bottom = 24
|
||
|
||
[node name="Multiplayer" type="VBoxContainer" parent="MarginContainer"]
|
||
layout_mode = 2
|
||
|
||
[node name="TimerLabel" type="Label" parent="MarginContainer/Multiplayer"]
|
||
layout_mode = 2
|
||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||
theme_override_font_sizes/font_size = 22
|
||
text = "Warmup"
|
||
horizontal_alignment = 1
|
||
script = ExtResource("1_6qrx6")
|
||
|
||
[node name="ObjectiveLabel" type="Label" parent="MarginContainer/Multiplayer"]
|
||
visible = false
|
||
layout_mode = 2
|
||
theme_override_colors/font_color = Color(1, 0.75, 0, 1)
|
||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.5)
|
||
theme_override_font_sizes/font_size = 24
|
||
text = "YOU ARE THE RABBIT"
|
||
horizontal_alignment = 1
|
||
uppercase = true
|
||
|
||
[node name="DebugLabel" type="Label" parent="MarginContainer"]
|
||
layout_mode = 2
|
||
size_flags_vertical = 0
|
||
theme_override_fonts/font = SubResource("SystemFont_oo638")
|
||
script = SubResource("GDScript_w8l21")
|
||
|
||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
|
||
layout_mode = 2
|
||
size_flags_horizontal = 3
|
||
size_flags_vertical = 10
|
||
|
||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
|
||
layout_mode = 2
|
||
size_flags_horizontal = 3
|
||
size_flags_vertical = 8
|
||
size_flags_stretch_ratio = 0.2
|
||
theme_override_constants/separation = 6
|
||
|
||
[node name="HealthBar" type="ProgressBar" parent="MarginContainer/HBoxContainer/VBoxContainer"]
|
||
custom_minimum_size = Vector2(0, 8)
|
||
layout_mode = 2
|
||
mouse_filter = 2
|
||
theme_override_styles/background = ExtResource("1_gmv44")
|
||
theme_override_styles/fill = ExtResource("2_6ejsl")
|
||
max_value = 255.0
|
||
step = 1.0
|
||
value = 255.0
|
||
show_percentage = false
|
||
|
||
[node name="EnergyBar" type="ProgressBar" parent="MarginContainer/HBoxContainer/VBoxContainer"]
|
||
custom_minimum_size = Vector2(0, 8)
|
||
layout_mode = 2
|
||
mouse_filter = 2
|
||
theme_override_styles/background = ExtResource("1_gmv44")
|
||
theme_override_styles/fill = SubResource("StyleBoxFlat_f23s3")
|
||
value = 100.0
|
||
show_percentage = false
|
||
|
||
[node name="Spacer" type="Control" parent="MarginContainer/HBoxContainer"]
|
||
layout_mode = 2
|
||
size_flags_horizontal = 3
|
||
size_flags_stretch_ratio = 0.6
|
||
|
||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer"]
|
||
layout_mode = 2
|
||
size_flags_horizontal = 3
|
||
size_flags_stretch_ratio = 0.2
|
||
|
||
[node name="AmmoLabel" type="Label" parent="MarginContainer/HBoxContainer/HBoxContainer"]
|
||
layout_mode = 2
|
||
size_flags_horizontal = 3
|
||
theme_override_font_sizes/font_size = 20
|
||
text = "24
|
||
"
|
||
horizontal_alignment = 2
|
||
vertical_alignment = 1
|
||
|
||
[node name="CenterContainer" type="CenterContainer" parent="MarginContainer"]
|
||
layout_mode = 2
|
||
|
||
[node name="TextureProgressBar" type="TextureProgressBar" parent="MarginContainer/CenterContainer"]
|
||
visible = false
|
||
layout_mode = 2
|
||
value = 100.0
|
||
fill_mode = 4
|
||
radial_initial_angle = 293.0
|
||
radial_fill_degrees = 135.0
|
||
texture_progress = ExtResource("6_rrus8")
|
||
|
||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
||
replication_interval = 0.1
|
||
replication_config = SubResource("SceneReplicationConfig_2pxd4")
|
||
|
||
[node name="CenterContainer" type="CenterContainer" parent="."]
|