[Screen] add HandleBackButton (for people who know what they're doing ;) [people making multi-state menus using the MK2ULTRA method])

This commit is contained in:
AJ Kelly
2011-01-01 14:02:53 -06:00
parent 098dbb4b1e
commit 5cd6a32930
4 changed files with 11 additions and 4 deletions
+4 -3
View File
@@ -10,12 +10,13 @@ supported but exist anyways.)
_____________________________________________________________________________ _____________________________________________________________________________
================================================================================ ================================================================================
sm-ssc v1.2 | 201012xx sm-ssc v1.2 | 201101xx
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
20101231 20110101
-------- --------
* [ScreenGameplay] Fixed "Gameplay ### combo" announcer messages. [neothe0ne] * [Screen] Added HandleBackButton metric; useful for custom menus that need to
use the Back button for more user-friendly canceling. [freem]
20101230 20101230
-------- --------
+1
View File
@@ -1198,6 +1198,7 @@ BlinkPlayersBest=true
ScreenInitCommand= ScreenInitCommand=
ScreenOnCommand= ScreenOnCommand=
AllowOperatorMenuButton=true AllowOperatorMenuButton=true
HandleBackButton=true
RepeatRate=-1 RepeatRate=-1
RepeatDelay=-1 RepeatDelay=-1
PrepareScreens= PrepareScreens=
+4
View File
@@ -42,6 +42,7 @@ bool Screen::SortMessagesByDelayRemaining( const Screen::QueuedScreenMessage &m1
void Screen::Init() void Screen::Init()
{ {
ALLOW_OPERATOR_MENU_BUTTON.Load( m_sName, "AllowOperatorMenuButton" ); ALLOW_OPERATOR_MENU_BUTTON.Load( m_sName, "AllowOperatorMenuButton" );
HANDLE_BACK_BUTTON.Load( m_sName, "HandleBackButton" );
REPEAT_RATE.Load( m_sName, "RepeatRate" ); REPEAT_RATE.Load( m_sName, "RepeatRate" );
REPEAT_DELAY.Load( m_sName, "RepeatDelay" ); REPEAT_DELAY.Load( m_sName, "RepeatDelay" );
LIGHTS_MODE.Load( m_sName, "LightsMode" ); LIGHTS_MODE.Load( m_sName, "LightsMode" );
@@ -204,7 +205,10 @@ void Screen::Input( const InputEventPlus &input )
case GAME_BUTTON_BACK: case GAME_BUTTON_BACK:
// Don't make the user hold the back button if they're pressing escape and escape is the back button. // Don't make the user hold the back button if they're pressing escape and escape is the back button.
if( !PREFSMAN->m_bDelayedBack || input.type==IET_REPEAT || (input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_ESC) ) if( !PREFSMAN->m_bDelayedBack || input.type==IET_REPEAT || (input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_ESC) )
{
if( HANDLE_BACK_BUTTON )
this->MenuBack( input ); this->MenuBack( input );
}
return; return;
case GAME_BUTTON_START: this->MenuStart ( input ); return; case GAME_BUTTON_START: this->MenuStart ( input ); return;
case GAME_BUTTON_SELECT:this->MenuSelect( input ); return; case GAME_BUTTON_SELECT:this->MenuSelect( input ); return;
+1
View File
@@ -80,6 +80,7 @@ protected:
InputQueueCodeSet m_Codes; InputQueueCodeSet m_Codes;
ThemeMetric<bool> ALLOW_OPERATOR_MENU_BUTTON; ThemeMetric<bool> ALLOW_OPERATOR_MENU_BUTTON;
ThemeMetric<bool> HANDLE_BACK_BUTTON;
ThemeMetric<float> REPEAT_RATE; ThemeMetric<float> REPEAT_RATE;
ThemeMetric<float> REPEAT_DELAY; ThemeMetric<float> REPEAT_DELAY;
ThemeMetric<LightsMode> LIGHTS_MODE; ThemeMetric<LightsMode> LIGHTS_MODE;