add ScreenInsertCredit
This commit is contained in:
@@ -4393,6 +4393,9 @@ Clear Machine Stats,1=screen,ScreenClearMachineStats;name,ClearMachineStats
|
||||
Input Options=1,together
|
||||
Input OptionsDefault=
|
||||
Input Options,1=screen,ScreenInputOptions;name,InputOptions
|
||||
Insert Credit=1,together
|
||||
Insert CreditDefault=
|
||||
Insert Credit,1=screen,ScreenInsertCredit;name,InsertCredit
|
||||
Gameplay Options=1,together
|
||||
Gameplay OptionsDefault=
|
||||
Gameplay Options,1=screen,ScreenGameplayOptions;name,GameplayOptions
|
||||
@@ -4498,6 +4501,9 @@ NoData=NO DATA
|
||||
[HighScore]
|
||||
EmptyName=STEP
|
||||
|
||||
[ScreenInsertCredit]
|
||||
NextScreen=ScreenOptionsMenu
|
||||
|
||||
[ScreenDownloadMachineStats]
|
||||
NextScreen=ScreenOptionsMenu
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ ScreenEditMenu.cpp ScreenEditMenu.h ScreenEnding.cpp ScreenEnding.h \
|
||||
ScreenEndlessBreak.cpp ScreenEndlessBreak.h ScreenEvaluation.cpp ScreenEvaluation.h ScreenExit.cpp ScreenExit.h \
|
||||
ScreenEz2SelectMusic.cpp ScreenEz2SelectMusic.h ScreenEz2SelectPlayer.cpp ScreenEz2SelectPlayer.h \
|
||||
ScreenGameOver.cpp ScreenGameOver.h ScreenGameplay.cpp ScreenGameplay.h ScreenHowToPlay.cpp ScreenHowToPlay.h \
|
||||
ScreenInstructions.cpp ScreenInstructions.h ScreenJukebox.cpp ScreenJukebox.h \
|
||||
ScreenInstructions.cpp ScreenInstructions.h ScreenInsertCredit.cpp ScreenInsertCredit.h \
|
||||
ScreenJukebox.cpp ScreenJukebox.h \
|
||||
ScreenJukeboxMenu.cpp ScreenJukeboxMenu.h ScreenLogo.cpp ScreenLogo.h ScreenMapControllers.cpp ScreenMapControllers.h \
|
||||
ScreenMessage.h ScreenMiniMenu.cpp ScreenMiniMenu.h ScreenMusicScroll.cpp ScreenMusicScroll.h \
|
||||
ScreenNameEntry.cpp ScreenNameEntry.h ScreenNameEntryTraditional.cpp ScreenNameEntryTraditional.h \
|
||||
|
||||
@@ -301,6 +301,7 @@ void Screen::ClearMessageQueue( const ScreenMessage SM )
|
||||
#include "ScreenClearMachineStats.h"
|
||||
#include "ScreenResetToDefaults.h"
|
||||
#include "ScreenClearBookkeepingData.h"
|
||||
#include "ScreenInsertCredit.h"
|
||||
|
||||
Screen* Screen::Create( CString sClassName )
|
||||
{
|
||||
@@ -369,6 +370,7 @@ Screen* Screen::Create( CString sClassName )
|
||||
IF_RETURN( ScreenClearMachineStats );
|
||||
IF_RETURN( ScreenResetToDefaults );
|
||||
IF_RETURN( ScreenClearBookkeepingData );
|
||||
IF_RETURN( ScreenInsertCredit );
|
||||
|
||||
RageException::Throw( "Invalid Screen class name '%s'", sClassName.c_str() );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
#include "global.h"
|
||||
#include "ScreenInsertCredit.h"
|
||||
#include "ProfileManager.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "MemoryCardManager.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "StepMania.h"
|
||||
|
||||
#define NEXT_SCREEN THEME->GetMetric(m_sName,"NextScreen")
|
||||
|
||||
static void SaveMachineStatsToFirstMemCard()
|
||||
{
|
||||
InsertCredit();
|
||||
}
|
||||
|
||||
ScreenInsertCredit::ScreenInsertCredit( CString sName ): Screen( sName )
|
||||
{
|
||||
SaveMachineStatsToFirstMemCard();
|
||||
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2004 Chris Danford
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||
* whom the Software is furnished to do so, provided that the above
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef ScreenInsertCredit_H
|
||||
#define ScreenInsertCredit_H
|
||||
|
||||
#include "Screen.h"
|
||||
|
||||
class ScreenInsertCredit: public Screen
|
||||
{
|
||||
public:
|
||||
ScreenInsertCredit( CString sName );
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (c) 2004 Chris Danford
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||
* whom the Software is furnished to do so, provided that the above
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
@@ -1283,6 +1283,20 @@ CString SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature,
|
||||
return sFileName;
|
||||
}
|
||||
|
||||
void InsertCoin( int iNum )
|
||||
{
|
||||
GAMESTATE->m_iCoins += iNum;
|
||||
LOG->Trace("%i coins inserted, %i needed to play", GAMESTATE->m_iCoins, PREFSMAN->m_iCoinsPerCredit);
|
||||
BOOKKEEPER->CoinInserted();
|
||||
SCREENMAN->RefreshCreditsMessages();
|
||||
SCREENMAN->PlayCoinSound();
|
||||
}
|
||||
|
||||
void InsertCredit()
|
||||
{
|
||||
GAMESTATE->m_iCoins += PREFSMAN->m_iCoinsPerCredit;
|
||||
}
|
||||
|
||||
/* Returns true if the key has been handled and should be discarded, false if
|
||||
* the key should be sent on to screens. */
|
||||
bool HandleGlobalInputs( DeviceInput DeviceI, InputEventType type, GameInput GameI, MenuInput MenuI, StyleInput StyleI )
|
||||
@@ -1313,12 +1327,7 @@ bool HandleGlobalInputs( DeviceInput DeviceI, InputEventType type, GameInput Gam
|
||||
LOG->Trace( "Ignored coin insertion (editing)" );
|
||||
break;
|
||||
}
|
||||
|
||||
GAMESTATE->m_iCoins++;
|
||||
LOG->Trace("%i coins inserted, %i needed to play", GAMESTATE->m_iCoins, PREFSMAN->m_iCoinsPerCredit);
|
||||
BOOKKEEPER->CoinInserted();
|
||||
SCREENMAN->RefreshCreditsMessages();
|
||||
SCREENMAN->PlayCoinSound();
|
||||
InsertCoin();
|
||||
return false; // Attract need to know because they go to TitleMenu on > 1 credit
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ void ChangeCurrentGame( Game g );
|
||||
// If successful, return filename of screenshot in sDir, else return ""
|
||||
CString SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex = -1 );
|
||||
|
||||
void InsertCoin( int iNum = 1 );
|
||||
void InsertCredit();
|
||||
|
||||
#if defined(_WINDOWS)
|
||||
#include "windows.h"
|
||||
extern HWND g_hWndMain;
|
||||
|
||||
Reference in New Issue
Block a user