From 44bfd7ce1d4c483c2ebee13aec968b16657ad596 Mon Sep 17 00:00:00 2001 From: Nicola Date: Wed, 6 May 2026 07:04:03 +0200 Subject: [PATCH] Added tooltip to map and fixed map loading. --- Scripts/Helpers/UIHandler.cs | 1 + Scripts/WorldGeneration/Map.cs | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Scripts/Helpers/UIHandler.cs b/Scripts/Helpers/UIHandler.cs index b56ddde..69c52b4 100644 --- a/Scripts/Helpers/UIHandler.cs +++ b/Scripts/Helpers/UIHandler.cs @@ -50,6 +50,7 @@ public partial class UIHandler : Control public void HandleMapButton() { OpenUIElement(map); + map.ShowMap(); } public void HandleRobotListButton() diff --git a/Scripts/WorldGeneration/Map.cs b/Scripts/WorldGeneration/Map.cs index 04db7de..a01ad51 100644 --- a/Scripts/WorldGeneration/Map.cs +++ b/Scripts/WorldGeneration/Map.cs @@ -13,15 +13,10 @@ public partial class Map : PanelContainer // Called every frame. 'delta' is the elapsed time since the previous frame. public override void _Process(double delta) { - ShowMap(true); } - public void ShowMap(bool isUpdate) + public void ShowMap() { - if (!isUpdate) - { - Visible = !Visible; - } if (!Visible) return; foreach (Node node in grid.GetChildren()) { @@ -67,15 +62,18 @@ public partial class Map : PanelContainer if (tiles[x, z].containsResource) { 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 { texture.Texture = GenerateTexture(32, new Color(0, 0, 0, 0)); + texture.TooltipText = ""; } } else { texture.Texture = GenerateTexture(32, new Color(0, 0, 0, 1)); + texture.TooltipText = "Not explored"; } texture.SizeFlagsHorizontal = SizeFlags.ExpandFill;