#24 et #21 ajout d'une plante générique, et d'un cycle de recharge du robot avec croissance des plantes

This commit is contained in:
2025-08-18 10:17:34 +02:00
parent 25d81d57a5
commit b164141d00
32 changed files with 514 additions and 97 deletions

View File

@@ -3,11 +3,8 @@
[ext_resource type="Script" uid="uid://bpqh8n0lbluf8" path="res://gui/player_info/scripts/player_info.gd" id="1_ghu0s"]
[ext_resource type="Texture2D" uid="uid://cm3ehinvvj52i" path="res://gui/player_info/assets/texture/Interface sans boutons.png" id="2_cgy6f"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://gui/player_info/assets/icons/bolt.svg" id="3_s4ggy"]
[ext_resource type="FontFile" uid="uid://byyfovm1ha5ya" path="res://gui/ressources/fonts/AtomicMd-3zXDZ.ttf" id="4_5y5ny"]
[sub_resource type="LabelSettings" id="LabelSettings_bye71"]
font = ExtResource("4_5y5ny")
font_size = 25
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="4_cgy6f"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/default_label_settings.tres" id="5_s4ggy"]
[node name="PlayerInfo" type="Control"]
custom_minimum_size = Vector2(337, 160)
@@ -56,7 +53,8 @@ stretch_mode = 5
[node name="Label" type="Label" parent="EnergyInfo"]
layout_mode = 2
theme = ExtResource("4_cgy6f")
text = "0"
label_settings = SubResource("LabelSettings_bye71")
label_settings = ExtResource("5_s4ggy")
horizontal_alignment = 1
vertical_alignment = 1

View File

@@ -0,0 +1,7 @@
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://dqwayi8yjwau2"]
[ext_resource type="FontFile" uid="uid://byyfovm1ha5ya" path="res://gui/ressources/fonts/AtomicMd-3zXDZ.ttf" id="1_w0wva"]
[resource]
font = ExtResource("1_w0wva")
font_size = 25

View File

@@ -0,0 +1,50 @@
[gd_resource type="Theme" load_steps=5 format=3 uid="uid://bgcmd213j6gk1"]
[ext_resource type="FontFile" uid="uid://byyfovm1ha5ya" path="res://gui/ressources/fonts/AtomicMd-3zXDZ.ttf" id="1_hv6r3"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hv6r3"]
bg_color = Color(0.976471, 0.741176, 0.4, 1)
border_width_left = 10
border_width_top = 10
border_width_right = 10
border_width_bottom = 10
border_color = Color(0.975367, 0.740445, 0.401877, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y48f0"]
bg_color = Color(0.886275, 0.623529, 0.196078, 1)
border_width_left = 10
border_width_top = 10
border_width_right = 10
border_width_bottom = 10
border_color = Color(0.886275, 0.623529, 0.196078, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_st1o2"]
bg_color = Color(0.692349, 0.477218, 0.112321, 1)
border_width_left = 10
border_width_top = 10
border_width_right = 10
border_width_bottom = 10
border_color = Color(0.694118, 0.478431, 0.113725, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[resource]
Button/font_sizes/font_size = 25
Button/fonts/font = ExtResource("1_hv6r3")
Button/styles/hover = SubResource("StyleBoxFlat_hv6r3")
Button/styles/normal = SubResource("StyleBoxFlat_y48f0")
Button/styles/pressed = SubResource("StyleBoxFlat_st1o2")
MarginContainer/constants/margin_bottom = 10
MarginContainer/constants/margin_left = 10
MarginContainer/constants/margin_right = 10
MarginContainer/constants/margin_top = 10

View File

@@ -1,7 +1,62 @@
[gd_scene load_steps=3 format=3 uid="uid://12nak7amd1uq"]
[gd_scene load_steps=10 format=3 uid="uid://12nak7amd1uq"]
[ext_resource type="PackedScene" uid="uid://baqrmhsgqda6v" path="res://gui/player_info/player_info.tscn" id="1_8kw6x"]
[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"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://gui/player_info/assets/icons/bolt.svg" id="4_k4juk"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/default_label_settings.tres" id="4_ujg5r"]
[sub_resource type="Animation" id="Animation_k4juk"]
resource_name = "recharge_fade_in"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("RechargeFade:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
}
[sub_resource type="Animation" id="Animation_iyvkh"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("RechargeFade:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0, 0, 0, 0)]
}
[sub_resource type="Animation" id="Animation_fovlv"]
resource_name = "recharge_fade_out"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("RechargeFade:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.166667, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_n4kem"]
_data = {
&"RESET": SubResource("Animation_iyvkh"),
&"recharge_fade_in": SubResource("Animation_k4juk"),
&"recharge_fade_out": SubResource("Animation_fovlv")
}
[node name="RootGui" type="Control"]
layout_mode = 3
@@ -14,14 +69,59 @@ size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_udau0")
[node name="PlayerInfo" parent="." instance=ExtResource("1_8kw6x")]
[node name="GameAction" type="TextureButton" parent="."]
layout_mode = 1
anchors_preset = 0
anchor_right = 0.0
anchor_bottom = 0.0
offset_right = 337.0
offset_bottom = 160.0
grow_horizontal = 1
grow_vertical = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[connection signal="player_stats_updated" from="." to="PlayerInfo" method="_on_root_gui_player_stats_updated"]
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme = ExtResource("2_nq5i2")
[node name="PlayerInfo" parent="MarginContainer" instance=ExtResource("1_8kw6x")]
layout_mode = 2
[node name="DayPass" type="Button" parent="MarginContainer"]
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 8
focus_mode = 0
theme = ExtResource("2_nq5i2")
text = "Recharge"
icon = ExtResource("4_k4juk")
[node name="DayCount" type="Label" parent="MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 0
label_settings = ExtResource("4_ujg5r")
[node name="RechargeFade" type="ColorRect" parent="."]
physics_interpolation_mode = 0
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0, 0, 0, 0)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_n4kem")
}
[connection signal="player_stats_updated" from="." to="MarginContainer/PlayerInfo" method="_on_root_gui_player_stats_updated"]
[connection signal="button_down" from="GameAction" to="." method="_on_game_action_button_down"]
[connection signal="pressed" from="MarginContainer/DayPass" to="." method="_on_day_pass_pressed"]

View File

@@ -2,6 +2,26 @@ extends Control
class_name RootGui
signal player_stats_updated(player : Player)
signal game_click
signal day_pass_pressed
signal day_pass_proceed
signal day_pass_finished
func _on_player_player_stats_updated(player:Player):
emit_signal("player_stats_updated", player)
func _on_planet_planet_stats_updated(day:int):
$MarginContainer/DayCount.text = "Day " + str(day)
func _on_day_pass_pressed():
day_pass_pressed.emit()
$AnimationPlayer.play("recharge_fade_in")
await $AnimationPlayer.animation_finished
day_pass_proceed.emit()
$AnimationPlayer.play("recharge_fade_out")
await $AnimationPlayer.animation_finished
day_pass_finished.emit()
func _on_game_action_button_down():
game_click.emit()