feat: correct IsPvP check, add IsPvPExcludingDen bool

This commit is contained in:
goaaats 2022-06-17 15:46:47 +02:00
parent dd686fe6a0
commit 2dabab812d
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -100,12 +100,12 @@ namespace Dalamud.Game.ClientState
/// <summary> /// <summary>
/// Event that fires when a character is entering PvP. /// Event that fires when a character is entering PvP.
/// </summary> /// </summary>
public event System.Action EnterPvP; public event Action EnterPvP;
/// <summary> /// <summary>
/// Event that fires when a character is leaving PvP. /// Event that fires when a character is leaving PvP.
/// </summary> /// </summary>
public event System.Action LeavePvP; public event Action LeavePvP;
/// <summary> /// <summary>
/// Event that gets fired when a duty is ready. /// Event that gets fired when a duty is ready.
@ -142,6 +142,11 @@ namespace Dalamud.Game.ClientState
/// </summary> /// </summary>
public bool IsPvP { get; private set; } public bool IsPvP { get; private set; }
/// <summary>
/// Gets a value indicating whether or not the user is playing PvP, excluding the Wolves' Den.
/// </summary>
public bool IsPvPExcludingDen { get; private set; }
/// <summary> /// <summary>
/// Enable this module. /// Enable this module.
/// </summary> /// </summary>
@ -203,7 +208,8 @@ namespace Dalamud.Game.ClientState
gameGui.ResetUiHideState(); gameGui.ResetUiHideState();
} }
this.IsPvP = GameMain.IsInPvPInstance(); this.IsPvP = GameMain.IsInPvPArea();
this.IsPvPExcludingDen = this.IsPvP && this.TerritoryType != 250;
if (this.IsPvP != this.lastFramePvP) if (this.IsPvP != this.lastFramePvP)
{ {