[ScreenSelectProfile] Transplant menu input functions from ScreenSelectMaster.
This commit is contained in:
@@ -14,6 +14,12 @@ sm-ssc v1.0 Release Candidate 2 | 201007xx
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
(work in progress, it's not out yet [hence the "xx" above].)
|
(work in progress, it's not out yet [hence the "xx" above].)
|
||||||
|
|
||||||
|
20100708
|
||||||
|
--------
|
||||||
|
* [ScreenSelectProfile] Transplant menu input functions from ScreenSelectMaster.
|
||||||
|
Now you no longer have to rely on stuffing the directions into the Codeset.
|
||||||
|
(Of course, you still have to handle Start and Back yourself.)
|
||||||
|
|
||||||
20100706
|
20100706
|
||||||
--------
|
--------
|
||||||
* [ScreenSelectMusic] add a code for closing the current folder from any
|
* [ScreenSelectMusic] add a code for closing the current folder from any
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "ProfileManager.h"
|
#include "ProfileManager.h"
|
||||||
#include "GameState.h"
|
#include "GameState.h"
|
||||||
#include "MemoryCardManager.h"
|
#include "MemoryCardManager.h"
|
||||||
|
#include "InputEventPlus.h"
|
||||||
|
|
||||||
REGISTER_SCREEN_CLASS( ScreenSelectProfile );
|
REGISTER_SCREEN_CLASS( ScreenSelectProfile );
|
||||||
|
|
||||||
@@ -14,6 +15,7 @@ void ScreenSelectProfile::Init()
|
|||||||
// no selection initially
|
// no selection initially
|
||||||
m_iSelectedProfiles[p]=-1;
|
m_iSelectedProfiles[p]=-1;
|
||||||
}
|
}
|
||||||
|
m_TrackingRepeatingInput = GameButton_Invalid;
|
||||||
ScreenWithMenuElements::Init();
|
ScreenWithMenuElements::Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,6 +27,86 @@ void ScreenSelectProfile::Input( const InputEventPlus &input )
|
|||||||
ScreenWithMenuElements::Input( input );
|
ScreenWithMenuElements::Input( input );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenSelectProfile::MenuLeft( const InputEventPlus &input )
|
||||||
|
{
|
||||||
|
PlayerNumber pn = input.pn;
|
||||||
|
if( m_fLockInputSecs > 0 )
|
||||||
|
return;
|
||||||
|
if( input.type == IET_RELEASE )
|
||||||
|
return;
|
||||||
|
if( input.type != IET_FIRST_PRESS )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
if( !ALLOW_REPEATING_INPUT )
|
||||||
|
return;
|
||||||
|
*/
|
||||||
|
if( m_TrackingRepeatingInput != input.MenuI )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_TrackingRepeatingInput = input.MenuI;
|
||||||
|
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuLeftP1+pn) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenSelectProfile::MenuRight( const InputEventPlus &input )
|
||||||
|
{
|
||||||
|
PlayerNumber pn = input.pn;
|
||||||
|
if( m_fLockInputSecs > 0 )
|
||||||
|
return;
|
||||||
|
if( input.type == IET_RELEASE )
|
||||||
|
return;
|
||||||
|
if( input.type != IET_FIRST_PRESS )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
if( !ALLOW_REPEATING_INPUT )
|
||||||
|
return;
|
||||||
|
*/
|
||||||
|
if( m_TrackingRepeatingInput != input.MenuI )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_TrackingRepeatingInput = input.MenuI;
|
||||||
|
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuRightP1+pn) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenSelectProfile::MenuUp( const InputEventPlus &input )
|
||||||
|
{
|
||||||
|
PlayerNumber pn = input.pn;
|
||||||
|
if( m_fLockInputSecs > 0 )
|
||||||
|
return;
|
||||||
|
if( input.type == IET_RELEASE )
|
||||||
|
return;
|
||||||
|
if( input.type != IET_FIRST_PRESS )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
if( !ALLOW_REPEATING_INPUT )
|
||||||
|
return;
|
||||||
|
*/
|
||||||
|
if( m_TrackingRepeatingInput != input.MenuI )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_TrackingRepeatingInput = input.MenuI;
|
||||||
|
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuUpP1+pn) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenSelectProfile::MenuDown( const InputEventPlus &input )
|
||||||
|
{
|
||||||
|
PlayerNumber pn = input.pn;
|
||||||
|
if( m_fLockInputSecs > 0 )
|
||||||
|
return;
|
||||||
|
if( input.type == IET_RELEASE )
|
||||||
|
return;
|
||||||
|
if( input.type != IET_FIRST_PRESS )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
if( !ALLOW_REPEATING_INPUT )
|
||||||
|
return;
|
||||||
|
*/
|
||||||
|
if( m_TrackingRepeatingInput != input.MenuI )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_TrackingRepeatingInput = input.MenuI;
|
||||||
|
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuDownP1+pn) );
|
||||||
|
}
|
||||||
|
|
||||||
bool ScreenSelectProfile::SetProfileIndex( PlayerNumber pn, int iProfileIndex )
|
bool ScreenSelectProfile::SetProfileIndex( PlayerNumber pn, int iProfileIndex )
|
||||||
{
|
{
|
||||||
if( !GAMESTATE->IsHumanPlayer( pn ) )
|
if( !GAMESTATE->IsHumanPlayer( pn ) )
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ class ScreenSelectProfile : public ScreenWithMenuElements
|
|||||||
public:
|
public:
|
||||||
virtual void Init();
|
virtual void Init();
|
||||||
virtual void Input( const InputEventPlus &input );
|
virtual void Input( const InputEventPlus &input );
|
||||||
|
virtual void MenuLeft( const InputEventPlus &input );
|
||||||
|
virtual void MenuRight( const InputEventPlus &input );
|
||||||
|
virtual void MenuUp( const InputEventPlus &input );
|
||||||
|
virtual void MenuDown( const InputEventPlus &input );
|
||||||
|
|
||||||
|
GameButton m_TrackingRepeatingInput;
|
||||||
|
|
||||||
// Lua
|
// Lua
|
||||||
void PushSelf( lua_State *L );
|
void PushSelf( lua_State *L );
|
||||||
|
|||||||
Reference in New Issue
Block a user