Added missing Symbol to the game, Improved move and explore logic, added map refresh for tiles.
This commit is contained in:
@@ -7,16 +7,12 @@ public partial class ResearchList : PanelContainer
|
||||
{
|
||||
[Export] private GraphEdit researchGraph;
|
||||
|
||||
private const float StartXDivisor = 32f;
|
||||
private const float StartYDivisor = 4f;
|
||||
private const float NodeSpacingMultiplier = 10f;
|
||||
|
||||
private List<string> reloadKeys = new List<string>();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
RecalculateResearchStates();
|
||||
SetupGraph();
|
||||
if(Visible) SetupGraph();
|
||||
}
|
||||
|
||||
public void SetupGraph()
|
||||
@@ -25,6 +21,7 @@ public partial class ResearchList : PanelContainer
|
||||
ClearGraph();
|
||||
CreateResearchNodes();
|
||||
CreateResearchConnections();
|
||||
researchGraph.ArrangeNodes();
|
||||
}
|
||||
|
||||
private void ClearGraph()
|
||||
@@ -111,7 +108,6 @@ public partial class ResearchList : PanelContainer
|
||||
{
|
||||
Name = id,
|
||||
Title = id,
|
||||
PositionOffset = GetNodePosition(texture),
|
||||
SelfModulate = stateColor
|
||||
};
|
||||
|
||||
@@ -131,24 +127,6 @@ public partial class ResearchList : PanelContainer
|
||||
return node;
|
||||
}
|
||||
|
||||
private Vector2 GetNodePosition(Texture2D texture)
|
||||
{
|
||||
Vector2 viewportSize = GetViewport().GetVisibleRect().Size;
|
||||
|
||||
float textureWidth = texture?.GetWidth() ?? 64f;
|
||||
|
||||
Vector2 startPosition = new Vector2(
|
||||
viewportSize.X / StartXDivisor,
|
||||
viewportSize.Y / StartYDivisor
|
||||
);
|
||||
|
||||
float xOffset =
|
||||
GameData.availableResearch.Count * -textureWidth +
|
||||
researchGraph.GetChildCount() * textureWidth * NodeSpacingMultiplier;
|
||||
|
||||
return startPosition + new Vector2(xOffset, 0);
|
||||
}
|
||||
|
||||
private void OnResearchPressed(string id)
|
||||
{
|
||||
GameData.availableResearch[id].state = ResearchState.RESEARCHED;
|
||||
@@ -208,4 +186,4 @@ public partial class ResearchList : PanelContainer
|
||||
_ => Colors.Red
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user