2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-07-11 19:02:26 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenAppearanceOptions
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenAppearanceOptions.h"
|
|
|
|
|
#include "RageTextureManager.h"
|
|
|
|
|
#include "RageUtil.h"
|
2003-01-02 07:54:28 +00:00
|
|
|
#include "RageSoundManager.h"
|
2002-07-11 19:02:26 +00:00
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "StepMania.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "PrefsManager.h"
|
2002-07-11 19:02:26 +00:00
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
2003-02-06 07:32:57 +00:00
|
|
|
#include "NoteSkinManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "GameState.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
2002-07-11 19:02:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
AO_ANNOUNCER = 0,
|
2002-07-23 01:41:40 +00:00
|
|
|
AO_THEME,
|
2003-02-22 00:12:45 +00:00
|
|
|
AO_SKIN,
|
2003-01-11 08:55:21 +00:00
|
|
|
AO_INSTRUCTIONS,
|
2002-12-15 10:07:27 +00:00
|
|
|
AO_CAUTION,
|
2003-02-25 11:20:45 +00:00
|
|
|
AO_DANCE_POINTS_FOR_ONI,
|
2002-12-15 10:25:20 +00:00
|
|
|
AO_SELECT_GROUP,
|
2002-12-30 21:42:14 +00:00
|
|
|
AO_WHEEL_SECTIONS,
|
2003-02-12 00:14:53 +00:00
|
|
|
AO_SHOW_TRANSLATIONS,
|
2003-03-20 10:59:09 +00:00
|
|
|
AO_SHOW_LYRICS,
|
2002-07-11 19:02:26 +00:00
|
|
|
NUM_APPEARANCE_OPTIONS_LINES
|
|
|
|
|
};
|
|
|
|
|
|
2003-03-15 19:25:37 +00:00
|
|
|
|
|
|
|
|
OptionRow g_AppearanceOptionsLines[NUM_APPEARANCE_OPTIONS_LINES] = {
|
|
|
|
|
OptionRow( "Announcer" ),
|
|
|
|
|
OptionRow( "Theme" ),
|
|
|
|
|
OptionRow( "Default\nNoteSkin" ),
|
2003-04-05 03:49:03 +00:00
|
|
|
OptionRow( "Instructions", "SKIP","SHOW"),
|
2003-03-15 19:25:37 +00:00
|
|
|
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"),
|
2003-03-20 10:59:09 +00:00
|
|
|
OptionRow( "Lyrics", "HIDE","SHOW"),
|
2002-07-11 19:02:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ScreenAppearanceOptions::ScreenAppearanceOptions() :
|
2003-03-09 00:55:49 +00:00
|
|
|
ScreenOptions("ScreenAppearanceOptions",false)
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
2002-07-31 19:40:40 +00:00
|
|
|
LOG->Trace( "ScreenAppearanceOptions::ScreenAppearanceOptions()" );
|
2002-07-11 19:02:26 +00:00
|
|
|
|
|
|
|
|
Init(
|
|
|
|
|
INPUTMODE_BOTH,
|
|
|
|
|
g_AppearanceOptionsLines,
|
2002-09-03 22:31:06 +00:00
|
|
|
NUM_APPEARANCE_OPTIONS_LINES,
|
2003-03-15 19:25:37 +00:00
|
|
|
false, true );
|
2003-03-11 21:33:11 +00:00
|
|
|
m_Menu.m_MenuTimer.Disable();
|
2002-08-27 16:53:25 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
SOUNDMAN->PlayMusic( THEME->GetPathToS("ScreenAppearanceOptions music") );
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenAppearanceOptions::ImportOptions()
|
|
|
|
|
{
|
2003-03-15 19:25:37 +00:00
|
|
|
unsigned i;
|
|
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
//
|
2002-07-11 19:02:26 +00:00
|
|
|
// fill in announcer names
|
2002-07-23 01:41:40 +00:00
|
|
|
//
|
2002-07-11 19:02:26 +00:00
|
|
|
CStringArray arrayAnnouncerNames;
|
|
|
|
|
ANNOUNCER->GetAnnouncerNames( arrayAnnouncerNames );
|
|
|
|
|
|
2003-03-15 19:25:37 +00:00
|
|
|
m_OptionRow[AO_ANNOUNCER].choices.clear();
|
|
|
|
|
m_OptionRow[AO_ANNOUNCER].choices.push_back( "OFF" );
|
|
|
|
|
for( i=0; i<arrayAnnouncerNames.size() && i<MAX_OPTIONS_PER_LINE; i++ )
|
|
|
|
|
{
|
|
|
|
|
m_OptionRow[AO_ANNOUNCER].choices.push_back( arrayAnnouncerNames[i] );
|
|
|
|
|
}
|
2002-07-11 19:02:26 +00:00
|
|
|
|
|
|
|
|
// highlight currently selected announcer
|
2003-03-15 19:25:37 +00:00
|
|
|
m_iSelectedOption[0][AO_ANNOUNCER] = 0;
|
|
|
|
|
for( i=1; i<m_OptionRow[AO_ANNOUNCER].choices.size(); i++ )
|
|
|
|
|
if( 0==stricmp(m_OptionRow[AO_ANNOUNCER].choices[i], ANNOUNCER->GetCurAnnouncerName()) )
|
2002-07-11 19:02:26 +00:00
|
|
|
m_iSelectedOption[0][AO_ANNOUNCER] = i;
|
|
|
|
|
|
|
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
//
|
|
|
|
|
// fill in theme names
|
|
|
|
|
//
|
|
|
|
|
CStringArray arrayThemeNames;
|
2003-04-13 04:50:08 +00:00
|
|
|
THEME->GetThemeNames( arrayThemeNames );
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-03-15 19:25:37 +00:00
|
|
|
m_OptionRow[AO_THEME].choices.clear();
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-03-15 19:25:37 +00:00
|
|
|
for( i=0; i<arrayThemeNames.size() && i<MAX_OPTIONS_PER_LINE; i++ )
|
|
|
|
|
{
|
|
|
|
|
m_OptionRow[AO_THEME].choices.push_back( arrayThemeNames[i] );
|
|
|
|
|
}
|
2002-07-23 01:41:40 +00:00
|
|
|
|
|
|
|
|
// highlight currently selected theme
|
2003-03-15 19:25:37 +00:00
|
|
|
m_iSelectedOption[0][AO_THEME] = 0;
|
|
|
|
|
for( i=0; i<m_OptionRow[AO_THEME].choices.size(); i++ )
|
|
|
|
|
if( 0==stricmp(m_OptionRow[AO_THEME].choices[i], THEME->GetCurThemeName()) )
|
2002-07-23 01:41:40 +00:00
|
|
|
m_iSelectedOption[0][AO_THEME] = i;
|
2003-03-15 19:25:37 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-02-22 00:12:45 +00:00
|
|
|
//
|
|
|
|
|
// fill in skin names
|
|
|
|
|
//
|
|
|
|
|
CStringArray arraySkinNames;
|
|
|
|
|
NOTESKIN->GetNoteSkinNames( arraySkinNames );
|
|
|
|
|
|
2003-03-15 19:25:37 +00:00
|
|
|
m_OptionRow[AO_SKIN].choices.clear();
|
2003-02-22 00:12:45 +00:00
|
|
|
|
2003-03-15 19:25:37 +00:00
|
|
|
for( i=0; i<arraySkinNames.size() && i<MAX_OPTIONS_PER_LINE; i++ )
|
|
|
|
|
{
|
|
|
|
|
arraySkinNames[i].MakeUpper();
|
|
|
|
|
m_OptionRow[AO_SKIN].choices.push_back( arraySkinNames[i] );
|
|
|
|
|
}
|
2003-02-22 00:12:45 +00:00
|
|
|
|
|
|
|
|
// highlight currently selected skin
|
2003-03-15 19:25:37 +00:00
|
|
|
m_iSelectedOption[0][AO_SKIN] = 0;
|
|
|
|
|
for( i=0; i<m_OptionRow[AO_SKIN].choices.size(); i++ )
|
|
|
|
|
if( 0==stricmp(m_OptionRow[AO_SKIN].choices[i], PREFSMAN->m_sDefaultNoteSkin) )
|
2003-02-22 00:12:45 +00:00
|
|
|
m_iSelectedOption[0][AO_SKIN] = i;
|
2003-03-15 19:25:37 +00:00
|
|
|
|
2003-02-22 00:12:45 +00:00
|
|
|
|
2003-02-12 00:14:53 +00:00
|
|
|
m_iSelectedOption[0][AO_INSTRUCTIONS] = PREFSMAN->m_bInstructions? 1:0;
|
2002-12-15 10:07:27 +00:00
|
|
|
m_iSelectedOption[0][AO_CAUTION] = PREFSMAN->m_bShowDontDie? 1:0;
|
2003-02-25 11:20:45 +00:00
|
|
|
m_iSelectedOption[0][AO_DANCE_POINTS_FOR_ONI] = PREFSMAN->m_bDancePointsForOni? 1:0;
|
2002-12-15 10:25:20 +00:00
|
|
|
m_iSelectedOption[0][AO_SELECT_GROUP] = PREFSMAN->m_bShowSelectGroup? 1:0;
|
2003-02-04 03:03:43 +00:00
|
|
|
m_iSelectedOption[0][AO_WHEEL_SECTIONS] = (int)PREFSMAN->m_MusicWheelUsesSections;
|
2003-05-20 04:44:41 +00:00
|
|
|
m_iSelectedOption[0][AO_SHOW_TRANSLATIONS] = PREFSMAN->m_bShowNative? 0:1;
|
2003-03-20 10:59:09 +00:00
|
|
|
m_iSelectedOption[0][AO_SHOW_LYRICS] = PREFSMAN->m_bShowLyrics;
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenAppearanceOptions::ExportOptions()
|
|
|
|
|
{
|
2002-09-29 17:38:07 +00:00
|
|
|
PREFSMAN->SaveGamePrefsToDisk();
|
|
|
|
|
PREFSMAN->SaveGlobalPrefsToDisk();
|
|
|
|
|
|
2002-07-11 19:02:26 +00:00
|
|
|
int iSelectedAnnouncer = m_iSelectedOption[0][AO_ANNOUNCER];
|
2003-03-15 19:25:37 +00:00
|
|
|
CString sNewAnnouncer = m_OptionRow[AO_ANNOUNCER].choices[iSelectedAnnouncer];
|
2002-07-11 19:02:26 +00:00
|
|
|
if( iSelectedAnnouncer == 0 )
|
|
|
|
|
sNewAnnouncer = "";
|
|
|
|
|
ANNOUNCER->SwitchAnnouncer( sNewAnnouncer );
|
|
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
int iSelectedTheme = m_iSelectedOption[0][AO_THEME];
|
2003-03-15 19:25:37 +00:00
|
|
|
CString sNewTheme = m_OptionRow[AO_THEME].choices[iSelectedTheme];
|
2003-05-25 22:39:23 +00:00
|
|
|
if( THEME->GetCurThemeName() != sNewTheme )
|
|
|
|
|
{
|
|
|
|
|
THEME->SwitchTheme( sNewTheme );
|
|
|
|
|
ApplyGraphicOptions(); // reset graphics to apply new window title and icon
|
|
|
|
|
}
|
2003-04-18 23:55:20 +00:00
|
|
|
TEXTUREMAN->DoDelayedDelete(); // delete all textures that don't have references
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-02-22 00:12:45 +00:00
|
|
|
int iSelectedSkin = m_iSelectedOption[0][AO_SKIN];
|
2003-03-15 19:25:37 +00:00
|
|
|
CString sNewSkin = m_OptionRow[AO_SKIN].choices[iSelectedSkin];
|
2003-02-22 00:12:45 +00:00
|
|
|
|
|
|
|
|
PREFSMAN->m_sDefaultNoteSkin = sNewSkin;
|
2003-02-21 10:05:13 +00:00
|
|
|
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];
|
2003-05-20 05:29:57 +00:00
|
|
|
(int&)PREFSMAN->m_MusicWheelUsesSections = m_iSelectedOption[0][AO_WHEEL_SECTIONS];
|
2003-05-20 04:44:41 +00:00
|
|
|
PREFSMAN->m_bShowNative = !m_iSelectedOption[0][AO_SHOW_TRANSLATIONS];
|
2003-03-20 10:59:09 +00:00
|
|
|
PREFSMAN->m_bShowLyrics = !!m_iSelectedOption[0][AO_SHOW_LYRICS];
|
2003-02-25 11:20:45 +00:00
|
|
|
PREFSMAN->m_bDancePointsForOni = !!m_iSelectedOption[0][AO_DANCE_POINTS_FOR_ONI];
|
2002-09-04 22:58:14 +00:00
|
|
|
|
2002-08-13 23:26:46 +00:00
|
|
|
PREFSMAN->SaveGamePrefsToDisk();
|
|
|
|
|
PREFSMAN->SaveGlobalPrefsToDisk();
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenAppearanceOptions::GoToPrevState()
|
|
|
|
|
{
|
2003-01-31 23:31:35 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenOptionsMenu" );
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenAppearanceOptions::GoToNextState()
|
|
|
|
|
{
|
2002-07-27 19:29:51 +00:00
|
|
|
PREFSMAN->SaveGamePrefsToDisk();
|
2003-01-31 23:31:35 +00:00
|
|
|
GoToPrevState();
|
2002-07-11 19:02:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|