Files
itgmania212121/stepmania/src/ScreenSelectGame.cpp
T

98 lines
2.2 KiB
C++
Raw Normal View History

2002-05-20 08:59:37 +00:00
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
File: ScreenSelectGame.cpp
Desc: Select a song.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
-----------------------------------------------------------------------------
*/
#include "ScreenSelectGame.h"
#include <assert.h>
#include "RageTextureManager.h"
#include "RageUtil.h"
#include "RageMusic.h"
#include "ScreenManager.h"
#include "PrefsManager.h"
#include "ScreenOptions.h"
#include "ScreenTitleMenu.h"
#include "GameConstantsAndTypes.h"
#include "StepMania.h"
2002-07-23 01:41:40 +00:00
#include "PrefsManager.h"
2002-05-20 08:59:37 +00:00
#include "RageLog.h"
#include "GameManager.h"
2002-07-23 01:41:40 +00:00
#include <string.h>
#include "GameState.h"
#include "InputMapper.h"
2002-05-20 08:59:37 +00:00
enum {
SG_GAME = 0,
NUM_SELECT_GAME_LINES
};
OptionLineData g_SelectGameLines[NUM_SELECT_GAME_LINES] =
{
2002-07-23 01:41:40 +00:00
"Game", 0, { "" }
2002-05-20 08:59:37 +00:00
};
ScreenSelectGame::ScreenSelectGame() :
ScreenOptions(
THEME->GetPathTo(GRAPHIC_PLAYER_OPTIONS_BACKGROUND),
THEME->GetPathTo(GRAPHIC_PLAYER_OPTIONS_TOP_EDGE)
)
{
LOG->WriteLine( "ScreenSelectGame::ScreenSelectGame()" );
// populate g_SelectGameLines
CStringArray arrayGameNames;
2002-05-27 08:23:27 +00:00
GAMEMAN->GetGameNames( arrayGameNames );
2002-05-20 08:59:37 +00:00
for( int i=0; i<arrayGameNames.GetSize(); i++ )
strcpy( g_SelectGameLines[0].szOptionsText[i], arrayGameNames[i] );
g_SelectGameLines[0].iNumOptions = arrayGameNames.GetSize();
Init(
INPUTMODE_P1_ONLY,
g_SelectGameLines,
NUM_SELECT_GAME_LINES
);
}
void ScreenSelectGame::ImportOptions()
{
2002-07-23 01:41:40 +00:00
m_iSelectedOption[0][SG_GAME] = GAMESTATE->GetCurGame();
2002-05-20 08:59:37 +00:00
}
void ScreenSelectGame::ExportOptions()
{
LOG->WriteLine("ScreenSelectGame::ExportOptions()");
2002-07-23 01:41:40 +00:00
INPUTMAPPER->SaveMappingsToDisk(); // save mappings before switching the game
PREFSMAN->SaveGamePrefsToDisk();
2002-05-27 08:23:27 +00:00
// Switch the current style to the frist style of the selected game
Game game = (Game)m_iSelectedOption[0][SG_GAME];
2002-07-23 01:41:40 +00:00
GAMESTATE->SwitchGame( game );
PREFSMAN->ReadGamePrefsFromDisk();
INPUTMAPPER->ReadMappingsFromDisk();
2002-05-20 08:59:37 +00:00
}
void ScreenSelectGame::GoToPrevState()
{
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
}
void ScreenSelectGame::GoToNextState()
{
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
}