allow 3 key navigation of workout Screens, ScreenMiniMenu
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "GameState.h"
|
||||
#include "FontCharAliases.h"
|
||||
#include "OptionRowHandler.h"
|
||||
#include "PrefsManager.h"
|
||||
|
||||
AutoScreenMessage( SM_GoToOK )
|
||||
AutoScreenMessage( SM_GoToCancel )
|
||||
@@ -45,6 +46,14 @@ void ScreenMiniMenu::MiniMenu( const MenuDef* pDef, ScreenMessage SM_SendOnOK, S
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenMiniMenu );
|
||||
|
||||
void ScreenMiniMenu::Init()
|
||||
{
|
||||
if( PREFSMAN->m_bArcadeOptionsNavigation )
|
||||
SetNavigation( NAV_THREE_KEY_MENU );
|
||||
|
||||
ScreenOptions::Init();
|
||||
}
|
||||
|
||||
void ScreenMiniMenu::BeginScreen()
|
||||
{
|
||||
ASSERT( g_pMenuDef != NULL );
|
||||
@@ -138,6 +147,11 @@ void ScreenMiniMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
ScreenOptions::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
bool ScreenMiniMenu::FocusedItemEndsScreen( PlayerNumber pn ) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (c) 2003-2004 Chris Danford
|
||||
|
||||
@@ -91,6 +91,7 @@ class ScreenMiniMenu : public ScreenOptions
|
||||
public:
|
||||
static void MiniMenu( const MenuDef* pDef, ScreenMessage smSendOnOK, ScreenMessage smSendOnCancel = SM_None, float fX = 0, float fY = 0 );
|
||||
|
||||
void Init();
|
||||
void BeginScreen();
|
||||
void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
@@ -99,6 +100,8 @@ protected:
|
||||
virtual void ImportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
||||
virtual void ExportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
||||
|
||||
virtual bool FocusedItemEndsScreen( PlayerNumber pn ) const;
|
||||
|
||||
void LoadMenu( const MenuDef* pDef );
|
||||
|
||||
ScreenMessage m_SMSendOnOK;
|
||||
|
||||
@@ -528,7 +528,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
return; /* already transitioning */
|
||||
|
||||
/* If the selected option sets a screen, honor it. */
|
||||
RString sThisScreen = GetNextScreenForSelection( GAMESTATE->m_MasterPlayerNumber );
|
||||
RString sThisScreen = GetNextScreenForFocusedItem( GAMESTATE->m_MasterPlayerNumber );
|
||||
if( sThisScreen != "" )
|
||||
m_sNextScreen = sThisScreen;
|
||||
|
||||
@@ -813,8 +813,7 @@ void ScreenOptions::ProcessMenuStart( const InputEventPlus &input )
|
||||
{
|
||||
/* In NAV_THREE_KEY_MENU mode, if a row doesn't set a screen, it does
|
||||
* something. Apply it now, and don't go to the next screen. */
|
||||
RString sScreen = GetNextScreenForSelection( input.pn );
|
||||
if( sScreen.empty() )
|
||||
if( !FocusedItemEndsScreen(input.pn) )
|
||||
{
|
||||
vector<PlayerNumber> vpns;
|
||||
vpns.push_back( input.pn );
|
||||
@@ -938,7 +937,13 @@ void ScreenOptions::StoreFocus( PlayerNumber pn )
|
||||
m_iCurrentRow[pn], row.GetChoiceInRowWithFocus(pn), m_iFocusX[pn]);
|
||||
}
|
||||
|
||||
RString ScreenOptions::GetNextScreenForSelection( PlayerNumber pn ) const
|
||||
bool ScreenOptions::FocusedItemEndsScreen( PlayerNumber pn ) const
|
||||
{
|
||||
RString sScreen = GetNextScreenForFocusedItem( pn );
|
||||
return !sScreen.empty();
|
||||
}
|
||||
|
||||
RString ScreenOptions::GetNextScreenForFocusedItem( PlayerNumber pn ) const
|
||||
{
|
||||
int iCurRow = this->GetCurrentRow( pn );
|
||||
|
||||
@@ -1192,6 +1197,16 @@ bool ScreenOptions::MoveRowAbsolute( PlayerNumber pn, int iRow )
|
||||
return bChanged;
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
ChangeValueInRowRelative(m_iCurrentRow[input.pn],input.pn,-1, input.type != IET_FIRST_PRESS);
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
ChangeValueInRowRelative(m_iCurrentRow[input.pn], input.pn,+1, input.type != IET_FIRST_PRESS);
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
MenuUpDown( input, -1 );
|
||||
|
||||
@@ -64,7 +64,8 @@ protected:
|
||||
void StoreFocus( PlayerNumber pn );
|
||||
|
||||
void BeginFadingOut();
|
||||
RString GetNextScreenForSelection( PlayerNumber pn ) const;
|
||||
virtual bool FocusedItemEndsScreen( PlayerNumber pn ) const;
|
||||
RString GetNextScreenForFocusedItem( PlayerNumber pn ) const;
|
||||
|
||||
void ChangeValueInRowRelative( int iRow, PlayerNumber pn, int iDelta, bool bRepeat );
|
||||
void ChangeValueInRowAbsolute( int iRow, PlayerNumber pn, int iChoiceIndex, bool bRepeat );
|
||||
@@ -77,8 +78,8 @@ protected:
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void ProcessMenuStart( const InputEventPlus &input );
|
||||
virtual void MenuLeft( const InputEventPlus &input ) { ChangeValueInRowRelative(m_iCurrentRow[input.pn],input.pn,-1, input.type != IET_FIRST_PRESS); }
|
||||
virtual void MenuRight( const InputEventPlus &input ) { ChangeValueInRowRelative(m_iCurrentRow[input.pn], input.pn,+1, input.type != IET_FIRST_PRESS); }
|
||||
virtual void MenuLeft( const InputEventPlus &input );
|
||||
virtual void MenuRight( const InputEventPlus &input );
|
||||
virtual void MenuUp( const InputEventPlus &input );
|
||||
virtual void MenuDown( const InputEventPlus &input );
|
||||
virtual void MenuSelect( const InputEventPlus &input );
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "ScreenTextEntry.h"
|
||||
#include "ScreenPrompt.h"
|
||||
#include "StatsManager.h"
|
||||
#include "PrefsManager.h"
|
||||
|
||||
AutoScreenMessage( SM_BackFromRename )
|
||||
AutoScreenMessage( SM_BackFromDelete )
|
||||
@@ -40,6 +41,9 @@ REGISTER_SCREEN_CLASS( ScreenOptionsManageWorkouts );
|
||||
|
||||
void ScreenOptionsManageWorkouts::Init()
|
||||
{
|
||||
if( PREFSMAN->m_bArcadeOptionsNavigation )
|
||||
SetNavigation( NAV_THREE_KEY_MENU );
|
||||
|
||||
ScreenOptions::Init();
|
||||
|
||||
CREATE_NEW_SCREEN.Load( m_sName, "CreateNewScreen" );
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "ScreenPrompt.h"
|
||||
#include "PlayerState.h"
|
||||
#include "Style.h"
|
||||
#include "PrefsManager.h"
|
||||
|
||||
enum ReviewWorkoutRow
|
||||
{
|
||||
@@ -42,6 +43,9 @@ AutoScreenMessage( SM_BackFromEnterName )
|
||||
|
||||
void ScreenOptionsReviewWorkout::Init()
|
||||
{
|
||||
if( PREFSMAN->m_bArcadeOptionsNavigation )
|
||||
SetNavigation( NAV_THREE_KEY_MENU );
|
||||
|
||||
ScreenOptions::Init();
|
||||
|
||||
m_soundSave.Load( THEME->GetPathS(m_sName,"Save") );
|
||||
|
||||
Reference in New Issue
Block a user