force particular Premium and CoinMode values if bEventMode

This commit is contained in:
Chris Danford
2004-06-09 08:14:21 +00:00
parent 0b8b2ad654
commit a266e00c93
10 changed files with 51 additions and 26 deletions
+1 -1
View File
@@ -751,7 +751,7 @@ bool GameState::PlayersCanJoin() const
bool GameState::EnoughCreditsToJoin() const bool GameState::EnoughCreditsToJoin() const
{ {
switch( PREFSMAN->m_iCoinMode ) switch( PREFSMAN->GetCoinMode() )
{ {
case COIN_PAY: case COIN_PAY:
return GAMESTATE->m_iCoins >= PREFSMAN->m_iCoinsPerCredit; return GAMESTATE->m_iCoins >= PREFSMAN->m_iCoinsPerCredit;
+4 -4
View File
@@ -224,7 +224,7 @@ int GetNumCreditsPaid()
int iNumCreditsPaid = GAMESTATE->GetNumSidesJoined(); int iNumCreditsPaid = GAMESTATE->GetNumSidesJoined();
// players other than the first joined for free // players other than the first joined for free
if( PREFSMAN->m_Premium == PrefsManager::JOINT_PREMIUM ) if( PREFSMAN->GetPremium() == PrefsManager::JOINT_PREMIUM )
iNumCreditsPaid = min( iNumCreditsPaid, 1 ); iNumCreditsPaid = min( iNumCreditsPaid, 1 );
return iNumCreditsPaid; return iNumCreditsPaid;
@@ -233,7 +233,7 @@ int GetNumCreditsPaid()
int GetCreditsRequiredToPlayStyle( Style style ) int GetCreditsRequiredToPlayStyle( Style style )
{ {
if( PREFSMAN->m_Premium == PrefsManager::JOINT_PREMIUM ) if( PREFSMAN->GetPremium() == PrefsManager::JOINT_PREMIUM )
return 1; return 1;
switch( GAMEMAN->GetStyleDefForStyle(style)->m_StyleType ) switch( GAMEMAN->GetStyleDefForStyle(style)->m_StyleType )
@@ -243,7 +243,7 @@ int GetCreditsRequiredToPlayStyle( Style style )
case StyleDef::TWO_PLAYERS_TWO_CREDITS: case StyleDef::TWO_PLAYERS_TWO_CREDITS:
return 2; return 2;
case StyleDef::ONE_PLAYER_TWO_CREDITS: case StyleDef::ONE_PLAYER_TWO_CREDITS:
return (PREFSMAN->m_Premium == PrefsManager::DOUBLES_PREMIUM) ? 1 : 2; return (PREFSMAN->GetPremium() == PrefsManager::DOUBLES_PREMIUM) ? 1 : 2;
default: default:
ASSERT(0); ASSERT(0);
return 1; return 1;
@@ -289,7 +289,7 @@ bool ModeChoice::IsPlayable( CString *why ) const
const int iNumCreditsPaid = GetNumCreditsPaid(); const int iNumCreditsPaid = GetNumCreditsPaid();
const int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_style); const int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_style);
switch( PREFSMAN->m_iCoinMode ) switch( PREFSMAN->GetCoinMode() )
{ {
case COIN_HOME: case COIN_HOME:
case COIN_FREE: case COIN_FREE:
+18
View File
@@ -8,6 +8,7 @@
#include "RageSoundReader_Resample.h" /* for ResampleQuality */ #include "RageSoundReader_Resample.h" /* for ResampleQuality */
#include "RageFile.h" #include "RageFile.h"
#include "ProductInfo.h" #include "ProductInfo.h"
#include "GameConstantsAndTypes.h"
#define STEPMANIA_INI_PATH "Data/StepMania.ini" #define STEPMANIA_INI_PATH "Data/StepMania.ini"
#define STATIC_INI_PATH "Data/Static.ini" #define STATIC_INI_PATH "Data/Static.ini"
@@ -812,6 +813,23 @@ void PrefsManager::ResetToFactoryDefaults()
m_bFirstRun = false; m_bFirstRun = false;
} }
int PrefsManager::GetCoinMode()
{
if(m_bEventMode)
return COIN_FREE;
else
return m_iCoinMode;
}
PrefsManager::Premium PrefsManager::GetPremium()
{
if(m_bEventMode)
return NO_PREMIUM;
else
return m_Premium;
}
/* /*
* (c) 2001-2004 Chris Danford, Chris Gomez * (c) 2001-2004 Chris Danford, Chris Gomez
* All rights reserved. * All rights reserved.
+9 -3
View File
@@ -49,8 +49,6 @@ public:
bool m_bOnlyDedicatedMenuButtons; bool m_bOnlyDedicatedMenuButtons;
bool m_bMenuTimer; bool m_bMenuTimer;
bool m_bShowDanger; bool m_bShowDanger;
int m_iNumArcadeStages;
bool m_bEventMode;
float m_fJudgeWindowScale; float m_fJudgeWindowScale;
float m_fJudgeWindowSecondsMarvelous; float m_fJudgeWindowSecondsMarvelous;
@@ -139,10 +137,18 @@ public:
int m_iMusicWheelSwitchSpeed; int m_iMusicWheelSwitchSpeed;
bool m_bEasterEggs; bool m_bEasterEggs;
int m_iMarvelousTiming; int m_iMarvelousTiming;
int m_iCoinMode; bool m_bEventMode;
int m_iCoinsPerCredit; int m_iCoinsPerCredit;
int m_iNumArcadeStages;
// These options have weird interactions depending on m_bEventMode,
// so wrap them.
enum Premium { NO_PREMIUM, DOUBLES_PREMIUM, JOINT_PREMIUM }; enum Premium { NO_PREMIUM, DOUBLES_PREMIUM, JOINT_PREMIUM };
int m_iCoinMode;
Premium m_Premium; Premium m_Premium;
int GetCoinMode();
Premium GetPremium();
bool m_bDelayedCreditsReconcile; bool m_bDelayedCreditsReconcile;
bool m_bPickExtraStage; bool m_bPickExtraStage;
bool m_bComboContinuesBetweenSongs; bool m_bComboContinuesBetweenSongs;
+5 -4
View File
@@ -160,12 +160,13 @@ bool Screen::ChangeCoinModeInput( const DeviceInput& DeviceI, const InputEventTy
return false; return false;
if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == SDLK_F3 ) if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == SDLK_F3 )
{ {
(int&)PREFSMAN->m_iCoinMode = (PREFSMAN->m_iCoinMode+1) % NUM_COIN_MODES; PREFSMAN->m_iCoinMode++;
wrap( PREFSMAN->m_iCoinMode, NUM_COIN_MODES );
/* ResetGame(); /* ResetGame();
This causes problems on ScreenIntroMovie, which results in the This causes problems on ScreenIntroMovie, which results in the
movie being restarted and/or becoming out-of-synch -- Miryokuteki */ movie being restarted and/or becoming out-of-synch -- Miryokuteki */
CString sMessage = CoinModeToString( (CoinMode)PREFSMAN->m_iCoinMode ); CString sMessage = CoinModeToString( (CoinMode)PREFSMAN->GetCoinMode() );
sMessage.MakeUpper(); sMessage.MakeUpper();
sMessage = "Coin Mode: " + sMessage; sMessage = "Coin Mode: " + sMessage;
SCREENMAN->RefreshCreditsMessages(); SCREENMAN->RefreshCreditsMessages();
@@ -188,11 +189,11 @@ bool Screen::JoinInput( const DeviceInput& DeviceI, const InputEventType type, c
/* subtract coins */ /* subtract coins */
int iCoinsToCharge = 0; int iCoinsToCharge = 0;
if( PREFSMAN->m_iCoinMode == COIN_PAY ) if( PREFSMAN->GetCoinMode() == COIN_PAY )
iCoinsToCharge = PREFSMAN->m_iCoinsPerCredit; iCoinsToCharge = PREFSMAN->m_iCoinsPerCredit;
// If joint premium don't take away a credit for the 2nd join. // If joint premium don't take away a credit for the 2nd join.
if( PREFSMAN->m_Premium == PrefsManager::JOINT_PREMIUM && if( PREFSMAN->GetPremium() == PrefsManager::JOINT_PREMIUM &&
GAMESTATE->GetNumSidesJoined() == 1 ) GAMESTATE->GetNumSidesJoined() == 1 )
iCoinsToCharge = 0; iCoinsToCharge = 0;
+1 -1
View File
@@ -91,7 +91,7 @@ void ScreenAttract::AttractInput( const DeviceInput& DeviceI, const InputEventTy
case MENU_BUTTON_START: case MENU_BUTTON_START:
case MENU_BUTTON_BACK: case MENU_BUTTON_BACK:
case MENU_BUTTON_COIN: case MENU_BUTTON_COIN:
switch( PREFSMAN->m_iCoinMode ) switch( PREFSMAN->GetCoinMode() )
{ {
case COIN_PAY: case COIN_PAY:
LOG->Trace("ScreenAttract::AttractInput: COIN_PAY (%i/%i)", GAMESTATE->m_iCoins, PREFSMAN->m_iCoinsPerCredit ); LOG->Trace("ScreenAttract::AttractInput: COIN_PAY (%i/%i)", GAMESTATE->m_iCoins, PREFSMAN->m_iCoinsPerCredit );
+1 -1
View File
@@ -215,7 +215,7 @@ void ScreenSystemLayer::RefreshCreditsMessages()
} }
else else
{ {
switch( PREFSMAN->m_iCoinMode ) switch( PREFSMAN->GetCoinMode() )
{ {
case COIN_HOME: case COIN_HOME:
if( GAMESTATE->PlayersCanJoin() ) if( GAMESTATE->PlayersCanJoin() )
+2 -2
View File
@@ -197,9 +197,9 @@ void ScreenSelectMode::UpdateSelectableChoices()
(mc.m_style == STYLE_INVALID) ? (mc.m_style == STYLE_INVALID) ?
1 : 1 :
1; 1;
if( PREFSMAN->m_Premium!=PrefsManager::JOINT_PREMIUM || if( PREFSMAN->GetPremium()!=PrefsManager::JOINT_PREMIUM ||
( (
(PREFSMAN->m_Premium==PrefsManager::JOINT_PREMIUM) && (PREFSMAN->GetPremium()==PrefsManager::JOINT_PREMIUM) &&
( (
(INCLUDE_DOUBLE_IN_JP == 1 && (GAMESTATE->GetNumSidesJoined() == SidesJoinedToPlay)) || (INCLUDE_DOUBLE_IN_JP == 1 && (GAMESTATE->GetNumSidesJoined() == SidesJoinedToPlay)) ||
( (
+1 -1
View File
@@ -100,7 +100,7 @@ ScreenSelectStyle::ScreenSelectStyle( CString sClassName ) : ScreenSelect( sClas
m_sprPremium.SetName( "Premium" ); m_sprPremium.SetName( "Premium" );
switch( PREFSMAN->m_Premium ) switch( PREFSMAN->GetPremium() )
{ {
case PrefsManager::DOUBLES_PREMIUM: case PrefsManager::DOUBLES_PREMIUM:
m_sprPremium.Load( THEME->GetPathToG(m_sName + " doubles premium") ); m_sprPremium.Load( THEME->GetPathToG(m_sName + " doubles premium") );
+9 -9
View File
@@ -55,7 +55,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
// Don't show screen title menu (says "Press Start") // Don't show screen title menu (says "Press Start")
// if there are 0 credits and inserted and CoinMode is pay. // if there are 0 credits and inserted and CoinMode is pay.
if( PREFSMAN->m_iCoinMode == COIN_PAY && if( PREFSMAN->GetCoinMode() == COIN_PAY &&
GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit ) GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit )
{ {
SCREENMAN->SetNewScreen( THEME->GetMetric("Common","InitialScreen") ); SCREENMAN->SetNewScreen( THEME->GetMetric("Common","InitialScreen") );
@@ -72,12 +72,12 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
m_sprLogo.Load( THEME->GetPathToG(ssprintf("ScreenLogo %s",GAMESTATE->GetCurrentGameDef()->m_szName)) ); m_sprLogo.Load( THEME->GetPathToG(ssprintf("ScreenLogo %s",GAMESTATE->GetCurrentGameDef()->m_szName)) );
m_sprLogo.Command( PREFSMAN->m_iCoinMode==COIN_HOME ? LOGO_HOME_ON_COMMAND : LOGO_ON_COMMAND ); m_sprLogo.Command( PREFSMAN->GetCoinMode()==COIN_HOME ? LOGO_HOME_ON_COMMAND : LOGO_ON_COMMAND );
this->AddChild( &m_sprLogo ); this->AddChild( &m_sprLogo );
if( PREFSMAN->m_iCoinMode != COIN_HOME ) if( PREFSMAN->GetCoinMode() != COIN_HOME )
{ {
switch( PREFSMAN->m_Premium ) switch( PREFSMAN->GetPremium() )
{ {
case PrefsManager::DOUBLES_PREMIUM: case PrefsManager::DOUBLES_PREMIUM:
m_Premium.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu doubles premium") ); m_Premium.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu doubles premium") );
@@ -113,19 +113,19 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
m_textMaxStages.SetText( sText ); m_textMaxStages.SetText( sText );
this->AddChild( &m_textMaxStages ); this->AddChild( &m_textMaxStages );
CString sCoinMode = CoinModeToString((CoinMode)PREFSMAN->m_iCoinMode); CString sCoinMode = CoinModeToString((CoinMode)PREFSMAN->GetCoinMode());
m_CoinMode.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu "+sCoinMode) ); m_CoinMode.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu "+sCoinMode) );
this->AddChild( &m_CoinMode ); this->AddChild( &m_CoinMode );
m_textHelp.LoadFromFont( THEME->GetPathToF("ScreenTitleMenu help") ); m_textHelp.LoadFromFont( THEME->GetPathToF("ScreenTitleMenu help") );
m_textHelp.SetText( HELP_TEXT((CoinMode)PREFSMAN->m_iCoinMode) ); m_textHelp.SetText( HELP_TEXT((CoinMode)PREFSMAN->GetCoinMode()) );
m_textHelp.SetXY( HELP_X, HELP_Y ); m_textHelp.SetXY( HELP_X, HELP_Y );
m_textHelp.SetZoom( 0.5f ); m_textHelp.SetZoom( 0.5f );
m_textHelp.SetEffectDiffuseBlink(); m_textHelp.SetEffectDiffuseBlink();
m_textHelp.SetShadowLength( 2 ); m_textHelp.SetShadowLength( 2 );
this->AddChild( &m_textHelp ); this->AddChild( &m_textHelp );
switch( PREFSMAN->m_iCoinMode ) switch( PREFSMAN->GetCoinMode() )
{ {
case COIN_HOME: case COIN_HOME:
{ {
@@ -195,7 +195,7 @@ void ScreenTitleMenu::UpdateSelectableChoices()
void ScreenTitleMenu::MoveCursor( bool up ) void ScreenTitleMenu::MoveCursor( bool up )
{ {
if( PREFSMAN->m_iCoinMode != COIN_HOME ) if( PREFSMAN->GetCoinMode() != COIN_HOME )
return; return;
// if( m_BeginOut.IsTransitioning() ) // if( m_BeginOut.IsTransitioning() )
// return; // return;
@@ -308,7 +308,7 @@ void ScreenTitleMenu::Update( float fDelta )
{ {
// don't time out on this screen is coin mode is pay. // don't time out on this screen is coin mode is pay.
// If we're here, then there's a credit in the machine. // If we're here, then there's a credit in the machine.
if( PREFSMAN->m_iCoinMode == COIN_PAY ) if( PREFSMAN->GetCoinMode() == COIN_PAY )
; // do nothing ; // do nothing
else else
{ {