rework ScreenOptionMaster metric names to not depend on language specific row title
create Mines row in ScreenPlayerOptions and move other options around
This commit is contained in:
@@ -1888,6 +1888,7 @@ NextAppearance=Left,Up,Right
|
||||
NextTurn=
|
||||
Reverse=Down,Left,Right,Left,Right
|
||||
HoldNotes=Right,Left,Down,Up
|
||||
Mines=
|
||||
Dark=
|
||||
CancelAll=Left,Right,Left,Right,Left,Right,Left,Right
|
||||
NextTheme=Left,Left,Left,Right,Right,Right,Left,Right
|
||||
@@ -2710,21 +2711,22 @@ StyleIcon=0
|
||||
PrevScreen=
|
||||
NextScreen=
|
||||
|
||||
OptionMenuFlags=rows,13
|
||||
OptionMenuFlags=rows,14
|
||||
|
||||
Line1=list,Speed
|
||||
Line2=list,Accel;title,Acceler::-ation
|
||||
Line3=list,Effect
|
||||
Line4=list,Appearance;title,Appear::-ance
|
||||
Line5=list,Turn
|
||||
Line6=list,Transform;title,Trans::-form
|
||||
Line6=list,Transform;title,Insert
|
||||
Line7=list,Scroll
|
||||
Line8=list,NoteSkins
|
||||
Line9=list,Holds
|
||||
Line10=list,Hide
|
||||
Line11=list,Persp
|
||||
Line12=Steps
|
||||
Line13=Characters
|
||||
Line10=list,Mines
|
||||
Line11=list,Hide
|
||||
Line12=list,Persp
|
||||
Line13=Steps
|
||||
Line14=Characters
|
||||
|
||||
[ScreenRaveOptions]
|
||||
PrevScreen=ScreenSelectMusic
|
||||
@@ -2940,7 +2942,7 @@ TurnName,5=SHUFFLE
|
||||
Turn,6=mod,supershuffle
|
||||
TurnName,6=S.SHUFFLE
|
||||
|
||||
Transform=9
|
||||
Transform=8
|
||||
TransformDefault=mod,no transform
|
||||
Transform,1=
|
||||
TransformName,1=OFF
|
||||
@@ -2954,12 +2956,10 @@ Transform,5=mod,quick
|
||||
TransformName,5=QUICK
|
||||
Transform,6=mod,skippy
|
||||
TransformName,6=SKIPPY
|
||||
Transform,7=mod,mines
|
||||
TransformName,7=MINES
|
||||
Transform,8=mod,echo
|
||||
TransformName,8=ECHO
|
||||
Transform,9=mod,stomp
|
||||
TransformName,9=STOMP
|
||||
Transform,7=mod,echo
|
||||
TransformName,7=ECHO
|
||||
Transform,8=mod,stomp
|
||||
TransformName,8=STOMP
|
||||
|
||||
Scroll=4
|
||||
ScrollDefault=mod,no reverse,no split,no alternate
|
||||
@@ -2973,7 +2973,7 @@ Scroll,4=mod,alternate
|
||||
ScrollName,4=ALTERNATE
|
||||
|
||||
Holds=3
|
||||
HoldsDefault=mod,no noholds
|
||||
HoldsDefault=mod,no noholds,no planted
|
||||
Holds,1=mod,noholds
|
||||
HoldsName,1=OFF
|
||||
Holds,2=
|
||||
@@ -2981,6 +2981,15 @@ HoldsName,2=ON
|
||||
Holds,3=mod,planted
|
||||
HoldsName,3=PLANTED
|
||||
|
||||
Mines=3
|
||||
MinesDefault=mod,no nomines,no mines
|
||||
Mines,1=mod,nomines
|
||||
MinesName,1=OFF
|
||||
Mines,2=
|
||||
MinesName,2=ON
|
||||
Mines,3=mod,mines
|
||||
MinesName,3=ADD
|
||||
|
||||
Hide=3
|
||||
HideDefault=mod,no dark,no blind
|
||||
Hide,1=
|
||||
|
||||
@@ -42,6 +42,7 @@ const CString g_sCodeNames[CodeDetector::NUM_CODES] = {
|
||||
"NextTurn",
|
||||
"Reverse",
|
||||
"HoldNotes",
|
||||
"Mines",
|
||||
"Dark",
|
||||
"Hidden",
|
||||
"RandomVanish",
|
||||
@@ -183,6 +184,7 @@ bool CodeDetector::DetectAndAdjustMusicOptions( GameController controller )
|
||||
case CODE_NEXT_TURN: GAMESTATE->m_PlayerOptions[pn].NextTurn(); break;
|
||||
case CODE_REVERSE: GAMESTATE->m_PlayerOptions[pn].NextScroll(); break;
|
||||
case CODE_HOLDS: TOGGLE( GAMESTATE->m_PlayerOptions[pn].m_bHoldNotes, true, false ); break;
|
||||
case CODE_MINES: TOGGLE( GAMESTATE->m_PlayerOptions[pn].m_bMines, true, false ); break;
|
||||
case CODE_DARK: FLOAT_TOGGLE( GAMESTATE->m_PlayerOptions[pn].m_fDark ); break;
|
||||
case CODE_CANCEL_ALL: GAMESTATE->m_PlayerOptions[pn].Init();
|
||||
GAMESTATE->m_PlayerOptions[pn].FromString( PREFSMAN->m_sDefaultModifiers ); break;
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
CODE_NEXT_TURN,
|
||||
CODE_REVERSE,
|
||||
CODE_HOLDS,
|
||||
CODE_MINES,
|
||||
CODE_DARK,
|
||||
CODE_HIDDEN,
|
||||
CODE_RANDOMVANISH,
|
||||
|
||||
@@ -282,6 +282,16 @@ void NoteDataUtil::RemoveHoldNotes(NoteData &in)
|
||||
}
|
||||
|
||||
|
||||
void NoteDataUtil::RemoveMines(NoteData &in)
|
||||
{
|
||||
int max_row = in.GetLastRow();
|
||||
for( int t=0; t<in.GetNumTracks(); t++ )
|
||||
for( int r=0; r<=max_row; r++ )
|
||||
if( in.GetTapNote(t,r)==TAP_MINE )
|
||||
in.SetTapNote(t,r,TAP_EMPTY);
|
||||
}
|
||||
|
||||
|
||||
void NoteDataUtil::Turn( NoteData &in, StepsType st, TurnType tt )
|
||||
{
|
||||
int iTakeFromTrack[MAX_NOTE_TRACKS]; // New track "t" will take from old track iTakeFromTrack[t]
|
||||
@@ -1107,6 +1117,9 @@ void NoteDataUtil::TransformNoteData( NoteData &nd, const PlayerOptions &po, Ste
|
||||
if( !po.m_bHoldNotes )
|
||||
RemoveHoldNotes( nd );
|
||||
|
||||
if( !po.m_bMines )
|
||||
RemoveMines( nd );
|
||||
|
||||
switch( po.m_Turn )
|
||||
{
|
||||
case PlayerOptions::TURN_NONE: break;
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace NoteDataUtil
|
||||
float GetRadarValue( const NoteData &in, RadarCategory rv, float fSongSeconds );
|
||||
|
||||
void RemoveHoldNotes( NoteData &in );
|
||||
void RemoveMines( NoteData &in );
|
||||
enum TurnType { left, right, mirror, shuffle, super_shuffle, NUM_TURN_TYPES };
|
||||
void Turn( NoteData &in, StepsType st, TurnType tt );
|
||||
void Little( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||
|
||||
@@ -40,7 +40,16 @@ OptionIcon::OptionIcon()
|
||||
|
||||
void OptionIcon::Load( PlayerNumber pn, CString sText, bool bHeader )
|
||||
{
|
||||
static CString sStopWords[] = { "OFF", "VISIBLE", "VIVID", "STANDARD", "X1", "HOLDS", "DEFAULT", "OVERHEAD" };
|
||||
static CString sStopWords[] =
|
||||
{
|
||||
"OFF",
|
||||
"VISIBLE",
|
||||
"VIVID",
|
||||
"STANDARD",
|
||||
"1X",
|
||||
"HOLDS",
|
||||
"DEFAULT",
|
||||
"OVERHEAD" };
|
||||
|
||||
for( unsigned i=0; i<ARRAYSIZE(sStopWords); i++ )
|
||||
if( 0==stricmp(sText,sStopWords[i]) )
|
||||
|
||||
@@ -161,6 +161,7 @@ CString PlayerOptions::GetString() const
|
||||
}
|
||||
|
||||
if( !m_bHoldNotes ) sReturn += "NoHolds, ";
|
||||
if( !m_bMines ) sReturn += "NoMines, ";
|
||||
if( m_bTimingAssist ) sReturn += "TimingAssist, ";
|
||||
if( m_bProTiming ) sReturn += "ProTiming, ";
|
||||
|
||||
@@ -291,6 +292,7 @@ void PlayerOptions::FromString( CString sOptions )
|
||||
else if( sBit == "alternate" ) SET_FLOAT( fScrolls[SCROLL_ALTERNATE] )
|
||||
else if( sBit == "noholds" ) m_bHoldNotes = !on;
|
||||
else if( sBit == "nofreeze" ) m_bHoldNotes = !on;
|
||||
else if( sBit == "nomines" ) m_bMines = !on;
|
||||
else if( sBit == "dark" ) SET_FLOAT( fDark )
|
||||
else if( sBit == "blind" ) SET_FLOAT( fBlind )
|
||||
else if( sBit == "passmark" ) SET_FLOAT( fPassmark )
|
||||
@@ -478,6 +480,7 @@ bool ComparePlayerOptions( const PlayerOptions &po1, const PlayerOptions &po2 )
|
||||
COMPARE(m_Turn);
|
||||
COMPARE(m_Transform);
|
||||
COMPARE(m_bHoldNotes);
|
||||
COMPARE(m_bMines);
|
||||
COMPARE(m_bTimingAssist);
|
||||
COMPARE(m_bProTiming);
|
||||
COMPARE(m_fPerspectiveTilt);
|
||||
|
||||
@@ -101,6 +101,7 @@ struct PlayerOptions
|
||||
Turn m_Turn;
|
||||
Transform m_Transform;
|
||||
bool m_bHoldNotes;
|
||||
bool m_bMines;
|
||||
bool m_bTimingAssist;
|
||||
bool m_bProTiming;
|
||||
CString m_sPositioning; /* The current positioning mode, or empty to use the normal positions. */
|
||||
|
||||
@@ -336,7 +336,7 @@ void ScreenOptions::InitOptionsText()
|
||||
BitmapText &title = m_textTitles[i];
|
||||
|
||||
title.LoadFromFont( THEME->GetPathToF("ScreenOptions title") );
|
||||
CString sText = optline.name;
|
||||
CString sText = optline.title;
|
||||
|
||||
title.SetText( sText );
|
||||
title.SetXY( LABELS_X, fY );
|
||||
@@ -422,41 +422,7 @@ void ScreenOptions::PositionIcons()
|
||||
|
||||
void ScreenOptions::RefreshIcons()
|
||||
{
|
||||
ASSERT( m_iNumOptionRows < (int) MAX_OPTION_LINES );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ ) // foreach player
|
||||
{
|
||||
if( !GAMESTATE->IsHumanPlayer(p) )
|
||||
continue;
|
||||
|
||||
for( int i=0; i<m_iNumOptionRows; i++ ) // foreach options line
|
||||
{
|
||||
OptionRow &row = m_OptionRow[i];
|
||||
OptionIcon &icon = m_OptionIcons[p][i];
|
||||
|
||||
int iSelection = m_iSelectedOption[p][i];
|
||||
if( iSelection >= (int)m_OptionRow[i].choices.size() )
|
||||
{
|
||||
/* Invalid selection. Send debug output, to aid debugging. */
|
||||
CString error = ssprintf("Option row with name \"%s\" selects item %i, but there are only %i items:\n",
|
||||
m_OptionRow[i].name.c_str(),
|
||||
iSelection, m_OptionRow[i].choices.size() );
|
||||
|
||||
for( unsigned j = 0; j < m_OptionRow[i].choices.size(); ++j )
|
||||
error += ssprintf(" %s\n", m_OptionRow[i].choices[j].c_str());
|
||||
|
||||
RageException::Throw( "%s", error.c_str() );
|
||||
}
|
||||
|
||||
CString sSelection = row.choices[iSelection];
|
||||
if( sSelection == "ON" )
|
||||
sSelection = m_OptionRow[i].name;
|
||||
if( row.bOneChoiceForAllPlayers )
|
||||
icon.Load( (PlayerNumber)p, "", false );
|
||||
else
|
||||
icon.Load( (PlayerNumber)p, sSelection, false );
|
||||
}
|
||||
}
|
||||
// handled by ScreenOptionsMaster
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ const unsigned MAX_OPTION_LINES = 40;
|
||||
struct OptionRow
|
||||
{
|
||||
CString name;
|
||||
CString title;
|
||||
bool bOneChoiceForAllPlayers;
|
||||
vector<CString> choices;
|
||||
|
||||
@@ -35,6 +36,7 @@ struct OptionRow
|
||||
OptionRow( const char *n, int b, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL )
|
||||
{
|
||||
name = n;
|
||||
title = n;
|
||||
bOneChoiceForAllPlayers = !!b;
|
||||
#define PUSH( c ) if(c) choices.push_back(c);
|
||||
PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19);
|
||||
@@ -68,7 +70,7 @@ protected:
|
||||
BitmapText &GetTextItemForRow( PlayerNumber pn, int iRow );
|
||||
void PositionUnderlines();
|
||||
void PositionIcons();
|
||||
void RefreshIcons();
|
||||
virtual void RefreshIcons();
|
||||
void PositionCursors();
|
||||
void PositionItems();
|
||||
void TweenCursor( PlayerNumber player_no );
|
||||
@@ -99,7 +101,6 @@ protected: // derived classes need access to these
|
||||
int m_iSelectedOption[NUM_PLAYERS][MAX_OPTION_LINES];
|
||||
int m_iCurrentRow[NUM_PLAYERS];
|
||||
|
||||
private:
|
||||
InputMode m_InputMode;
|
||||
|
||||
int m_iNumOptionRows;
|
||||
|
||||
@@ -240,35 +240,34 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
|
||||
const CString name = asBits[0];
|
||||
const CString param = asBits.size() > 1? asBits[1]: "";
|
||||
|
||||
CString Title = "";
|
||||
if( !name.CompareNoCase("title") )
|
||||
{
|
||||
TitleSetExplicitly = true;
|
||||
row.name = param;
|
||||
row.title = param;
|
||||
}
|
||||
else if( !name.CompareNoCase("list") )
|
||||
{
|
||||
SetList( row, hand, param, Title );
|
||||
SetList( row, hand, param, row.name );
|
||||
}
|
||||
else if( !name.CompareNoCase("steps") )
|
||||
{
|
||||
SetStep( row, hand );
|
||||
Title = "Steps";
|
||||
row.name = "Steps";
|
||||
}
|
||||
else if( !name.CompareNoCase("conf") )
|
||||
{
|
||||
SetConf( row, hand, param, Title );
|
||||
SetConf( row, hand, param, row.name );
|
||||
}
|
||||
else if( !name.CompareNoCase("characters") )
|
||||
{
|
||||
SetCharacter( row, hand );
|
||||
Title = "Characters";
|
||||
row.name = "Characters";
|
||||
}
|
||||
else
|
||||
RageException::Throw( "Unexpected type '%s' in %s::Line%i", name.c_str(), m_sName.c_str(), i );
|
||||
|
||||
if( !TitleSetExplicitly )
|
||||
row.name = Title;
|
||||
row.title = row.name;
|
||||
}
|
||||
OptionRowHandlers.push_back( hand );
|
||||
}
|
||||
@@ -568,3 +567,51 @@ void ScreenOptionsMaster::GoToPrevState()
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN ); // (GAMESTATE->m_PlayMode) );
|
||||
}
|
||||
|
||||
void ScreenOptionsMaster::RefreshIcons()
|
||||
{
|
||||
ASSERT( m_iNumOptionRows < (int) MAX_OPTION_LINES );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ ) // foreach player
|
||||
{
|
||||
if( !GAMESTATE->IsHumanPlayer(p) )
|
||||
continue;
|
||||
|
||||
for( int i=0; i<m_iNumOptionRows; i++ ) // foreach options line
|
||||
{
|
||||
OptionRow &row = m_OptionRow[i];
|
||||
OptionIcon &icon = m_OptionIcons[p][i];
|
||||
OptionRowHandler &handler = OptionRowHandlers[i];
|
||||
|
||||
int iSelection = m_iSelectedOption[p][i];
|
||||
if( iSelection >= (int)m_OptionRow[i].choices.size() )
|
||||
{
|
||||
/* Invalid selection. Send debug output, to aid debugging. */
|
||||
CString error = ssprintf("Option row with name '%s' selects item %i, but there are only %i items:\n",
|
||||
m_OptionRow[i].name.c_str(),
|
||||
iSelection, m_OptionRow[i].choices.size() );
|
||||
|
||||
for( unsigned j = 0; j < m_OptionRow[i].choices.size(); ++j )
|
||||
error += ssprintf(" %s\n", m_OptionRow[i].choices[j].c_str());
|
||||
|
||||
RageException::Throw( "%s", error.c_str() );
|
||||
}
|
||||
|
||||
// set icon name
|
||||
CString sIcon;
|
||||
switch( handler.type )
|
||||
{
|
||||
case ROW_LIST:
|
||||
sIcon = handler.ListEntries[iSelection].m_sModifiers;
|
||||
break;
|
||||
case ROW_STEP:
|
||||
case ROW_CHARACTER:
|
||||
sIcon = row.choices[iSelection];
|
||||
break;
|
||||
case ROW_CONFIG:
|
||||
break;
|
||||
}
|
||||
|
||||
icon.Load( (PlayerNumber)p, sIcon, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,8 @@ protected:
|
||||
|
||||
virtual void GoToNextState();
|
||||
virtual void GoToPrevState();
|
||||
|
||||
virtual void RefreshIcons();
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user