This commit is contained in:
Riley Labrecque
2022-07-17 20:47:24 -07:00
parent 37e939ea0d
commit 28ab7e1d4d
36 changed files with 1149 additions and 367 deletions
+26
View File
@@ -26,6 +26,7 @@
#include "steam/steamencryptedappticket.h"
#include "RemotePlay.h"
#include "ItemStore.h"
#include "OverlayExamples.h"
#ifdef WIN32
#include <direct.h>
#else
@@ -170,6 +171,8 @@ void CSpaceWarClient::Init( IGameEngine *pGameEngine )
m_pItemStore = new CItemStore( pGameEngine );
m_pItemStore->LoadItemsWithPrices();
m_pOverlayExamples = new COverlayExamples( pGameEngine );
LoadWorkshopItems();
}
@@ -1047,6 +1050,15 @@ void CSpaceWarClient::OnMenuSelection( PurchaseableItem_t selection )
}
//-----------------------------------------------------------------------------
// Purpose: Handles menu actions when viewing Overlay Examples
//-----------------------------------------------------------------------------
void CSpaceWarClient::OnMenuSelection( OverlayExample_t selection )
{
m_pOverlayExamples->OnMenuSelection( selection );
}
//-----------------------------------------------------------------------------
// Purpose: For a player in game, set the appropriate rich presence keys for display
// in the Steam friends list and return the value for steam_display
@@ -1234,6 +1246,12 @@ void CSpaceWarClient::OnGameStateChanged( EClientGameState eGameStateNew )
m_pItemStore->Show();
SteamFriends()->SetRichPresence( "status", "Viewing Item Store" );
}
else if ( m_eGameState == k_EClientOverlayAPI )
{
// we've switched to the item store
m_pOverlayExamples->Show();
SteamFriends()->SetRichPresence( "status", "Viewing Overlay API Examples" );
}
if ( pchSteamRichPresenceDisplay != NULL )
{
@@ -1755,6 +1773,14 @@ void CSpaceWarClient::RunFrame()
if (bEscapePressed)
SetGameState(k_EClientGameMenu);
break;
case k_EClientOverlayAPI:
m_pStarField->Render();
m_pOverlayExamples->RunFrame();
if ( bEscapePressed )
SetGameState( k_EClientGameMenu );
break;
default:
OutputDebugString( "Unhandled game state in CSpaceWar::RunFrame\n" );