Added survival mechanic that consumes inventory items if needed.

This commit is contained in:
2026-05-09 12:22:04 +02:00
parent 8a79a3474e
commit 9f32152fb8
11 changed files with 356 additions and 25 deletions
+32 -1
View File
@@ -18,6 +18,7 @@
[ext_resource type="Script" uid="uid://drscsrkfphpy7" path="res://Scripts/UI/Research/ResearchList.cs" id="12_4q8tf"]
[ext_resource type="Texture2D" uid="uid://dt84awx33mulb" path="res://Assets/Images/ResearchSymbol.png" id="13_alh3a"]
[ext_resource type="Texture2D" uid="uid://bmcpkt6mae2qi" path="res://Assets/Images/AlarmSign.png" id="13_x3xnh"]
[ext_resource type="Texture2D" path="res://Assets/Images/Resources/MushroomSymbol.png" id="14_food"]
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_u44n3"]
@@ -67,7 +68,7 @@ environment = SubResource("Environment_sb48q")
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1558432386]
follow_viewport_enabled = true
[node name="UIHandler" type="Control" parent="CanvasLayer" unique_id=1713248285 node_paths=PackedStringArray("codingWindow", "robotList", "mainCam", "map", "FPS", "RAM", "options", "uiContent", "menu", "inventory", "researchList", "robotAlarm")]
[node name="UIHandler" type="Control" parent="CanvasLayer" unique_id=1713248285 node_paths=PackedStringArray("codingWindow", "robotList", "mainCam", "map", "FPS", "RAM", "options", "uiContent", "menu", "inventory", "researchList", "robotAlarm", "energyLabel", "waterLabel", "hungerLabel", "survivalStatus")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@@ -91,6 +92,10 @@ menu = NodePath("MainUI/Content/Menu")
inventory = NodePath("MainUI/Content/Inventory")
researchList = NodePath("MainUI/Content/Research")
robotAlarm = NodePath("MainUI/FooterContainer/HBoxContainer/RobotAlarm")
energyLabel = NodePath("MainUI/HeaderContainer/VBoxContainer/RowEnergy/RichTextLabel")
waterLabel = NodePath("MainUI/HeaderContainer/VBoxContainer/RowWater/RichTextLabel")
hungerLabel = NodePath("MainUI/HeaderContainer/VBoxContainer/RowHunger/RichTextLabel")
survivalStatus = NodePath("MainUI/HeaderContainer/VBoxContainer/SurvivalStatus")
[node name="MainUI" type="VBoxContainer" parent="CanvasLayer/UIHandler" unique_id=1437975209]
layout_mode = 1
@@ -141,6 +146,32 @@ autowrap_mode = 0
horizontal_alignment = 1
vertical_alignment = 1
[node name="RowHunger" type="HBoxContainer" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer/RowHunger"]
layout_mode = 2
texture = ExtResource("14_food")
expand_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer/RowHunger"]
layout_mode = 2
size_flags_horizontal = 3
text = "Food: 100/100"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
vertical_alignment = 1
[node name="SurvivalStatus" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Survival stable"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
vertical_alignment = 1
[node name="Content" type="Control" parent="CanvasLayer/UIHandler/MainUI" unique_id=45665557]
layout_mode = 2
size_flags_vertical = 3