add OptionsList broadcasts for Left,Right,Start
This commit is contained in:
@@ -280,6 +280,10 @@ void OptionsList::Input( const InputEventPlus &input )
|
|||||||
--m_iMenuStackSelection;
|
--m_iMenuStackSelection;
|
||||||
wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row
|
wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row
|
||||||
PositionCursor();
|
PositionCursor();
|
||||||
|
|
||||||
|
Message msg("OptionsListLeft");
|
||||||
|
msg.SetParam( "Player", input.pn );
|
||||||
|
MESSAGEMAN->Broadcast( msg );
|
||||||
}
|
}
|
||||||
else if( input.MenuI == MENU_BUTTON_RIGHT )
|
else if( input.MenuI == MENU_BUTTON_RIGHT )
|
||||||
{
|
{
|
||||||
@@ -294,11 +298,15 @@ void OptionsList::Input( const InputEventPlus &input )
|
|||||||
++m_iMenuStackSelection;
|
++m_iMenuStackSelection;
|
||||||
wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row
|
wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row
|
||||||
PositionCursor();
|
PositionCursor();
|
||||||
|
|
||||||
|
Message msg("OptionsListRight");
|
||||||
|
msg.SetParam( "Player", input.pn );
|
||||||
|
MESSAGEMAN->Broadcast( msg );
|
||||||
}
|
}
|
||||||
else if( input.MenuI == MENU_BUTTON_START )
|
else if( input.MenuI == MENU_BUTTON_START )
|
||||||
{
|
{
|
||||||
LOG->Trace( "X5" );
|
LOG->Trace( "X5" );
|
||||||
Start();
|
Start( input.pn );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,7 +423,7 @@ void OptionsList::Push( RString sDest )
|
|||||||
SwitchToCurrentRow();
|
SwitchToCurrentRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OptionsList::Start()
|
bool OptionsList::Start( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
const OptionRowHandler *pHandler = GetCurrentHandler();
|
const OptionRowHandler *pHandler = GetCurrentHandler();
|
||||||
const RString &sCurrentRow = m_asMenuStack.back();
|
const RString &sCurrentRow = m_asMenuStack.back();
|
||||||
@@ -463,6 +471,10 @@ bool OptionsList::Start()
|
|||||||
PositionCursor();
|
PositionCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Message msg("OptionsListStart");
|
||||||
|
msg.SetParam( "Player", pn );
|
||||||
|
MESSAGEMAN->Broadcast( msg );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ public:
|
|||||||
|
|
||||||
void PositionCursor( Actor *pCursor, int iSelection );
|
void PositionCursor( Actor *pCursor, int iSelection );
|
||||||
|
|
||||||
void Up();
|
|
||||||
void Down();
|
|
||||||
void Start();
|
void Start();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -49,7 +47,7 @@ public:
|
|||||||
void Input( const InputEventPlus &input );
|
void Input( const InputEventPlus &input );
|
||||||
bool IsOpened() const { return m_asMenuStack.size() > 0; }
|
bool IsOpened() const { return m_asMenuStack.size() > 0; }
|
||||||
|
|
||||||
bool Start(); /* return true if the last menu was popped in response to this press */
|
bool Start( PlayerNumber pn ); /* return true if the last menu was popped in response to this press */
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SwitchMenu( int iDir );
|
void SwitchMenu( int iDir );
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
|||||||
CloseOptionsList( pn );
|
CloseOptionsList( pn );
|
||||||
return;
|
return;
|
||||||
case GAME_BUTTON_START:
|
case GAME_BUTTON_START:
|
||||||
if( m_OptionsList[pn].Start() )
|
if( m_OptionsList[pn].Start(pn) )
|
||||||
CloseOptionsList( pn );
|
CloseOptionsList( pn );
|
||||||
return;
|
return;
|
||||||
case GAME_BUTTON_MENULEFT:
|
case GAME_BUTTON_MENULEFT:
|
||||||
@@ -1194,7 +1194,7 @@ void ScreenSelectMusic::AfterMusicChange()
|
|||||||
void ScreenSelectMusic::OpenOptionsList( PlayerNumber pn )
|
void ScreenSelectMusic::OpenOptionsList( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
m_OptionsList[pn].Open();
|
m_OptionsList[pn].Open();
|
||||||
Message msg("OptionsOpened");
|
Message msg("OptionsListOpened");
|
||||||
msg.SetParam( "Player", pn );
|
msg.SetParam( "Player", pn );
|
||||||
MESSAGEMAN->Broadcast( msg );
|
MESSAGEMAN->Broadcast( msg );
|
||||||
}
|
}
|
||||||
@@ -1202,7 +1202,7 @@ void ScreenSelectMusic::OpenOptionsList( PlayerNumber pn )
|
|||||||
void ScreenSelectMusic::CloseOptionsList( PlayerNumber pn )
|
void ScreenSelectMusic::CloseOptionsList( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
m_OptionsList[pn].Close();
|
m_OptionsList[pn].Close();
|
||||||
Message msg("OptionsClosed");
|
Message msg("OptionsListClosed");
|
||||||
msg.SetParam( "Player", pn );
|
msg.SetParam( "Player", pn );
|
||||||
MESSAGEMAN->Broadcast( msg );
|
MESSAGEMAN->Broadcast( msg );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user