generated from krampus/template-godot4
Placeholder UI elements for grunk alert
This commit is contained in:
parent
229b3f8f7e
commit
4f6789f5c6
@ -1,6 +1,10 @@
|
||||
[gd_resource type="Theme" format=3 uid="uid://b07fevr214mmr"]
|
||||
|
||||
[resource]
|
||||
AlertLabel/base_type = &"Label"
|
||||
AlertLabel/colors/font_color = Color(1, 0, 0, 1)
|
||||
AlertLabel/colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
AlertLabel/font_sizes/font_size = 64
|
||||
Label/colors/font_color = Color(1, 1, 1, 1)
|
||||
Label/colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
Label/constants/outline_size = 16
|
||||
|
@ -8,6 +8,12 @@ const COLOR_INVISIBLE := Color("#ffffff00")
|
||||
|
||||
@onready var interact_hud: Control = %InteractHUD
|
||||
|
||||
@onready var alert_player: AnimationPlayer = %AlertPlayer
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
Game.manager.alert_raised.connect(_on_raise_alert)
|
||||
|
||||
|
||||
func _transition_color(element: CanvasItem, color: Color) -> void:
|
||||
create_tween().tween_property(element, "modulate", color, TRANSITION_TIME).set_trans(
|
||||
@ -35,3 +41,7 @@ func select_interactive(prop: Interactive) -> void:
|
||||
_to_disabled(interact_hud)
|
||||
else:
|
||||
_to_invisible(interact_hud)
|
||||
|
||||
|
||||
func _on_raise_alert(_new_value: int) -> void:
|
||||
alert_player.play("grunk_alert")
|
||||
|
@ -1,9 +1,71 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dq1x21tq06dud"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dq1x21tq06dud"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://b07fevr214mmr" path="res://src/ui/hud/hud_theme.tres" id="1_lirk3"]
|
||||
[ext_resource type="Script" uid="uid://lrsv0185bfu" path="res://src/ui/hud/player_hud.gd" id="2_j6lpx"]
|
||||
[ext_resource type="PackedScene" uid="uid://cq8qcp5xg41e0" path="res://src/ui/hud/grunk_counter/grunk_counter.tscn" id="3_5be8f"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_5be8f"]
|
||||
resource_name = "grunk_alert"
|
||||
length = 4.0
|
||||
step = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("GrunkAlert:modulate")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("GrunkAlert2:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 1.6, 2.2, 2.8, 3.4, 4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_n6jee"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("GrunkAlert:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("GrunkAlert2:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ud8na"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_n6jee"),
|
||||
&"grunk_alert": SubResource("Animation_5be8f")
|
||||
}
|
||||
|
||||
[node name="PlayerHUD" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
@ -47,6 +109,57 @@ grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
text = "Press [E] to use"
|
||||
|
||||
[node name="AlertHUD" type="Control" parent="."]
|
||||
custom_minimum_size = Vector2(800, 600)
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="GrunkAlert" type="Label" parent="AlertHUD"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 45.0
|
||||
grow_horizontal = 2
|
||||
theme_type_variation = &"AlertLabel"
|
||||
text = "!! GRUNK ALERT !!"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="GrunkAlert2" type="Label" parent="AlertHUD"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 45.0
|
||||
grow_horizontal = 2
|
||||
theme_type_variation = &"AlertLabel"
|
||||
text = "GRUNK ALERT LEVEL INCREASING
|
||||
EXERCISE EXTREME CAUTION"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="AlertPlayer" type="AnimationPlayer" parent="AlertHUD"]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_ud8na")
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
|
@ -19,6 +19,21 @@ height = 0.3
|
||||
height = 0.3
|
||||
radius = 0.3
|
||||
|
||||
[sub_resource type="Animation" id="Animation_b6er8"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D:mesh:material:emission_energy_multiplier")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_piaxx"]
|
||||
resource_name = "trigger"
|
||||
length = 4.0
|
||||
@ -36,21 +51,6 @@ tracks/0/keys = {
|
||||
"values": [0.0, 4.0, 0.0, 4.0, 0.0, 4.0, 0.0, 4.0, 0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_b6er8"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D:mesh:material:emission_energy_multiplier")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_b6er8"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_b6er8"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user