Files
itgmania212121/stepmania/src/ScreenSongOptions.cpp
T

123 lines
3.6 KiB
C++
Raw Normal View History

2003-02-16 04:01:45 +00:00
#include "global.h"
2002-05-20 08:59:37 +00:00
/*
-----------------------------------------------------------------------------
Class: ScreenSongOptions
2002-05-20 08:59:37 +00:00
Desc: See header.
2002-05-20 08:59:37 +00:00
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
2002-05-20 08:59:37 +00:00
-----------------------------------------------------------------------------
*/
#include "ScreenSongOptions.h"
#include "RageUtil.h"
2003-01-02 07:54:28 +00:00
#include "RageSoundManager.h"
2002-05-20 08:59:37 +00:00
#include "ScreenManager.h"
#include "GameConstantsAndTypes.h"
#include "RageLog.h"
2002-07-23 01:41:40 +00:00
#include "GameState.h"
#include "ThemeManager.h"
2002-05-20 08:59:37 +00:00
enum {
2002-07-27 19:29:51 +00:00
SO_LIFE = 0,
SO_DRAIN,
SO_BAT_LIVES,
SO_FAIL,
2002-05-20 08:59:37 +00:00
SO_ASSIST,
SO_RATE,
SO_AUTOSYNC,
2002-08-01 05:11:11 +00:00
NUM_SONG_OPTIONS_LINES
2002-05-20 08:59:37 +00:00
};
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\nTick", "OFF", "ON" ),
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" ),
2002-08-01 05:11:11 +00:00
};
2002-05-20 08:59:37 +00:00
ScreenSongOptions::ScreenSongOptions() :
2003-03-09 00:55:49 +00:00
ScreenOptions("ScreenSongOptions",true)
2002-05-20 08:59:37 +00:00
{
LOG->Trace( "ScreenSongOptions::ScreenSongOptions()" );
2002-05-20 08:59:37 +00:00
Init( INPUTMODE_BOTH,
g_SongOptionsLines,
NUM_SONG_OPTIONS_LINES,
false, false );
2002-05-20 08:59:37 +00:00
}
void ScreenSongOptions::ImportOptions()
{
2002-07-23 01:41:40 +00:00
SongOptions &so = GAMESTATE->m_SongOptions;
2002-05-20 08:59:37 +00:00
2002-07-27 19:29:51 +00:00
m_iSelectedOption[0][SO_LIFE] = so.m_LifeType;
m_iSelectedOption[0][SO_BAT_LIVES] = so.m_iBatteryLives-1;
m_iSelectedOption[0][SO_FAIL] = so.m_FailType;
m_iSelectedOption[0][SO_ASSIST] = so.m_bAssistTick;
m_iSelectedOption[0][SO_AUTOSYNC] = so.m_bAutoSync;
2002-05-20 08:59:37 +00:00
2003-01-02 06:52:39 +00:00
if( so.m_fMusicRate == 0.7f ) m_iSelectedOption[0][SO_RATE] = 0;
else if( so.m_fMusicRate == 0.8f ) m_iSelectedOption[0][SO_RATE] = 1;
else if( so.m_fMusicRate == 0.9f ) m_iSelectedOption[0][SO_RATE] = 2;
else if( so.m_fMusicRate == 1.0f ) m_iSelectedOption[0][SO_RATE] = 3;
else if( so.m_fMusicRate == 1.1f ) m_iSelectedOption[0][SO_RATE] = 4;
else if( so.m_fMusicRate == 1.2f ) m_iSelectedOption[0][SO_RATE] = 5;
else if( so.m_fMusicRate == 1.3f ) m_iSelectedOption[0][SO_RATE] = 6;
else if( so.m_fMusicRate == 1.4f ) m_iSelectedOption[0][SO_RATE] = 7;
else if( so.m_fMusicRate == 1.5f ) m_iSelectedOption[0][SO_RATE] = 8;
else m_iSelectedOption[0][SO_RATE] = 3;
2002-05-20 08:59:37 +00:00
}
void ScreenSongOptions::ExportOptions()
{
2002-07-23 01:41:40 +00:00
SongOptions &so = GAMESTATE->m_SongOptions;
2002-05-20 08:59:37 +00:00
2002-07-27 19:29:51 +00:00
so.m_LifeType = (SongOptions::LifeType)m_iSelectedOption[0][SO_LIFE];
so.m_DrainType = (SongOptions::DrainType)m_iSelectedOption[0][SO_DRAIN];
so.m_iBatteryLives = m_iSelectedOption[0][SO_BAT_LIVES]+1;
so.m_FailType = (SongOptions::FailType)m_iSelectedOption[0][SO_FAIL];
so.m_bAssistTick = !!m_iSelectedOption[0][SO_ASSIST];
so.m_bAutoSync = !!m_iSelectedOption[0][SO_AUTOSYNC];
2002-05-20 08:59:37 +00:00
switch( m_iSelectedOption[0][SO_RATE] )
{
2003-01-02 06:52:39 +00:00
case 0: so.m_fMusicRate = 0.7f; break;
case 1: so.m_fMusicRate = 0.8f; break;
case 2: so.m_fMusicRate = 0.9f; break;
case 3: so.m_fMusicRate = 1.0f; break;
case 4: so.m_fMusicRate = 1.1f; break;
case 5: so.m_fMusicRate = 1.2f; break;
case 6: so.m_fMusicRate = 1.3f; break;
case 7: so.m_fMusicRate = 1.4f; break;
case 8: so.m_fMusicRate = 1.5f; break;
2002-05-20 08:59:37 +00:00
default: ASSERT( false );
}
}
void ScreenSongOptions::GoToPrevState()
{
2003-02-19 05:46:09 +00:00
if( GAMESTATE->m_bEditing )
SCREENMAN->PopTopScreen( SM_None );
else
SCREENMAN->SetNewScreen( "ScreenPlayerOptions" );
2002-05-20 08:59:37 +00:00
}
void ScreenSongOptions::GoToNextState()
{
2003-02-19 05:46:09 +00:00
if( GAMESTATE->m_bEditing )
SCREENMAN->PopTopScreen();
else
SCREENMAN->SetNewScreen( "ScreenStage" );
2002-05-20 08:59:37 +00:00
}