Refactor SelectedUnitPanel to enable unit info display and button functionality; add Godot project files for integration
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
<Project Sdk="Godot.NET.Sdk/4.4.1">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../Lib/Civilization.Core/Civilization.Core.csproj" />
|
||||
<ProjectReference Include="../../Lib/Civilization.Shared/Civilization.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -6,21 +6,21 @@ namespace Civilization.GodotIntegration;
|
||||
|
||||
public partial class SelectedUnitPanel : Control
|
||||
{
|
||||
// [Export] public Label UnitInfoLabel;
|
||||
// [Export] public Button SettleButton;
|
||||
//
|
||||
// public Action? OnSettleClicked;
|
||||
[Export] public Label UnitInfoLabel;
|
||||
[Export] public Button SettleButton;
|
||||
|
||||
public Action? OnSettleClicked;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
// SettleButton.Pressed += () => OnSettleClicked?.Invoke();
|
||||
SettleButton.Pressed += () => OnSettleClicked?.Invoke();
|
||||
Hide();
|
||||
}
|
||||
|
||||
public void ShowFor(Unit unit)
|
||||
{
|
||||
GD.Print($"Showing unit panel for {unit.Id} at {unit.Position} ({unit.Type})");
|
||||
// UnitInfoLabel.Text = $"{unit.Type} at {unit.Position} ({unit.ActionPoints} AP)";
|
||||
UnitInfoLabel.Text = $"{unit.Type} at {unit.Position} ({unit.ActionPoints} AP)";
|
||||
Show();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user