mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-04-27 07:19:42 +03:00
Call StoreStats when triggering an achievement
This commit is contained in:
parent
53709bf5d0
commit
d417f22336
@ -44,11 +44,20 @@ namespace Facepunch.Steamworks
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unlock an achievement by identifier
|
/// Unlock an achievement by identifier. If apply is true this will happen as expected
|
||||||
|
/// and the achievement overlay will popup etc. If it's false then you'll have to manually
|
||||||
|
/// call Stats.StoreStats() to actually trigger it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Trigger( string identifier )
|
public bool Trigger( string identifier, bool apply = true )
|
||||||
{
|
{
|
||||||
return client.native.userstats.SetAchievement( identifier );
|
var r = client.native.userstats.SetAchievement( identifier );
|
||||||
|
|
||||||
|
if ( apply )
|
||||||
|
{
|
||||||
|
client.Stats.StoreStats();
|
||||||
|
}
|
||||||
|
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -148,12 +157,19 @@ namespace Facepunch.Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make this achievement earned
|
/// Make this achievement earned
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Trigger()
|
public bool Trigger( bool apply = true )
|
||||||
{
|
{
|
||||||
State = true;
|
State = true;
|
||||||
UnlockTime = DateTime.Now;
|
UnlockTime = DateTime.Now;
|
||||||
|
|
||||||
return client.native.userstats.SetAchievement( Id );
|
var r = client.native.userstats.SetAchievement( Id );
|
||||||
|
|
||||||
|
if ( apply )
|
||||||
|
{
|
||||||
|
client.Stats.StoreStats();
|
||||||
|
}
|
||||||
|
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user