COIN_ -> COIN_MODE_
This commit is contained in:
@@ -482,8 +482,8 @@ bool GameCommand::IsPlayable( CString *why ) const
|
|||||||
|
|
||||||
switch( GAMESTATE->GetCoinMode() )
|
switch( GAMESTATE->GetCoinMode() )
|
||||||
{
|
{
|
||||||
case COIN_HOME:
|
case COIN_MODE_HOME:
|
||||||
case COIN_FREE:
|
case COIN_MODE_FREE:
|
||||||
iCredits = NUM_PLAYERS; /* not iNumCreditsPaid */
|
iCredits = NUM_PLAYERS; /* not iNumCreditsPaid */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,7 +685,7 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
|
|||||||
// players joined. If enough players aren't joined, then
|
// players joined. If enough players aren't joined, then
|
||||||
// we need to subtract credits for the sides that will be
|
// we need to subtract credits for the sides that will be
|
||||||
// joined as a result of applying this option.
|
// joined as a result of applying this option.
|
||||||
if( PREFSMAN->m_CoinMode == COIN_PAY )
|
if( PREFSMAN->m_CoinMode == COIN_MODE_PAY )
|
||||||
{
|
{
|
||||||
int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle);
|
int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle);
|
||||||
int iNumCreditsPaid = GetNumCreditsPaid();
|
int iNumCreditsPaid = GetNumCreditsPaid();
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ static void LuaCoinMode(lua_State* L)
|
|||||||
{
|
{
|
||||||
CString s = CoinModeNames[i];
|
CString s = CoinModeNames[i];
|
||||||
s.MakeUpper();
|
s.MakeUpper();
|
||||||
LUA->SetGlobal( "COIN_"+s, i );
|
LUA->SetGlobal( "COIN_MODE_"+s, i );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
REGISTER_WITH_LUA_FUNCTION( LuaCoinMode );
|
REGISTER_WITH_LUA_FUNCTION( LuaCoinMode );
|
||||||
|
|||||||
@@ -267,7 +267,13 @@ const int ITEM_NONE = -1;
|
|||||||
// Coin stuff
|
// Coin stuff
|
||||||
//
|
//
|
||||||
|
|
||||||
enum CoinMode { COIN_HOME, COIN_PAY, COIN_FREE, NUM_COIN_MODES };
|
enum CoinMode
|
||||||
|
{
|
||||||
|
COIN_MODE_HOME,
|
||||||
|
COIN_MODE_PAY,
|
||||||
|
COIN_MODE_FREE,
|
||||||
|
NUM_COIN_MODES
|
||||||
|
};
|
||||||
#define FOREACH_CoinMode( i ) FOREACH_ENUM( CoinMode, NUM_COIN_MODES, i )
|
#define FOREACH_CoinMode( i ) FOREACH_ENUM( CoinMode, NUM_COIN_MODES, i )
|
||||||
const CString& CoinModeToString( CoinMode cm );
|
const CString& CoinModeToString( CoinMode cm );
|
||||||
|
|
||||||
@@ -275,7 +281,13 @@ const CString& CoinModeToString( CoinMode cm );
|
|||||||
//
|
//
|
||||||
// Premium
|
// Premium
|
||||||
//
|
//
|
||||||
enum Premium { PREMIUM_NONE, PREMIUM_DOUBLE, PREMIUM_JOINT, NUM_PREMIUMS };
|
enum Premium
|
||||||
|
{
|
||||||
|
PREMIUM_NONE,
|
||||||
|
PREMIUM_DOUBLE,
|
||||||
|
PREMIUM_JOINT,
|
||||||
|
NUM_PREMIUMS
|
||||||
|
};
|
||||||
#define FOREACH_Premium( i ) FOREACH_ENUM( Premium, NUM_PREMIUMS, i )
|
#define FOREACH_Premium( i ) FOREACH_ENUM( Premium, NUM_PREMIUMS, i )
|
||||||
const CString& PremiumToString( Premium p );
|
const CString& PremiumToString( Premium p );
|
||||||
|
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ int GameState::GetCoinsNeededToJoin() const
|
|||||||
{
|
{
|
||||||
int iCoinsToCharge = 0;
|
int iCoinsToCharge = 0;
|
||||||
|
|
||||||
if( GAMESTATE->GetCoinMode() == COIN_PAY )
|
if( GAMESTATE->GetCoinMode() == COIN_MODE_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.
|
||||||
@@ -1835,8 +1835,8 @@ bool GameState::IsEventMode() const
|
|||||||
|
|
||||||
CoinMode GameState::GetCoinMode()
|
CoinMode GameState::GetCoinMode()
|
||||||
{
|
{
|
||||||
if( IsEventMode() && PREFSMAN->m_CoinMode == COIN_PAY )
|
if( IsEventMode() && PREFSMAN->m_CoinMode == COIN_MODE_PAY )
|
||||||
return COIN_FREE;
|
return COIN_MODE_FREE;
|
||||||
else
|
else
|
||||||
return PREFSMAN->m_CoinMode;
|
return PREFSMAN->m_CoinMode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ PrefsManager::PrefsManager() :
|
|||||||
m_iCoinsPerCredit ( "CoinsPerCredit", 1 ),
|
m_iCoinsPerCredit ( "CoinsPerCredit", 1 ),
|
||||||
m_iSongsPerPlay ( "SongsPerPlay", 3 ),
|
m_iSongsPerPlay ( "SongsPerPlay", 3 ),
|
||||||
|
|
||||||
m_CoinMode ( "CoinMode", COIN_HOME ),
|
m_CoinMode ( "CoinMode", COIN_MODE_HOME ),
|
||||||
m_Premium ( "Premium", PREMIUM_NONE ),
|
m_Premium ( "Premium", PREMIUM_NONE ),
|
||||||
m_bDelayedCreditsReconcile ( "DelayedCreditsReconcile", false ),
|
m_bDelayedCreditsReconcile ( "DelayedCreditsReconcile", false ),
|
||||||
m_bPickExtraStage ( "PickExtraStage", false ),
|
m_bPickExtraStage ( "PickExtraStage", false ),
|
||||||
|
|||||||
@@ -72,13 +72,13 @@ void ScreenAttract::AttractInput( const DeviceInput& DeviceI, const InputEventTy
|
|||||||
case MENU_BUTTON_COIN:
|
case MENU_BUTTON_COIN:
|
||||||
switch( GAMESTATE->GetCoinMode() )
|
switch( GAMESTATE->GetCoinMode() )
|
||||||
{
|
{
|
||||||
case COIN_PAY:
|
case COIN_MODE_PAY:
|
||||||
LOG->Trace("ScreenAttract::AttractInput: COIN_PAY (%i/%i)", GAMESTATE->m_iCoins, PREFSMAN->m_iCoinsPerCredit.Get() );
|
LOG->Trace("ScreenAttract::AttractInput: COIN_PAY (%i/%i)", GAMESTATE->m_iCoins, PREFSMAN->m_iCoinsPerCredit.Get() );
|
||||||
if( GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit )
|
if( GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit )
|
||||||
break; // don't fall through
|
break; // don't fall through
|
||||||
// fall through
|
// fall through
|
||||||
case COIN_HOME:
|
case COIN_MODE_HOME:
|
||||||
case COIN_FREE:
|
case COIN_MODE_FREE:
|
||||||
if( pScreen->IsTransitioning() )
|
if( pScreen->IsTransitioning() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -322,13 +322,13 @@ static void MarvelousTiming( int &sel, bool ToSel, const ConfOption *pConfOption
|
|||||||
|
|
||||||
static void CoinModeM( int &sel, bool ToSel, const ConfOption *pConfOption )
|
static void CoinModeM( int &sel, bool ToSel, const ConfOption *pConfOption )
|
||||||
{
|
{
|
||||||
const CoinMode mapping[] = { COIN_HOME, COIN_PAY, COIN_FREE };
|
const CoinMode mapping[] = { COIN_MODE_HOME, COIN_MODE_PAY, COIN_MODE_FREE };
|
||||||
MoveMap( sel, PREFSMAN->m_CoinMode, ToSel, mapping, ARRAYSIZE(mapping) );
|
MoveMap( sel, PREFSMAN->m_CoinMode, ToSel, mapping, ARRAYSIZE(mapping) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption )
|
static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption )
|
||||||
{
|
{
|
||||||
const CoinMode mapping[] = { COIN_PAY, COIN_FREE };
|
const CoinMode mapping[] = { COIN_MODE_PAY, COIN_MODE_FREE };
|
||||||
MoveMap( sel, PREFSMAN->m_CoinMode, ToSel, mapping, ARRAYSIZE(mapping) );
|
MoveMap( sel, PREFSMAN->m_CoinMode, ToSel, mapping, ARRAYSIZE(mapping) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ void ScreenSelect::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( GAMESTATE->GetCoinMode() != COIN_PAY )
|
if( GAMESTATE->GetCoinMode() != COIN_MODE_PAY )
|
||||||
{
|
{
|
||||||
if( IDLE_TIMEOUT_SECONDS > 0 && m_timerIdleTimeout.PeekDeltaTime() >= IDLE_TIMEOUT_SECONDS )
|
if( IDLE_TIMEOUT_SECONDS > 0 && m_timerIdleTimeout.PeekDeltaTime() >= IDLE_TIMEOUT_SECONDS )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -180,13 +180,13 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const
|
|||||||
{
|
{
|
||||||
switch( GAMESTATE->GetCoinMode() )
|
switch( GAMESTATE->GetCoinMode() )
|
||||||
{
|
{
|
||||||
case COIN_HOME:
|
case COIN_MODE_HOME:
|
||||||
if( GAMESTATE->PlayersCanJoin() )
|
if( GAMESTATE->PlayersCanJoin() )
|
||||||
return CREDITS_PRESS_START.GetValue();
|
return CREDITS_PRESS_START.GetValue();
|
||||||
else
|
else
|
||||||
return CREDITS_NOT_PRESENT.GetValue();
|
return CREDITS_NOT_PRESENT.GetValue();
|
||||||
|
|
||||||
case COIN_PAY:
|
case COIN_MODE_PAY:
|
||||||
{
|
{
|
||||||
int Credits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
|
int Credits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
|
||||||
int Coins = GAMESTATE->m_iCoins % PREFSMAN->m_iCoinsPerCredit;
|
int Coins = GAMESTATE->m_iCoins % PREFSMAN->m_iCoinsPerCredit;
|
||||||
@@ -197,7 +197,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const
|
|||||||
sCredits += ssprintf(" %d/%d", Coins, PREFSMAN->m_iCoinsPerCredit.Get() );
|
sCredits += ssprintf(" %d/%d", Coins, PREFSMAN->m_iCoinsPerCredit.Get() );
|
||||||
return sCredits;
|
return sCredits;
|
||||||
}
|
}
|
||||||
case COIN_FREE:
|
case COIN_MODE_FREE:
|
||||||
if( GAMESTATE->PlayersCanJoin() )
|
if( GAMESTATE->PlayersCanJoin() )
|
||||||
return CREDITS_FREE_PLAY.GetValue();
|
return CREDITS_FREE_PLAY.GetValue();
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sScreenName ) :
|
|||||||
|
|
||||||
// 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( GAMESTATE->GetCoinMode() == COIN_PAY &&
|
if( GAMESTATE->GetCoinMode() == COIN_MODE_PAY &&
|
||||||
GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit )
|
GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit )
|
||||||
{
|
{
|
||||||
SCREENMAN->SetNewScreen( INITIAL_SCREEN );
|
SCREENMAN->SetNewScreen( INITIAL_SCREEN );
|
||||||
|
|||||||
Reference in New Issue
Block a user