add positioning mode selection
This commit is contained in:
@@ -55,6 +55,7 @@ public:
|
||||
void Load(PlayerNumber pn);
|
||||
|
||||
void GetNamesForCurrentGame(vector<CString> &IDs);
|
||||
bool IsValidModeForCurrentGame(CString mode) const { return GetID(mode) != -1; }
|
||||
|
||||
private:
|
||||
CString m_Filename;
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "RageUtil.h"
|
||||
#include "math.h"
|
||||
|
||||
#include "GameState.h"
|
||||
#include "NoteFieldPositioning.h"
|
||||
|
||||
void PlayerOptions::Init()
|
||||
{
|
||||
@@ -125,6 +127,7 @@ CString PlayerOptions::GetString()
|
||||
if( !m_bHoldNotes ) sReturn += "NoHolds, ";
|
||||
if( m_bTimingAssist ) sReturn += "TimingAssist, ";
|
||||
|
||||
if( m_sPositioning != "" ) sReturn += m_sPositioning + ", ";
|
||||
switch( (int)m_fPerspectiveTilt )
|
||||
{
|
||||
case -1: sReturn += "Incoming, "; break;
|
||||
@@ -195,6 +198,8 @@ void PlayerOptions::FromString( CString sOptions )
|
||||
else if( sBit == "timingassist")m_bTimingAssist = true;
|
||||
else if( sBit == "incoming" ) m_fPerspectiveTilt = -1;
|
||||
else if( sBit == "space" ) m_fPerspectiveTilt = +1;
|
||||
else if( GAMESTATE->m_Position->IsValidModeForCurrentGame(sBit) )
|
||||
m_sPositioning = sBit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "ThemeManager.h"
|
||||
#include "AnnouncerManager.h"
|
||||
#include "NoteSkinManager.h"
|
||||
#include "NoteFieldPositioning.h"
|
||||
|
||||
#define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","PrevScreen"+Capitalize(PlayModeToString(play_mode)))
|
||||
#define NEXT_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","NextScreen"+Capitalize(PlayModeToString(play_mode)))
|
||||
@@ -47,7 +48,7 @@ OptionRow g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = {
|
||||
OptionRow( "Note\nSkin", "" ),
|
||||
OptionRow( "Holds", "OFF","ON" ),
|
||||
OptionRow( "Other", "OFF","DARK","TIME SPACING" ),
|
||||
OptionRow( "Perspec\n-tive", "INCOMING","OVERHEAD","SPACE" ),
|
||||
OptionRow( "Perspec\n-tive", "" ),
|
||||
};
|
||||
|
||||
|
||||
@@ -82,6 +83,19 @@ void ScreenPlayerOptions::ImportOptions()
|
||||
m_OptionRow[PO_NOTE_SKIN].choices.push_back( arraySkinNames[i] );
|
||||
}
|
||||
|
||||
m_OptionRow[PO_PERSPECTIVE].choices.clear();
|
||||
m_OptionRow[PO_PERSPECTIVE].choices.push_back( "INCOMING" );
|
||||
m_OptionRow[PO_PERSPECTIVE].choices.push_back( "OVERHEAD" );
|
||||
m_OptionRow[PO_PERSPECTIVE].choices.push_back( "SPACE" );
|
||||
|
||||
CStringArray arrayPosNames;
|
||||
GAMESTATE->m_Position->GetNamesForCurrentGame(arrayPosNames);
|
||||
for( unsigned i=0; i<arrayPosNames.size(); i++ )
|
||||
{
|
||||
arrayPosNames[i].MakeUpper();
|
||||
m_OptionRow[PO_PERSPECTIVE].choices.push_back( arrayPosNames[i] );
|
||||
}
|
||||
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
@@ -134,8 +148,19 @@ void ScreenPlayerOptions::ImportOptions()
|
||||
else
|
||||
m_iSelectedOption[p][PO_OTHER] = 0;
|
||||
|
||||
m_iSelectedOption[p][PO_PERSPECTIVE]= (int)po.m_fPerspectiveTilt + 1;
|
||||
|
||||
/* Default: */
|
||||
m_iSelectedOption[p][PO_PERSPECTIVE] = 1;
|
||||
if(po.m_fPerspectiveTilt == -1)
|
||||
m_iSelectedOption[p][PO_PERSPECTIVE] = 0;
|
||||
else if(po.m_fPerspectiveTilt == 1)
|
||||
m_iSelectedOption[p][PO_PERSPECTIVE] = 2;
|
||||
else /* po.m_fPerspectiveTilt == 0 */
|
||||
{
|
||||
vector<CString> &choices = m_OptionRow[PO_PERSPECTIVE].choices;
|
||||
for(unsigned n = 3; n < choices.size(); ++n)
|
||||
if(!choices[n].CompareNoCase(po.m_sPositioning))
|
||||
m_iSelectedOption[p][PO_PERSPECTIVE] = n;
|
||||
}
|
||||
|
||||
po.Init();
|
||||
}
|
||||
@@ -187,7 +212,18 @@ void ScreenPlayerOptions::ExportOptions()
|
||||
po.m_bHoldNotes = (m_iSelectedOption[p][PO_HOLD_NOTES] == 1);
|
||||
po.m_fDark = (m_iSelectedOption[p][PO_OTHER] == 1) ? 1.f : 0.f;
|
||||
po.m_bTimeSpacing = (m_iSelectedOption[p][PO_OTHER] == 2);
|
||||
po.m_fPerspectiveTilt = (float)m_iSelectedOption[p][PO_PERSPECTIVE] - 1;
|
||||
|
||||
switch(m_iSelectedOption[p][PO_PERSPECTIVE])
|
||||
{
|
||||
case 0: po.m_fPerspectiveTilt = -1; break;
|
||||
case 2: po.m_fPerspectiveTilt = 1; break;
|
||||
default:po.m_fPerspectiveTilt = 0; break;
|
||||
}
|
||||
if(m_iSelectedOption[p][PO_PERSPECTIVE] > 2)
|
||||
{
|
||||
const int choice = m_iSelectedOption[p][PO_PERSPECTIVE];
|
||||
po.m_sPositioning = m_OptionRow[PO_PERSPECTIVE].choices[choice];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user