mirror of
https://github.com/Alee14/OpenHacknet.git
synced 2025-01-22 09:12:44 -05:00
26 lines
No EOL
704 B
C#
26 lines
No EOL
704 B
C#
using Steamworks;
|
|
|
|
namespace Hacknet
|
|
{
|
|
public static class AchievementsManager
|
|
{
|
|
public static bool Unlock(string name, bool recordAndCheckFlag = false)
|
|
{
|
|
try
|
|
{
|
|
var flag = name + "_Unlocked";
|
|
if (recordAndCheckFlag && OS.currentInstance.Flags.HasFlag(flag))
|
|
return false;
|
|
SteamUserStats.SetAchievement(name);
|
|
if (!SteamUserStats.StoreStats())
|
|
return false;
|
|
OS.currentInstance.Flags.AddFlag(flag);
|
|
return true;
|
|
}
|
|
catch
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
} |