From 28df21a19bdcdbd76437acefc4ac1ebc934ceca5 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 15 Feb 2018 13:19:14 +0000 Subject: [PATCH] Added app.OnDlcInstalled callback --- Facepunch.Steamworks/Client/App.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Facepunch.Steamworks/Client/App.cs b/Facepunch.Steamworks/Client/App.cs index f448bf3..404887b 100644 --- a/Facepunch.Steamworks/Client/App.cs +++ b/Facepunch.Steamworks/Client/App.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using SteamNative; namespace Facepunch.Steamworks { @@ -12,6 +13,23 @@ public class App : IDisposable internal App( Client c ) { client = c; + + client.RegisterCallback( DlcInstalled ); + } + + public delegate void DlcInstalledDelegate( uint appid ); + + /// + /// Triggered after the current user gains ownership of DLC and that DLC is installed. + /// + public event DlcInstalledDelegate OnDlcInstalled; + + private void DlcInstalled( DlcInstalled_t data ) + { + if ( OnDlcInstalled != null ) + { + OnDlcInstalled( data.AppID ); + } } public void Dispose()