From 54d9bb9d8dd43ee19505d005eedfb7b60df10dd5 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 14 May 2026 15:07:00 +0200 Subject: [PATCH] feat(B.5): SendPickUp helper + F-key SelectionPickUp wiring --- src/AcDream.App/Rendering/GameWindow.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index ecd3bda..c6fc8e8 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -8746,6 +8746,13 @@ public sealed class GameWindow : IDisposable UseCurrentSelection(); break; + case AcDream.UI.Abstractions.Input.InputAction.SelectionPickUp: + if (_selectedGuid is uint pickupTarget) + SendPickUp(pickupTarget); + else + _debugVm?.AddToast("Nothing selected"); + break; + case AcDream.UI.Abstractions.Input.InputAction.EscapeKey: if (_cameraController?.IsFlyMode == true) _cameraController.ToggleFly(); // exit fly, release cursor @@ -8881,6 +8888,21 @@ public sealed class GameWindow : IDisposable Console.WriteLine($"[B.4b] use guid=0x{guid:X8} seq={seq}"); } + private void SendPickUp(uint itemGuid) + { + if (_liveSession is null + || _liveSession.CurrentState != AcDream.Core.Net.WorldSession.State.InWorld) + { + _debugVm?.AddToast("Not in world"); + return; + } + var seq = _liveSession.NextGameActionSequence(); + var body = AcDream.Core.Net.Messages.InteractRequests.BuildPickUp( + seq, itemGuid, _playerServerGuid, placement: 0); + _liveSession.SendGameAction(body); + Console.WriteLine($"[B.5] pickup item=0x{itemGuid:X8} container=0x{_playerServerGuid:X8} seq={seq}"); + } + private uint? SelectClosestCombatTarget(bool showToast) { if (!_entitiesByServerGuid.TryGetValue(_playerServerGuid, out var playerEntity))