Allow GPose Target to work as Target.

This commit is contained in:
Ottermandias 2023-10-17 19:49:49 +02:00
parent 27f1fcd422
commit 0e943b5d1d
3 changed files with 5 additions and 4 deletions

View file

@ -419,7 +419,7 @@ public class ActorPanel
: "The current target can not be manipulated." : "The current target can not be manipulated."
: "No valid target selected."; : "No valid target selected.";
if (!ImGuiUtil.DrawDisabledButton("Apply to Target", Vector2.Zero, tt, if (!ImGuiUtil.DrawDisabledButton("Apply to Target", Vector2.Zero, tt,
!data.Valid || id == _identifier || _state!.ModelData.ModelId != 0 || _objects.IsInGPose)) !data.Valid || id == _identifier || _state!.ModelData.ModelId != 0))
return; return;
var (applyGear, applyCustomize) = UiHelpers.ConvertKeysToFlags(); var (applyGear, applyCustomize) = UiHelpers.ConvertKeysToFlags();

View file

@ -449,7 +449,7 @@ public class DesignPanel
? "Apply the current design with its settings to your current target.\nHold Control to only apply gear.\nHold Shift to only apply customizations." ? "Apply the current design with its settings to your current target.\nHold Control to only apply gear.\nHold Shift to only apply customizations."
: "The current target can not be manipulated." : "The current target can not be manipulated."
: "No valid target selected."; : "No valid target selected.";
if (!ImGuiUtil.DrawDisabledButton("Apply to Target", Vector2.Zero, tt, !data.Valid || _objects.IsInGPose)) if (!ImGuiUtil.DrawDisabledButton("Apply to Target", Vector2.Zero, tt, !data.Valid))
return; return;
if (_state.GetOrCreate(id, data.Objects[0], out var state)) if (_state.GetOrCreate(id, data.Objects[0], out var state))

View file

@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Dalamud.Game.ClientState.Objects; using Dalamud.Game.ClientState.Objects;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game.Control;
using Glamourer.Interop.Structs; using Glamourer.Interop.Structs;
using Glamourer.Services; using Glamourer.Services;
using Penumbra.GameData.Actors; using Penumbra.GameData.Actors;
@ -152,8 +153,8 @@ public class ObjectManager : IReadOnlyDictionary<ActorIdentifier, ActorData>
public Actor Player public Actor Player
=> _objects.GetObjectAddress(0); => _objects.GetObjectAddress(0);
public Actor Target public unsafe Actor Target
=> _targets.Target?.Address ?? nint.Zero; => _clientState.IsGPosing ? TargetSystem.Instance()->GPoseTarget : TargetSystem.Instance()->Target;
public Actor Focus public Actor Focus
=> _targets.FocusTarget?.Address ?? nint.Zero; => _targets.FocusTarget?.Address ?? nint.Zero;