use BeginScreen
This commit is contained in:
@@ -32,8 +32,6 @@ void ScreenSelect::Init()
|
|||||||
{
|
{
|
||||||
ScreenWithMenuElements::Init();
|
ScreenWithMenuElements::Init();
|
||||||
|
|
||||||
m_bTimeToFinalizePlayers = false;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Load messages to update on
|
// Load messages to update on
|
||||||
//
|
//
|
||||||
@@ -87,6 +85,13 @@ void ScreenSelect::Init()
|
|||||||
|
|
||||||
if( !m_aGameCommands.size() )
|
if( !m_aGameCommands.size() )
|
||||||
RageException::Throw( "Screen \"%s\" does not set any choices", m_sName.c_str() );
|
RageException::Throw( "Screen \"%s\" does not set any choices", m_sName.c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenSelect::BeginScreen()
|
||||||
|
{
|
||||||
|
ScreenWithMenuElements::BeginScreen();
|
||||||
|
|
||||||
|
m_bTimeToFinalizePlayers = false;
|
||||||
|
|
||||||
// derived classes can override if they want
|
// derived classes can override if they want
|
||||||
LIGHTSMAN->SetLightsMode( LIGHTSMODE_MENU );
|
LIGHTSMAN->SetLightsMode( LIGHTSMODE_MENU );
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class ScreenSelect : public ScreenWithMenuElements
|
|||||||
public:
|
public:
|
||||||
ScreenSelect( CString sClassName );
|
ScreenSelect( CString sClassName );
|
||||||
virtual void Init();
|
virtual void Init();
|
||||||
|
virtual void BeginScreen();
|
||||||
virtual ~ScreenSelect();
|
virtual ~ScreenSelect();
|
||||||
|
|
||||||
virtual void Update( float fDelta );
|
virtual void Update( float fDelta );
|
||||||
|
|||||||
@@ -54,26 +54,6 @@ void ScreenSelectMaster::Init()
|
|||||||
{
|
{
|
||||||
ScreenSelect::Init();
|
ScreenSelect::Init();
|
||||||
|
|
||||||
// TODO: Move default choice to ScreenSelect
|
|
||||||
int iDefaultChoice = -1;
|
|
||||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
|
||||||
{
|
|
||||||
const GameCommand& mc = m_aGameCommands[c];
|
|
||||||
if( mc.m_sName == (CString) DEFAULT_CHOICE )
|
|
||||||
{
|
|
||||||
iDefaultChoice = c;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
|
||||||
{
|
|
||||||
m_iChoice[p] = (iDefaultChoice!=-1) ? iDefaultChoice : 0;
|
|
||||||
m_bChosen[p] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
vector<PlayerNumber> vpns;
|
vector<PlayerNumber> vpns;
|
||||||
if( SHARED_SELECTION )
|
if( SHARED_SELECTION )
|
||||||
{
|
{
|
||||||
@@ -155,14 +135,6 @@ void ScreenSelectMaster::Init()
|
|||||||
LUA->UnsetGlobal( "ThisGameCommand" );
|
LUA->UnsetGlobal( "ThisGameCommand" );
|
||||||
}
|
}
|
||||||
|
|
||||||
// position scroller items so that the items' will start from their resting
|
|
||||||
// position when they execute their OnCommand.
|
|
||||||
if( SHOW_SCROLLER )
|
|
||||||
{
|
|
||||||
FOREACH( PlayerNumber, vpns, p )
|
|
||||||
m_Scroller[*p].PositionItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
for( int page=0; page<NUM_PAGES; page++ )
|
for( int page=0; page<NUM_PAGES; page++ )
|
||||||
{
|
{
|
||||||
m_sprMore[page].Load( THEME->GetPathG(m_sName, ssprintf("more page%d",page+1)) );
|
m_sprMore[page].Load( THEME->GetPathG(m_sName, ssprintf("more page%d",page+1)) );
|
||||||
@@ -177,12 +149,6 @@ void ScreenSelectMaster::Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
|
||||||
{
|
|
||||||
CLAMP( m_iChoice[p], 0, (int)m_aGameCommands.size()-1 );
|
|
||||||
m_bChosen[p] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_soundChange.Load( THEME->GetPathS(m_sName,"change"), true );
|
m_soundChange.Load( THEME->GetPathS(m_sName,"change"), true );
|
||||||
m_soundDifficult.Load( ANNOUNCER->GetPathTo("select difficulty challenge") );
|
m_soundDifficult.Load( ANNOUNCER->GetPathTo("select difficulty challenge") );
|
||||||
m_soundStart.Load( THEME->GetPathS(m_sName,"start") );
|
m_soundStart.Load( THEME->GetPathS(m_sName,"start") );
|
||||||
@@ -238,6 +204,50 @@ void ScreenSelectMaster::Init()
|
|||||||
m_Next[dir][from] = to;
|
m_Next[dir][from] = to;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenSelectMaster::BeginScreen()
|
||||||
|
{
|
||||||
|
ScreenSelect::BeginScreen();
|
||||||
|
|
||||||
|
// TODO: Move default choice to ScreenSelect
|
||||||
|
int iDefaultChoice = -1;
|
||||||
|
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||||
|
{
|
||||||
|
const GameCommand& mc = m_aGameCommands[c];
|
||||||
|
if( mc.m_sName == (CString) DEFAULT_CHOICE )
|
||||||
|
{
|
||||||
|
iDefaultChoice = c;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FOREACH_PlayerNumber( p )
|
||||||
|
{
|
||||||
|
m_iChoice[p] = (iDefaultChoice!=-1) ? iDefaultChoice : 0;
|
||||||
|
CLAMP( m_iChoice[p], 0, (int)m_aGameCommands.size()-1 );
|
||||||
|
m_bChosen[p] = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<PlayerNumber> vpns;
|
||||||
|
if( SHARED_SELECTION )
|
||||||
|
{
|
||||||
|
vpns.push_back( (PlayerNumber)0 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FOREACH_HumanPlayer( p )
|
||||||
|
vpns.push_back( p );
|
||||||
|
}
|
||||||
|
|
||||||
|
// position scroller items so that the items' will start from their resting
|
||||||
|
// position when they execute their OnCommand.
|
||||||
|
if( SHOW_SCROLLER )
|
||||||
|
{
|
||||||
|
FOREACH( PlayerNumber, vpns, p )
|
||||||
|
m_Scroller[*p].PositionItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this->UpdateSelectableChoices();
|
this->UpdateSelectableChoices();
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class ScreenSelectMaster : public ScreenSelect
|
|||||||
public:
|
public:
|
||||||
ScreenSelectMaster( CString sName );
|
ScreenSelectMaster( CString sName );
|
||||||
virtual void Init();
|
virtual void Init();
|
||||||
|
virtual void BeginScreen();
|
||||||
|
|
||||||
virtual void Update( float fDelta );
|
virtual void Update( float fDelta );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user