From ebc1336da332779245de410e870e85f45cf89e36 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Tue, 16 Apr 2019 20:57:17 +0100 Subject: [PATCH] Achievement.Name/Description --- Facepunch.Steamworks.Test/UserStatsTest.cs | 4 +++- Facepunch.Steamworks/Structs/Achievement.cs | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Facepunch.Steamworks.Test/UserStatsTest.cs b/Facepunch.Steamworks.Test/UserStatsTest.cs index 6950311..2c7cd57 100644 --- a/Facepunch.Steamworks.Test/UserStatsTest.cs +++ b/Facepunch.Steamworks.Test/UserStatsTest.cs @@ -16,9 +16,11 @@ namespace Steamworks { foreach ( var a in SteamUserStats.Achievements ) { - Console.WriteLine( $"{a.Value}" ); + Console.WriteLine( $"{a.Identifier}" ); Console.WriteLine( $" a.State: {a.State}" ); Console.WriteLine( $" a.UnlockTime: {a.UnlockTime}" ); + Console.WriteLine( $" a.Name: {a.Name}" ); + Console.WriteLine( $" a.Description: {a.Description}" ); Console.WriteLine( $" a.GlobalUnlockedPercentage: {a.GlobalUnlockedPercentage}" ); var icon = a.GetIcon(); diff --git a/Facepunch.Steamworks/Structs/Achievement.cs b/Facepunch.Steamworks/Structs/Achievement.cs index a7c85ac..aa9ec3b 100644 --- a/Facepunch.Steamworks/Structs/Achievement.cs +++ b/Facepunch.Steamworks/Structs/Achievement.cs @@ -8,7 +8,7 @@ namespace Steamworks.Data { public struct Achievement { - public string Value; + internal string Value; public Achievement( string name ) { @@ -30,6 +30,12 @@ namespace Steamworks.Data } } + public string Identifier => Value; + + public string Name => SteamUserStats.Internal.GetAchievementDisplayAttribute( Value, "name" ); + + public string Description => SteamUserStats.Internal.GetAchievementDisplayAttribute( Value, "desc" ); + /// /// Should hold the unlock time if State is true