Finished first EA Version #1
@@ -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()
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user