// STEAM Stats CSteamStats::CSteamStats(Stat_t *Stats, int NumStats) : m_iAppID( 0 ), m_bInitialized( false ), m_CallbackUserStatsReceived( this, &CSteamStats::OnUserStatsReceived ), m_CallbackUserStatsStored( this, &CSteamStats::OnUserStatsStored ) { m_iAppID = SteamUtils()->GetAppID(); m_pStats = Stats; m_iNumStats = NumStats; RequestStats(); }
CSteamAchievements::CSteamAchievements(Achievement_t *Achievements, int NumAchievements): m_iAppID( 0 ), m_bInitialized( false ), m_CallbackUserStatsReceived( this, &CSteamAchievements::OnUserStatsReceived ), m_CallbackUserStatsStored( this, &CSteamAchievements::OnUserStatsStored ), m_CallbackAchievementStored( this, &CSteamAchievements::OnAchievementStored ) { m_iAppID = SteamUtils()->GetAppID(); m_pAchievements = Achievements; m_iNumAchievements = NumAchievements; RequestStats(); }
bool CSteam::Initialize() { if (m_bInitialized) return true; // Try to initialize the version safe API m_bInitialized = (SteamAPI_InitSafe() && m_ctx.Init()); if (!m_bInitialized) { SteamAPI_Shutdown(); m_ctx.Clear(); return false; } m_iAppID = m_ctx.SteamUtils()->GetAppID(); RequestStats(); return true; }
/* * StatButtonCommand: User pressed stat button */ void StatButtonCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) { int group; list_type stat_list; group = StatsFindGroupByHwnd(hwndCtl) + 1; // Skip main stat group if (group == GROUP_NONE) return; if (group != StatsGetCurrentGroup()) { // ajw Changes to make Inventory act somewhat like one of the stats groups. if( StatsGetCurrentGroup() == STATS_INVENTORY ) { // Inventory must be going away. ShowInventory( False ); // StatsShowGroup( True ); } if( group == STATS_INVENTORY ) { // The hacks continue... Force previously toggled non-inventory button to repaint and show new unpressed state. InvalidateRect( buttons[ StatsGetCurrentGroup()-2 ].hwnd, NULL, FALSE ); StatsShowGroup( False ); ShowInventory( True ); DisplayInventoryAsStatGroup( (BYTE)STATS_INVENTORY ); } else { // Check stat cache; if group not present, ask server if (StatCacheGetEntry(group, &stat_list) == True) DisplayStatGroup((BYTE) group, stat_list); else { debug(("Requesting group %d\n", group)); RequestStats(group); } } } if( StatsGetCurrentGroup() == STATS_INVENTORY ) InventorySetFocus( True ); // Force focus to leave stats group window after button within it was pushed. // [ xxx Still broken - click on Inv when it is already selected, but drag off of button and release. ] }