From 82199383a8d55b3e6a192ee8c299aad9cb9bc738 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 13 Apr 2003 04:50:08 +0000 Subject: [PATCH] Change event mode to a CoinMode (since using COIN_PAY and EventMode at the same time doesn't make sense). Split ScreenLogo and ScreenTitleMenu. In ScreenTitleMenu, add a different animation if using COIN_HOME (for SMMAX2). Added codes at TitleMenu to change Theme and Announcer. --- stepmania/NEWS | 2 + .../ScreenTitleMenu background.redir | 1 + .../BGAnimations/ScreenTitleMenu home.redir | 1 + .../BGAnimations/ScreenTitleMenu in.redir | 1 + .../BGAnimations/ScreenTitleMenu out.redir | 1 + stepmania/Themes/default/metrics.ini | 11 +- stepmania/src/AnnouncerManager.cpp | 24 +++++ stepmania/src/AnnouncerManager.h | 1 + stepmania/src/CodeDetector.cpp | 54 +++------- stepmania/src/CodeDetector.h | 31 +++++- stepmania/src/GameConstantsAndTypes.cpp | 11 ++ stepmania/src/GameConstantsAndTypes.h | 9 ++ stepmania/src/GameState.cpp | 12 +-- stepmania/src/Player.cpp | 3 + stepmania/src/PrefsManager.cpp | 12 +-- stepmania/src/PrefsManager.h | 5 +- stepmania/src/RageUtil.cpp | 9 ++ stepmania/src/RageUtil.h | 2 + stepmania/src/Screen.cpp | 14 +-- stepmania/src/ScreenAppearanceOptions.cpp | 2 +- stepmania/src/ScreenAttract.cpp | 9 +- stepmania/src/ScreenDemonstration.cpp | 2 +- stepmania/src/ScreenEvaluation.cpp | 2 +- stepmania/src/ScreenEz2SelectMusic.cpp | 2 +- stepmania/src/ScreenGameplay.cpp | 2 +- stepmania/src/ScreenHowToPlay.cpp | 1 + stepmania/src/ScreenInstructions.cpp | 15 +-- stepmania/src/ScreenJukebox.cpp | 9 +- stepmania/src/ScreenLogo.cpp | 13 --- stepmania/src/ScreenLogo.h | 3 - stepmania/src/ScreenMachineOptions.cpp | 13 ++- stepmania/src/ScreenManager.cpp | 11 +- stepmania/src/ScreenSelect.cpp | 2 +- stepmania/src/ScreenSelectCourse.cpp | 2 +- stepmania/src/ScreenSelectMusic.cpp | 4 +- stepmania/src/ScreenTitleMenu.cpp | 102 +++++++++++------- stepmania/src/ScreenTitleMenu.h | 18 ++-- stepmania/src/ThemeManager.cpp | 35 +++--- stepmania/src/ThemeManager.h | 4 +- 39 files changed, 263 insertions(+), 192 deletions(-) create mode 100644 stepmania/Themes/default/BGAnimations/ScreenTitleMenu background.redir create mode 100644 stepmania/Themes/default/BGAnimations/ScreenTitleMenu home.redir create mode 100644 stepmania/Themes/default/BGAnimations/ScreenTitleMenu in.redir create mode 100644 stepmania/Themes/default/BGAnimations/ScreenTitleMenu out.redir diff --git a/stepmania/NEWS b/stepmania/NEWS index c230b8b623..3856252d0d 100644 --- a/stepmania/NEWS +++ b/stepmania/NEWS @@ -42,6 +42,8 @@ NEW FEATURE: Set default player and song options in stepmania.ini using DefaultModifiers. NEW FEATURE: Courses can be organized into group folders. See README-FIRST.html for details. +NEW FEATURE: Switch current theme from TitleMenu with L,L,L,R,R,R,L,R. +NEW FEATURE: Switch current announcer from TitleMenu with L,L,R,R,L,R,L,R. ----------------------- Version 3.01 --------------------------- CHANGE: Simplified NoteSkin tap graphic format. Old NoteSkins will need to diff --git a/stepmania/Themes/default/BGAnimations/ScreenTitleMenu background.redir b/stepmania/Themes/default/BGAnimations/ScreenTitleMenu background.redir new file mode 100644 index 0000000000..f50ddf6505 --- /dev/null +++ b/stepmania/Themes/default/BGAnimations/ScreenTitleMenu background.redir @@ -0,0 +1 @@ +ScreenLogo background \ No newline at end of file diff --git a/stepmania/Themes/default/BGAnimations/ScreenTitleMenu home.redir b/stepmania/Themes/default/BGAnimations/ScreenTitleMenu home.redir new file mode 100644 index 0000000000..e410bb21b4 --- /dev/null +++ b/stepmania/Themes/default/BGAnimations/ScreenTitleMenu home.redir @@ -0,0 +1 @@ +_missing \ No newline at end of file diff --git a/stepmania/Themes/default/BGAnimations/ScreenTitleMenu in.redir b/stepmania/Themes/default/BGAnimations/ScreenTitleMenu in.redir new file mode 100644 index 0000000000..d2902773d0 --- /dev/null +++ b/stepmania/Themes/default/BGAnimations/ScreenTitleMenu in.redir @@ -0,0 +1 @@ +_fade in \ No newline at end of file diff --git a/stepmania/Themes/default/BGAnimations/ScreenTitleMenu out.redir b/stepmania/Themes/default/BGAnimations/ScreenTitleMenu out.redir new file mode 100644 index 0000000000..b8a32d0947 --- /dev/null +++ b/stepmania/Themes/default/BGAnimations/ScreenTitleMenu out.redir @@ -0,0 +1 @@ +_fade out \ No newline at end of file diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index f9958b9b98..7a0effa3b4 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -22,6 +22,10 @@ InitialScreen=ScreenCompany DefaultScrollDirection=0 [ScreenTitleMenu] +LogoHomeOnCommand=x,320;y,240;zoomy,0;sleep,0.5;bounceend,0.5;zoomy,1;glowshift;effectperiod,2.5;effectcolor1,1,1,1,0.1;effectcolor2,1,1,1,0.3 +LogoOnCommand=x,320;y,240;zoomy,0;sleep,0.5;bounceend,0.5;zoomy,1;glowshift;effectperiod,2.5;effectcolor1,1,1,1,0.1;effectcolor2,1,1,1,0.3 +VersionOnCommand=horizalign,right;x,620;y,20;diffuse,0.6,0.6,0.6,1;zoom,0.5;shadowlength,2 +SongsOnCommand=horizalign,left;x,20;y,20;diffuse,0.6,0.6,0.6,1;zoom,0.5;shadowlength,2 ChoicesX=320 ChoicesStartY=92 ChoicesSpacingY=52 @@ -37,6 +41,7 @@ SecondsBeforeAttract=30 HelpTextHome=Use &UP; &DOWN; to select, then press START HelpTextPay=Press START to begin HelpTextFree=Press START to begin +HelpTextEvent=Press START to begin NextScreen=ScreenCaution [ScreenCaution] @@ -1069,6 +1074,8 @@ Reverse=Down,Left,Right,Left,Right HoldNotes=Right,Left,Down,Up Dark= CancelAll=Left,Right,Left,Right,Left,Right,Left,Right +NextTheme=Left,Left,Left,Right,Right,Right,Left,Right +NextAnnouncer=Left,Left,Right,Right,Left,Left,Right,Right [GrooveRadar] Label1OffsetX=0 // stream @@ -1119,7 +1126,7 @@ WheelSpeed=Adjusts the speed of the DDR style musicwheel. [ScreenMachineOptions] HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes MenuTimer=Turn this &oq;OFF&cq; to disable the time limit in menus. -ArcadeStages=The number of songs a player can play in Arcade mode.::Set this to &oq;Unlimited&cq;, and you can continue playing forever.::Also, when this option is set to &oq;Unlimited&cq;, failing will take you::back to the the Select Music or Select Course screen. +SongsPerPlay=The number of songs a player can play in Arcade mode.::Set this to &oq;Unlimited&cq;, and you can continue playing forever.::Also, when this option is set to &oq;Unlimited&cq;, failing will take you::back to the the Select Music or Select Course screen. JudgeDifficulty=Increase this value to cause your steps to be judged more strictly::(i.e. shink the timing window). LifeDifficulty=Increate this value to cause your life meter to::drain faster and refill slower. DefaultFailType=Choose the conditions for game over.::ARCADE will stop the music immediately when all players have 0 life.::END OF SONG will cause the game to end at the conclusion of the current song::if all players failed at some point during the song.::OFF disables game over entirely. @@ -1224,8 +1231,6 @@ NextScreen=ScreenLogo [ScreenLogo] LogoOnCommand=x,320;y,240;zoomy,0;sleep,0.5;bounceend,0.5;zoomy,1;glowshift;effectperiod,2.5;effectcolor1,1,1,1,0.1;effectcolor2,1,1,1,0.3 -VersionOnCommand=horizalign,right;x,620;y,20;diffuse,0.6,0.6,0.6,1;zoom,0.5;shadowlength,2 -SongsOnCommand=horizalign,left;x,20;y,20;diffuse,0.6,0.6,0.6,1;zoom,0.5;shadowlength,2 NextScreen=ScreenHowToPlay [ScreenHowToPlay] diff --git a/stepmania/src/AnnouncerManager.cpp b/stepmania/src/AnnouncerManager.cpp index 59e85e39bc..382d5d58be 100644 --- a/stepmania/src/AnnouncerManager.cpp +++ b/stepmania/src/AnnouncerManager.cpp @@ -154,3 +154,27 @@ bool AnnouncerManager::HasSoundsFor( CString sFolderName ) { return !DirectoryIsEmpty( GetPathTo(sFolderName) ); } + +void AnnouncerManager::NextAnnouncer() +{ + CStringArray as; + GetAnnouncerNames( as ); + if( as.size()==0 ) + return; + + if( m_sCurAnnouncerName == "" ) + SwitchAnnouncer( as[0] ); + else + { + for( unsigned i=0; i 0 ) if( INPUTQUEUE->MatchesPattern(controller, g_CodeCacheItems[code].buttons, g_CodeCacheItems[code].iNumButtons) ) @@ -102,7 +80,7 @@ void RefreshCacheItem( int iIndex ) return; } - for( unsigned i=0; iGetCurrentStyleDef(); PlayerNumber pn = pStyleDef->ControllerToPlayerNumber( controller ); - for( int c=CODE_MIRROR; cIsExtraStage() || GAMESTATE->IsExtraStage2()) return 1; - if(PREFSMAN->m_bEventMode) + if(PREFSMAN->m_iCoinMode==COIN_EVENT) return 999; return PREFSMAN->m_iNumArcadeStages - m_iCurrentStageIndex; } bool GameState::IsFinalStage() { - if( PREFSMAN->m_bEventMode ) + if( PREFSMAN->m_iCoinMode==COIN_EVENT ) return false; int iPredictedStageForCurSong = 1; if( m_pCurSong != NULL ) @@ -172,14 +172,14 @@ bool GameState::IsFinalStage() bool GameState::IsExtraStage() { - if( PREFSMAN->m_bEventMode ) + if( PREFSMAN->m_iCoinMode==COIN_EVENT ) return false; return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages; } bool GameState::IsExtraStage2() { - if( PREFSMAN->m_bEventMode ) + if( PREFSMAN->m_iCoinMode==COIN_EVENT ) return false; return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages+1; } @@ -190,7 +190,7 @@ CString GameState::GetStageText() else if( m_PlayMode == PLAY_MODE_ONI ) return "oni"; else if( m_PlayMode == PLAY_MODE_NONSTOP ) return "nonstop"; else if( m_PlayMode == PLAY_MODE_ENDLESS ) return "endless"; - else if( PREFSMAN->m_bEventMode ) return "event"; + else if( PREFSMAN->m_iCoinMode==COIN_EVENT ) return "event"; else if( IsFinalStage() ) return "final"; else if( IsExtraStage() ) return "extra1"; else if( IsExtraStage2() ) return "extra2"; @@ -299,7 +299,7 @@ bool GameState::IsCourseMode() const bool GameState::HasEarnedExtraStage() { - if( PREFSMAN->m_bEventMode ) + if( PREFSMAN->m_iCoinMode==COIN_EVENT ) return false; if( GAMESTATE->m_PlayMode != PLAY_MODE_ARCADE ) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 543096807a..28855ac951 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -163,6 +163,9 @@ void Player::Update( float fDeltaTime ) { //LOG->Trace( "Player::Update(%f)", fDeltaTime ); + if( GAMESTATE->m_pCurSong==NULL ) + return; + const float fSongBeat = GAMESTATE->m_fSongBeat; // diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 9c082adc60..d6957837c1 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -21,6 +21,7 @@ #include "GameDef.h" #include "AnnouncerManager.h" #include "ThemeManager.h" +#include "GameConstantsAndTypes.h" #include "arch/arch.h" /* for default driver specs */ @@ -52,7 +53,6 @@ PrefsManager::PrefsManager() m_bShowDanger = true; m_fBGBrightness = 0.8f; m_bMenuTimer = true; - m_bEventMode = false; m_iNumArcadeStages = 3; m_bAutoPlay = false; m_fJudgeWindowScale = 1.0f; @@ -73,13 +73,12 @@ PrefsManager::PrefsManager() m_bArcadeOptionsNavigation = false; m_bSoloSingle = false; // OFF!!!! m_iUnloadTextureDelaySeconds = 0; // disabled 60*30; // 30 mins - m_bCoinOpMode = false; m_MusicWheelUsesSections = ALWAYS; m_iMusicWheelSwitchSpeed = 10; m_bChangeBannersWhenFast = false; m_bEasterEggs = true; m_bMarvelousTiming = true; - m_CoinMode = COIN_HOME; + m_iCoinMode = COIN_HOME; m_iCoinsPerCredit = 1; m_bJointPremium = false; m_iBoostAppPriority = -1; @@ -143,7 +142,6 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) ini.GetValueB( "Options", "ShowDanger", m_bShowDanger ); ini.GetValueF( "Options", "BGBrightness", m_fBGBrightness ); ini.GetValueB( "Options", "MenuTimer", m_bMenuTimer ); - ini.GetValueB( "Options", "EventMode", m_bEventMode ); ini.GetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages ); ini.GetValueB( "Options", "AutoPlay", m_bAutoPlay ); ini.GetValueF( "Options", "JudgeWindowScale", m_fJudgeWindowScale ); @@ -166,7 +164,6 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) ini.GetValueB( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation ); ini.GetValue ( "Options", "DWIPath", m_DWIPath ); ini.GetValueI( "Options", "UnloadTextureDelaySeconds", m_iUnloadTextureDelaySeconds ); - ini.GetValueB( "Options", "CoinOpMode", m_bCoinOpMode ); ini.GetValueI( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections ); ini.GetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed ); ini.GetValueB( "Options", "ChangeBannersWhenFast", m_bChangeBannersWhenFast ); @@ -175,7 +172,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) ini.GetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming ); ini.GetValueF( "Options", "SoundVolume", m_fSoundVolume ); ini.GetValueB( "Options", "SoundPreloadAll", m_bSoundPreloadAll ); - ini.GetValueI( "Options", "CoinMode", (int&)m_CoinMode ); + ini.GetValueI( "Options", "CoinMode", m_iCoinMode ); ini.GetValueI( "Options", "CoinsPerCredit", m_iCoinsPerCredit ); ini.GetValueB( "Options", "JointPremium", m_bJointPremium ); ini.GetValueI( "Options", "BoostAppPriority", m_iBoostAppPriority ); @@ -226,7 +223,6 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueI( "Options", "BackgroundMode", m_BackgroundMode); ini.SetValueB( "Options", "ShowDanger", m_bShowDanger ); ini.SetValueF( "Options", "BGBrightness", m_fBGBrightness ); - ini.SetValueB( "Options", "EventMode", m_bEventMode ); ini.SetValueB( "Options", "MenuTimer", m_bMenuTimer ); ini.SetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages ); ini.SetValueB( "Options", "AutoPlay", m_bAutoPlay ); @@ -256,7 +252,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueB( "Options", "EasterEggs", m_bEasterEggs ); ini.SetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming ); ini.SetValueB( "Options", "SoundPreloadAll", m_bSoundPreloadAll ); - ini.SetValueI( "Options", "CoinMode", (int&)m_CoinMode ); + ini.SetValueI( "Options", "CoinMode", m_iCoinMode ); ini.SetValueI( "Options", "CoinsPerCredit", m_iCoinsPerCredit ); ini.SetValueB( "Options", "JointPremium", m_bJointPremium ); ini.SetValueI( "Options", "BoostAppPriority", m_iBoostAppPriority ); diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 9c3ecd26cd..1a849567ec 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -11,7 +11,6 @@ Chris Gomez ----------------------------------------------------------------------------- */ -#include "SongOptions.h" class PrefsManager { @@ -41,7 +40,6 @@ public: bool m_bMenuTimer; bool m_bShowDanger; int m_iNumArcadeStages; - bool m_bEventMode; float m_fJudgeWindowScale; float m_fLifeDifficultyScale; float m_fJudgeWindowMarvelousSeconds; @@ -55,13 +53,12 @@ public: bool m_bInstructions, m_bShowDontDie, m_bShowSelectGroup; bool m_bShowTranslations; bool m_bArcadeOptionsNavigation; - bool m_bCoinOpMode; enum { NEVER, ALWAYS, ABC_ONLY } m_MusicWheelUsesSections; int m_iMusicWheelSwitchSpeed; bool m_bChangeBannersWhenFast; bool m_bEasterEggs; bool m_bMarvelousTiming; - enum { COIN_HOME, COIN_PAY, COIN_FREE, NUM_COIN_MODES } m_CoinMode; + int m_iCoinMode; int m_iCoinsPerCredit; bool m_bJointPremium; bool m_bPickExtraStage; diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 985566d810..940cc463a7 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -1283,3 +1283,12 @@ CString Basename(CString dir) } +CString Capitalize( CString s ) +{ + if( s.GetLength()==0 ) + return ""; + CString s1 = s.Left(1); + s1.MakeUpper(); + CString s2 = s.Right( s.GetLength()-1 ); + return s1+s2; +} diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 7e6133a6ff..88a517d66a 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -248,6 +248,8 @@ CString WcharDisplayText(wchar_t c); CString Basename(CString dir); +CString Capitalize( CString s ); + #ifndef WIN32 #include /* correct place with correct definitions */ #endif diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 2b89927937..1c57a4c73d 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -136,18 +136,14 @@ bool Screen::ChangeCoinModeInput( const DeviceInput& DeviceI, const InputEventTy return false; if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == SDLK_F3 ) { - (int&)PREFSMAN->m_CoinMode = (PREFSMAN->m_CoinMode+1) % PrefsManager::NUM_COIN_MODES; + (int&)PREFSMAN->m_iCoinMode = (PREFSMAN->m_iCoinMode+1) % NUM_COIN_MODES; /* ResetGame(); This causes problems on ScreenIntroMovie, which results in the movie being restarted and/or becoming out-of-synch -- Miryokuteki */ - CString sMessage = "Coin Mode: "; - switch( PREFSMAN->m_CoinMode ) - { - case PrefsManager::COIN_HOME: sMessage += "HOME"; break; - case PrefsManager::COIN_PAY: sMessage += "PAY"; break; - case PrefsManager::COIN_FREE: sMessage += "FREE"; break; - } + CString sMessage = CoinModeToString( (CoinMode)PREFSMAN->m_iCoinMode ); + sMessage.MakeUpper(); + sMessage = "Coin Mode: " + sMessage; SCREENMAN->RefreshCreditsMessages(); SCREENMAN->SystemMessage( sMessage ); return true; @@ -168,7 +164,7 @@ bool Screen::JoinInput( const DeviceInput& DeviceI, const InputEventType type, c /* subtract coins */ int iCoinsToCharge = 0; - if( PREFSMAN->m_CoinMode == PrefsManager::COIN_PAY ) + if( PREFSMAN->m_iCoinMode == COIN_PAY ) iCoinsToCharge = PREFSMAN->m_iCoinsPerCredit; if( PREFSMAN->m_bJointPremium ) diff --git a/stepmania/src/ScreenAppearanceOptions.cpp b/stepmania/src/ScreenAppearanceOptions.cpp index ec4caa1e90..19f9357160 100644 --- a/stepmania/src/ScreenAppearanceOptions.cpp +++ b/stepmania/src/ScreenAppearanceOptions.cpp @@ -97,7 +97,7 @@ void ScreenAppearanceOptions::ImportOptions() // fill in theme names // CStringArray arrayThemeNames; - THEME->GetThemeNamesForCurGame( arrayThemeNames ); + THEME->GetThemeNames( arrayThemeNames ); m_OptionRow[AO_THEME].choices.clear(); diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index a1b9bc9ada..8c45670317 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -88,14 +88,15 @@ void ScreenAttract::AttractInput( const DeviceInput& DeviceI, const InputEventTy case MENU_BUTTON_START: case MENU_BUTTON_BACK: case MENU_BUTTON_COIN: - switch( PREFSMAN->m_CoinMode ) + switch( PREFSMAN->m_iCoinMode ) { - case PrefsManager::COIN_PAY: + case COIN_PAY: if( GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit ) break; // don't fall through // fall through - case PrefsManager::COIN_FREE: - case PrefsManager::COIN_HOME: + case COIN_HOME: + case COIN_FREE: + case COIN_EVENT: SOUNDMAN->StopMusic(); /* We already played the it was a coin was inserted. Don't play it again. */ if( MenuI.button != MENU_BUTTON_COIN ) diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index 6a22756cb1..122556d69e 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -93,7 +93,7 @@ void ScreenDemonstration::Input( const DeviceInput& DeviceI, const InputEventTyp case MENU_BUTTON_START: case MENU_BUTTON_BACK: - if( PREFSMAN->m_CoinMode == PrefsManager::COIN_PAY ) + if( PREFSMAN->m_iCoinMode == COIN_PAY ) if( GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit ) break; // don't fall through m_soundMusic.Stop(); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index a5b6a6134e..be9e9a6108 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -773,7 +773,7 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn ) m_Grades[p].SettleImmediately(); - if( PREFSMAN->m_bEventMode ) + if( PREFSMAN->m_iCoinMode==COIN_EVENT ) { switch( GAMESTATE->m_PlayMode ) { diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index b1d4c66483..eaa532b085 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -195,7 +195,7 @@ void ScreenEz2SelectMusic::Input( const DeviceInput& DeviceI, const InputEventTy HarderDifficulty( pn ); return; } - if( CodeDetector::DetectAndAdjustOptions(GameI.controller) ) + if( CodeDetector::DetectAndAdjustMusicOptions(GameI.controller) ) { UpdateOptions(pn,1); } diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 768a65a723..647407b7a8 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1541,7 +1541,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) case PLAY_MODE_ARCADE: case PLAY_MODE_BATTLE: case PLAY_MODE_RAVE: - if( PREFSMAN->m_bEventMode ) + if( PREFSMAN->m_iCoinMode==COIN_EVENT ) HandleScreenMessage( SM_GoToScreenAfterBack ); else if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) SCREENMAN->SetNewScreen( "ScreenEvaluationSummary" ); diff --git a/stepmania/src/ScreenHowToPlay.cpp b/stepmania/src/ScreenHowToPlay.cpp index 1f60cc4682..b2d212be65 100644 --- a/stepmania/src/ScreenHowToPlay.cpp +++ b/stepmania/src/ScreenHowToPlay.cpp @@ -69,6 +69,7 @@ ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay") ScreenHowToPlay::~ScreenHowToPlay() { delete m_pSong; + GAMESTATE->m_pCurSong = NULL; } void ScreenHowToPlay::Update( float fDelta ) diff --git a/stepmania/src/ScreenInstructions.cpp b/stepmania/src/ScreenInstructions.cpp index d97bddda45..0e765e1d33 100644 --- a/stepmania/src/ScreenInstructions.cpp +++ b/stepmania/src/ScreenInstructions.cpp @@ -22,18 +22,9 @@ #include "PrefsManager.h" -#define HELP_TEXT THEME->GetMetric("ScreenInstructions","HelpText") -#define TIMER_SECONDS THEME->GetMetricI("ScreenInstructions","TimerSeconds") -CString Capitalize( CString s ) -{ - if( s.GetLength()==0 ) - return ""; - CString s1 = s.Left(1); - s1.MakeUpper(); - CString s2 = s.Right( s.GetLength()-1 ); - return s1+s2; -} -#define NEXT_SCREEN( pm ) THEME->GetMetric("ScreenInstructions","NextScreen"+Capitalize(PlayModeToString(pm)) ) +#define HELP_TEXT THEME->GetMetric("ScreenInstructions","HelpText") +#define TIMER_SECONDS THEME->GetMetricI("ScreenInstructions","TimerSeconds") +#define NEXT_SCREEN( pm ) THEME->GetMetric("ScreenInstructions","NextScreen"+Capitalize(PlayModeToString(pm)) ) ScreenInstructions::ScreenInstructions() : Screen("ScreenInstructions") diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index 8013284d8c..96e07bec0e 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -178,14 +178,15 @@ void ScreenJukebox::Input( const DeviceInput& DeviceI, const InputEventType type case MENU_BUTTON_START: case MENU_BUTTON_BACK: case MENU_BUTTON_COIN: - switch( PREFSMAN->m_CoinMode ) + switch( PREFSMAN->m_iCoinMode ) { - case PrefsManager::COIN_PAY: + case COIN_PAY: if( GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit ) break; // don't fall through // fall through - case PrefsManager::COIN_FREE: - case PrefsManager::COIN_HOME: + case COIN_HOME: + case COIN_FREE: + case COIN_EVENT: SOUNDMAN->StopMusic(); /* We already played the it was a coin was inserted. Don't play it again. */ if( MenuI.button != MENU_BUTTON_COIN ) diff --git a/stepmania/src/ScreenLogo.cpp b/stepmania/src/ScreenLogo.cpp index 5560136d57..999fec6968 100644 --- a/stepmania/src/ScreenLogo.cpp +++ b/stepmania/src/ScreenLogo.cpp @@ -18,8 +18,6 @@ #include "SongManager.h" #define LOGO_ON_COMMAND THEME->GetMetric("ScreenLogo","LogoOnCommand") -#define VERSION_ON_COMMAND THEME->GetMetric("ScreenLogo","VersionOnCommand") -#define SONGS_ON_COMMAND THEME->GetMetric("ScreenLogo","SongsOnCommand") ScreenLogo::ScreenLogo() : ScreenAttract("ScreenLogo") @@ -28,17 +26,6 @@ ScreenLogo::ScreenLogo() : ScreenAttract("ScreenLogo") m_sprLogo.Command( LOGO_ON_COMMAND ); this->AddChild( &m_sprLogo ); - m_textVersion.LoadFromFont( THEME->GetPathToF("Common normal") ); - m_textVersion.Command( VERSION_ON_COMMAND ); - m_textVersion.SetText( "CVS" ); - this->AddChild( &m_textVersion ); - - - m_textSongs.LoadFromFont( THEME->GetPathToF("Common normal") ); - m_textSongs.Command( SONGS_ON_COMMAND ); - m_textSongs.SetText( ssprintf("%d songs in %d groups, %d courses", SONGMAN->GetNumSongs(), SONGMAN->GetNumGroups(), SONGMAN->GetNumCourses()) ); - this->AddChild( &m_textSongs ); - this->MoveToTail( &m_In ); // put it in the back so it covers up the stuff we just added this->MoveToTail( &m_Out ); // put it in the back so it covers up the stuff we just added } diff --git a/stepmania/src/ScreenLogo.h b/stepmania/src/ScreenLogo.h index 41173661e8..3cbfa162dd 100644 --- a/stepmania/src/ScreenLogo.h +++ b/stepmania/src/ScreenLogo.h @@ -21,9 +21,6 @@ public: protected: Sprite m_sprLogo; - - BitmapText m_textVersion; - BitmapText m_textSongs; }; diff --git a/stepmania/src/ScreenMachineOptions.cpp b/stepmania/src/ScreenMachineOptions.cpp index d7dab4c965..9f3524dc72 100644 --- a/stepmania/src/ScreenMachineOptions.cpp +++ b/stepmania/src/ScreenMachineOptions.cpp @@ -27,12 +27,12 @@ enum { MO_MENU_TIMER, + MO_COIN_MODE, MO_NUM_ARCADE_STAGES, MO_JUDGE_DIFFICULTY, MO_LIFE_DIFFICULTY, MO_FAIL, MO_SHOWSTATS, - MO_COIN_MODE, MO_COINS_PER_CREDIT, MO_JOINT_PREMIUM, MO_SHOW_SONG_OPTIONS, @@ -41,12 +41,12 @@ enum { OptionRow g_MachineOptionsLines[NUM_MACHINE_OPTIONS_LINES] = { OptionRow( "Menu\nTimer", "OFF","ON" ), - OptionRow( "Arcade\nStages", "1","2","3","4","5","6","7","UNLIMITED" ), + OptionRow( "Coin\nMode", "HOME","PAY","FREE PLAY","EVENT MODE" ), + OptionRow( "Songs Per\nPlay", "1","2","3","4","5","6","7" ), OptionRow( "Judge\nDifficulty", "1","2","3","4","5","6","7","8" ), OptionRow( "Life\nDifficulty", "1","2","3","4","5","6","7" ), OptionRow( "Default\nFail Type", "ARCADE","END OF SONG","OFF" ), OptionRow( "Show\nStats", "OFF","ON" ), - OptionRow( "Coin\nMode", "HOME","PAY","FREE PLAY" ), OptionRow( "Coins Per\nCredit", "1","2","3","4","5","6","7","8" ), OptionRow( "Joint\nPremium", "OFF","ON" ), OptionRow( "Song\nOptions", "HIDE","ALLOW" ), @@ -69,8 +69,9 @@ ScreenMachineOptions::ScreenMachineOptions() : void ScreenMachineOptions::ImportOptions() { + m_iSelectedOption[0][MO_COIN_MODE] = PREFSMAN->m_iCoinMode; m_iSelectedOption[0][MO_MENU_TIMER] = PREFSMAN->m_bMenuTimer ? 1:0; - m_iSelectedOption[0][MO_NUM_ARCADE_STAGES] = PREFSMAN->m_bEventMode ? 7 : PREFSMAN->m_iNumArcadeStages - 1; + m_iSelectedOption[0][MO_NUM_ARCADE_STAGES] = PREFSMAN->m_iNumArcadeStages - 1; /* .02 difficulty is beyond our timing right now; even autoplay * misses! At least fix autoplay before enabling this, or we'll @@ -103,7 +104,6 @@ void ScreenMachineOptions::ImportOptions() so.FromString( PREFSMAN->m_sDefaultModifiers ); m_iSelectedOption[0][MO_FAIL] = so.m_FailType; m_iSelectedOption[0][MO_SHOWSTATS] = PREFSMAN->m_bShowStats ? 1:0; - m_iSelectedOption[0][MO_COIN_MODE] = PREFSMAN->m_CoinMode; m_iSelectedOption[0][MO_COINS_PER_CREDIT] = PREFSMAN->m_iCoinsPerCredit - 1; m_iSelectedOption[0][MO_JOINT_PREMIUM] = PREFSMAN->m_bJointPremium ? 1:0; m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = PREFSMAN->m_bShowSongOptions ? 1:0; @@ -111,8 +111,8 @@ void ScreenMachineOptions::ImportOptions() void ScreenMachineOptions::ExportOptions() { + PREFSMAN->m_iCoinMode = m_iSelectedOption[0][MO_COIN_MODE]; PREFSMAN->m_bMenuTimer = m_iSelectedOption[0][MO_MENU_TIMER] == 1; - PREFSMAN->m_bEventMode = m_iSelectedOption[0][MO_NUM_ARCADE_STAGES] == 7; PREFSMAN->m_iNumArcadeStages = m_iSelectedOption[0][MO_NUM_ARCADE_STAGES] + 1; switch( m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] ) @@ -160,7 +160,6 @@ void ScreenMachineOptions::ExportOptions() as.push_back( so.GetString() ); PREFSMAN->m_sDefaultModifiers = join(", ",as); PREFSMAN->m_bShowStats = m_iSelectedOption[0][MO_SHOWSTATS] == 1; - (int&)PREFSMAN->m_CoinMode = m_iSelectedOption[0][MO_COIN_MODE]; PREFSMAN->m_iCoinsPerCredit = m_iSelectedOption[0][MO_COINS_PER_CREDIT] + 1; PREFSMAN->m_bJointPremium = m_iSelectedOption[0][MO_JOINT_PREMIUM] == 1; PREFSMAN->m_bShowSongOptions = (bool&)m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS]; diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 70cceca63f..7a7b2582cd 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -149,9 +149,9 @@ void ScreenSystemLayer::RefreshCreditsMessages() // update joined for( int p=0; pm_CoinMode ) + switch( PREFSMAN->m_iCoinMode ) { - case PrefsManager::COIN_HOME: + case COIN_HOME: if( GAMESTATE->m_bSideIsJoined[p] ) m_textCreditInfo[p].SetText( "" ); else if( GAMESTATE->m_bPlayersCanJoin ) // would (GAMESTATE->m_CurStyle!=STYLE_INVALID) do the same thing? @@ -159,7 +159,7 @@ void ScreenSystemLayer::RefreshCreditsMessages() else m_textCreditInfo[p].SetText( "NOT PRESENT" ); break; - case PrefsManager::COIN_PAY: + case COIN_PAY: { int Coins = GAMESTATE->m_iCoins % PREFSMAN->m_iCoinsPerCredit; CString txt = ssprintf("CREDIT(S) %d", GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit); @@ -168,9 +168,12 @@ void ScreenSystemLayer::RefreshCreditsMessages() m_textCreditInfo[p].SetText(txt); } break; - case PrefsManager::COIN_FREE: + case COIN_FREE: m_textCreditInfo[p].SetText( "FREE PLAY" ); break; + case COIN_EVENT: + m_textCreditInfo[p].SetText( "EVENT MODE" ); + break; default: ASSERT(0); } diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index 92e4b1168f..c88107d304 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -181,7 +181,7 @@ void ScreenSelect::Input( const DeviceInput& DeviceI, const InputEventType type, /* Joint premium on a DDR machine does allow two player modes with a single * credit. -Chris */ - if( PREFSMAN->m_CoinMode == PrefsManager::COIN_PAY ) + if( PREFSMAN->m_iCoinMode == COIN_PAY ) { if( !PREFSMAN->m_bJointPremium ) { diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index b1208ce89f..64f95a16f7 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -246,7 +246,7 @@ void ScreenSelectCourse::Input( const DeviceInput& DeviceI, InputEventType type, if( m_bMadeChoice ) return; - if( CodeDetector::DetectAndAdjustOptions(GameI.controller) ) + if( CodeDetector::DetectAndAdjustMusicOptions(GameI.controller) ) { m_soundOptionsChange.Play(); UpdateOptionsDisplays(); diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 2d2d6382df..96049e1570 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -418,7 +418,7 @@ void ScreenSelectMusic::Input( const DeviceInput& DeviceI, InputEventType type, } return; } - if( !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() && CodeDetector::DetectAndAdjustOptions(GameI.controller) ) + if( !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() && CodeDetector::DetectAndAdjustMusicOptions(GameI.controller) ) { m_soundOptionsChange.Play(); UpdateOptionsDisplays(); @@ -496,7 +496,7 @@ void ScreenSelectMusic::AdjustOptions() /* If beginner's steps were chosen, and this is the first stage, * turn off failure completely--always give a second try. */ if(dc == DIFFICULTY_BEGINNER && - !PREFSMAN->m_bEventMode && /* stage index is meaningless in event mode */ + PREFSMAN->m_iCoinMode!=COIN_EVENT && /* stage index is meaningless in event mode */ GAMESTATE->m_iCurrentStageIndex == 0) ft = SongOptions::FAIL_OFF; // Redundant. -Chris diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 0dc675dc74..16a4c8fc57 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -11,6 +11,7 @@ */ #include "ScreenTitleMenu.h" +#include "ScreenAttract.h" #include "ScreenManager.h" #include "GameConstantsAndTypes.h" #include "RageUtil.h" @@ -25,8 +26,13 @@ #include "ThemeManager.h" #include "SDL_utils.h" #include "RageSoundManager.h" +#include "CodeDetector.h" +#define LOGO_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","LogoOnCommand") +#define LOGO_HOME_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","LogoHomeOnCommand") +#define VERSION_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","VersionOnCommand") +#define SONGS_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","SongsOnCommand") #define HELP_X THEME->GetMetricF("ScreenTitleMenu","HelpX") #define HELP_Y THEME->GetMetricF("ScreenTitleMenu","HelpY") #define CHOICES_X THEME->GetMetricF("ScreenTitleMenu","ChoicesX") @@ -39,53 +45,52 @@ #define ZOOM_SELECTED THEME->GetMetricF("ScreenTitleMenu","ZoomSelected") #define SECONDS_BETWEEN_COMMENTS THEME->GetMetricF("ScreenTitleMenu","SecondsBetweenComments") #define SECONDS_BEFORE_ATTRACT THEME->GetMetricF("ScreenTitleMenu","SecondsBeforeAttract") -#define HELP_TEXT_HOME THEME->GetMetric("ScreenTitleMenu","HelpTextHome") -#define HELP_TEXT_PAY THEME->GetMetric("ScreenTitleMenu","HelpTextPay") -#define HELP_TEXT_FREE THEME->GetMetric("ScreenTitleMenu","HelpTextFree") +#define HELP_TEXT( coin_mode ) THEME->GetMetric("ScreenTitleMenu","HelpText"+Capitalize(CoinModeToString(coin_mode))) #define NEXT_SCREEN THEME->GetMetric("ScreenTitleMenu","NextScreen") const ScreenMessage SM_PlayComment = ScreenMessage(SM_User+1); const ScreenMessage SM_GoToAttractLoop = ScreenMessage(SM_User+13); -ScreenTitleMenu::ScreenTitleMenu() +ScreenTitleMenu::ScreenTitleMenu() : Screen("ScreenTitleMenu") { LOG->Trace( "ScreenTitleMenu::ScreenTitleMenu()" ); GAMESTATE->m_bPlayersCanJoin = true; - if( PREFSMAN->m_CoinMode!=PrefsManager::COIN_HOME && PREFSMAN->m_bJointPremium ) + CodeDetector::RefreshCacheItems(); + + if( PREFSMAN->m_iCoinMode!=COIN_HOME && PREFSMAN->m_bJointPremium ) { m_JointPremium.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu joint premium") ); this->AddChild( &m_JointPremium ); } - switch( PREFSMAN->m_CoinMode ) - { - case PrefsManager::COIN_HOME: - // do nothing - break; - case PrefsManager::COIN_PAY: - m_CoinMode.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu pay") ); - this->AddChild( &m_CoinMode ); - break; - case PrefsManager::COIN_FREE: - m_CoinMode.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu free") ); - this->AddChild( &m_CoinMode ); - break; - default: - ASSERT(0); - } + + m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu background") ); + this->AddChild( &m_Background ); + + 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 ); + this->AddChild( &m_sprLogo ); + + m_textVersion.LoadFromFont( THEME->GetPathToF("Common normal") ); + m_textVersion.Command( VERSION_ON_COMMAND ); + m_textVersion.SetText( "CVS" ); + this->AddChild( &m_textVersion ); + + + m_textSongs.LoadFromFont( THEME->GetPathToF("Common normal") ); + m_textSongs.Command( SONGS_ON_COMMAND ); + m_textSongs.SetText( ssprintf("%d songs in %d groups, %d courses", SONGMAN->GetNumSongs(), SONGMAN->GetNumGroups(), SONGMAN->GetNumCourses()) ); + this->AddChild( &m_textSongs ); + + + CString sCoinMode = CoinModeToString((CoinMode)PREFSMAN->m_iCoinMode); + m_CoinMode.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu "+sCoinMode) ); + this->AddChild( &m_CoinMode ); m_textHelp.LoadFromFont( THEME->GetPathToF("ScreenTitleMenu help") ); - CString sHelpText; - switch( PREFSMAN->m_CoinMode ) - { - case PrefsManager::COIN_HOME: sHelpText = HELP_TEXT_HOME; break; - case PrefsManager::COIN_PAY: sHelpText = HELP_TEXT_PAY; break; - case PrefsManager::COIN_FREE: sHelpText = HELP_TEXT_FREE; break; - default: ASSERT(0); - } - m_textHelp.SetText( sHelpText ); + m_textHelp.SetText( HELP_TEXT((CoinMode)PREFSMAN->m_iCoinMode) ); m_textHelp.SetXY( HELP_X, HELP_Y ); m_textHelp.SetZoom( 0.5f ); m_textHelp.SetEffectDiffuseBlink(); @@ -93,9 +98,9 @@ ScreenTitleMenu::ScreenTitleMenu() m_textHelp.SetShadowLength( 2 ); this->AddChild( &m_textHelp ); - switch( PREFSMAN->m_CoinMode ) + switch( PREFSMAN->m_iCoinMode ) { - case PrefsManager::COIN_HOME: + case COIN_HOME: int i; for( i=0; iAddChild( &m_textChoice[i] ); } break; - case PrefsManager::COIN_PAY: - break; - case PrefsManager::COIN_FREE: + case COIN_PAY: + case COIN_FREE: + case COIN_EVENT: break; default: ASSERT(0); } + m_In.Load( THEME->GetPathToB("ScreenTitleMenu in") ); + m_In.StartTransitioning(); + this->AddChild( &m_In ); + + m_Out.Load( THEME->GetPathToB("ScreenTitleMenu out") ); + this->AddChild( &m_Out ); + + SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("title menu game name") ); @@ -164,7 +177,7 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty switch( MenuI.button ) { case MENU_BUTTON_UP: - if( PREFSMAN->m_CoinMode != PrefsManager::COIN_HOME ) + if( PREFSMAN->m_iCoinMode != COIN_HOME ) break; if( m_In.IsTransitioning() || m_Out.IsTransitioning() ) break; @@ -177,7 +190,7 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty GainFocus( m_Choice ); break; case MENU_BUTTON_DOWN: - if( PREFSMAN->m_CoinMode != PrefsManager::COIN_HOME ) + if( PREFSMAN->m_iCoinMode != COIN_HOME ) break; if( m_In.IsTransitioning() || m_Out.IsTransitioning() ) break; @@ -220,6 +233,21 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty m_Out.StartTransitioning( SM_GoToNextScreen ); } + // detect codes + if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME) ) + { + THEME->NextTheme(); + SCREENMAN->SystemMessage( "Theme: "+THEME->GetCurThemeName() ); + SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); + } + if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER) ) + { + ANNOUNCER->NextAnnouncer(); + CString sName = ANNOUNCER->GetCurAnnouncerName(); + if( sName=="" ) sName = "(none)"; + SCREENMAN->SystemMessage( "Announcer: "+sName ); + SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); + } // Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); } diff --git a/stepmania/src/ScreenTitleMenu.h b/stepmania/src/ScreenTitleMenu.h index 0f45f04380..736e79ce7d 100644 --- a/stepmania/src/ScreenTitleMenu.h +++ b/stepmania/src/ScreenTitleMenu.h @@ -9,7 +9,8 @@ ----------------------------------------------------------------------------- */ -#include "ScreenLogo.h" +#include "Screen.h" +#include "Transition.h" #include "Sprite.h" #include "BitmapText.h" #include "RageSound.h" @@ -18,7 +19,7 @@ #include "RandomSample.h" -class ScreenTitleMenu : public ScreenLogo +class ScreenTitleMenu : public Screen { public: ScreenTitleMenu(); @@ -32,8 +33,6 @@ public: { CHOICE_GAME_START = 0, CHOICE_SELECT_GAME, - /* At request, moved this into the options/operator menu -- Miryokuteki */ - //CHOICE_MAP_KEY_JOY, CHOICE_OPTIONS, CHOICE_EDIT, CHOICE_JUKEBOX, @@ -48,9 +47,7 @@ public: { const CString s[NUM_CHOICES] = { "GAME START", - "SWITCH GAME", - /* At request, moved this into the options/operator menu -- Miryokuteki */ - //"CONFIG KEY/JOY", + "SELECT GAME", "OPTIONS", "EDIT/SYNC SONGS", "JUKEBOX", @@ -69,6 +66,10 @@ private: Choice m_Choice; + BGAnimation m_Background; + Sprite m_sprLogo; + BitmapText m_textVersion; + BitmapText m_textSongs; BitmapText m_textHelp; BitmapText m_textChoice[NUM_CHOICES]; @@ -81,6 +82,9 @@ private: BGAnimation m_CoinMode; BGAnimation m_JointPremium; + + Transition m_In; + Transition m_Out; }; diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 1ca29d4720..6f3b81e617 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -49,7 +49,7 @@ ThemeManager::ThemeManager() m_uHashForCurThemeMetrics = m_uHashForBaseThemeMetrics = 0; CStringArray arrayThemeNames; - GetAllThemeNames( arrayThemeNames ); + GetThemeNames( arrayThemeNames ); } ThemeManager::~ThemeManager() @@ -57,7 +57,7 @@ ThemeManager::~ThemeManager() delete m_pIniMetrics; } -void ThemeManager::GetAllThemeNames( CStringArray& AddTo ) +void ThemeManager::GetThemeNames( CStringArray& AddTo ) { GetDirListing( THEMES_DIR+"/*", AddTo, true ); @@ -71,28 +71,10 @@ void ThemeManager::GetAllThemeNames( CStringArray& AddTo ) } } -void ThemeManager::GetThemeNamesForCurGame( CStringArray& AddTo ) -{ - GetAllThemeNames( AddTo ); - - /* - // strip out announcers that don't have the current game name in them - CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName; - sGameName.MakeLower(); - for( unsigned i=AddTo.size()-1; i>=0; i-- ) - { - CString sLowercaseVer = AddTo[i]; - sLowercaseVer.MakeLower(); - if( sLowercaseVer.Find(sGameName)==-1 ) - AddTo.RemoveAt(i); - } - */ -} - bool ThemeManager::DoesThemeExist( CString sThemeName ) { CStringArray asThemeNames; - GetAllThemeNames( asThemeNames ); + GetThemeNames( asThemeNames ); for( unsigned i=0; i