mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Merge pull request #282 from kalilistic/logged-in
add isloggedin property
This commit is contained in:
commit
9cf3fd42ed
2 changed files with 13 additions and 0 deletions
|
|
@ -10,3 +10,9 @@ insert_final_newline = true
|
||||||
# 4 space indentation
|
# 4 space indentation
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
|
# disable redundant style warnings
|
||||||
|
dotnet_style_qualification_for_field = false:silent
|
||||||
|
dotnet_style_qualification_for_property = false:silent
|
||||||
|
dotnet_style_qualification_for_method = false:silent
|
||||||
|
dotnet_style_qualification_for_event = false:silent
|
||||||
|
|
@ -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