derive ScreenSongOptions from ScreenOptionsMaster
This commit is contained in:
@@ -2598,6 +2598,20 @@ Game=Change the current game type with this option.
|
||||
TimerSeconds=30
|
||||
StyleIcon=0
|
||||
|
||||
PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster
|
||||
NextScreen=ScreenOptionsMenu@ScreenOptionsMaster
|
||||
|
||||
OptionMenuFlags=rows,8
|
||||
Line1=list,LifeType;title,Life::Type
|
||||
Line2=list,BarDrain;title,Bar::Drain
|
||||
Line3=list,BatLives;title,Bat::Lives
|
||||
Line4=list,Fail
|
||||
Line5=list,AssistTick;title,Assist::Tick
|
||||
Line6=list,Rate
|
||||
Line7=list,AutoAdjust;title,Auto::Adjust
|
||||
Line8=list,SaveScores;title,Save::Scores
|
||||
|
||||
|
||||
[ScreenCredits]
|
||||
BackgroundsBaseX=160
|
||||
BackgroundsBaseY=0
|
||||
@@ -2833,6 +2847,115 @@ PerspName,4=HALLWAY
|
||||
Persp,5=mod,distant
|
||||
PerspName,5=DISTANT
|
||||
|
||||
# Song options
|
||||
LifeType=2,together
|
||||
LifeTypeDefault=
|
||||
LifeType,1=mod,bar
|
||||
LifeTypeName,1=BAR
|
||||
LifeType,2=mod,battery
|
||||
LifeTypeName,2=BATTERY
|
||||
|
||||
BarDrain=3,together
|
||||
BarDrainDefault=
|
||||
BarDrain,1=mod,normal-drain
|
||||
BarDrainName,1=NORMAL
|
||||
BarDrain,2=mod,norecover
|
||||
BarDrainName,2=NO RECOVER
|
||||
BarDrain,3=mod,suddendeath
|
||||
BarDrainName,3=SUDDEN DEATH
|
||||
|
||||
BatLives=10,together
|
||||
BatLivesDefault=
|
||||
BatLives,1=mod,1 life
|
||||
BatLivesName,1=1
|
||||
BatLives,2=mod,2 lives
|
||||
BatLivesName,2=2
|
||||
BatLives,3=mod,3 lives
|
||||
BatLivesName,3=3
|
||||
BatLives,4=mod,4 lives
|
||||
BatLivesName,4=4
|
||||
BatLives,5=mod,5 lives
|
||||
BatLivesName,5=5
|
||||
BatLives,6=mod,6 lives
|
||||
BatLivesName,6=6
|
||||
BatLives,7=mod,7 lives
|
||||
BatLivesName,7=7
|
||||
BatLives,8=mod,8 lives
|
||||
BatLivesName,8=8
|
||||
BatLives,9=mod,9 lives
|
||||
BatLivesName,9=9
|
||||
BatLives,10=mod,10 lives
|
||||
BatLivesName,10=10
|
||||
|
||||
Fail=3,together
|
||||
FailDefault=
|
||||
Fail,1=mod,failarcade
|
||||
FailName,1=ARCADE
|
||||
Fail,2=mod,failendofsong
|
||||
FailName,2=END OF SONG
|
||||
Fail,3=mod,failoff
|
||||
FailName,3=OFF
|
||||
|
||||
AssistTick=2,together
|
||||
AssistTickDefault=
|
||||
AssistTick,1=mod,no assisttick
|
||||
AssistTickName,1=OFF
|
||||
AssistTick,2=mod,assisttick
|
||||
AssistTickName,2=ON
|
||||
|
||||
Rate=18,together
|
||||
RateDefault=
|
||||
Rate,1=mod,0.3xmusic
|
||||
RateName,1=0.3x
|
||||
Rate,2=mod,0.4xmusic
|
||||
RateName,2=0.4x
|
||||
Rate,3=mod,0.5xmusic
|
||||
RateName,3=0.5x
|
||||
Rate,4=mod,0.6xmusic
|
||||
RateName,4=0.6x
|
||||
Rate,5=mod,0.7xmusic
|
||||
RateName,5=0.7x
|
||||
Rate,6=mod,0.8xmusic
|
||||
RateName,6=0.8x
|
||||
Rate,7=mod,0.9xmusic
|
||||
RateName,7=0.9x
|
||||
Rate,8=mod,1.0xmusic
|
||||
RateName,8=1.0x
|
||||
Rate,9=mod,1.1xmusic
|
||||
RateName,9=1.1x
|
||||
Rate,10=mod,1.2xmusic
|
||||
RateName,10=1.2x
|
||||
Rate,11=mod,1.3xmusic
|
||||
RateName,11=1.3x
|
||||
Rate,12=mod,1.4xmusic
|
||||
RateName,12=1.4x
|
||||
Rate,13=mod,1.5xmusic
|
||||
RateName,13=1.5x
|
||||
Rate,14=mod,1.6xmusic
|
||||
RateName,14=1.6x
|
||||
Rate,15=mod,1.7xmusic
|
||||
RateName,15=1.7x
|
||||
Rate,16=mod,1.8xmusic
|
||||
RateName,16=1.8x
|
||||
Rate,17=mod,1.9xmusic
|
||||
RateName,17=1.9x
|
||||
Rate,18=mod,2.0xmusic
|
||||
RateName,18=2.0x
|
||||
|
||||
AutoAdjust=2,together
|
||||
AutoAdjustDefault=
|
||||
AutoAdjust,1=mod,no autosync
|
||||
AutoAdjustName,1=OFF
|
||||
AutoAdjust,2=mod,autosync
|
||||
AutoAdjustName,2=ON
|
||||
|
||||
SaveScores=2,together
|
||||
SaveScoresDefault=
|
||||
SaveScores,1=mod,no savescore
|
||||
SaveScoresName,1=OFF
|
||||
SaveScores,2=mod,savescore
|
||||
SaveScoresName,2=ON
|
||||
|
||||
Beginner=BEGINNER
|
||||
Easy=LIGHT
|
||||
Medium=STANDARD
|
||||
|
||||
@@ -3,17 +3,13 @@
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ScreenSongOptions
|
||||
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "ScreenSongOptions.h"
|
||||
#include "RageUtil.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "RageLog.h"
|
||||
#include "GameState.h"
|
||||
#include "ThemeManager.h"
|
||||
@@ -22,29 +18,6 @@
|
||||
#define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenSongOptions","PrevScreen"+Capitalize(PlayModeToString(play_mode)))
|
||||
#define NEXT_SCREEN( play_mode ) THEME->GetMetric ("ScreenSongOptions","NextScreen"+Capitalize(PlayModeToString(play_mode)))
|
||||
|
||||
enum {
|
||||
SO_LIFE = 0,
|
||||
SO_DRAIN,
|
||||
SO_BAT_LIVES,
|
||||
SO_FAIL,
|
||||
SO_ASSIST,
|
||||
SO_RATE,
|
||||
SO_AUTOSYNC,
|
||||
SO_SAVE,
|
||||
NUM_SONG_OPTIONS_LINES
|
||||
};
|
||||
|
||||
OptionRow g_SongOptionsLines[NUM_SONG_OPTIONS_LINES] = {
|
||||
OptionRow( "Life\nType", true, "BAR","BATTERY" ),
|
||||
OptionRow( "Bar\nDrain", true, "NORMAL","NO RECOVER","SUDDEN DEATH" ),
|
||||
OptionRow( "Bat\nLives", true, "1","2","3","4","5","6","7","8","9","10" ),
|
||||
OptionRow( "Fail", true, "ARCADE","END OF SONG","OFF" ),
|
||||
OptionRow( "Assist\nTick", true, "OFF", "ON" ),
|
||||
OptionRow( "Rate", true, "0.3x","0.4x","0.5x","0.6x","0.7x","0.8x","0.9x","1.0x","1.1x","1.2x","1.3x","1.4x","1.5x","1.6x","1.7x","1.8x","1.9x","2.0x" ),
|
||||
OptionRow( "Auto\nAdjust", true, "OFF", "ON" ),
|
||||
OptionRow( "Save\nScores", true, "OFF", "ON" ),
|
||||
};
|
||||
|
||||
/* Get the next screen we'll go to when finished. */
|
||||
CString ScreenSongOptions::GetNextScreen()
|
||||
{
|
||||
@@ -53,17 +26,10 @@ CString ScreenSongOptions::GetNextScreen()
|
||||
|
||||
|
||||
ScreenSongOptions::ScreenSongOptions( CString sClassName ) :
|
||||
ScreenOptions( sClassName )
|
||||
ScreenOptionsMaster( sClassName )
|
||||
{
|
||||
LOG->Trace( "ScreenSongOptions::ScreenSongOptions()" );
|
||||
|
||||
Init( INPUTMODE_TOGETHER,
|
||||
g_SongOptionsLines,
|
||||
NUM_SONG_OPTIONS_LINES,
|
||||
false );
|
||||
|
||||
/* If we're coming in from "press start for more options", we need a different
|
||||
* fade in. XXX: this is a hack */
|
||||
/* Hack: If we're coming in from "press start for more options", we need a different
|
||||
* fade in. */
|
||||
if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK)
|
||||
{
|
||||
m_Menu.m_In.Load( THEME->GetPathToB("ScreenSongOptions option in") );
|
||||
@@ -71,51 +37,6 @@ ScreenSongOptions::ScreenSongOptions( CString sClassName ) :
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenSongOptions::ImportOptions()
|
||||
{
|
||||
SongOptions &so = GAMESTATE->m_SongOptions;
|
||||
|
||||
m_iSelectedOption[0][SO_LIFE] = so.m_LifeType;
|
||||
m_iSelectedOption[0][SO_BAT_LIVES] = so.m_iBatteryLives-1;
|
||||
|
||||
if ( m_iSelectedOption[0][SO_BAT_LIVES] < 0 )
|
||||
m_iSelectedOption[0][SO_BAT_LIVES] = 3; // default in case value is invalid
|
||||
|
||||
m_iSelectedOption[0][SO_FAIL] = so.m_FailType;
|
||||
m_iSelectedOption[0][SO_ASSIST] = so.m_bAssistTick;
|
||||
m_iSelectedOption[0][SO_AUTOSYNC] = so.m_bAutoSync;
|
||||
m_iSelectedOption[0][SO_SAVE] = so.m_bSaveScore;
|
||||
|
||||
m_iSelectedOption[0][SO_RATE] = 7; // in case we don't match below
|
||||
for( unsigned i=0; i<g_SongOptionsLines[SO_RATE].choices.size(); i++ )
|
||||
{
|
||||
float fThisRate = (float) atof(g_SongOptionsLines[SO_RATE].choices[i]);
|
||||
if( fabsf(fThisRate - so.m_fMusicRate) < 0.001 )
|
||||
m_iSelectedOption[0][SO_RATE] = i;
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenSongOptions::ExportOptions()
|
||||
{
|
||||
SongOptions &so = GAMESTATE->m_SongOptions;
|
||||
|
||||
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;
|
||||
if( so.m_FailType != (SongOptions::FailType)m_iSelectedOption[0][SO_FAIL] )
|
||||
{
|
||||
/* The user is changing the fail mode explicitly; stop messing with it. */
|
||||
GAMESTATE->m_bChangedFailType = true;
|
||||
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];
|
||||
so.m_bSaveScore = !!m_iSelectedOption[0][SO_SAVE];
|
||||
|
||||
int iSel = m_iSelectedOption[0][SO_RATE];
|
||||
so.m_fMusicRate = (float) atof( g_SongOptionsLines[SO_RATE].choices[iSel] );
|
||||
}
|
||||
|
||||
void ScreenSongOptions::GoToPrevState()
|
||||
{
|
||||
if( GAMESTATE->m_bEditing )
|
||||
|
||||
@@ -2,26 +2,21 @@
|
||||
-----------------------------------------------------------------------------
|
||||
File: ScreenSongOptions.h
|
||||
|
||||
Desc: Select a song.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef SCREEN_SONG_OPTIONS_H
|
||||
#define SCREEN_SONG_OPTIONS_H
|
||||
|
||||
#include "ScreenOptions.h"
|
||||
#include "ScreenOptionsMaster.h"
|
||||
|
||||
class ScreenSongOptions : public ScreenOptions
|
||||
class ScreenSongOptions : public ScreenOptionsMaster
|
||||
{
|
||||
public:
|
||||
ScreenSongOptions( CString sName );
|
||||
static CString GetNextScreen();
|
||||
|
||||
private:
|
||||
void ImportOptions();
|
||||
void ExportOptions();
|
||||
|
||||
void GoToNextState();
|
||||
void GoToPrevState();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user