refactor(B.4b): unify _selectedTargetGuid -> _selectedGuid
Retail's selection model is a single "current target" used by combat, interaction, NPC dialog, and HUD alike - not two parallel selections. Renames the existing combat-only field on GameWindow so the upcoming B.4b click handler and the existing Q-cycle SelectClosestCombatTarget share the same selection state. Mechanical rename, no behavior change. Build + tests green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5821bdc9ea
commit
7b4aff21b6
1 changed files with 5 additions and 5 deletions
|
|
@ -783,7 +783,7 @@ public sealed class GameWindow : IDisposable
|
|||
/// fields when a 0xF625 ObjDescEvent arrives carrying only updated visuals.
|
||||
/// </summary>
|
||||
private readonly Dictionary<uint, AcDream.Core.Net.WorldSession.EntitySpawn> _lastSpawnByGuid = new();
|
||||
private uint? _selectedTargetGuid;
|
||||
private uint? _selectedGuid;
|
||||
private readonly record struct LiveEntityInfo(
|
||||
string? Name,
|
||||
AcDream.Core.Items.ItemType ItemType);
|
||||
|
|
@ -2998,8 +2998,8 @@ public sealed class GameWindow : IDisposable
|
|||
_liveEntityInfoByGuid.Remove(serverGuid);
|
||||
_entitiesByServerGuid.Remove(serverGuid);
|
||||
_lastSpawnByGuid.Remove(serverGuid);
|
||||
if (_selectedTargetGuid == serverGuid)
|
||||
_selectedTargetGuid = null;
|
||||
if (_selectedGuid == serverGuid)
|
||||
_selectedGuid = null;
|
||||
|
||||
if (logDelete)
|
||||
_lightingSink?.UnregisterOwner(existingEntity.Id);
|
||||
|
|
@ -8697,7 +8697,7 @@ public sealed class GameWindow : IDisposable
|
|||
|
||||
private uint? GetSelectedOrClosestCombatTarget()
|
||||
{
|
||||
if (_selectedTargetGuid is { } selected && IsLiveCreatureTarget(selected))
|
||||
if (_selectedGuid is { } selected && IsLiveCreatureTarget(selected))
|
||||
return selected;
|
||||
|
||||
return SelectClosestCombatTarget(showToast: false);
|
||||
|
|
@ -8725,7 +8725,7 @@ public sealed class GameWindow : IDisposable
|
|||
bestGuid = guid;
|
||||
}
|
||||
|
||||
_selectedTargetGuid = bestGuid;
|
||||
_selectedGuid = bestGuid;
|
||||
if (bestGuid is { } selected)
|
||||
{
|
||||
string label = DescribeLiveEntity(selected);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue