add screenshots to ScreenAwards
This commit is contained in:
@@ -18,6 +18,11 @@
|
|||||||
#include "GameState.h"
|
#include "GameState.h"
|
||||||
#include "SongManager.h"
|
#include "SongManager.h"
|
||||||
#include "Steps.h"
|
#include "Steps.h"
|
||||||
|
#include "StyleDef.h"
|
||||||
|
#include "CodeDetector.h"
|
||||||
|
#include "ProfileManager.h"
|
||||||
|
#include "StepMania.h"
|
||||||
|
#include "CryptManager.h"
|
||||||
|
|
||||||
|
|
||||||
#define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen")
|
#define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen")
|
||||||
@@ -26,6 +31,7 @@
|
|||||||
ScreenAward::ScreenAward( CString sName ) : Screen( sName )
|
ScreenAward::ScreenAward( CString sName ) : Screen( sName )
|
||||||
{
|
{
|
||||||
bool bEitherPlayerHasAward = false;
|
bool bEitherPlayerHasAward = false;
|
||||||
|
ZERO( m_bSavedScreenshot );
|
||||||
|
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
{
|
{
|
||||||
@@ -101,6 +107,38 @@ void ScreenAward::Input( const DeviceInput& DeviceI, const InputEventType type,
|
|||||||
if( m_Menu.IsTransitioning() )
|
if( m_Menu.IsTransitioning() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
if( GameI.IsValid() )
|
||||||
|
{
|
||||||
|
PlayerNumber pn = GAMESTATE->GetCurrentStyleDef()->ControllerToPlayerNumber( GameI.controller );
|
||||||
|
|
||||||
|
if( CodeDetector::EnteredCode(GameI.controller, CodeDetector::CODE_SAVE_SCREENSHOT) )
|
||||||
|
{
|
||||||
|
if( !m_bSavedScreenshot[pn] && // only allow one screenshot
|
||||||
|
PROFILEMAN->IsUsingProfile(pn) )
|
||||||
|
{
|
||||||
|
Profile* pProfile = PROFILEMAN->GetProfile(pn);
|
||||||
|
CString sDir = PROFILEMAN->GetProfileDir((ProfileSlot)pn) + "Screenshots/";
|
||||||
|
int iScreenshotIndex = pProfile->GetNextScreenshotIndex();
|
||||||
|
CString sFileName = SaveScreenshot( sDir, true, true, iScreenshotIndex );
|
||||||
|
CString sPath = sDir+sFileName;
|
||||||
|
|
||||||
|
if( !sFileName.empty() )
|
||||||
|
{
|
||||||
|
Profile::Screenshot screenshot;
|
||||||
|
screenshot.sFileName = sFileName;
|
||||||
|
screenshot.sMD5 = CRYPTMAN->GetMD5( sPath );
|
||||||
|
screenshot.time = time(NULL);
|
||||||
|
screenshot.iMachineGuid = PROFILEMAN->GetMachineProfile()->m_iGuid;
|
||||||
|
pProfile->AddScreenshot( screenshot );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_bSavedScreenshot[pn] = true;
|
||||||
|
return; // handled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public:
|
|||||||
virtual void MenuStart( PlayerNumber pn );
|
virtual void MenuStart( PlayerNumber pn );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool m_bSavedScreenshot[NUM_PLAYERS];
|
||||||
|
|
||||||
AutoActor m_Received[NUM_PLAYERS];
|
AutoActor m_Received[NUM_PLAYERS];
|
||||||
AutoActor m_Trophy[NUM_PLAYERS];
|
AutoActor m_Trophy[NUM_PLAYERS];
|
||||||
|
|||||||
Reference in New Issue
Block a user