Merge pull request #497 from daemitus/event

Change Framework.OnUpdateEvent to Update
This commit is contained in:
goaaats 2021-08-23 23:48:08 +02:00 committed by GitHub
commit 1c1a007e41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -66,7 +66,7 @@ namespace Dalamud.Game.ClientState
this.setupTerritoryTypeHook = new Hook<SetupTerritoryTypeDelegate>(this.address.SetupTerritoryType, this.SetupTerritoryTypeDetour);
var framework = Service<Framework>.Get();
framework.OnUpdateEvent += this.FrameworkOnOnUpdateEvent;
framework.Update += this.FrameworkOnOnUpdateEvent;
var networkHandlers = Service<NetworkHandlers>.Get();
networkHandlers.CfPop += this.NetworkHandlersOnCfPop;
@ -136,7 +136,7 @@ namespace Dalamud.Game.ClientState
{
this.setupTerritoryTypeHook.Dispose();
Service<GamepadState>.Get().Dispose();
Service<Framework>.Get().OnUpdateEvent -= this.FrameworkOnOnUpdateEvent;
Service<Framework>.Get().Update -= this.FrameworkOnOnUpdateEvent;
Service<NetworkHandlers>.Get().CfPop -= this.NetworkHandlersOnCfPop;
}

View file

@ -49,7 +49,7 @@ namespace Dalamud.Game
}
/// <summary>
/// A delegate type used with the <see cref="OnUpdateEvent"/> event.
/// A delegate type used with the <see cref="Update"/> event.
/// </summary>
/// <param name="framework">The Framework instance.</param>
public delegate void OnUpdateDelegate(Framework framework);
@ -75,7 +75,7 @@ namespace Dalamud.Game
/// <summary>
/// Event that gets fired every time the game framework updates.
/// </summary>
public event OnUpdateDelegate OnUpdateEvent;
public event OnUpdateDelegate Update;
/// <summary>
/// Gets or sets a value indicating whether the collection of stats is enabled.
@ -175,10 +175,10 @@ namespace Dalamud.Game
{
try
{
if (StatsEnabled && this.OnUpdateEvent != null)
if (StatsEnabled && this.Update != null)
{
// Stat Tracking for Framework Updates
var invokeList = this.OnUpdateEvent.GetInvocationList();
var invokeList = this.Update.GetInvocationList();
var notUpdated = StatsHistory.Keys.ToList();
// Individually invoke OnUpdate handlers and time them.
foreach (var d in invokeList)
@ -211,7 +211,7 @@ namespace Dalamud.Game
}
else
{
this.OnUpdateEvent?.Invoke(this);
this.Update?.Invoke(this);
}
}
catch (Exception ex)