private static Task <Bitmap> GetAchievementIconAsync(string achId) { Bitmap result = null; Callback <UserAchievementIconFetched_t> callback = null; AutoResetEvent ev = null; void OnIconFetched(UserAchievementIconFetched_t e) { result = GetBitmapFromHandle(e.m_nIconHandle); // Intentional // ReSharper disable once AccessToModifiedClosure callback?.Dispose(); ev?.Set(); } var iconHandle = SteamUserStats.GetAchievementIcon(achId); if (iconHandle != 0) { result = GetBitmapFromHandle(iconHandle); } else { try { ev = new AutoResetEvent(false); callback = new Callback <UserAchievementIconFetched_t>(OnIconFetched); ev.WaitOne(); } finally { ev?.Dispose(); } } return(Task.FromResult(result)); }
IEnumerator _GetAchivementIcon(string ID) { int iconInt = 0; int counter = 0; while (iconInt <= 0 && counter < retryCounter.Value) { iconInt = SteamUserStats.GetAchievementIcon(ID); counter++; yield return(null); } if (iconInt <= 0) { Fsm.Event(noImageFound); Finish(); } else { SteamUtils.GetImageSize(iconInt, out icon_width, out icon_height); byte[] iconStream = new byte[4 * (int)icon_width * (int)icon_height]; SteamUtils.GetImageRGBA(iconInt, iconStream, 4 * (int)icon_width * (int)icon_height); Texture2D downloadIcon = new Texture2D((int)icon_width, (int)icon_height, TextureFormat.RGBA32, false); downloadIcon.LoadRawTextureData(iconStream); downloadIcon.Apply(); Sprite spriteTemp = Sprite.Create(downloadIcon, new Rect(0, 0, downloadIcon.width, downloadIcon.height), new Vector2(.5f, .5f)); Debug.Log(downloadIcon.width + "+" + downloadIcon.height); icon.Value = (Sprite)spriteTemp; spriteTemp = null; Finish(); } }
public Stream GetPicture() { int img = SteamUserStats.GetAchievementIcon(Key); uint w, h; SteamUtils.GetImageSize(img, out w, out h); byte[] imgData = new byte[w * h * 4]; SteamUtils.GetImageRGBA(img, imgData, imgData.Length); return(new MemoryStream(imgData)); // FIXME: Leak! -flibit }
/// <summary> /// This method gets the icon of the achievement as of the actual state (if needed to use on a menu /// option for instance) /// </summary> /// <param name="_achievementID"></param> /// <returns></returns> public static Sprite GetAchievementIcon(string _achievementID) { int _iconInt; uint _width, _height; Texture2D _downloadedAvatar; Rect _rect = new Rect(0, 0, 184, 184); Vector2 _pivot = new Vector2(0.5f, 0.5f); _iconInt = SteamUserStats.GetAchievementIcon(_achievementID); //If the icon isn't downloaded yet if (_iconInt == -1) { //this is a delay necessary if the image is not loaded yet, may freeze a bit of the code for (int i = 0; i <= 2000; i++) { Debug.Log("Icon not found"); } } if (_iconInt > 0) { SteamUtils.GetImageSize(_iconInt, out _width, out _height); if (_width > 0 && _height > 0) { byte[] _avatarStream = new byte[4 * (int)_width * (int)_height]; SteamUtils.GetImageRGBA(_iconInt, _avatarStream, 4 * (int)_width * (int)_height); _downloadedAvatar = new Texture2D((int)_width, (int)_height, TextureFormat.RGBA32, false); _downloadedAvatar.LoadRawTextureData(_avatarStream); _downloadedAvatar.Apply(); return(Sprite.Create(_downloadedAvatar, _rect, _pivot)); } } return(null); }
private void RenderPageOne() { if (GUILayout.Button("RequestCurrentStats()")) { bool ret = SteamUserStats.RequestCurrentStats(); print("RequestCurrentStats() - " + ret); } { bool ret = SteamUserStats.GetStat("NumGames", out m_NumGamesStat); GUILayout.Label("GetStat(\"NumGames\", out m_NumGamesStat) - " + ret + " -- " + m_NumGamesStat); } { bool ret = SteamUserStats.GetStat("FeetTraveled", out m_FeetTraveledStat); GUILayout.Label("GetStat(\"FeetTraveled\", out m_FeetTraveledStat) - " + ret + " -- " + m_FeetTraveledStat); } if (GUILayout.Button("SetStat(\"NumGames\", m_NumGamesStat + 1)")) { bool ret = SteamUserStats.SetStat("NumGames", m_NumGamesStat + 1); print("SetStat(\"NumGames\", " + (m_NumGamesStat + 1) + ") - " + ret); } if (GUILayout.Button("SetStat(\"FeetTraveled\", m_FeetTraveledStat + 1)")) { bool ret = SteamUserStats.SetStat("FeetTraveled", m_FeetTraveledStat + 1); print("SetStat(\"FeetTraveled\", " + (m_FeetTraveledStat + 1) + ") - " + ret); } if (GUILayout.Button("UpdateAvgRateStat(\"AverageSpeed\", 100, 60.0)")) { bool ret = SteamUserStats.UpdateAvgRateStat("AverageSpeed", 100, 60.0); print("UpdateAvgRateStat(\"AverageSpeed\", 100, 60.0) - " + ret); } { bool ret = SteamUserStats.GetAchievement("ACH_WIN_ONE_GAME", out m_AchievedWinOneGame); GUILayout.Label("GetAchievement(\"ACH_WIN_ONE_GAME\", out m_AchievedWinOneGame) - " + ret + " -- " + m_AchievedWinOneGame); } if (GUILayout.Button("SetAchievement(\"ACH_WIN_ONE_GAME\")")) { bool ret = SteamUserStats.SetAchievement("ACH_WIN_ONE_GAME"); print("SetAchievement(\"ACH_WIN_ONE_GAME\") - " + ret); } if (GUILayout.Button("ClearAchievement(\"ACH_WIN_ONE_GAME\")")) { bool ret = SteamUserStats.ClearAchievement("ACH_WIN_ONE_GAME"); print("ClearAchievement(\"ACH_WIN_ONE_GAME\") - " + ret); } { bool Achieved; uint UnlockTime; bool ret = SteamUserStats.GetAchievementAndUnlockTime("ACH_WIN_ONE_GAME", out Achieved, out UnlockTime); GUILayout.Label("GetAchievementAndUnlockTime(\"ACH_WIN_ONE_GAME\", out Achieved, out UnlockTime) - " + ret + " -- " + Achieved + " -- " + UnlockTime); } if (GUILayout.Button("StoreStats()")) { bool ret = SteamUserStats.StoreStats(); print("StoreStats() - " + ret); } if (GUILayout.Button("GetAchievementIcon(\"ACH_WIN_ONE_GAME\")")) { int icon = SteamUserStats.GetAchievementIcon("ACH_WIN_ONE_GAME"); print("SteamUserStats.GetAchievementIcon(\"ACH_WIN_ONE_GAME\") - " + icon); if (icon != 0) { uint Width = 0; uint Height = 0; bool ret = SteamUtils.GetImageSize(icon, out Width, out Height); if (ret && Width > 0 && Height > 0) { byte[] RGBA = new byte[Width * Height * 4]; ret = SteamUtils.GetImageRGBA(icon, RGBA, RGBA.Length); if (ret) { m_Icon = new Texture2D((int)Width, (int)Height, TextureFormat.RGBA32, false, true); m_Icon.LoadRawTextureData(RGBA); m_Icon.Apply(); } } } } GUILayout.Label("GetAchievementDisplayAttribute(\"ACH_WIN_ONE_GAME\", \"name\") : " + SteamUserStats.GetAchievementDisplayAttribute("ACH_WIN_ONE_GAME", "name")); if (GUILayout.Button("IndicateAchievementProgress(\"ACH_WIN_100_GAMES\", 10, 100)")) { bool ret = SteamUserStats.IndicateAchievementProgress("ACH_WIN_100_GAMES", 10, 100); print("IndicateAchievementProgress(\"ACH_WIN_100_GAMES\", 10, 100) - " + ret); } GUILayout.Label("GetNumAchievements() : " + SteamUserStats.GetNumAchievements()); GUILayout.Label("GetAchievementName(0) : " + SteamUserStats.GetAchievementName(0)); if (GUILayout.Button("RequestUserStats(SteamUser.GetSteamID())")) { SteamAPICall_t handle = SteamUserStats.RequestUserStats(new CSteamID(76561197991230424)); //rlabrecque UserStatsReceived.Set(handle); print("RequestUserStats(" + SteamUser.GetSteamID() + ") - " + handle); } { int Data; bool ret = SteamUserStats.GetUserStat(new CSteamID(76561197991230424), "NumWins", out Data); //rlabrecque GUILayout.Label("GetUserStat(SteamUser.GetSteamID(), \"NumWins\", out Data) : " + ret + " -- " + Data); } { float Data; bool ret = SteamUserStats.GetUserStat(new CSteamID(76561197991230424), "MaxFeetTraveled", out Data); //rlabrecque GUILayout.Label("GetUserStat(SteamUser.GetSteamID(), \"NumWins\", out Data) : " + ret + " -- " + Data); } { bool Achieved; bool ret = SteamUserStats.GetUserAchievement(new CSteamID(76561197991230424), "ACH_TRAVEL_FAR_ACCUM", out Achieved); //rlabrecque GUILayout.Label("GetUserAchievement(SteamUser.GetSteamID(), \"ACH_TRAVEL_FAR_ACCUM\", out Achieved) : " + ret + " -- " + Achieved); } { bool Achieved; uint UnlockTime; bool ret = SteamUserStats.GetUserAchievementAndUnlockTime(new CSteamID(76561197991230424), "ACH_WIN_ONE_GAME", out Achieved, out UnlockTime); //rlabrecque GUILayout.Label("GetUserAchievementAndUnlockTime(SteamUser.GetSteamID(), ACH_TRAVEL_FAR_SINGLE\", out Achieved, out UnlockTime) : " + ret + " -- " + Achieved + " -- " + UnlockTime); } if (GUILayout.Button("ResetAllStats(true)")) { bool ret = SteamUserStats.ResetAllStats(true); print("ResetAllStats(true) - " + ret); } }
public void RenderOnGUI() { GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); GUILayout.Label("Variables:"); GUILayout.Label("m_NumGamesStat: " + m_NumGamesStat); GUILayout.Label("m_FeetTraveledStat: " + m_FeetTraveledStat); GUILayout.Label("m_AchievedWinOneGame: " + m_AchievedWinOneGame); GUILayout.Label("m_SteamLeaderboard: " + m_SteamLeaderboard); GUILayout.Label("m_SteamLeaderboardEntries: " + m_SteamLeaderboardEntries); GUILayout.Label("m_Icon:"); GUILayout.Label(m_Icon); GUILayout.EndArea(); GUILayout.BeginVertical("box"); m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); if (GUILayout.Button("RequestCurrentStats()")) { bool ret = SteamUserStats.RequestCurrentStats(); print("SteamUserStats.RequestCurrentStats() : " + ret); } { bool ret = SteamUserStats.GetStat("NumGames", out m_NumGamesStat); GUILayout.Label("GetStat(\"NumGames\", out m_NumGamesStat) : " + ret + " -- " + m_NumGamesStat); } { bool ret = SteamUserStats.GetStat("FeetTraveled", out m_FeetTraveledStat); GUILayout.Label("GetStat(\"FeetTraveled\", out m_FeetTraveledStat) : " + ret + " -- " + m_FeetTraveledStat); } if (GUILayout.Button("SetStat(\"NumGames\", m_NumGamesStat + 1)")) { bool ret = SteamUserStats.SetStat("NumGames", m_NumGamesStat + 1); print("SteamUserStats.SetStat(" + "\"NumGames\"" + ", " + m_NumGamesStat + 1 + ") : " + ret); } if (GUILayout.Button("SetStat(\"FeetTraveled\", m_FeetTraveledStat + 1)")) { bool ret = SteamUserStats.SetStat("FeetTraveled", m_FeetTraveledStat + 1); print("SteamUserStats.SetStat(" + "\"FeetTraveled\"" + ", " + m_FeetTraveledStat + 1 + ") : " + ret); } if (GUILayout.Button("UpdateAvgRateStat(\"AverageSpeed\", 100, 60.0)")) { bool ret = SteamUserStats.UpdateAvgRateStat("AverageSpeed", 100, 60.0); print("SteamUserStats.UpdateAvgRateStat(" + "\"AverageSpeed\"" + ", " + 100 + ", " + 60.0 + ") : " + ret); } { bool ret = SteamUserStats.GetAchievement("ACH_WIN_ONE_GAME", out m_AchievedWinOneGame); GUILayout.Label("GetAchievement(\"ACH_WIN_ONE_GAME\", out m_AchievedWinOneGame) : " + ret + " -- " + m_AchievedWinOneGame); } if (GUILayout.Button("SetAchievement(\"ACH_WIN_ONE_GAME\")")) { bool ret = SteamUserStats.SetAchievement("ACH_WIN_ONE_GAME"); print("SteamUserStats.SetAchievement(" + "\"ACH_WIN_ONE_GAME\"" + ") : " + ret); } if (GUILayout.Button("ClearAchievement(\"ACH_WIN_ONE_GAME\")")) { bool ret = SteamUserStats.ClearAchievement("ACH_WIN_ONE_GAME"); print("SteamUserStats.ClearAchievement(" + "\"ACH_WIN_ONE_GAME\"" + ") : " + ret); } { bool Achieved; uint UnlockTime; bool ret = SteamUserStats.GetAchievementAndUnlockTime("ACH_WIN_ONE_GAME", out Achieved, out UnlockTime); GUILayout.Label("GetAchievementAndUnlockTime(\"ACH_WIN_ONE_GAME\", out Achieved, out UnlockTime) : " + ret + " -- " + Achieved + " -- " + UnlockTime); } if (GUILayout.Button("StoreStats()")) { bool ret = SteamUserStats.StoreStats(); print("SteamUserStats.StoreStats() : " + ret); } if (GUILayout.Button("GetAchievementIcon(\"ACH_WIN_ONE_GAME\")")) { int ret = SteamUserStats.GetAchievementIcon("ACH_WIN_ONE_GAME"); print("SteamUserStats.GetAchievementIcon(" + "\"ACH_WIN_ONE_GAME\"" + ") : " + ret); if (ret != 0) { m_Icon = SteamUtilsTest.GetSteamImageAsTexture2D(ret); } } GUILayout.Label("GetAchievementDisplayAttribute(\"ACH_WIN_ONE_GAME\", \"name\") : " + SteamUserStats.GetAchievementDisplayAttribute("ACH_WIN_ONE_GAME", "name")); if (GUILayout.Button("IndicateAchievementProgress(\"ACH_WIN_100_GAMES\", 10, 100)")) { bool ret = SteamUserStats.IndicateAchievementProgress("ACH_WIN_100_GAMES", 10, 100); print("SteamUserStats.IndicateAchievementProgress(" + "\"ACH_WIN_100_GAMES\"" + ", " + 10 + ", " + 100 + ") : " + ret); } GUILayout.Label("GetNumAchievements() : " + SteamUserStats.GetNumAchievements()); GUILayout.Label("GetAchievementName(0) : " + SteamUserStats.GetAchievementName(0)); if (GUILayout.Button("RequestUserStats(TestConstants.Instance.k_SteamId_rlabrecque)")) { SteamAPICall_t handle = SteamUserStats.RequestUserStats(TestConstants.Instance.k_SteamId_rlabrecque); OnUserStatsReceivedCallResult.Set(handle); print("SteamUserStats.RequestUserStats(" + TestConstants.Instance.k_SteamId_rlabrecque + ") : " + handle); } { int Data; bool ret = SteamUserStats.GetUserStat(TestConstants.Instance.k_SteamId_rlabrecque, "NumWins", out Data); GUILayout.Label("GetUserStat(TestConstants.Instance.k_SteamId_rlabrecque, \"NumWins\", out Data) : " + ret + " -- " + Data); } { float Data; bool ret = SteamUserStats.GetUserStat(TestConstants.Instance.k_SteamId_rlabrecque, "MaxFeetTraveled", out Data); GUILayout.Label("GetUserStat(TestConstants.Instance.k_SteamId_rlabrecque, \"MaxFeetTraveled\", out Data) : " + ret + " -- " + Data); } { bool Achieved; bool ret = SteamUserStats.GetUserAchievement(TestConstants.Instance.k_SteamId_rlabrecque, "ACH_TRAVEL_FAR_ACCUM", out Achieved); GUILayout.Label("GetUserAchievement(TestConstants.Instance.k_SteamId_rlabrecque, \"ACH_TRAVEL_FAR_ACCUM\", out Achieved) : " + ret + " -- " + Achieved); } { bool Achieved; uint UnlockTime; bool ret = SteamUserStats.GetUserAchievementAndUnlockTime(TestConstants.Instance.k_SteamId_rlabrecque, "ACH_WIN_ONE_GAME", out Achieved, out UnlockTime); GUILayout.Label("GetUserAchievementAndUnlockTime(TestConstants.Instance.k_SteamId_rlabrecque, \"ACH_WIN_ONE_GAME\", out Achieved, out UnlockTime) : " + ret + " -- " + Achieved + " -- " + UnlockTime); } if (GUILayout.Button("ResetAllStats(true)")) { bool ret = SteamUserStats.ResetAllStats(true); print("SteamUserStats.ResetAllStats(" + true + ") : " + ret); } if (GUILayout.Button("FindOrCreateLeaderboard(\"Feet Traveled\", ELeaderboardSortMethod.k_ELeaderboardSortMethodAscending, ELeaderboardDisplayType.k_ELeaderboardDisplayTypeNumeric)")) { SteamAPICall_t handle = SteamUserStats.FindOrCreateLeaderboard("Feet Traveled", ELeaderboardSortMethod.k_ELeaderboardSortMethodAscending, ELeaderboardDisplayType.k_ELeaderboardDisplayTypeNumeric); OnLeaderboardFindResultCallResult.Set(handle); print("SteamUserStats.FindOrCreateLeaderboard(" + "\"Feet Traveled\"" + ", " + ELeaderboardSortMethod.k_ELeaderboardSortMethodAscending + ", " + ELeaderboardDisplayType.k_ELeaderboardDisplayTypeNumeric + ") : " + handle); } if (GUILayout.Button("FindLeaderboard(\"Feet Traveled\")")) { SteamAPICall_t handle = SteamUserStats.FindLeaderboard("Feet Traveled"); OnLeaderboardFindResultCallResult.Set(handle); print("SteamUserStats.FindLeaderboard(" + "\"Feet Traveled\"" + ") : " + handle); } // Spams SteamAPI Warnings that the SteamLeaderboard does not exist. if (m_SteamLeaderboard != new SteamLeaderboard_t(0)) { GUILayout.Label("GetLeaderboardName(m_SteamLeaderboard) : " + SteamUserStats.GetLeaderboardName(m_SteamLeaderboard)); GUILayout.Label("GetLeaderboardEntryCount(m_SteamLeaderboard) : " + SteamUserStats.GetLeaderboardEntryCount(m_SteamLeaderboard)); GUILayout.Label("GetLeaderboardSortMethod(m_SteamLeaderboard) : " + SteamUserStats.GetLeaderboardSortMethod(m_SteamLeaderboard)); GUILayout.Label("GetLeaderboardDisplayType(m_SteamLeaderboard) : " + SteamUserStats.GetLeaderboardDisplayType(m_SteamLeaderboard)); } else { GUILayout.Label("GetLeaderboardName(m_SteamLeaderboard) : "); GUILayout.Label("GetLeaderboardEntryCount(m_SteamLeaderboard) : "); GUILayout.Label("GetLeaderboardSortMethod(m_SteamLeaderboard) : "); GUILayout.Label("GetLeaderboardDisplayType(m_SteamLeaderboard) : "); } if (GUILayout.Button("DownloadLeaderboardEntries(m_SteamLeaderboard, ELeaderboardDataRequest.k_ELeaderboardDataRequestGlobal, 1, 5)")) { SteamAPICall_t handle = SteamUserStats.DownloadLeaderboardEntries(m_SteamLeaderboard, ELeaderboardDataRequest.k_ELeaderboardDataRequestGlobal, 1, 5); OnLeaderboardScoresDownloadedCallResult.Set(handle); print("SteamUserStats.DownloadLeaderboardEntries(" + m_SteamLeaderboard + ", " + ELeaderboardDataRequest.k_ELeaderboardDataRequestGlobal + ", " + 1 + ", " + 5 + ") : " + handle); } if (GUILayout.Button("DownloadLeaderboardEntriesForUsers(m_SteamLeaderboard, Users, Users.Length)")) { CSteamID[] Users = { SteamUser.GetSteamID() }; SteamAPICall_t handle = SteamUserStats.DownloadLeaderboardEntriesForUsers(m_SteamLeaderboard, Users, Users.Length); OnLeaderboardScoresDownloadedCallResult.Set(handle); print("SteamUserStats.DownloadLeaderboardEntriesForUsers(" + m_SteamLeaderboard + ", " + Users + ", " + Users.Length + ") : " + handle); } if (GUILayout.Button("GetDownloadedLeaderboardEntry(m_SteamLeaderboardEntries, 0, out LeaderboardEntry, null, 0)")) { LeaderboardEntry_t LeaderboardEntry; bool ret = SteamUserStats.GetDownloadedLeaderboardEntry(m_SteamLeaderboardEntries, 0, out LeaderboardEntry, null, 0); print("SteamUserStats.GetDownloadedLeaderboardEntry(" + m_SteamLeaderboardEntries + ", " + 0 + ", " + "out LeaderboardEntry" + ", " + null + ", " + 0 + ") : " + ret + " -- " + LeaderboardEntry); } if (GUILayout.Button("UploadLeaderboardScore(m_SteamLeaderboard, ELeaderboardUploadScoreMethod.k_ELeaderboardUploadScoreMethodForceUpdate, (int)m_FeetTraveledStat, null, 0)")) { SteamAPICall_t handle = SteamUserStats.UploadLeaderboardScore(m_SteamLeaderboard, ELeaderboardUploadScoreMethod.k_ELeaderboardUploadScoreMethodForceUpdate, (int)m_FeetTraveledStat, null, 0); OnLeaderboardScoreUploadedCallResult.Set(handle); print("SteamUserStats.UploadLeaderboardScore(" + m_SteamLeaderboard + ", " + ELeaderboardUploadScoreMethod.k_ELeaderboardUploadScoreMethodForceUpdate + ", " + (int)m_FeetTraveledStat + ", " + null + ", " + 0 + ") : " + handle); } if (GUILayout.Button("AttachLeaderboardUGC(m_SteamLeaderboard, UGCHandle_t.Invalid)")) { SteamAPICall_t handle = SteamUserStats.AttachLeaderboardUGC(m_SteamLeaderboard, UGCHandle_t.Invalid); OnLeaderboardUGCSetCallResult.Set(handle); print("SteamUserStats.AttachLeaderboardUGC(" + m_SteamLeaderboard + ", " + UGCHandle_t.Invalid + ") : " + handle); } if (GUILayout.Button("GetNumberOfCurrentPlayers()")) { SteamAPICall_t handle = SteamUserStats.GetNumberOfCurrentPlayers(); OnNumberOfCurrentPlayersCallResult.Set(handle); print("SteamUserStats.GetNumberOfCurrentPlayers() : " + handle); } if (GUILayout.Button("RequestGlobalAchievementPercentages()")) { SteamAPICall_t handle = SteamUserStats.RequestGlobalAchievementPercentages(); OnGlobalAchievementPercentagesReadyCallResult.Set(handle); print("SteamUserStats.RequestGlobalAchievementPercentages() : " + handle); } { int Iterator; { string Name; float Percent; bool Achieved; Iterator = SteamUserStats.GetMostAchievedAchievementInfo(out Name, 120, out Percent, out Achieved); if (Iterator != -1) { GUILayout.Label("GetMostAchievedAchievementInfo(out Name, 120, out Percent, out Achieved) : " + Iterator + " -- " + Name + " -- " + Percent + " -- " + Achieved); } else { GUILayout.Label("GetMostAchievedAchievementInfo(out Name, 120, out Percent, out Achieved) : " + Iterator); } } if (Iterator != -1) { string Name; float Percent; bool Achieved; Iterator = SteamUserStats.GetNextMostAchievedAchievementInfo(Iterator, out Name, 120, out Percent, out Achieved); GUILayout.Label("GetNextMostAchievedAchievementInfo(out Name, 120, out Percent, out Achieved) : " + Iterator + " -- " + Name + " -- " + Percent + " -- " + Achieved); } } { float Percent; bool ret = SteamUserStats.GetAchievementAchievedPercent("ACH_WIN_100_GAMES", out Percent); GUILayout.Label("GetAchievementAchievedPercent(\"ACH_WIN_100_GAMES\", out Percent) : " + ret + " -- " + Percent); } if (GUILayout.Button("RequestGlobalStats(3)")) { SteamAPICall_t handle = SteamUserStats.RequestGlobalStats(3); OnGlobalStatsReceivedCallResult.Set(handle); print("SteamUserStats.RequestGlobalStats(" + 3 + ") : " + handle); } /* TODO - Spams SteamAPI warnings * Does SpaceWar have a stat marked as "aggregated" to try out these functions? * { * long Data; * bool ret = SteamUserStats.GetGlobalStat("", out Data); * GUILayout.Label("GetGlobalStat(\"\", out Data) : " + ret + " -- " + Data); * } */ { double Data; bool ret = SteamUserStats.GetGlobalStat("", out Data); GUILayout.Label("GetGlobalStat(\"\", out Data) : " + ret + " -- " + Data); } { long[] Data = new long[1]; int ret = SteamUserStats.GetGlobalStatHistory("", Data, (uint)Data.Length); if (ret != 0) { GUILayout.Label("GetGlobalStatHistory(\"\", Data, " + (uint)Data.Length + ") : " + ret + " -- " + Data[0]); } else { GUILayout.Label("GetGlobalStatHistory(\"\", Data, " + (uint)Data.Length + ") : " + ret + " -- "); } } { double[] Data = new double[1]; int ret = SteamUserStats.GetGlobalStatHistory("", Data, (uint)Data.Length); if (ret != 0) { GUILayout.Label("GetGlobalStatHistory(\"\", Data, " + (uint)Data.Length + ") : " + ret + " -- " + Data[0]); } else { GUILayout.Label("GetGlobalStatHistory(\"\", Data, " + (uint)Data.Length + ") : " + ret + " -- "); } } //SteamUserStats.InstallPS3Trophies() // PS3 Only. //SteamUserStats.GetTrophySpaceRequiredBeforeInstall() // PS3 Only. //SteamUserStats.SetUserStatsData() // PS3 Only. //SteamUserStats.GetUserStatsData() // PS3 Only. GUILayout.EndScrollView(); GUILayout.EndVertical(); }