mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-21 15:27: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>
|
/// </summary>
|
||||||
public event EventHandler OnLogout;
|
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) {
|
private void FrameworkOnOnUpdateEvent(Framework framework) {
|
||||||
if (this.Condition.Any() && this.lastConditionNone == true) {
|
if (this.Condition.Any() && this.lastConditionNone == true) {
|
||||||
Log.Debug("Is login");
|
Log.Debug("Is login");
|
||||||
this.lastConditionNone = false;
|
this.lastConditionNone = false;
|
||||||
|
this.IsLoggedIn = true;
|
||||||
OnLogin?.Invoke(this, null);
|
OnLogin?.Invoke(this, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.Condition.Any() && this.lastConditionNone == false) {
|
if (!this.Condition.Any() && this.lastConditionNone == false) {
|
||||||
Log.Debug("Is logout");
|
Log.Debug("Is logout");
|
||||||
this.lastConditionNone = true;
|
this.lastConditionNone = true;
|
||||||
|
this.IsLoggedIn = false;
|
||||||
OnLogout?.Invoke(this, null);
|
OnLogout?.Invoke(this, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue