make achivements work without steam( partially )

This commit is contained in:
nillerusr 2022-01-09 19:57:09 +03:00
parent ead7bfc155
commit 05ab85e853
2 changed files with 8 additions and 4 deletions

View file

@ -101,11 +101,12 @@ void CAchievementNotificationPanel::FireGameEvent( IGameEvent * event )
int iMax = event->GetInt( "max_val" ); int iMax = event->GetInt( "max_val" );
wchar_t szLocalizedName[256]=L""; wchar_t szLocalizedName[256]=L"";
#if 0
if ( IsPC() ) if ( IsPC() )
{ {
// shouldn't ever get achievement progress if steam not running and user logged in, but check just in case // shouldn't ever get achievement progress if steam not running and user logged in, but check just in case
if ( !steamapicontext->SteamUserStats() ) if ( !steamapicontext->SteamUserStats() )
{ {
Msg( "Steam not running, achievement progress notification not displayed\n" ); Msg( "Steam not running, achievement progress notification not displayed\n" );
} }
else else
@ -115,6 +116,7 @@ void CAchievementNotificationPanel::FireGameEvent( IGameEvent * event )
} }
} }
else else
#endif
{ {
// on X360 we need to show our own achievement progress UI // on X360 we need to show our own achievement progress UI
@ -245,7 +247,7 @@ void CAchievementNotificationPanel::SetXAndWide( Panel *pPanel, int x, int wide
pPanel->SetWide( wide ); pPanel->SetWide( wide );
} }
CON_COMMAND_F( achievement_notification_test, "Test the hud notification UI", FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY ) CON_COMMAND_F( achievement_notification_test, "Test the hud notification UI", FCVAR_CHEAT )
{ {
static int iCount=0; static int iCount=0;
@ -269,4 +271,4 @@ CON_COMMAND_F( achievement_notification_test, "Test the hud notification UI", FC
#endif #endif
iCount++; iCount++;
} }

View file

@ -930,7 +930,7 @@ void CAchievementMgr::AwardAchievement( int iAchievementID )
pAchievement->OnAchieved(); pAchievement->OnAchieved();
// [tj] // [tj]
IGameEvent * event = gameeventmanager->CreateEvent( "achievement_earned_local" ); IGameEvent * event = gameeventmanager->CreateEvent( "achievement_earned" );
if ( event ) if ( event )
{ {
event->SetInt( "achievement", pAchievement->GetAchievementID() ); event->SetInt( "achievement", pAchievement->GetAchievementID() );
@ -1033,6 +1033,8 @@ extern bool IsInCommentaryMode( void );
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool CAchievementMgr::CheckAchievementsEnabled() bool CAchievementMgr::CheckAchievementsEnabled()
{ {
return true;
// if PC, Steam must be running and user logged in // if PC, Steam must be running and user logged in
if ( IsPC() && !LoggedIntoSteam() ) if ( IsPC() && !LoggedIntoSteam() )
{ {