mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-31 21:03:43 +01:00
add IsLoggedIn property
This commit is contained in:
parent
5c3bcf94ce
commit
7368ace8b4
1 changed files with 7 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue