Finished first EA Version #1

Merged
Nicola merged 110 commits from dev into main 2026-05-19 20:01:13 +02:00
2 changed files with 5 additions and 6 deletions
Showing only changes of commit 44bfd7ce1d - Show all commits
+1
View File
@@ -50,6 +50,7 @@ public partial class UIHandler : Control
public void HandleMapButton() public void HandleMapButton()
{ {
OpenUIElement(map); OpenUIElement(map);
map.ShowMap();
} }
public void HandleRobotListButton() public void HandleRobotListButton()
+4 -6
View File
@@ -13,15 +13,10 @@ public partial class Map : PanelContainer
// Called every frame. 'delta' is the elapsed time since the previous frame. // Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta) public override void _Process(double delta)
{ {
ShowMap(true);
} }
public void ShowMap(bool isUpdate) public void ShowMap()
{ {
if (!isUpdate)
{
Visible = !Visible;
}
if (!Visible) return; if (!Visible) return;
foreach (Node node in grid.GetChildren()) foreach (Node node in grid.GetChildren())
{ {
@@ -67,15 +62,18 @@ public partial class Map : PanelContainer
if (tiles[x, z].containsResource) if (tiles[x, z].containsResource)
{ {
texture.Texture = ResourceDistributor.resources[tiles[x, z].resource.name]; texture.Texture = ResourceDistributor.resources[tiles[x, z].resource.name];
texture.TooltipText = tiles[x, z].resource.item.GetReadableName() + $"\r(X: {x},Y: {GameData.currentLayer},Z: {z})";
} }
else else
{ {
texture.Texture = GenerateTexture(32, new Color(0, 0, 0, 0)); texture.Texture = GenerateTexture(32, new Color(0, 0, 0, 0));
texture.TooltipText = "";
} }
} }
else else
{ {
texture.Texture = GenerateTexture(32, new Color(0, 0, 0, 1)); texture.Texture = GenerateTexture(32, new Color(0, 0, 0, 1));
texture.TooltipText = "Not explored";
} }
texture.SizeFlagsHorizontal = SizeFlags.ExpandFill; texture.SizeFlagsHorizontal = SizeFlags.ExpandFill;