This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=16 format=3 uid="uid://12nak7amd1uq"]
|
||||
[gd_scene load_steps=17 format=3 uid="uid://12nak7amd1uq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cqao7n800qy40" path="res://gui/scripts/root_gui.gd" id="1_udau0"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="2_nq5i2"]
|
||||
@@ -46,6 +46,18 @@ tracks/1/keys = {
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_left")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [-44.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_k4juk"]
|
||||
resource_name = "recharge_fade_in"
|
||||
@@ -101,9 +113,26 @@ tracks/1/keys = {
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_n4kem"]
|
||||
resource_name = "no_energy_left"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_left")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.0666667, 0.133333, 0.2, 0.266667, 0.333333, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [-44.0, -40.0, -44.0, -48.0, -44.0, -40.0, -44.0]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_n4kem"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_iyvkh"),
|
||||
&"no_energy_left": SubResource("Animation_n4kem"),
|
||||
&"recharge_fade_in": SubResource("Animation_k4juk"),
|
||||
&"recharge_fade_out": SubResource("Animation_fovlv")
|
||||
}
|
||||
@@ -155,6 +184,7 @@ expand_mode = 2
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="EnergyInfo" type="HBoxContainer" parent="MarginContainer/PlayerInfo"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.281899
|
||||
|
||||
@@ -8,6 +8,7 @@ signal day_pass_finished
|
||||
|
||||
func _on_player_updated(player:Player):
|
||||
%EnergyCount.text = str(player.energy)
|
||||
%EnergyInfo.modulate = Color.WHITE if player.energy > 0 else Color.RED
|
||||
|
||||
%AvailableActions/GetItem.visible = player.closest_interactable is ItemObject and player.inventory.get_item() == null
|
||||
%AvailableActions/SwapItem.visible = player.closest_interactable is ItemObject and player.inventory.get_item() != null
|
||||
@@ -38,3 +39,7 @@ func _on_game_action_button_down():
|
||||
func _on_planet_updated(planet:Planet):
|
||||
$MarginContainer/DayCount.text = "Day " + str(planet.day)
|
||||
%DecontaminationCoverage.text = str(roundi(planet.decontamination_coverage * 100)) + "%"
|
||||
|
||||
|
||||
func _on_player_action_tried_without_energy():
|
||||
$AnimationPlayer.play("no_energy_left")
|
||||
|
||||
Reference in New Issue
Block a user