25 lines
556 B
C#
25 lines
556 B
C#
using Chickensoft.AutoInject;
|
|
using Chickensoft.Introspection;
|
|
using Godot;
|
|
|
|
namespace Zennysoft.Game.Ma;
|
|
[Meta(typeof(IAutoNode))]
|
|
public partial class Minimap : Control
|
|
{
|
|
public override void _Notification(int what) => this.Notify(what);
|
|
|
|
[Dependency] public IMap _map => this.DependOn<IMap>();
|
|
|
|
[Node] public Label LayerNumberText { get; set; } = default!;
|
|
|
|
public void OnResolved()
|
|
{
|
|
_map.CurrentFloorNumber.Sync += CurrentFloorNumber_Sync;
|
|
}
|
|
|
|
private void CurrentFloorNumber_Sync(int obj)
|
|
{
|
|
LayerNumberText.Text = $"{obj:D2}";
|
|
}
|
|
}
|