mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Update to use AgentUpdate event
This commit is contained in:
parent
700aaa4a5d
commit
af8b61f08a
2 changed files with 24 additions and 7 deletions
|
|
@ -54,7 +54,7 @@ internal unsafe class RecipeData : IInternalDisposableService
|
|||
this.clientState.Login += this.Update;
|
||||
this.clientState.Logout += this.OnLogout;
|
||||
this.clientState.LevelChanged += this.OnlevelChanged;
|
||||
this.gameGui.UnlocksUpdate += this.Update;
|
||||
this.gameGui.AgentUpdate += this.OnAgentUpdate;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -63,7 +63,7 @@ internal unsafe class RecipeData : IInternalDisposableService
|
|||
this.clientState.Login -= this.Update;
|
||||
this.clientState.Logout -= this.OnLogout;
|
||||
this.clientState.LevelChanged -= this.OnlevelChanged;
|
||||
this.gameGui.UnlocksUpdate -= this.Update;
|
||||
this.gameGui.AgentUpdate -= this.OnAgentUpdate;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -121,6 +121,12 @@ internal unsafe class RecipeData : IInternalDisposableService
|
|||
}
|
||||
}
|
||||
|
||||
private void OnAgentUpdate(AgentUpdateFlag agentUpdateFlag)
|
||||
{
|
||||
if (agentUpdateFlag.HasFlag(AgentUpdateFlag.UnlocksUpdate))
|
||||
this.Update();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// based on Client::Game::UI::RecipeNote.InitializeStructs
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
[ServiceManager.ServiceConstructor]
|
||||
private UnlockState()
|
||||
{
|
||||
this.clientState.Login += this.UpdateUnlocks;
|
||||
this.clientState.Login += this.OnLogin;
|
||||
this.clientState.Logout += this.OnLogout;
|
||||
this.gameGui.UnlocksUpdate += this.UpdateUnlocks;
|
||||
this.gameGui.AgentUpdate += this.OnAgentUpdate;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -62,9 +62,9 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
/// <inheritdoc/>
|
||||
void IInternalDisposableService.DisposeService()
|
||||
{
|
||||
this.clientState.Login -= this.UpdateUnlocks;
|
||||
this.clientState.Login -= this.OnLogin;
|
||||
this.clientState.Logout -= this.OnLogout;
|
||||
this.gameGui.UnlocksUpdate -= this.UpdateUnlocks;
|
||||
this.gameGui.AgentUpdate -= this.OnAgentUpdate;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -577,12 +577,23 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
|||
return UIState.Instance()->IsUnlockLinkUnlockedOrQuestCompleted(unlockLink);
|
||||
}
|
||||
|
||||
private void OnLogin()
|
||||
{
|
||||
this.Update();
|
||||
}
|
||||
|
||||
private void OnLogout(int type, int code)
|
||||
{
|
||||
this.cachedUnlockedRowIds.Clear();
|
||||
}
|
||||
|
||||
private void UpdateUnlocks()
|
||||
private void OnAgentUpdate(AgentUpdateFlag agentUpdateFlag)
|
||||
{
|
||||
if (agentUpdateFlag.HasFlag(AgentUpdateFlag.UnlocksUpdate))
|
||||
this.Update();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!this.IsLoaded)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue