Added tooltip to map and fixed map loading.

This commit is contained in:
2026-05-06 07:04:03 +02:00
parent 6445c24202
commit 44bfd7ce1d
2 changed files with 5 additions and 6 deletions
+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.
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;