From 7bd8aaa793e75159ccd73efeada69bf684421bb4 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Mon, 31 Jul 2017 10:31:04 +0100 Subject: [PATCH] OnAchievementStateChanged nicer --- Facepunch.Steamworks/Client/Achievements.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Client/Achievements.cs b/Facepunch.Steamworks/Client/Achievements.cs index 07e3f04..ce80fd1 100644 --- a/Facepunch.Steamworks/Client/Achievements.cs +++ b/Facepunch.Steamworks/Client/Achievements.cs @@ -55,12 +55,17 @@ public void Refresh() foreach ( var i in unlockedRecently ) { - OnAchievementStateChanged?.Invoke( i ); + OnUnlocked( i ); } unlockedRecently.Clear(); } + internal void OnUnlocked( Achievement a ) + { + OnAchievementStateChanged?.Invoke( a ); + } + public void Dispose() { client = null; @@ -211,6 +216,8 @@ public bool Trigger( bool apply = true ) client.Stats.StoreStats(); } + client.Achievements.OnUnlocked( this ); + return r; }