Files
itgmania212121/stepmania/src/ScreenSelectGame.cpp
T

115 lines
2.5 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
};
OptionRowData g_SelectGameLines[NUM_SELECT_GAME_LINES] =
2002-05-20 08:59:37 +00:00
{
2002-07-23 01:41:40 +00:00
"Game", 0, { "" }
2002-05-20 08:59:37 +00:00
};
ScreenSelectGame::ScreenSelectGame() :
ScreenOptions(
THEME->GetPathTo("BGAnimations","select game"),
THEME->GetPathTo("Graphics","select game page"),
THEME->GetPathTo("Graphics","select game top edge")
2002-05-20 08:59:37 +00:00
)
{
LOG->Trace( "ScreenSelectGame::ScreenSelectGame()" );
2002-05-20 08:59:37 +00:00
//
2002-05-20 08:59:37 +00:00
// populate g_SelectGameLines
//
// CStringArray arrayGameNames;
// GAMEMAN->GetGameNames( arrayGameNames );
CArray<Game,Game> aGames;
GAMEMAN->GetEnabledGames( aGames );
for( int i=0; i<aGames.GetSize(); i++ )
{
Game game = aGames[i];
CString sGameName = GAMEMAN->GetGameDefForGame(game)->m_szName;
strcpy( g_SelectGameLines[0].szOptionsText[i], sGameName );
}
g_SelectGameLines[0].iNumOptions = i;
2002-08-01 13:42:56 +00:00
2002-05-20 08:59:37 +00:00
Init(
INPUTMODE_BOTH,
2002-05-20 08:59:37 +00:00
g_SelectGameLines,
NUM_SELECT_GAME_LINES,
false );
m_Menu.SetTimer( 99 );
m_Menu.StopTimer();
2002-08-27 16:53:25 +00:00
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","select game music") );
2002-05-20 08:59:37 +00:00
}
void ScreenSelectGame::ImportOptions()
{
2002-07-27 19:29:51 +00:00
m_iSelectedOption[0][SG_GAME] = GAMESTATE->m_CurGame;
2002-05-20 08:59:37 +00:00
}
void ScreenSelectGame::ExportOptions()
{
LOG->Trace("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
int iSelection = m_iSelectedOption[0][SG_GAME];
CArray<Game,Game> aGames;
GAMEMAN->GetEnabledGames( aGames );
Game game = aGames[iSelection];
2002-07-27 19:29:51 +00:00
GAMESTATE->m_CurGame = game;
2002-07-23 01:41:40 +00:00
PREFSMAN->ReadGamePrefsFromDisk();
INPUTMAPPER->ReadMappingsFromDisk();
2002-05-20 08:59:37 +00:00
}
void ScreenSelectGame::GoToPrevState()
{
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
2002-05-20 08:59:37 +00:00
}
void ScreenSelectGame::GoToNextState()
{
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
2002-05-20 08:59:37 +00:00
}