Change Next/Prev OptionsList to CodeDetector
This commit is contained in:
@@ -331,6 +331,13 @@ local CodeDetectorCodes = {
|
|||||||
CloseCurrentFolder = {
|
CloseCurrentFolder = {
|
||||||
default = "MenuUp-MenuDown",
|
default = "MenuUp-MenuDown",
|
||||||
},
|
},
|
||||||
|
-- OptionsList
|
||||||
|
PrevOptionsList = {
|
||||||
|
default = "@MenuUp-MenuDown",
|
||||||
|
},
|
||||||
|
NextOptionsList = {
|
||||||
|
default = "@MenuDown-MenuUp",
|
||||||
|
},
|
||||||
-- sorts
|
-- sorts
|
||||||
NextSort1 = {
|
NextSort1 = {
|
||||||
default = "@MenuLeft-@MenuRight-Start",
|
default = "@MenuLeft-@MenuRight-Start",
|
||||||
@@ -462,14 +469,6 @@ function GetCodeForGame(codeName)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local OptionsListKeys = {
|
local OptionsListKeys = {
|
||||||
PrevMenu = {
|
|
||||||
pump="MenuUp",
|
|
||||||
default="MenuLeft"
|
|
||||||
},
|
|
||||||
NextMenu = {
|
|
||||||
pump="MenuDown",
|
|
||||||
default="MenuRight"
|
|
||||||
},
|
|
||||||
PrevItem = {
|
PrevItem = {
|
||||||
pump="MenuLeft",
|
pump="MenuLeft",
|
||||||
default="MenuUp"
|
default="MenuUp"
|
||||||
|
|||||||
@@ -368,6 +368,10 @@ PrevGroup=GetCodeForGame("PrevGroup")
|
|||||||
CloseCurrentFolder=GetCodeForGame("CloseCurrentFolder")
|
CloseCurrentFolder=GetCodeForGame("CloseCurrentFolder")
|
||||||
Hidden=GetCodeForGame("Hidden")
|
Hidden=GetCodeForGame("Hidden")
|
||||||
RandomVanish=GetCodeForGame("RandomVanish")
|
RandomVanish=GetCodeForGame("RandomVanish")
|
||||||
|
# OptionsList (if enabled)
|
||||||
|
PrevOptionsList=GetCodeForGame("PrevOptionsList")
|
||||||
|
NextOptionsList=GetCodeForGame("NextOptionsList")
|
||||||
|
# Evaluation screen
|
||||||
SaveScreenshot1=GetCodeForGame("SaveScreenshot1")
|
SaveScreenshot1=GetCodeForGame("SaveScreenshot1")
|
||||||
SaveScreenshot2=GetCodeForGame("SaveScreenshot2")
|
SaveScreenshot2=GetCodeForGame("SaveScreenshot2")
|
||||||
# on the player options menu.
|
# on the player options menu.
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ const char *CodeNames[] = {
|
|||||||
"CancelAllPlayerOptions",
|
"CancelAllPlayerOptions",
|
||||||
"BackInEventMode",
|
"BackInEventMode",
|
||||||
"CloseCurrentFolder",
|
"CloseCurrentFolder",
|
||||||
|
"PrevOptionsList",
|
||||||
|
"NextOptionsList"
|
||||||
};
|
};
|
||||||
XToString( Code );
|
XToString( Code );
|
||||||
|
|
||||||
@@ -116,6 +118,15 @@ bool CodeDetector::EnteredModeMenu( GameController controller )
|
|||||||
return EnteredCode(controller,CODE_MODE_MENU1) || EnteredCode(controller,CODE_MODE_MENU2);
|
return EnteredCode(controller,CODE_MODE_MENU1) || EnteredCode(controller,CODE_MODE_MENU2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CodeDetector::EnteredPrevOpList( GameController controller )
|
||||||
|
{
|
||||||
|
return EnteredCode(controller,CODE_PREV_OPLIST);
|
||||||
|
}
|
||||||
|
bool CodeDetector::EnteredNextOpList( GameController controller )
|
||||||
|
{
|
||||||
|
return EnteredCode(controller,CODE_NEXT_OPLIST);
|
||||||
|
}
|
||||||
|
|
||||||
#define TOGGLE(v,a,b) if(v!=a) v=a; else v=b;
|
#define TOGGLE(v,a,b) if(v!=a) v=a; else v=b;
|
||||||
#define FLOAT_TOGGLE(v) if(v!=1.f) v=1.f; else v=0.f;
|
#define FLOAT_TOGGLE(v) if(v!=1.f) v=1.f; else v=0.f;
|
||||||
// XXX: Read the metrics file instead!
|
// XXX: Read the metrics file instead!
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ enum Code {
|
|||||||
CODE_CANCEL_ALL_PLAYER_OPTIONS,
|
CODE_CANCEL_ALL_PLAYER_OPTIONS,
|
||||||
CODE_BACK_IN_EVENT_MODE,
|
CODE_BACK_IN_EVENT_MODE,
|
||||||
CODE_CLOSE_CURRENT_FOLDER,
|
CODE_CLOSE_CURRENT_FOLDER,
|
||||||
|
CODE_NEXT_OPLIST,
|
||||||
|
CODE_PREV_OPLIST,
|
||||||
NUM_Code // leave this at the end
|
NUM_Code // leave this at the end
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -63,6 +65,8 @@ public:
|
|||||||
static bool EnteredPrevGroup( GameController controller );
|
static bool EnteredPrevGroup( GameController controller );
|
||||||
static bool EnteredNextGroup( GameController controller );
|
static bool EnteredNextGroup( GameController controller );
|
||||||
static bool EnteredCloseFolder( GameController controller );
|
static bool EnteredCloseFolder( GameController controller );
|
||||||
|
static bool EnteredPrevOpList( GameController controller );
|
||||||
|
static bool EnteredNextOpList( GameController controller );
|
||||||
|
|
||||||
// todo: move to PlayerOptions.h -aj
|
// todo: move to PlayerOptions.h -aj
|
||||||
void ChangeScrollSpeed( GameController controller, bool bIncrement );
|
void ChangeScrollSpeed( GameController controller, bool bIncrement );
|
||||||
|
|||||||
+2
-4
@@ -188,8 +188,6 @@ void OptionsList::Load( RString sType, PlayerNumber pn )
|
|||||||
|
|
||||||
m_pn = pn;
|
m_pn = pn;
|
||||||
m_bStartIsDown = false;
|
m_bStartIsDown = false;
|
||||||
m_GameButtonPreviousMenu = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric( m_sName,"PrevMenuButton" ) );
|
|
||||||
m_GameButtonNextMenu = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric( m_sName,"NextMenuButton" ) );
|
|
||||||
m_GameButtonPreviousItem = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric( m_sName,"PrevItemButton" ) );
|
m_GameButtonPreviousItem = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric( m_sName,"PrevItemButton" ) );
|
||||||
m_GameButtonNextItem = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric( m_sName,"NextItemButton" ) );
|
m_GameButtonNextItem = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric( m_sName,"NextItemButton" ) );
|
||||||
|
|
||||||
@@ -450,13 +448,13 @@ bool OptionsList::Input( const InputEventPlus &input )
|
|||||||
MESSAGEMAN->Broadcast( lMsg );
|
MESSAGEMAN->Broadcast( lMsg );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( input.MenuI == m_GameButtonPreviousMenu )
|
else if ( CodeDetector::EnteredPrevOpList(input.GameI.controller) )
|
||||||
{
|
{
|
||||||
if( input.type == IET_FIRST_PRESS )
|
if( input.type == IET_FIRST_PRESS )
|
||||||
SwitchMenu( -1 );
|
SwitchMenu( -1 );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( input.MenuI == m_GameButtonNextMenu )
|
else if ( CodeDetector::EnteredNextOpList(input.GameI.controller) )
|
||||||
{
|
{
|
||||||
if( input.type == IET_FIRST_PRESS )
|
if( input.type == IET_FIRST_PRESS )
|
||||||
SwitchMenu( +1 );
|
SwitchMenu( +1 );
|
||||||
|
|||||||
@@ -102,8 +102,6 @@ private:
|
|||||||
vector<RString> m_asMenuStack;
|
vector<RString> m_asMenuStack;
|
||||||
int m_iMenuStackSelection;
|
int m_iMenuStackSelection;
|
||||||
protected:
|
protected:
|
||||||
GameButton m_GameButtonPreviousMenu;
|
|
||||||
GameButton m_GameButtonNextMenu;
|
|
||||||
GameButton m_GameButtonPreviousItem;
|
GameButton m_GameButtonPreviousItem;
|
||||||
GameButton m_GameButtonNextItem;
|
GameButton m_GameButtonNextItem;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user