add IsLoggedIn property

This commit is contained in:
kalilistic 2021-04-03 12:11:22 -04:00
parent 5c3bcf94ce
commit 7368ace8b4

View file

@ -175,16 +175,23 @@ namespace Dalamud.Game.ClientState
/// </summary>
public event EventHandler OnLogout;
/// <summary>
/// Gets a value indicating whether a character is logged in.
/// </summary>
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);
}
}