basic capture functionality

This commit is contained in:
anonoe 2026-02-10 21:17:17 +01:00
parent 246f3c0840
commit c141e6a169
Signed by: anonoe
SSH key fingerprint: SHA256:OnAs6gNQelOnDiY5tBpDYKQiuTgBvnmIdMo5P09cdqg
20 changed files with 430 additions and 14 deletions

View file

@ -0,0 +1,28 @@
using Godot;
public partial class CaptureController : Node
{
[Export] public NodePath CaptureUIPath { get; set; }
private GameRoot _root = null!;
private CaptureUI? _ui;
public override void _Ready()
{
_ui = GetNodeOrNull<CaptureUI>(CaptureUIPath);
if (_ui == null)
{
GD.PrintErr("CaptureController: CaptureUIPath not set.");
return;
}
GameRoot.Instance.CaptureRequested += OnRequestCapture;
}
private void OnRequestCapture(Creature creature)
{
if (_ui == null) return;
if (!IsInstanceValid(creature)) return;
_ui.StartCapture(creature);
}
}