Added mechanic that the gate blocks switching to another layer, added map button, moved small parts to fit buttons.

This commit is contained in:
=
2026-05-02 20:08:18 +02:00
parent a2c35c44cb
commit 7f13505759
9 changed files with 111 additions and 67 deletions
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d068gyi3e48cv"
path="res://.godot/imported/MapSymbol.png-12998dcead6e19bcc0954353e168f273.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/MapSymbol.png"
dest_files=["res://.godot/imported/MapSymbol.png-12998dcead6e19bcc0954353e168f273.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
+48 -42
View File
@@ -10,6 +10,7 @@
[ext_resource type="Script" uid="uid://fegfbcnlk8p5" path="res://Scripts/WorldGeneration/Map.cs" id="8_bf53h"]
[ext_resource type="Texture2D" uid="uid://deuxffyhsrinn" path="res://Assets/EnergySymbol.png" id="9_71axn"]
[ext_resource type="Texture2D" uid="uid://dje86ro2e37xl" path="res://Assets/WaterSymbol.png" id="10_71axn"]
[ext_resource type="Texture2D" uid="uid://d068gyi3e48cv" path="res://Assets/MapSymbol.png" id="11_3cx6b"]
[ext_resource type="Texture2D" uid="uid://ban872p4eh4gi" path="res://Assets/RobotSymbol.png" id="11_dahhg"]
[ext_resource type="Texture2D" uid="uid://b77mo4fhklnja" path="res://Assets/OptionsSymbol.png" id="12_3so38"]
@@ -95,6 +96,43 @@ grow_vertical = 2
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_b2bpf")
[node name="VBoxContainer" type="HBoxContainer" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer" unique_id=536619770]
layout_mode = 2
[node name="RowEnergy" type="HBoxContainer" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer" unique_id=867560906]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer/RowEnergy" unique_id=1218525340]
layout_mode = 2
texture = ExtResource("9_71axn")
expand_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer/RowEnergy" unique_id=32920400]
layout_mode = 2
size_flags_horizontal = 3
text = "Energy: 100/100"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
vertical_alignment = 1
[node name="RowWater" type="HBoxContainer" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer" unique_id=465013052]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer/RowWater" unique_id=1398125603]
layout_mode = 2
texture = ExtResource("10_71axn")
expand_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer/RowWater" unique_id=1355787203]
layout_mode = 2
size_flags_horizontal = 3
text = "Water: 100/100"
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
@@ -315,48 +353,6 @@ text = "Exit"
visible = false
layout_mode = 1
[node name="Survival" type="PanelContainer" parent="CanvasLayer/UIHandler/MainUI/Content" unique_id=141921319]
layout_mode = 1
offset_right = 150.0
offset_bottom = 23.0
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/UIHandler/MainUI/Content/Survival" unique_id=1716446061]
layout_mode = 2
[node name="RowEnergy" type="HBoxContainer" parent="CanvasLayer/UIHandler/MainUI/Content/Survival/VBoxContainer" unique_id=867560906]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="CanvasLayer/UIHandler/MainUI/Content/Survival/VBoxContainer/RowEnergy" unique_id=1218525340]
layout_mode = 2
texture = ExtResource("9_71axn")
expand_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/Content/Survival/VBoxContainer/RowEnergy" unique_id=32920400]
layout_mode = 2
size_flags_horizontal = 3
text = "Energy: 100/100"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
vertical_alignment = 1
[node name="RowWater" type="HBoxContainer" parent="CanvasLayer/UIHandler/MainUI/Content/Survival/VBoxContainer" unique_id=465013052]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="CanvasLayer/UIHandler/MainUI/Content/Survival/VBoxContainer/RowWater" unique_id=1398125603]
layout_mode = 2
texture = ExtResource("10_71axn")
expand_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/Content/Survival/VBoxContainer/RowWater" unique_id=1355787203]
layout_mode = 2
size_flags_horizontal = 3
text = "Water: 100/100"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
vertical_alignment = 1
[node name="FooterContainer" type="PanelContainer" parent="CanvasLayer/UIHandler/MainUI" unique_id=1495029884]
layout_mode = 2
@@ -375,12 +371,19 @@ layout_mode = 2
fit_content = true
autowrap_mode = 0
[node name="Map" type="TextureButton" parent="CanvasLayer/UIHandler/MainUI/FooterContainer/HBoxContainer" unique_id=1320346210]
layout_mode = 2
tooltip_text = "Map (M)"
texture_normal = ExtResource("11_3cx6b")
[node name="Robots" type="TextureButton" parent="CanvasLayer/UIHandler/MainUI/FooterContainer/HBoxContainer" unique_id=1666653447]
layout_mode = 2
tooltip_text = "Robots (R)"
texture_normal = ExtResource("11_dahhg")
[node name="Options" type="TextureButton" parent="CanvasLayer/UIHandler/MainUI/FooterContainer/HBoxContainer" unique_id=1930105751]
layout_mode = 2
tooltip_text = "Menu (ESC)"
texture_normal = ExtResource("12_3so38")
[connection signal="button_up" from="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow/Buttons/Clear" to="CanvasLayer/UIHandler/MainUI/Content/CodingWindow" method="ClearWindow"]
@@ -388,3 +391,6 @@ texture_normal = ExtResource("12_3so38")
[connection signal="pressed" from="CanvasLayer/UIHandler/MainUI/Content/Menu/VBoxContainer/Button" to="CanvasLayer/UIHandler" method="HandleMenu"]
[connection signal="pressed" from="CanvasLayer/UIHandler/MainUI/Content/Menu/VBoxContainer/Button2" to="CanvasLayer/UIHandler" method="ShowOptions"]
[connection signal="pressed" from="CanvasLayer/UIHandler/MainUI/Content/Menu/VBoxContainer/Button3" to="CanvasLayer/UIHandler" method="ExitGame"]
[connection signal="pressed" from="CanvasLayer/UIHandler/MainUI/FooterContainer/HBoxContainer/Map" to="CanvasLayer/UIHandler/MainUI/Content/Map" method="ShowMap"]
[connection signal="pressed" from="CanvasLayer/UIHandler/MainUI/FooterContainer/HBoxContainer/Robots" to="CanvasLayer/UIHandler/MainUI/Content/RobotList" method="ShowList"]
[connection signal="pressed" from="CanvasLayer/UIHandler/MainUI/FooterContainer/HBoxContainer/Options" to="CanvasLayer/UIHandler" method="HandleMenu"]
+1 -5
View File
@@ -30,11 +30,7 @@ public partial class UIHandler : Control
if (Input.IsActionJustPressed("map"))
{
map.Visible = !map.Visible;
if (map.Visible)
{
map.ShowMap();
}
map.ShowMap();
}
if (Input.IsActionJustPressed("menu"))
+7 -2
View File
@@ -18,11 +18,16 @@ public partial class RobotList : PanelContainer
{
if (Input.IsActionJustPressed("robot_list"))
{
Visible = !Visible;
if (Visible) ReloadRobots();
ShowList();
}
}
public void ShowList()
{
Visible = !Visible;
if (Visible) ReloadRobots();
}
public void ReloadRobots()
{
foreach (Node node in robotList.GetChildren())
+4 -1
View File
@@ -18,6 +18,9 @@ public partial class Map : PanelContainer
public void ShowMap()
{
Visible = !Visible;
if (!Visible) return;
foreach (Node node in grid.GetChildren())
{
grid.RemoveChild(node);
@@ -45,7 +48,7 @@ public partial class Map : PanelContainer
{
label.Text = "\u2193 Z | \u2192 X";
}
else if(z == -1)
else if (z == -1)
{
label.Text = x.ToString();
}
+9 -10
View File
@@ -46,6 +46,14 @@ public partial class World : Node3D
Pathfinding.BuildAStarGraph();
HandleRenderData(BuildRenderData(0));
//TODO: Remove for live build -> DEBUG ONLY
Robot robot = ResourceLoader.LoadRobotPrefab().Instantiate<Robot>();
robot.Name = $"Robot #{robots.Count + 1}";
robot.Position = map[0].tiles[0, 0].Position;
AddChild(robot);
robots.Add(robot);
}
private Dictionary<string, MultiMeshInstance3D> CreateMultiMeshes(Dictionary<string, Mesh> meshLibrary)
@@ -78,22 +86,13 @@ public partial class World : Node3D
{
if (!canMove) return;
if (Input.IsActionJustPressed("layer_up") && currentLayer > 0) currentLayer--;
if (Input.IsActionJustPressed("layer_down") && currentLayer < ruinSize - 1) currentLayer++;
if (Input.IsActionJustPressed("layer_down") && currentLayer < ruinSize - 1 && map[currentLayer].isGateOpen) currentLayer++;
if (currentLayer != visibleLayer)
{
map[visibleLayer].ClearDecorations();
HandleRenderData(BuildRenderData(currentLayer));
visibleLayer = currentLayer;
}
if (Input.IsActionJustPressed("spawn_robot") && robots.Count < maxRobotCount)
{
Robot robot = ResourceLoader.LoadRobotPrefab().Instantiate<Robot>();
robot.Name = $"Robot #{robots.Count + 1}";
robot.Position = map[0].tiles[0, 0].Position;
AddChild(robot);
robots.Add(robot);
}
}
private void GenerateWorld()
-5
View File
@@ -72,11 +72,6 @@ sprint={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
spawn_robot={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
]
}
robot_list={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":114,"location":0,"echo":false,"script":null)