From 7368ace8b4240b1c90304a34134599b91a024d1c Mon Sep 17 00:00:00 2001 From: kalilistic <35899782+kalilistic@users.noreply.github.com> Date: Sat, 3 Apr 2021 12:11:22 -0400 Subject: [PATCH] add IsLoggedIn property --- Dalamud/Game/ClientState/ClientState.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dalamud/Game/ClientState/ClientState.cs b/Dalamud/Game/ClientState/ClientState.cs index 610c2523d..9be2d194c 100644 --- a/Dalamud/Game/ClientState/ClientState.cs +++ b/Dalamud/Game/ClientState/ClientState.cs @@ -175,16 +175,23 @@ namespace Dalamud.Game.ClientState /// public event EventHandler OnLogout; + /// + /// Gets a value indicating whether a character is logged in. + /// + public bool IsLoggedIn { get; private set; } + private void FrameworkOnOnUpdateEvent(Framework framework) { if (this.Condition.Any() && this.lastConditionNone == true) { Log.Debug("Is login"); this.lastConditionNone = false; + this.IsLoggedIn = true; OnLogin?.Invoke(this, null); } if (!this.Condition.Any() && this.lastConditionNone == false) { Log.Debug("Is logout"); this.lastConditionNone = true; + this.IsLoggedIn = false; OnLogout?.Invoke(this, null); } }