[v9] Move GPose check to ClientState (#1378)

This commit is contained in:
KazWolfe 2023-09-17 06:56:49 -07:00 committed by GitHub
parent fb3d4b5b4c
commit 2c23e6fdb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 15 deletions

View file

@ -102,6 +102,9 @@ public sealed class ClientState : IDisposable, IServiceType, IClientState
/// <inheritdoc/>
public bool IsPvPExcludingDen { get; private set; }
/// <inheritdoc />
public bool IsGPosing => GameMain.IsInGPose();
/// <summary>
/// Gets client state address resolver.
/// </summary>

View file

@ -5,6 +5,7 @@ using System.Threading.Tasks;
using Dalamud.Configuration.Internal;
using Dalamud.Game;
using Dalamud.Game.ClientState;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.Gui;
using Dalamud.Interface.GameFonts;
@ -179,20 +180,6 @@ public sealed class UiBuilder : IDisposable
}
}
/// <summary>
/// Gets a value indicating whether or not gpose is active.
/// </summary>
public bool GposeActive
{
get
{
var condition = Service<Condition>.GetNullable();
if (condition == null)
return false;
return condition[ConditionFlag.WatchingCutscene];
}
}
/// <summary>
/// Gets a value indicating whether this plugin should modify the game's interface at this time.
/// </summary>
@ -448,6 +435,7 @@ public sealed class UiBuilder : IDisposable
{
this.hitchDetector.Start();
var clientState = Service<ClientState>.Get();
var configuration = Service<DalamudConfiguration>.Get();
var gameGui = Service<GameGui>.GetNullable();
if (gameGui == null)
@ -457,7 +445,7 @@ public sealed class UiBuilder : IDisposable
!(this.DisableUserUiHide || this.DisableAutomaticUiHide)) ||
(this.CutsceneActive && configuration.ToggleUiHideDuringCutscenes &&
!(this.DisableCutsceneUiHide || this.DisableAutomaticUiHide)) ||
(this.GposeActive && configuration.ToggleUiHideDuringGpose &&
(clientState.IsGPosing && configuration.ToggleUiHideDuringGpose &&
!(this.DisableGposeUiHide || this.DisableAutomaticUiHide)))
{
if (!this.lastFrameUiHideState)

View file

@ -73,4 +73,9 @@ public interface IClientState
/// Gets a value indicating whether or not the user is playing PvP, excluding the Wolves' Den.
/// </summary>
public bool IsPvPExcludingDen { get; }
/// <summary>
/// Gets a value indicating whether the client is currently in Group Pose (GPose) mode.
/// </summary>
public bool IsGPosing { get; }
}