diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 2f6edccb0c..b801ec23aa 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -1,4 +1,4 @@ -// Possible NextScreen names: +// Possible NextScreen names: // - ScreenCaution // - ScreenEz2SelectPlayer // - ScreenSelectMode @@ -851,7 +851,7 @@ SoloSingles=Turn this option &oq;ON&cq; to enable Solo-Style::for 4-panel single HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes Announcer=Choose from this list of installed annoucner packs.::For more information about creating announcer packs, see the README. Theme=Choose from this list of installed theme packs.::For more information about creating theme packs, see the README. -NoteSkin=Choose from this list of installed note skins.::For more information about creating a note skin, see the README. +DefaultNoteSkin=Choose from this list of installed note skins.::For more information about creating a note skin, see the README. HowToPlay=Toggle whether the How To Play screen is shown. Caution=Toggle whether the Caution screen is shown. OniScoreDisplay=Toggle whether the score in Oni mode displays Dance Points or the Dance Percent. diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 43a1f9eec0..9a4ab6c412 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -21,9 +21,6 @@ #include "PrefsManager.h" -const CString BG_ANIMS_DIR = "BGAnimations/"; -const CString VISUALIZATIONS_DIR = "Visualizations/"; -const CString RANDOMMOVIES_DIR = "RandomMovies/"; const float FADE_SECONDS = 1.0f; diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index b793905fe9..2ccb455841 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -198,4 +198,12 @@ const int ITEM_NONE = -1; const int NUM_ITEM_SLOTS = 3; + + +const CString BG_ANIMS_DIR = "BGAnimations/"; +const CString VISUALIZATIONS_DIR = "Visualizations/"; +const CString RANDOMMOVIES_DIR = "RandomMovies/"; + + + #endif diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 86b3f3bc0f..b4fd1e1a81 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -732,7 +732,7 @@ bool RageSound::SetPositionSamples( int samples ) * To do this, we'll undo the muliply by the playback rate above. * Glenn: Feel free to change this to whatever method is more elegant. * -Chris */ - int ms = int(float(samples) * 1000.f / samplerate) * GetPlaybackRate(); + int ms = int( float(samples) * 1000.f / samplerate * GetPlaybackRate() ); if(!big) { /* Just make sure the position is in range. */ diff --git a/stepmania/src/ScreenAppearanceOptions.cpp b/stepmania/src/ScreenAppearanceOptions.cpp index a8b61f60bb..3c8529ebdd 100644 --- a/stepmania/src/ScreenAppearanceOptions.cpp +++ b/stepmania/src/ScreenAppearanceOptions.cpp @@ -29,7 +29,6 @@ enum { AO_ANNOUNCER = 0, AO_THEME, -// AO_DIFF_SELECT, AO_SKIN, AO_INSTRUCTIONS, AO_CAUTION, @@ -40,17 +39,17 @@ enum { NUM_APPEARANCE_OPTIONS_LINES }; -OptionRowData g_AppearanceOptionsLines[NUM_APPEARANCE_OPTIONS_LINES] = { - { "Announcer", 1, {"OFF"} }, // fill this in on ImportOptions() - { "Theme", 0, {""} }, // fill this in on ImportOptions() -// { "Difficulty\nSelect", 2, {"DDR Extreme", "Normal"} }, - { "Note\nSkin", 0, {""} }, // fill this in on ImportOptions() - { "How To\nPlay", 2, {"SKIP","SHOW"} }, - { "Caution", 2, {"SKIP","SHOW"} }, - { "Oni Score\nDisplay", 2, {"PERCENT","DANCE POINTS"} }, - { "Song\nGroup", 2, {"ALL MUSIC","CHOOSE"} }, - { "Wheel\nSections", 3, {"NEVER","ALWAYS", "ABC ONLY"} }, - { "Translations", 2, {"NATIVE","TRANSLITERATE"} }, + +OptionRow g_AppearanceOptionsLines[NUM_APPEARANCE_OPTIONS_LINES] = { + OptionRow( "Announcer" ), + OptionRow( "Theme" ), + OptionRow( "Default\nNoteSkin" ), + OptionRow( "How To\nPlay", "SKIP","SHOW"), + OptionRow( "Caution", "SKIP","SHOW"), + OptionRow( "Oni Score\nDisplay","PERCENT","DANCE POINTS"), + OptionRow( "Song\nGroup", "ALL MUSIC","CHOOSE"), + OptionRow( "Wheel\nSections", "NEVER","ALWAYS", "ABC ONLY"), + OptionRow( "Translations", "NATIVE","TRANSLITERATE"), }; ScreenAppearanceOptions::ScreenAppearanceOptions() : @@ -58,20 +57,11 @@ ScreenAppearanceOptions::ScreenAppearanceOptions() : { LOG->Trace( "ScreenAppearanceOptions::ScreenAppearanceOptions()" ); - // fill g_InputOptionsLines with explanation text - for( int i=0; iGetMetric("ScreenAppearanceOptions",sLineName) ); - } - Init( INPUTMODE_BOTH, g_AppearanceOptionsLines, NUM_APPEARANCE_OPTIONS_LINES, - false ); + false, true ); m_Menu.m_MenuTimer.Disable(); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenAppearanceOptions music") ); @@ -79,30 +69,26 @@ ScreenAppearanceOptions::ScreenAppearanceOptions() : void ScreenAppearanceOptions::ImportOptions() { + unsigned i; + // // fill in announcer names // CStringArray arrayAnnouncerNames; ANNOUNCER->GetAnnouncerNames( arrayAnnouncerNames ); - m_OptionRowData[AO_ANNOUNCER].iNumOptions = arrayAnnouncerNames.size() + 1; - unsigned i; - for( i=0; iGetCurAnnouncerName()) ) - { + m_iSelectedOption[0][AO_ANNOUNCER] = 0; + for( i=1; iGetCurAnnouncerName()) ) m_iSelectedOption[0][AO_ANNOUNCER] = i; - break; - } - } - if( m_iSelectedOption[0][AO_ANNOUNCER] == -1 ) - m_iSelectedOption[0][AO_ANNOUNCER] = 0; // @@ -111,24 +97,19 @@ void ScreenAppearanceOptions::ImportOptions() CStringArray arrayThemeNames; THEME->GetThemeNamesForCurGame( arrayThemeNames ); - m_OptionRowData[AO_THEME].iNumOptions = arrayThemeNames.size(); + m_OptionRow[AO_THEME].choices.clear(); - for( i=0; iGetCurThemeName()) ) - { + m_iSelectedOption[0][AO_THEME] = 0; + for( i=0; iGetCurThemeName()) ) m_iSelectedOption[0][AO_THEME] = i; - break; - } - } - if( m_iSelectedOption[0][AO_THEME] == -1 ) - m_iSelectedOption[0][AO_THEME] = 0; + // // fill in skin names @@ -136,27 +117,23 @@ void ScreenAppearanceOptions::ImportOptions() CStringArray arraySkinNames; NOTESKIN->GetNoteSkinNames( arraySkinNames ); - m_OptionRowData[AO_SKIN].iNumOptions = arraySkinNames.size(); + m_OptionRow[AO_SKIN].choices.clear(); - for( i=0; im_sDefaultNoteSkin) ) - { + m_iSelectedOption[0][AO_SKIN] = 0; + for( i=0; im_sDefaultNoteSkin) ) m_iSelectedOption[0][AO_SKIN] = i; - break; - } - } - if( m_iSelectedOption[0][AO_SKIN] == -1 ) - m_iSelectedOption[0][AO_SKIN] = 0; + m_iSelectedOption[0][AO_INSTRUCTIONS] = PREFSMAN->m_bInstructions? 1:0; m_iSelectedOption[0][AO_CAUTION] = PREFSMAN->m_bShowDontDie? 1:0; -// m_iSelectedOption[0][AO_DIFF_SELECT] = PREFSMAN->m_bDDRExtremeDifficultySelect? 1:0; m_iSelectedOption[0][AO_DANCE_POINTS_FOR_ONI] = PREFSMAN->m_bDancePointsForOni? 1:0; m_iSelectedOption[0][AO_SELECT_GROUP] = PREFSMAN->m_bShowSelectGroup? 1:0; m_iSelectedOption[0][AO_WHEEL_SECTIONS] = (int)PREFSMAN->m_MusicWheelUsesSections; @@ -169,20 +146,19 @@ void ScreenAppearanceOptions::ExportOptions() PREFSMAN->SaveGlobalPrefsToDisk(); int iSelectedAnnouncer = m_iSelectedOption[0][AO_ANNOUNCER]; - CString sNewAnnouncer = m_OptionRowData[AO_ANNOUNCER].szOptionsText[iSelectedAnnouncer]; + CString sNewAnnouncer = m_OptionRow[AO_ANNOUNCER].choices[iSelectedAnnouncer]; if( iSelectedAnnouncer == 0 ) sNewAnnouncer = ""; ANNOUNCER->SwitchAnnouncer( sNewAnnouncer ); int iSelectedTheme = m_iSelectedOption[0][AO_THEME]; - CString sNewTheme = m_OptionRowData[AO_THEME].szOptionsText[iSelectedTheme]; + CString sNewTheme = m_OptionRow[AO_THEME].choices[iSelectedTheme]; THEME->SwitchTheme( sNewTheme ); int iSelectedSkin = m_iSelectedOption[0][AO_SKIN]; - CString sNewSkin = m_OptionRowData[AO_SKIN].szOptionsText[iSelectedSkin]; + CString sNewSkin = m_OptionRow[AO_SKIN].choices[iSelectedSkin]; PREFSMAN->m_sDefaultNoteSkin = sNewSkin; -// PREFSMAN->m_bDDRExtremeDifficultySelect = !!m_iSelectedOption[0][AO_DIFF_SELECT]; PREFSMAN->m_bInstructions = !!m_iSelectedOption[0][AO_INSTRUCTIONS]; PREFSMAN->m_bShowDontDie = !!m_iSelectedOption[0][AO_CAUTION]; PREFSMAN->m_bShowSelectGroup = !!m_iSelectedOption[0][AO_SELECT_GROUP]; diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 5d35912291..5a2bb18ca9 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -82,6 +82,7 @@ const ScreenMessage SM_BackFromAreaMenu = (ScreenMessage)(SM_User+2); const ScreenMessage SM_BackFromEditNotesStatistics = (ScreenMessage)(SM_User+3); const ScreenMessage SM_BackFromEditOptions = (ScreenMessage)(SM_User+4); const ScreenMessage SM_BackFromEditSongInfo = (ScreenMessage)(SM_User+5); +const ScreenMessage SM_BackFromBGChange = (ScreenMessage)(SM_User+6); const CString HELP_TEXT = @@ -95,102 +96,106 @@ const CString HELP_TEXT = "F1:\n Show\n keyboard\n shortcuts\n"; -MiniMenuDefinition g_KeyboardShortcuts = -{ + +#define E " " // CHAR[32] +#define OPTION_NAME_SIZE sizeof(E) +#define THIRTY_ES E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E // MAX_OPTIONS_PER_LINE == 30 + + +Menu g_KeyboardShortcuts +( "Keyboard Shortcuts", - 9, - { - { "PgUp/PgDn: jump measure", false, 1, 0, {""} }, - { "Home/End: jump to first/last beat", false, 1, 0, {""} }, - { "Ctrl + Up/Down: Change zoom", false, 1, 0, {""} }, - { "Shift + Up/Down: Drag area marker", false, 1, 0, {""} }, - { "P: Play selection", false, 1, 0, {""} }, - { "Ctrl + P: Play whole song", false, 1, 0, {""} }, - { "F7/F8: Decrease/increase BPM at cur beat", false, 1, 0, {""} }, - { "F9/F10: Decrease/increase stop at cur beat", false, 1, 0, {""} }, - { "F11/F12: Decrease/increase music offset", false, 1, 0, {""} }, + MenuRow( "PgUp/PgDn: jump measure", false ), + MenuRow( "Home/End: jump to first/last beat", false ), + MenuRow( "Ctrl + Up/Down: Change zoom", false ), + MenuRow( "Shift + Up/Down: Drag area marker", false ), + MenuRow( "P: Play selection", false ), + MenuRow( "Ctrl + P: Play whole song", false ), + MenuRow( "F7/F8: Decrease/increase BPM at cur beat", false ), + MenuRow( "F9/F10: Decrease/increase stop at cur beat", false ), + MenuRow( "F11/F12: Decrease/increase music offset", false ), /* XXX: This would be better as a single submenu, to let people tweak * and play the sample several times (without having to re-enter the * menu each time), so it doesn't use a whole bunch of hotkeys. */ - { "[ and ]: Decrease/increase sample music start", false, 1, 0, {""} }, - { "{ and }: Decrease/increase sample music length", false, 1, 0, {""} }, - { "M: Play sample music", false, 1, 0, {""} }, - } -}; + MenuRow( "[ and ]: Decrease/increase sample music start", false ), + MenuRow( "{ and }: Decrease/increase sample music length", false ), + MenuRow( "M: Play sample music", false ) +); -MiniMenuDefinition g_MainMenu = -{ +Menu g_MainMenu +( "Main Menu", - ScreenEdit::NUM_MAIN_MENU_CHOICES, - { - { "Edit Notes Statistics", true, 1, 0, {""} }, - { "Play Whole Song", true, 1, 0, {""} }, - { "Save", true, 1, 0, {""} }, - { "Player Options", true, 1, 0, {""} }, - { "Song Options", true, 1, 0, {""} }, - { "Edit Song Info", true, 1, 0, {""} }, - { "Add/Edit BPM Change", true, 1, 0, {""} }, - { "Add/Edit Stop", true, 1, 0, {""} }, - { "Add/Edit BG Change", true, 1, 0, {""} }, - { "Play preview music", true, 1, 0, {""} }, - { "Exit", true, 1, 0, {""} }, - } -}; + MenuRow( "Edit Notes Statistics", true ), + MenuRow( "Play Whole Song", true ), + MenuRow( "Save", true ), + MenuRow( "Player Options", true ), + MenuRow( "Song Options", true ), + MenuRow( "Edit Song Info", true ), + MenuRow( "Add/Edit BPM Change", true ), + MenuRow( "Add/Edit Stop", true ), + MenuRow( "Add/Edit BG Change", true ), + MenuRow( "Play preview music", true ), + MenuRow( "Exit", true ) +); -MiniMenuDefinition g_AreaMenu = -{ +Menu g_AreaMenu +( "Area Menu", - ScreenEdit::NUM_AREA_MENU_CHOICES, - { - { "Cut", true, 1, 0, {""} }, - { "Copy", true, 1, 0, {""} }, - { "Paste at current beat", true, 1, 0, {""} }, - { "Paste at begin marker", true, 1, 0, {""} }, - { "Clear", true, 1, 0, {""} }, - { "Quantize", true, NUM_NOTE_TYPES, 0, {"4TH","8TH","12TH","16TH","24TH","32ND"} }, - { "Turn", true, ScreenEdit::NUM_TURN_TYPES, 0, {"Left","Right","Mirror","Shuffle","Super Shuffle"} }, - { "Transform", true, ScreenEdit::NUM_TRANSFORM_TYPES, 0, {"Little","Wide","Big","Quick","Skippy"} }, - { "Alter", true, ScreenEdit::NUM_ALTER_TYPES, 0, {"Backwards","Swap Sides","Copy Left To Right","Copy Right To Left","Clear Left","Clear Right","Collapse To One","Shift Left","Shift Right"} }, - { "Play selection", true, 1, 0, {""} }, - { "Record in selection", true, 1, 0, {""} }, - { "Insert blank beat and shift down", true, 1, 0, {""} }, - { "Delete blank beat and shift up", true, 1, 0, {""} }, - } -}; + MenuRow( "Cut", true ), + MenuRow( "Copy", true ), + MenuRow( "Paste at current beat", true ), + MenuRow( "Paste at begin marker", true ), + MenuRow( "Clear", true ), + MenuRow( "Quantize", true, 0, "4TH","8TH","12TH","16TH","24TH","32ND" ), + MenuRow( "Turn", true, 0, "Left","Right","Mirror","Shuffle","Super Shuffle" ), + MenuRow( "Transform", true, 0, "Little","Wide","Big","Quick","Skippy" ), + MenuRow( "Alter", true, 0, "Backwards","Swap Sides","Copy Left To Right","Copy Right To Left","Clear Left","Clear Right","Collapse To One","Shift Left","Shift Right" ), + MenuRow( "Play selection", true ), + MenuRow( "Record in selection", true ), + MenuRow( "Insert beat and shift down", true ), + MenuRow( "Delete beat and shift up", true ) +); -MiniMenuDefinition g_EditNotesStatistics = -{ +Menu g_EditNotesStatistics +( "Statistics", - ScreenEdit::NUM_EDIT_NOTES_STATISTICS_CHOICES, - { - { "Difficulty", true, 5, 0, {"BEGINNER","EASY","MEDIUM","HARD","CHALLENGE"} }, - { "Meter", true, 11, 0, {"1","2","3","4","5","6","7","8","9","10","11"} }, - { "Description",true, 1, 0, {""} }, - { "Tap Notes", false, 1, 0, {""} }, - { "Hold Notes", false, 1, 0, {""} }, - { "Stream", false, 1, 0, {""} }, - { "Voltage", false, 1, 0, {""} }, - { "Air", false, 1, 0, {""} }, - { "Freeze", false, 1, 0, {""} }, - { "Chaos", false, 1, 0, {""} }, - } -}; + MenuRow( "Difficulty", true, 0, "BEGINNER","EASY","MEDIUM","HARD","CHALLENGE" ), + MenuRow( "Meter", true, 0, "1","2","3","4","5","6","7","8","9","10","11" ), + MenuRow( "Description", true ), + MenuRow( "Tap Notes", false ), + MenuRow( "Hold Notes", false ), + MenuRow( "Stream", false ), + MenuRow( "Voltage", false ), + MenuRow( "Air", false ), + MenuRow( "Freeze", false ), + MenuRow( "Chaos", false ) +); -MiniMenuDefinition g_EditSongInfo = -{ +Menu g_EditSongInfo +( "Edit Song Info", - ScreenEdit::NUM_EDIT_SONG_INFO_CHOICES, - { - { "Main title", true, 1, 0, {""} }, - { "Sub title", true, 1, 0, {""} }, - { "Artist", true, 1, 0, {""} }, - { "Main title transliteration", true, 1, 0, {""} }, - { "Sub title transliteration", true, 1, 0, {""} }, - { "Artist transliteration", true, 1, 0, {""} }, - } -}; + MenuRow( "Main title", true ), + MenuRow( "Sub title", true ), + MenuRow( "Artist", true ), + MenuRow( "Main title transliteration", true ), + MenuRow( "Sub title transliteration", true ), + MenuRow( "Artist transliteration", true ) +); + + +Menu g_BGChange +( + "Background Change", + MenuRow( "Add Change to random", true ), + MenuRow( "Add Change to song BGAnimation", true ), + MenuRow( "Add Change to song Movie", true ), + MenuRow( "Add Change to global Random Movie", true ), + MenuRow( "Add Change to global BGAnimation", true ), + MenuRow( "Add Change to global Visualization", true ), + MenuRow( "Remove Change", true ) +); ScreenEdit::ScreenEdit() @@ -761,17 +766,17 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ { // update enabled/disabled in g_AreaMenu bool bAreaSelected = m_NoteFieldEdit.m_fBeginMarker!=-1 && m_NoteFieldEdit.m_fEndMarker!=-1; - g_AreaMenu.lines[cut].bEnabled = bAreaSelected; - g_AreaMenu.lines[copy].bEnabled = bAreaSelected; - g_AreaMenu.lines[paste_at_current_beat].bEnabled = this->m_Clipboard.GetLastBeat() != 0; - g_AreaMenu.lines[paste_at_begin_marker].bEnabled = this->m_Clipboard.GetLastBeat() != 0 && m_NoteFieldEdit.m_fBeginMarker!=-1; - g_AreaMenu.lines[clear].bEnabled = bAreaSelected; - g_AreaMenu.lines[quantize].bEnabled = bAreaSelected; - g_AreaMenu.lines[turn].bEnabled = bAreaSelected; - g_AreaMenu.lines[transform].bEnabled = bAreaSelected; - g_AreaMenu.lines[alter].bEnabled = bAreaSelected; - g_AreaMenu.lines[play].bEnabled = bAreaSelected; - g_AreaMenu.lines[record].bEnabled = bAreaSelected; + g_AreaMenu.rows[cut].enabled = bAreaSelected; + g_AreaMenu.rows[copy].enabled = bAreaSelected; + g_AreaMenu.rows[paste_at_current_beat].enabled = this->m_Clipboard.GetLastBeat() != 0; + g_AreaMenu.rows[paste_at_begin_marker].enabled = this->m_Clipboard.GetLastBeat() != 0 && m_NoteFieldEdit.m_fBeginMarker!=-1; + g_AreaMenu.rows[clear].enabled = bAreaSelected; + g_AreaMenu.rows[quantize].enabled = bAreaSelected; + g_AreaMenu.rows[turn].enabled = bAreaSelected; + g_AreaMenu.rows[transform].enabled = bAreaSelected; + g_AreaMenu.rows[alter].enabled = bAreaSelected; + g_AreaMenu.rows[play].enabled = bAreaSelected; + g_AreaMenu.rows[record].enabled = bAreaSelected; SCREENMAN->MiniMenu( &g_AreaMenu, SM_BackFromAreaMenu ); } break; @@ -1056,6 +1061,9 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) case SM_BackFromEditSongInfo: HandleEditSongInfoChoice( (EditSongInfoChoice)ScreenMiniMenu::s_iLastLine, ScreenMiniMenu::s_iLastAnswers ); break; + case SM_BackFromBGChange: + HandleBGChangeChoice( (BGChangeChoice)ScreenMiniMenu::s_iLastLine, ScreenMiniMenu::s_iLastAnswers ); + break; case SM_RegainingFocus: // coming back from PlayerOptions or SongOptions m_soundMusic.SetPlaybackRate( GAMESTATE->m_SongOptions.m_fMusicRate ); @@ -1155,16 +1163,16 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers ) Notes* pNotes = GAMESTATE->m_pCurNotes[PLAYER_1]; float fMusicSeconds = m_soundMusic.GetLengthSeconds(); - g_EditNotesStatistics.lines[difficulty].iDefaultOption = pNotes->GetDifficulty(); - g_EditNotesStatistics.lines[meter].iDefaultOption = pNotes->GetMeter()-1; - strcpy( g_EditNotesStatistics.lines[description].szOptionsText[0], pNotes->GetDescription() ); - strcpy( g_EditNotesStatistics.lines[tap_notes].szOptionsText[0], ssprintf("%d", m_NoteFieldEdit.GetNumTapNotes()) ); - strcpy( g_EditNotesStatistics.lines[hold_notes].szOptionsText[0], ssprintf("%d", m_NoteFieldEdit.GetNumHoldNotes()) ); - strcpy( g_EditNotesStatistics.lines[stream].szOptionsText[0], ssprintf("%f", NoteDataUtil::GetStreamRadarValue(m_NoteFieldEdit,fMusicSeconds)) ); - strcpy( g_EditNotesStatistics.lines[voltage].szOptionsText[0], ssprintf("%f", NoteDataUtil::GetVoltageRadarValue(m_NoteFieldEdit,fMusicSeconds)) ); - strcpy( g_EditNotesStatistics.lines[air].szOptionsText[0], ssprintf("%f", NoteDataUtil::GetAirRadarValue(m_NoteFieldEdit,fMusicSeconds)) ); - strcpy( g_EditNotesStatistics.lines[freeze].szOptionsText[0], ssprintf("%f", NoteDataUtil::GetFreezeRadarValue(m_NoteFieldEdit,fMusicSeconds)) ); - strcpy( g_EditNotesStatistics.lines[chaos].szOptionsText[0], ssprintf("%f", NoteDataUtil::GetChaosRadarValue(m_NoteFieldEdit,fMusicSeconds)) ); + g_EditNotesStatistics.rows[difficulty].defaultChoice = pNotes->GetDifficulty(); + g_EditNotesStatistics.rows[meter].defaultChoice = pNotes->GetMeter()-1; + g_EditNotesStatistics.rows[description].choices.resize(1); g_EditNotesStatistics.rows[description].choices[0] = pNotes->GetDescription(); + g_EditNotesStatistics.rows[tap_notes].choices.resize(1); g_EditNotesStatistics.rows[tap_notes].choices[0] = ssprintf("%d", m_NoteFieldEdit.GetNumTapNotes()); + g_EditNotesStatistics.rows[hold_notes].choices.resize(1); g_EditNotesStatistics.rows[hold_notes].choices[0] = ssprintf("%d", m_NoteFieldEdit.GetNumHoldNotes()); + g_EditNotesStatistics.rows[stream].choices.resize(1); g_EditNotesStatistics.rows[stream].choices[0] = ssprintf("%f", NoteDataUtil::GetStreamRadarValue(m_NoteFieldEdit,fMusicSeconds)); + g_EditNotesStatistics.rows[voltage].choices.resize(1); g_EditNotesStatistics.rows[voltage].choices[0] = ssprintf("%f", NoteDataUtil::GetVoltageRadarValue(m_NoteFieldEdit,fMusicSeconds)); + g_EditNotesStatistics.rows[air].choices.resize(1); g_EditNotesStatistics.rows[air].choices[0] = ssprintf("%f", NoteDataUtil::GetAirRadarValue(m_NoteFieldEdit,fMusicSeconds)); + g_EditNotesStatistics.rows[freeze].choices.resize(1); g_EditNotesStatistics.rows[freeze].choices[0] = ssprintf("%f", NoteDataUtil::GetFreezeRadarValue(m_NoteFieldEdit,fMusicSeconds)); + g_EditNotesStatistics.rows[chaos].choices.resize(1); g_EditNotesStatistics.rows[chaos].choices[0] = ssprintf("%f", NoteDataUtil::GetChaosRadarValue(m_NoteFieldEdit,fMusicSeconds)); SCREENMAN->MiniMenu( &g_EditNotesStatistics, SM_BackFromEditNotesStatistics ); } break; @@ -1197,12 +1205,12 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers ) case edit_song_info: { Song* pSong = GAMESTATE->m_pCurSong; - strcpy( g_EditSongInfo.lines[main_title].szOptionsText[0], pSong->m_sMainTitle ); - strcpy( g_EditSongInfo.lines[sub_title].szOptionsText[0], pSong->m_sSubTitle ); - strcpy( g_EditSongInfo.lines[artist].szOptionsText[0], pSong->m_sArtist ); - strcpy( g_EditSongInfo.lines[main_title_transliteration].szOptionsText[0], pSong->m_sMainTitleTranslit ); - strcpy( g_EditSongInfo.lines[sub_title_transliteration].szOptionsText[0], pSong->m_sSubTitleTranslit ); - strcpy( g_EditSongInfo.lines[artist_transliteration].szOptionsText[0], pSong->m_sArtistTranslit ); + g_EditSongInfo.rows[main_title].choices.resize(1); g_EditSongInfo.rows[main_title].choices[0] = pSong->m_sMainTitle; + g_EditSongInfo.rows[sub_title].choices.resize(1); g_EditSongInfo.rows[sub_title].choices[0] = pSong->m_sSubTitle; + g_EditSongInfo.rows[artist].choices.resize(1); g_EditSongInfo.rows[artist].choices[0] = pSong->m_sArtist; + g_EditSongInfo.rows[main_title_transliteration].choices.resize(1); g_EditSongInfo.rows[main_title_transliteration].choices[0] = pSong->m_sMainTitleTranslit; + g_EditSongInfo.rows[sub_title_transliteration].choices.resize(1); g_EditSongInfo.rows[sub_title_transliteration].choices[0] = pSong->m_sSubTitleTranslit; + g_EditSongInfo.rows[artist_transliteration].choices.resize(1); g_EditSongInfo.rows[artist_transliteration].choices[0] = pSong->m_sArtistTranslit; SCREENMAN->MiniMenu( &g_EditSongInfo, SM_BackFromEditSongInfo ); } @@ -1213,17 +1221,50 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers ) break; case edit_bg_change: { - CString sOldBackground; - unsigned i; - for( i=0; im_BackgroundChanges.size(); i++ ) - { - if( m_pSong->m_BackgroundChanges[i].m_fStartBeat == GAMESTATE->m_fSongBeat ) - break; - } - if( i != m_pSong->m_BackgroundChanges.size() ) // there is already a BGChange here - sOldBackground = m_pSong->m_BackgroundChanges[i].m_sBGName; + // + // Fill in option names + // + g_BGChange.rows[add_song_bganimation].choices.clear(); + GetDirListing( m_pSong->GetSongDir()+"/*.*", g_BGChange.rows[add_song_bganimation].choices, true ); - SCREENMAN->TextEntry( SM_None, "Type a background name.\nPress Enter to keep,\nEscape to cancel.\nEnter an empty string to remove\nthe Background Change.", sOldBackground, AddBGChange, NULL ); + g_BGChange.rows[add_song_movie].choices.clear(); + GetDirListing( m_pSong->GetSongDir()+"/*.avi", g_BGChange.rows[add_song_movie].choices, false ); + GetDirListing( m_pSong->GetSongDir()+"/*.mpg", g_BGChange.rows[add_song_movie].choices, false ); + GetDirListing( m_pSong->GetSongDir()+"/*.mpeg", g_BGChange.rows[add_song_movie].choices, false ); + + g_BGChange.rows[add_global_random_movie].choices.clear(); + GetDirListing( m_pSong->GetSongDir()+"/*.avi", g_BGChange.rows[add_global_random_movie].choices, false ); + GetDirListing( m_pSong->GetSongDir()+"/*.mpg", g_BGChange.rows[add_global_random_movie].choices, false ); + GetDirListing( m_pSong->GetSongDir()+"/*.mpeg", g_BGChange.rows[add_global_random_movie].choices, false ); + + g_BGChange.rows[add_global_bganimation].choices.clear(); + GetDirListing( m_pSong->GetSongDir()+"/*.*", g_BGChange.rows[add_global_bganimation].choices, true ); + + g_BGChange.rows[add_global_visualization].choices.clear(); + GetDirListing( m_pSong->GetSongDir()+"/*.avi", g_BGChange.rows[add_global_visualization].choices, false ); + GetDirListing( m_pSong->GetSongDir()+"/*.mpg", g_BGChange.rows[add_global_visualization].choices, false ); + GetDirListing( m_pSong->GetSongDir()+"/*.mpeg", g_BGChange.rows[add_global_visualization].choices, false ); + + + // + // Fill in line enabled/disabled + // + bool bAlreadyBGChangeHere = false; + for( unsigned i=0; im_BackgroundChanges.size(); i++ ) + if( m_pSong->m_BackgroundChanges[i].m_fStartBeat == GAMESTATE->m_fSongBeat ) + bAlreadyBGChangeHere = true; + + g_BGChange.rows[add_random].enabled = true; + g_BGChange.rows[add_song_bganimation].enabled = g_BGChange.rows[add_song_bganimation].choices.size() > 0; + g_BGChange.rows[add_song_movie].enabled = g_BGChange.rows[add_global_random_movie].choices.size() > 0; + g_BGChange.rows[add_global_random_movie].enabled = g_BGChange.rows[add_global_random_movie].choices.size() > 0; + g_BGChange.rows[add_global_bganimation].enabled = g_BGChange.rows[add_global_bganimation].choices.size() > 0; + g_BGChange.rows[add_global_visualization].enabled = g_BGChange.rows[add_global_visualization].choices.size() > 0; + g_BGChange.rows[delete_change].enabled = bAlreadyBGChangeHere; + + + + SCREENMAN->MiniMenu( &g_BGChange, SM_BackFromBGChange ); } break; case play_preview_music: @@ -1468,4 +1509,36 @@ void ScreenEdit::HandleEditSongInfoChoice( EditSongInfoChoice c, int* iAnswers ) default: ASSERT(0); }; -} \ No newline at end of file +} + +void ScreenEdit::HandleBGChangeChoice( BGChangeChoice c, int* iAnswers ) +{ + Song* pSong = GAMESTATE->m_pCurSong; + + switch( c ) + { + case add_random: + SCREENMAN->TextEntry( SM_None, "Edit main title.\nPress Enter to confirm,\nEscape to cancel.", pSong->m_sMainTitle, ChangeMainTitle, NULL ); + break; + case add_song_bganimation: + SCREENMAN->TextEntry( SM_None, "Edit sub title.\nPress Enter to confirm,\nEscape to cancel.", pSong->m_sSubTitle, ChangeSubTitle, NULL ); + break; + case add_song_movie: + SCREENMAN->TextEntry( SM_None, "Edit artist.\nPress Enter to confirm,\nEscape to cancel.", pSong->m_sArtist, ChangeArtist, NULL ); + break; + case add_global_random_movie: + SCREENMAN->TextEntry( SM_None, "Edit main title transliteration.\nPress Enter to confirm,\nEscape to cancel.", pSong->m_sMainTitleTranslit, ChangeMainTitleTranslit, NULL ); + break; + case add_global_bganimation: + SCREENMAN->TextEntry( SM_None, "Edit sub title transliteration.\nPress Enter to confirm,\nEscape to cancel.", pSong->m_sSubTitleTranslit, ChangeSubTitleTranslit, NULL ); + break; + case add_global_visualization: + SCREENMAN->TextEntry( SM_None, "Edit artist transliteration.\nPress Enter to confirm,\nEscape to cancel.", pSong->m_sArtistTranslit, ChangeArtistTranslit, NULL ); + break; + case delete_change: + SCREENMAN->TextEntry( SM_None, "Edit artist transliteration.\nPress Enter to confirm,\nEscape to cancel.", pSong->m_sArtistTranslit, ChangeArtistTranslit, NULL ); + break; + default: + ASSERT(0); + }; +} diff --git a/stepmania/src/ScreenEdit.h b/stepmania/src/ScreenEdit.h index e332cecf38..b470f4f4a1 100644 --- a/stepmania/src/ScreenEdit.h +++ b/stepmania/src/ScreenEdit.h @@ -164,6 +164,18 @@ public: }; void HandleEditSongInfoChoice( EditSongInfoChoice c, int* iAnswers ); + enum BGChangeChoice { + add_random, + add_song_bganimation, + add_song_movie, + add_global_random_movie, + add_global_bganimation, + add_global_visualization, + delete_change, + NUM_BGCHANGE_CHOICES + }; + void HandleBGChangeChoice( BGChangeChoice c, int* iAnswers ); + }; diff --git a/stepmania/src/ScreenGameplayOptions.cpp b/stepmania/src/ScreenGameplayOptions.cpp index 3d1f4c27bd..00d3c9d277 100644 --- a/stepmania/src/ScreenGameplayOptions.cpp +++ b/stepmania/src/ScreenGameplayOptions.cpp @@ -37,16 +37,16 @@ enum { NUM_GAMEPLAY_OPTIONS_LINES }; -OptionRowData g_GameplayOptionsLines[NUM_GAMEPLAY_OPTIONS_LINES] = { - { "Background\nMode", 4, {"OFF","ANIMATIONS","VISUALIZATIONS","RANDOM MOVIES"} }, - { "Background\nBrightness", 11, {"0%","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%"} }, - { "BG For\nBanner", 2, {"NO", "YES (slow)"} }, - { "Show\nDanger", 2, {"OFF","ON"} }, - { "Solo\nSingles", 2, {"OFF","ON"} }, - { "Hidden\nSongs", 2, {"OFF","ON"} }, - { "Easter\nEggs", 2, {"OFF","ON"} }, - { "Marvelous\nTiming", 2, {"OFF","ON"} }, - { "Pick Extra\nStage", 2, {"OFF","ON"} } +OptionRow g_GameplayOptionsLines[NUM_GAMEPLAY_OPTIONS_LINES] = { + OptionRow( "Background\nMode", "OFF","ANIMATIONS","VISUALIZATIONS","RANDOM MOVIES" ), + OptionRow( "Background\nBrightness","0%","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%" ), + OptionRow( "BG For\nBanner", "NO", "YES (slow)" ), + OptionRow( "Show\nDanger", "OFF","ON" ), + OptionRow( "Solo\nSingles", "OFF","ON" ), + OptionRow( "Hidden\nSongs", "OFF","ON" ), + OptionRow( "Easter\nEggs", "OFF","ON" ), + OptionRow( "Marvelous\nTiming", "OFF","ON" ), + OptionRow( "Pick Extra\nStage", "OFF","ON" ) }; ScreenGameplayOptions::ScreenGameplayOptions() : @@ -54,20 +54,11 @@ ScreenGameplayOptions::ScreenGameplayOptions() : { LOG->Trace( "ScreenGameplayOptions::ScreenGameplayOptions()" ); - // fill g_InputOptionsLines with explanation text - for( int i=0; iGetMetric("ScreenGameplayOptions",sLineName) ); - } - Init( INPUTMODE_BOTH, g_GameplayOptionsLines, NUM_GAMEPLAY_OPTIONS_LINES, - false ); + false, true ); m_Menu.m_MenuTimer.Disable(); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenMachineOptions music") ); diff --git a/stepmania/src/ScreenGraphicOptions.cpp b/stepmania/src/ScreenGraphicOptions.cpp index 09266f7b98..8b4ef29e1e 100644 --- a/stepmania/src/ScreenGraphicOptions.cpp +++ b/stepmania/src/ScreenGraphicOptions.cpp @@ -35,16 +35,16 @@ enum { GO_VSYNC, NUM_GRAPHIC_OPTIONS_LINES }; -OptionRowData g_GraphicOptionsLines[NUM_GRAPHIC_OPTIONS_LINES] = { - { "Display\nMode", 2, {"FULLSCREEN", "WINDOWED"} }, - { "Display\nResolution", 7, {"320","400","512","640","800","1024","1280"} }, - { "Display\nColor", 2, {"16BIT","32BIT"} }, - { "Max Texture\nResolution",4, {"256","512","1024","2048"} }, - { "Texture\nColor", 2, {"16BIT","32BIT"} }, - { "Keep Textures\nIn Memory",2, {"NO","YES"} }, - { "Refresh\nRate", 11, {"DEFAULT","60","70","72","75","80","85","90","100","120","150"} }, - { "Movie\nDecode", 4, {"1ms","2ms","3ms","4ms"} }, - { "Wait For\nVsync", 2, {"NO", "YES"} }, +OptionRow g_GraphicOptionsLines[NUM_GRAPHIC_OPTIONS_LINES] = { + OptionRow( "Display\nMode", "FULLSCREEN", "WINDOWED" ), + OptionRow( "Display\nResolution", "320","400","512","640","800","1024","1280" ), + OptionRow( "Display\nColor", "16BIT","32BIT" ), + OptionRow( "Max Texture\nResolution", "256","512","1024","2048" ), + OptionRow( "Texture\nColor", "16BIT","32BIT" ), + OptionRow( "Keep Textures\nIn Memory", "NO","YES" ), + OptionRow( "Refresh\nRate", "DEFAULT","60","70","72","75","80","85","90","100","120","150" ), + OptionRow( "Movie\nDecode", "1ms","2ms","3ms","4ms" ), + OptionRow( "Wait For\nVsync", "NO", "YES" ), }; static const int HorizRes[] = { @@ -62,20 +62,11 @@ ScreenGraphicOptions::ScreenGraphicOptions() : { LOG->Trace( "ScreenGraphicOptions::ScreenGraphicOptions()" ); - // fill g_InputOptionsLines with explanation text - for( int i=0; iGetMetric("ScreenGraphicOptions",sLineName) ); - } - Init( INPUTMODE_BOTH, g_GraphicOptionsLines, NUM_GRAPHIC_OPTIONS_LINES, - false ); + false, true ); m_Menu.m_MenuTimer.Disable(); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenGraphicOptions music") ); @@ -124,8 +115,8 @@ void ScreenGraphicOptions::ImportOptions() { case REFRESH_DEFAULT: m_iSelectedOption[0][GO_REFRESH_RATE] = 0; break; default: - for(unsigned i = 2; i < g_GraphicOptionsLines[GO_REFRESH_RATE].iNumOptions; ++i) { - if(atoi(g_GraphicOptionsLines[GO_REFRESH_RATE].szOptionsText[i]) <= PREFSMAN->m_iRefreshRate) + for(unsigned i = 2; i < g_GraphicOptionsLines[GO_REFRESH_RATE].choices.size(); ++i) { + if(atoi(g_GraphicOptionsLines[GO_REFRESH_RATE].choices[i]) <= PREFSMAN->m_iRefreshRate) m_iSelectedOption[0][GO_REFRESH_RATE] = i; } } @@ -169,7 +160,7 @@ void ScreenGraphicOptions::ExportOptions() else { int n = m_iSelectedOption[0][GO_REFRESH_RATE]; - PREFSMAN->m_iRefreshRate = atoi(g_GraphicOptionsLines[GO_REFRESH_RATE].szOptionsText[n]); + PREFSMAN->m_iRefreshRate = atoi(g_GraphicOptionsLines[GO_REFRESH_RATE].choices[n]); } PREFSMAN->m_iMovieDecodeMS = m_iSelectedOption[0][GO_MOVIEDECODEMS]+1; diff --git a/stepmania/src/ScreenInputOptions.cpp b/stepmania/src/ScreenInputOptions.cpp index fe91cf43be..ac1a68195a 100644 --- a/stepmania/src/ScreenInputOptions.cpp +++ b/stepmania/src/ScreenInputOptions.cpp @@ -35,13 +35,13 @@ enum { /* Hmm. Ignore JoyAxes and Back Delayed probably belong in "key/joy config", * preferably alongside button configuration. */ -OptionRowData g_InputOptionsLines[NUM_INPUT_OPTIONS_LINES] = { - { "Ignore\nJoy Axes", 2, {"OFF","ON (for NTPad or DirectPad)"} }, - { "Menu\nButtons", 2, {"USE GAMEPLAY BUTTONS","ONLY DEDICATED BUTTONS"} }, - { "AutoPlay", 2, {"OFF","ON"} }, - { "Back\nDelayed", 2, {"INSTANT","HOLD"} }, - { "Options\nNavigation",2, {"SM STYLE","ARCADE STYLE"} }, - { "Wheel\nSpeed", 4, {"SLOW","NORMAL","FAST","REALLY FAST"} }, +OptionRow g_InputOptionsLines[NUM_INPUT_OPTIONS_LINES] = { + OptionRow( "Ignore\nJoy Axes", "OFF","ON (for NTPad or DirectPad)" ), + OptionRow( "Menu\nButtons", "USE GAMEPLAY BUTTONS","ONLY DEDICATED BUTTONS" ), + OptionRow( "AutoPlay", "OFF","ON" ), + OptionRow( "Back\nDelayed", "INSTANT","HOLD" ), + OptionRow( "Options\nNavigation", "SM STYLE","ARCADE STYLE" ), + OptionRow( "Wheel\nSpeed", "SLOW","NORMAL","FAST","REALLY FAST" ), }; ScreenInputOptions::ScreenInputOptions() : @@ -49,20 +49,11 @@ ScreenInputOptions::ScreenInputOptions() : { LOG->Trace( "ScreenInputOptions::ScreenInputOptions()" ); - // fill g_InputOptionsLines with explanation text - for( int i=0; iGetMetric("ScreenInputOptions",sLineName) ); - } - Init( INPUTMODE_BOTH, g_InputOptionsLines, NUM_INPUT_OPTIONS_LINES, - false ); + false, true ); m_Menu.m_MenuTimer.Disable(); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenInputOptions music") ); diff --git a/stepmania/src/ScreenMachineOptions.cpp b/stepmania/src/ScreenMachineOptions.cpp index e8a3342db1..cef33f9710 100644 --- a/stepmania/src/ScreenMachineOptions.cpp +++ b/stepmania/src/ScreenMachineOptions.cpp @@ -38,17 +38,17 @@ enum { }; /* Hmm. Ignore JoyAxes and Back Delayed probably belong in "input options", * preferably alongside button configuration. */ -OptionRowData g_MachineOptionsLines[NUM_MACHINE_OPTIONS_LINES] = { - { "Menu\nTimer", 2, {"OFF","ON"} }, - { "Arcade\nStages", 8, {"1","2","3","4","5","6","7","UNLIMITED"} }, - { "Judge\nDifficulty", 8, {"1","2","3","4","5","6","7","8"} }, - { "Life\nDifficulty", 7, {"1","2","3","4","5","6","7"} }, - { "Default\nFail Type", 3, {"ARCADE","END OF SONG","OFF"} }, - { "Show\nStats", 2, {"OFF","ON"} }, - { "Coin\nMode", 3, {"HOME","PAY","FREE PLAY"} }, - { "Coins Per\nCredit", 8, {"1","2","3","4","5","6","7","8"} }, - { "Joint\nPremium", 2, {"OFF","ON"} }, - { "Song\nOptions", 2, {"HIDE","ALLOW"} }, +OptionRow g_MachineOptionsLines[NUM_MACHINE_OPTIONS_LINES] = { + OptionRow( "Menu\nTimer", "OFF","ON" ), + OptionRow( "Arcade\nStages", "1","2","3","4","5","6","7","UNLIMITED" ), + 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" ), }; ScreenMachineOptions::ScreenMachineOptions() : @@ -56,20 +56,11 @@ ScreenMachineOptions::ScreenMachineOptions() : { LOG->Trace( "ScreenMachineOptions::ScreenMachineOptions()" ); - // fill g_InputOptionsLines with explanation text - for( int i=0; iGetMetric("ScreenMachineOptions",sLineName) ); - } - Init( INPUTMODE_BOTH, g_MachineOptionsLines, NUM_MACHINE_OPTIONS_LINES, - false ); + false, true ); m_Menu.m_MenuTimer.Disable(); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenMachineOptions music") ); diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 6930147245..ae843c7f01 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -467,7 +467,7 @@ void ScreenManager::TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion, m_ScreenStack.push_back( new ScreenTextEntry(SM_SendWhenDone, sQuestion, sInitialAnswer, OnOK, OnCanel) ); } -void ScreenManager::MiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel ) +void ScreenManager::MiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel ) { // add the new state onto the back of the array m_ScreenStack.push_back( new ScreenMiniMenu(pDef, SM_SendOnOK, SM_SendOnCancel) ); diff --git a/stepmania/src/ScreenManager.h b/stepmania/src/ScreenManager.h index 06f3f12eea..4ea8940d10 100644 --- a/stepmania/src/ScreenManager.h +++ b/stepmania/src/ScreenManager.h @@ -22,7 +22,7 @@ #include "MenuInput.h" #include "StyleInput.h" class Screen; -struct MiniMenuDefinition; +struct Menu; class ScreenSystemLayer; @@ -46,7 +46,7 @@ public: void AddNewScreenToTop( CString sClassName ); void Prompt( ScreenMessage SM_SendWhenDone, CString sText, bool bYesNo = false, bool bDefaultAnswer = false, void(*OnYes)() = NULL, void(*OnNo)() = NULL ); void TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion, CString sInitialAnswer, void(*OnOK)(CString sAnswer) = NULL, void(*OnCanel)() = NULL ); - void MiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel = SM_None ); + void MiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel = SM_None ); void PopTopScreen( ScreenMessage SM = SM_RegainingFocus ); void SystemMessage( CString sMessage ); diff --git a/stepmania/src/ScreenMiniMenu.cpp b/stepmania/src/ScreenMiniMenu.cpp index c1badb7e55..4dc5140658 100644 --- a/stepmania/src/ScreenMiniMenu.cpp +++ b/stepmania/src/ScreenMiniMenu.cpp @@ -35,17 +35,17 @@ const ScreenMessage SM_GoToCancel = (ScreenMessage)(SM_User+2); int ScreenMiniMenu::s_iLastLine; -int ScreenMiniMenu::s_iLastAnswers[MAX_MINI_MENU_LINES]; +int ScreenMiniMenu::s_iLastAnswers[MAX_MENU_ROWS]; -ScreenMiniMenu::ScreenMiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel ) +ScreenMiniMenu::ScreenMiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel ) { m_bIsTransparent = true; // draw screens below us m_SMSendOnOK = SM_SendOnOK; m_SMSendOnCancel = SM_SendOnCancel; m_Def = *pDef; - ASSERT( m_Def.iNumLines <= MAX_MINI_MENU_LINES ); + ASSERT( m_Def.rows.size() <= MAX_MENU_ROWS ); m_Fade.SetTransitionTime( 0.5f ); @@ -55,10 +55,10 @@ ScreenMiniMenu::ScreenMiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendO this->AddChild( &m_Fade ); - float fHeightOfAll = (m_Def.iNumLines-1)*SPACING_Y; + float fHeightOfAll = (m_Def.rows.size()-1)*SPACING_Y; m_textTitle.LoadFromFont( THEME->GetPathTo("Fonts","normal") ); - m_textTitle.SetText( m_Def.szTitle ); + m_textTitle.SetText( m_Def.title ); m_textTitle.SetXY( CENTER_X, CENTER_Y - fHeightOfAll/2 - 30 ); m_textTitle.SetZoom( 0.8f ); this->AddChild( &m_textTitle ); @@ -68,27 +68,28 @@ ScreenMiniMenu::ScreenMiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendO float fLongestLabelPlusAnswer = 0; - for( int i=0; iGetPathTo("Fonts","normal") ); - m_textLabel[i].SetText( line.szLabel ); + m_textLabel[i].SetText( line.name ); m_textLabel[i].SetY( fY ); m_textLabel[i].SetZoom( ZOOM_NOT_SELECTED ); m_textLabel[i].SetHorizAlign( Actor::align_left ); - m_textLabel[i].SetDiffuse( line.bEnabled ? COLOR_ENABLED : COLOR_DISABLED ); + m_textLabel[i].SetDiffuse( line.enabled ? COLOR_ENABLED : COLOR_DISABLED ); this->AddChild( &m_textLabel[i] ); + CString sText = line.choices.empty() ? "" : line.choices[line.defaultChoice]; m_textAnswer[i].LoadFromFont( THEME->GetPathTo("Fonts","normal") ); - m_textAnswer[i].SetText( line.szOptionsText[line.iDefaultOption] ); + m_textAnswer[i].SetText( sText ); m_textAnswer[i].SetY( fY ); m_textAnswer[i].SetZoom( ZOOM_NOT_SELECTED ); m_textAnswer[i].SetHorizAlign( Actor::align_right ); - m_textAnswer[i].SetDiffuse( line.bEnabled ? COLOR_ENABLED : COLOR_DISABLED ); + m_textAnswer[i].SetDiffuse( line.enabled ? COLOR_ENABLED : COLOR_DISABLED ); this->AddChild( &m_textAnswer[i] ); fLongestLabelPlusAnswer = max( @@ -96,14 +97,14 @@ ScreenMiniMenu::ScreenMiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendO m_textLabel[i].GetWidestLineWidthInSourcePixels() * ZOOM_SELECTED + m_textAnswer[i].GetWidestLineWidthInSourcePixels() * ZOOM_SELECTED ); - if( !bMarkedFirstEnabledLine && line.bEnabled ) + if( !bMarkedFirstEnabledLine && line.enabled ) { m_iCurLine = i; AfterLineChanged(); bMarkedFirstEnabledLine = true; } - m_iCurAnswers[i] = line.iDefaultOption; + m_iCurAnswers[i] = line.defaultChoice; } // adjust text spacing based on widest line @@ -117,7 +118,7 @@ ScreenMiniMenu::ScreenMiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendO fAnswerX += fIncreaseBy/2; } - for( int k=0; kPlayOnce( THEME->GetPathTo("Sounds","ScreenMiniMenu row") ); int iAnswerInRow = m_iCurAnswers[m_iCurLine]; - CString sAnswerText = m_Def.lines[m_iCurLine].szOptionsText[iAnswerInRow]; + CString sAnswerText = m_Def.rows[m_iCurLine].choices[iAnswerInRow]; m_textAnswer[m_iCurLine].SetText( sAnswerText ); } @@ -252,11 +253,11 @@ int ScreenMiniMenu::GetGoUpSpot() { int i; for( i=m_iCurLine-1; i>=0; i-- ) - if( m_Def.lines[i].bEnabled ) + if( m_Def.rows[i].enabled ) return i; // wrap - for( i=m_Def.iNumLines-1; i>=0; i-- ) - if( m_Def.lines[i].bEnabled ) + for( i=m_Def.rows.size()-1; i>=0; i-- ) + if( m_Def.rows[i].enabled ) return i; return -1; } @@ -264,12 +265,12 @@ int ScreenMiniMenu::GetGoUpSpot() int ScreenMiniMenu::GetGoDownSpot() { int i; - for( i=m_iCurLine+1; i choices; + + MenuRow() { - char szLabel[256]; - bool bEnabled; - int iNumOptions; - int iDefaultOption; - char szOptionsText[MAX_OPTIONS_PER_LINE][256]; - } lines[MAX_MINI_MENU_LINES]; + enabled = true; + defaultChoice = 0; + } + + MenuRow( CString n, bool e, CString c0="", CString c1="", CString c2="", CString c3="", CString c4="", CString c5="", CString c6="", CString c7="", CString c8="", CString c9="", CString c10="", CString c11="", CString c12="", CString c13="", CString c14="" ) + { + name = n; + enabled = e; + defaultChoice = 0; +#define PUSH( c ) if(c!="") choices.push_back(c); + PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14); + printf( "choices.size = %u", choices.size() ); + } +}; + + +struct Menu +{ + CString title; + vector rows; + + Menu() {} + + Menu( CString t, MenuRow r0, MenuRow r1=MenuRow(), MenuRow r2=MenuRow(), MenuRow r3=MenuRow(), MenuRow r4=MenuRow(), MenuRow r5=MenuRow(), MenuRow r6=MenuRow(), MenuRow r7=MenuRow(), MenuRow r8=MenuRow(), MenuRow r9=MenuRow(), MenuRow r10=MenuRow(), MenuRow r11=MenuRow(), MenuRow r12=MenuRow(), MenuRow r13=MenuRow(), MenuRow r14=MenuRow(), MenuRow r15=MenuRow(), MenuRow r16=MenuRow(), MenuRow r17=MenuRow(), MenuRow r18=MenuRow(), MenuRow r19=MenuRow() ) + { + title = t; +#define PUSH2( r ) if(r.name!="" || !r.choices.empty()) rows.push_back(r); + PUSH2(r0);PUSH2(r1);PUSH2(r2);PUSH2(r3);PUSH2(r4);PUSH2(r5);PUSH2(r6);PUSH2(r7);PUSH2(r8);PUSH2(r9);PUSH2(r10);PUSH2(r11);PUSH2(r12);PUSH2(r13);PUSH2(r14);PUSH2(r15);PUSH2(r16);PUSH2(r17);PUSH2(r18);PUSH2(r19); + } }; @@ -38,7 +65,7 @@ class ScreenMiniMenu : public Screen { public: ScreenMiniMenu(); - ScreenMiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel ); + ScreenMiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel ); virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); @@ -63,18 +90,18 @@ protected: void AfterLineChanged(); void AfterAnswerChanged(); - MiniMenuDefinition m_Def; + Menu m_Def; TransitionFade m_Fade; BitmapText m_textTitle; - BitmapText m_textLabel[MAX_MINI_MENU_LINES]; - BitmapText m_textAnswer[MAX_MINI_MENU_LINES]; + BitmapText m_textLabel[MAX_MENU_ROWS]; + BitmapText m_textAnswer[MAX_MENU_ROWS]; int m_iCurLine; - int m_iCurAnswers[MAX_MINI_MENU_LINES]; + int m_iCurAnswers[MAX_MENU_ROWS]; ScreenMessage m_SMSendOnOK, m_SMSendOnCancel; public: static int s_iLastLine; - static int s_iLastAnswers[MAX_MINI_MENU_LINES]; + static int s_iLastAnswers[MAX_MENU_ROWS]; }; diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index ba7b012f7f..dc2566d06e 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -45,6 +45,8 @@ ScreenOptions::ScreenOptions( CString sClassName, bool bEnableTimer ) { LOG->Trace( "ScreenOptions::ScreenOptions()" ); + m_sClassName = sClassName; + m_SoundChangeCol.Load( THEME->GetPathTo("Sounds","ScreenOptions change") ); m_SoundNextRow.Load( THEME->GetPathTo("Sounds","ScreenOptions next") ); m_SoundPrevRow.Load( THEME->GetPathTo("Sounds","ScreenOptions prev") ); @@ -74,15 +76,16 @@ ScreenOptions::ScreenOptions( CString sClassName, bool bEnableTimer ) memset(&m_OptionDim, 0, sizeof(m_OptionDim)); } -void ScreenOptions::Init( InputMode im, OptionRowData OptionRowData[], int iNumOptionLines, bool bUseIcons ) +void ScreenOptions::Init( InputMode im, OptionRow OptionRow[], int iNumOptionLines, bool bUseIcons, bool bLoadExplanations ) { LOG->Trace( "ScreenOptions::Set()" ); m_InputMode = im; - m_OptionRowData = OptionRowData; + m_OptionRow = OptionRow; m_iNumOptionRows = iNumOptionLines; m_bUseIcons = bUseIcons; + m_bLoadExplanations = bLoadExplanations; this->ImportOptions(); @@ -120,7 +123,7 @@ void ScreenOptions::Init( InputMode im, OptionRowData OptionRowData[], int iNumO m_framePage.AddChild( &m_textOptionLineTitles[i] ); - for( unsigned j=0; jGetPathTo("Fonts","option title") ); - CString sText = optline.szTitle; + CString sText = optline.name; title.SetText( sText ); title.SetXY( LABELS_X, fY ); @@ -192,12 +195,12 @@ void ScreenOptions::InitOptionsText() // init all text in this line and count the width of the line float fX = ITEMS_START_X; // indent 70 pixels - for( unsigned j=0; jGetPathTo("Fonts","option item") ); - option.SetText( optline.szOptionsText[j] ); + option.SetText( optline.choices[j] ); option.SetZoom( ITEMS_ZOOM ); option.EnableShadow( false ); @@ -243,7 +246,7 @@ void ScreenOptions::DimOption(int line, int option, bool dim) bool ScreenOptions::RowCompletelyDimmed(int line) const { - for(unsigned i = 0; i < m_OptionRowData[line].iNumOptions; ++i) + for(unsigned i = 0; i < m_OptionRow[line].choices.size(); ++i) if(!m_OptionDim[line][i]) return false; return true; } @@ -260,7 +263,7 @@ void ScreenOptions::PositionUnderlines() // If there's only one choice (ScreenOptionsMenu), don't show underlines. // It looks silly. - bool bOnlyOneChoice = m_OptionRowData[i].iNumOptions == 1; + bool bOnlyOneChoice = m_OptionRow[i].choices.size() == 1; underline.SetDiffuse( bOnlyOneChoice ? RageColor(1,1,1,0) : RageColor(1,1,1,1) ); int iWidth, iX, iY; @@ -298,9 +301,9 @@ void ScreenOptions::RefreshIcons() OptionIcon &icon = m_OptionIcons[p][i]; int iSelection = m_iSelectedOption[p][i]; - CString sSelection = m_OptionRowData[i].szOptionsText[iSelection]; + CString sSelection = m_OptionRow[i].choices[iSelection]; if( sSelection == "ON" ) - sSelection = m_OptionRowData[i].szTitle; + sSelection = m_OptionRow[i].name; icon.Load( (PlayerNumber)p, m_bUseIcons ? sSelection : "", false ); } } @@ -357,7 +360,7 @@ void ScreenOptions::UpdateEnabledDisabled() m_textOptionLineTitles[i].SetDiffuse( bThisRowIsSelected ? colorSelected : colorNotSelected ); - for( unsigned j=0; jGetMetric(m_sClassName,sLineName) ); + } else m_textExplanation.SetText( "" ); } @@ -484,7 +497,7 @@ void ScreenOptions::MenuLeft( PlayerNumber pn ) if( iCurRow == m_iNumOptionRows ) // EXIT is selected return; // don't allow a move - const int iNumOptions = m_OptionRowData[iCurRow].iNumOptions; + const int iNumOptions = m_OptionRow[iCurRow].choices.size(); if( iNumOptions == 1 ) continue; @@ -508,7 +521,7 @@ void ScreenOptions::MenuRight( PlayerNumber pn ) if( iCurRow == m_iNumOptionRows ) // EXIT is selected return; // don't allow a move - const int iNumOptions = m_OptionRowData[iCurRow].iNumOptions; + const int iNumOptions = m_OptionRow[iCurRow].choices.size(); if( iNumOptions == 1 ) continue; diff --git a/stepmania/src/ScreenOptions.h b/stepmania/src/ScreenOptions.h index f9621a9727..447b132181 100644 --- a/stepmania/src/ScreenOptions.h +++ b/stepmania/src/ScreenOptions.h @@ -26,13 +26,17 @@ const unsigned MAX_OPTION_LINES = 20; const unsigned MAX_OPTIONS_PER_LINE = 20; +struct OptionRow +{ + CString name; + vector choices; -// used to pass menu info into this class -struct OptionRowData { - char szTitle[40]; - unsigned iNumOptions; - char szOptionsText[MAX_OPTIONS_PER_LINE][80]; - char szExplanation[2048]; + OptionRow( CString n, CString c0="", CString c1="", CString c2="", CString c3="", CString c4="", CString c5="", CString c6="", CString c7="", CString c8="", CString c9="", CString c10="", CString c11="", CString c12="", CString c13="", CString c14="" ) + { + name = n; +#define PUSH( c ) if(c!="") choices.push_back(c); + PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14); + } }; enum InputMode @@ -46,7 +50,7 @@ class ScreenOptions : public Screen { public: ScreenOptions( CString sClassName, bool bEnableTimer ); - void Init( InputMode im, OptionRowData OptionRowData[], int iNumOptionLines, bool bUseIcons ); + void Init( InputMode im, OptionRow OptionRow[], int iNumOptionLines, bool bUseIcons, bool bLoadExplanations ); virtual ~ScreenOptions(); virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); @@ -79,10 +83,12 @@ protected: void MenuUp( PlayerNumber pn ); void MenuDown( PlayerNumber pn ); + CString m_sClassName; InputMode m_InputMode; bool m_bUseIcons; + bool m_bLoadExplanations; - OptionRowData* m_OptionRowData; + OptionRow* m_OptionRow; int m_iNumOptionRows; MenuElements m_Menu; diff --git a/stepmania/src/ScreenOptionsMenu.cpp b/stepmania/src/ScreenOptionsMenu.cpp index 0a8a87e553..8444160868 100644 --- a/stepmania/src/ScreenOptionsMenu.cpp +++ b/stepmania/src/ScreenOptionsMenu.cpp @@ -38,14 +38,14 @@ enum { NUM_OPTIONS_MENU_LINES }; -OptionRowData g_OptionsMenuLines[NUM_OPTIONS_MENU_LINES] = { - { "", 1, {"Appearance Options"} }, - { "", 1, {"Config Key/Joy Mappings"} }, - { "", 1, {"Input Options"} }, - { "", 1, {"Gameplay Options"} }, - { "", 1, {"Graphic Options"} }, - { "", 1, {"Machine Options"} }, - { "", 1, {"Sound Options"} }, +OptionRow g_OptionsMenuLines[NUM_OPTIONS_MENU_LINES] = { + OptionRow( "", "Appearance Options" ), + OptionRow( "", "Config Key/Joy Mappings" ), + OptionRow( "", "Input Options" ), + OptionRow( "", "Gameplay Options" ), + OptionRow( "", "Graphic Options" ), + OptionRow( "", "Machine Options" ), + OptionRow( "", "Sound Options" ), }; ScreenOptionsMenu::ScreenOptionsMenu() : @@ -53,20 +53,11 @@ ScreenOptionsMenu::ScreenOptionsMenu() : { LOG->Trace( "ScreenOptionsMenu::ScreenOptionsMenu()" ); - // fill g_InputOptionsLines with explanation text - for( int i=0; iGetMetric("ScreenOptionsMenu",sLineName) ); - } - Init( INPUTMODE_BOTH, g_OptionsMenuLines, NUM_OPTIONS_MENU_LINES, - false ); + false, true ); m_Menu.m_MenuTimer.Disable(); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenOptionsMenu music") ); diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index 6af0abeac8..70e2cf307e 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -34,17 +34,17 @@ enum { PO_DARK, NUM_PLAYER_OPTIONS_LINES }; -OptionRowData g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = { - { "Speed", 11, {"x0.25","x0.5","x0.75","x1","x1.5","x2","x3","x4","x5","x8", "x12"} }, - { "Acceler\n-ation",6, {"OFF","BOOST","LAND","WAVE","EXPAND","BOOMERANG"} }, - { "Effect", 7, {"OFF","DRUNK","DIZZY","SPACE","MINI","FLIP","TORNADO"} }, - { "Appear\n-ance", 5, {"VISIBLE","HIDDEN","SUDDEN","STEALTH","BLINK"} }, - { "Turn", 6, {"OFF","MIRROR","LEFT","RIGHT","SHUFFLE","SUPER SHUFFLE"} }, - { "Trans\n-form", 6, {"OFF","LITTLE","WIDE","BIG","QUICK","SKIPPY"} }, - { "Scroll", 2, {"STANDARD","REVERSE"} }, - { "Note\nSkin", 0, {""} }, - { "Holds", 2, {"OFF","ON"} }, - { "Dark", 2, {"OFF","ON"} }, +OptionRow g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = { + OptionRow( "Speed", "x0.25","x0.5","x0.75","x1","x1.5","x2","x3","x4","x5","x8", "x12" ), + OptionRow( "Acceler\n-ation", "OFF","BOOST","LAND","WAVE","EXPAND","BOOMERANG" ), + OptionRow( "Effect", "OFF","DRUNK","DIZZY","SPACE","MINI","FLIP","TORNADO" ), + OptionRow( "Appear\n-ance", "VISIBLE","HIDDEN","SUDDEN","STEALTH","BLINK" ), + OptionRow( "Turn", "OFF","MIRROR","LEFT","RIGHT","SHUFFLE","SUPER SHUFFLE" ), + OptionRow( "Trans\n-form", "OFF","LITTLE","WIDE","BIG","QUICK","SKIPPY" ), + OptionRow( "Scroll", "STANDARD","REVERSE" ), + OptionRow( "Note\nSkin", "" ), + OptionRow( "Holds", "OFF","ON" ), + OptionRow( "Dark", "OFF","ON" ), }; @@ -57,7 +57,7 @@ ScreenPlayerOptions::ScreenPlayerOptions() : INPUTMODE_PLAYERS, g_PlayerOptionsLines, NUM_PLAYER_OPTIONS_LINES, - true ); + true, false ); SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") ); @@ -81,12 +81,12 @@ void ScreenPlayerOptions::ImportOptions() CStringArray arraySkinNames; NOTESKIN->GetNoteSkinNames( arraySkinNames ); - m_OptionRowData[PO_NOTE_SKIN].iNumOptions = arraySkinNames.size(); + m_OptionRow[PO_NOTE_SKIN].choices.clear(); for( unsigned i=0; iGetCurNoteSkinName((PlayerNumber)p)) ) + if( 0==stricmp(m_OptionRow[PO_NOTE_SKIN].choices[j], NOTESKIN->GetCurNoteSkinName((PlayerNumber)p)) ) { m_iSelectedOption[p][PO_NOTE_SKIN] = j; break; @@ -172,7 +172,7 @@ void ScreenPlayerOptions::ExportOptions() int iSelectedSkin = m_iSelectedOption[p][PO_NOTE_SKIN]; - CString sNewSkin = m_OptionRowData[PO_NOTE_SKIN].szOptionsText[iSelectedSkin]; + CString sNewSkin = m_OptionRow[PO_NOTE_SKIN].choices[iSelectedSkin]; NOTESKIN->SwitchNoteSkin( (PlayerNumber)p, sNewSkin ); diff --git a/stepmania/src/ScreenSelectGame.cpp b/stepmania/src/ScreenSelectGame.cpp index 86a581a06f..55a6d37497 100644 --- a/stepmania/src/ScreenSelectGame.cpp +++ b/stepmania/src/ScreenSelectGame.cpp @@ -27,9 +27,9 @@ enum { }; -OptionRowData g_SelectGameLines[NUM_SELECT_GAME_LINES] = +OptionRow g_SelectGameLines[NUM_SELECT_GAME_LINES] = { - { "Game", 0, { "" } } + OptionRow( "Game" ), }; @@ -41,23 +41,14 @@ ScreenSelectGame::ScreenSelectGame() : /* populate g_SelectGameLines */ vector aGames; GAMEMAN->GetEnabledGames( aGames ); - unsigned i; - for( i=0; iGetGameDefForGame(game)->m_szName; - strcpy( g_SelectGameLines[0].szOptionsText[i], sGameName ); - } - g_SelectGameLines[0].iNumOptions = i; - - - // fill g_InputOptionsLines with explanation text - for( i=0; iGetMetric("ScreenSelectGame",sLineName) ); + sGameName.MakeUpper(); + m_OptionRow[SG_GAME].choices.push_back( sGameName ); } @@ -65,7 +56,7 @@ ScreenSelectGame::ScreenSelectGame() : INPUTMODE_BOTH, g_SelectGameLines, NUM_SELECT_GAME_LINES, - false ); + false, true ); m_Menu.m_MenuTimer.Disable(); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenSelectGame music") ); diff --git a/stepmania/src/ScreenSongOptions.cpp b/stepmania/src/ScreenSongOptions.cpp index ac3d86a6b6..95525a486f 100644 --- a/stepmania/src/ScreenSongOptions.cpp +++ b/stepmania/src/ScreenSongOptions.cpp @@ -31,14 +31,14 @@ enum { NUM_SONG_OPTIONS_LINES }; -OptionRowData g_SongOptionsLines[NUM_SONG_OPTIONS_LINES] = { - { "Life\nType", 2, {"BAR","BATTERY"} }, - { "Bar\nDrain", 3, {"NORMAL","NO RECOVER","SUDDEN DEATH"} }, - { "Bat\nLives", 10, {"1","2","3","4","5","6","7","8","9","10"} }, - { "Fail", 3, {"ARCADE","END OF SONG","OFF"} }, - { "Assist", 2, {"OFF","TICK"} }, - { "Rate", 9, {"x0.7","x0.8","x0.9","x1.0","x1.1","x1.2","x1.3","x1.4","x1.5"} }, - { "Auto\nAdjust", 2, {"OFF", "ON"} }, +OptionRow g_SongOptionsLines[NUM_SONG_OPTIONS_LINES] = { + OptionRow( "Life\nType", "BAR","BATTERY" ), + OptionRow( "Bar\nDrain", "NORMAL","NO RECOVER","SUDDEN DEATH" ), + OptionRow( "Bat\nLives", "1","2","3","4","5","6","7","8","9","10" ), + OptionRow( "Fail", "ARCADE","END OF SONG","OFF" ), + OptionRow( "Assist", "OFF","TICK" ), + OptionRow( "Rate", "x0.7","x0.8","x0.9","x1.0","x1.1","x1.2","x1.3","x1.4","x1.5" ), + OptionRow( "Auto\nAdjust", "OFF", "ON" ), }; @@ -50,7 +50,7 @@ ScreenSongOptions::ScreenSongOptions() : Init( INPUTMODE_BOTH, g_SongOptionsLines, NUM_SONG_OPTIONS_LINES, - false ); + false, false ); } void ScreenSongOptions::ImportOptions() diff --git a/stepmania/src/ScreenSoundOptions.cpp b/stepmania/src/ScreenSoundOptions.cpp index 44679bb596..5048b4d47b 100644 --- a/stepmania/src/ScreenSoundOptions.cpp +++ b/stepmania/src/ScreenSoundOptions.cpp @@ -28,8 +28,8 @@ enum { SO_MASTER_VOLUME, NUM_SOUND_OPTIONS_LINES }; -OptionRowData g_SoundOptionsLines[NUM_SOUND_OPTIONS_LINES] = { - { "Master\nVolume", 6, {"MUTE","20%","40%","60%","80%","100%"} }, +OptionRow g_SoundOptionsLines[NUM_SOUND_OPTIONS_LINES] = { + OptionRow( "Master\nVolume", "MUTE","20%","40%","60%","80%","100%" ), }; ScreenSoundOptions::ScreenSoundOptions() : @@ -37,16 +37,7 @@ ScreenSoundOptions::ScreenSoundOptions() : { LOG->Trace( "ScreenSoundOptions::ScreenSoundOptions()" ); - // fill g_InputOptionsLines with explanation text - for( int i=0; iGetMetric("ScreenSoundOptions",sLineName) ); - } - - Init( INPUTMODE_BOTH, g_SoundOptionsLines, NUM_SOUND_OPTIONS_LINES, false ); + Init( INPUTMODE_BOTH, g_SoundOptionsLines, NUM_SOUND_OPTIONS_LINES, false, true ); m_Menu.m_MenuTimer.Disable(); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenSoundOptions music") ); diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 31fe243a93..f26a2db717 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -60,7 +60,7 @@ IntDir=.\../Release6 TargetDir=\stepmania\stepmania TargetName=StepMania SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -95,7 +95,7 @@ IntDir=.\../Debug6 TargetDir=\stepmania\stepmania TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool diff --git a/stepmania/src/resource.h b/stepmania/src/resource.h index c9ac400e4b..72d22b8f0f 100644 --- a/stepmania/src/resource.h +++ b/stepmania/src/resource.h @@ -38,7 +38,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 124 +#define _APS_NEXT_RESOURCE_VALUE 126 #define _APS_NEXT_COMMAND_VALUE 40009 #define _APS_NEXT_CONTROL_VALUE 1015 #define _APS_NEXT_SYMED_VALUE 101