move GetMenuButtonSecondaryFunction into InputScheme
This commit is contained in:
@@ -2490,17 +2490,6 @@ const Style* GameManager::GameAndStringToStyle( const Game *game, RString sStyle
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MenuButton GameManager::GetMenuButtonSecondaryFunction( const Game *pGame, GameButton gb ) const
|
|
||||||
{
|
|
||||||
FOREACH_MenuButton(m)
|
|
||||||
if( pGame->m_InputScheme.m_SecondaryMenuButton[m] == gb )
|
|
||||||
return m;
|
|
||||||
|
|
||||||
return MenuButton_Invalid; // only used in gameplay
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// lua start
|
// lua start
|
||||||
#include "LuaBinding.h"
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ public:
|
|||||||
static const Game* StringToGameType( RString sGameType );
|
static const Game* StringToGameType( RString sGameType );
|
||||||
const Style* GameAndStringToStyle( const Game* pGame, RString sStyle );
|
const Style* GameAndStringToStyle( const Game* pGame, RString sStyle );
|
||||||
static RString StyleToLocalizedString( const Style* s );
|
static RString StyleToLocalizedString( const Style* s );
|
||||||
MenuButton GetMenuButtonSecondaryFunction( const Game *pGame, GameButton gb ) const;
|
|
||||||
|
|
||||||
// Lua
|
// Lua
|
||||||
void PushSelf( lua_State *L );
|
void PushSelf( lua_State *L );
|
||||||
|
|||||||
@@ -977,6 +977,15 @@ void InputScheme::MenuButtonToGameInputs( MenuButton MenuI, PlayerNumber pn, Gam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MenuButton InputScheme::GetMenuButtonSecondaryFunction( GameButton gb ) const
|
||||||
|
{
|
||||||
|
FOREACH_MenuButton(mb)
|
||||||
|
if( m_SecondaryMenuButton[mb] == gb )
|
||||||
|
return mb;
|
||||||
|
|
||||||
|
return MenuButton_Invalid;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2003 Chris Danford
|
* (c) 2001-2003 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public:
|
|||||||
GameButton ButtonNameToIndex( const RString &sButtonName ) const;
|
GameButton ButtonNameToIndex( const RString &sButtonName ) const;
|
||||||
MenuButton GameInputToMenuButton( GameInput GameI ) const;
|
MenuButton GameInputToMenuButton( GameInput GameI ) const;
|
||||||
void MenuButtonToGameInputs( MenuButton MenuI, PlayerNumber pn, GameInput GameIout[4] ) const;
|
void MenuButtonToGameInputs( MenuButton MenuI, PlayerNumber pn, GameInput GameIout[4] ) const;
|
||||||
|
MenuButton GetMenuButtonSecondaryFunction( GameButton gb ) const;
|
||||||
};
|
};
|
||||||
#define FOREACH_GameButtonInScheme( s, var ) for( GameButton var=(GameButton)0; var<s->m_iButtonsPerController; enum_add<GameButton>( var, +1 ) )
|
#define FOREACH_GameButtonInScheme( s, var ) for( GameButton var=(GameButton)0; var<s->m_iButtonsPerController; enum_add<GameButton>( var, +1 ) )
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "RageInput.h"
|
#include "RageInput.h"
|
||||||
#include "InputMapper.h"
|
#include "InputMapper.h"
|
||||||
#include "GameManager.h"
|
|
||||||
#include "GameState.h"
|
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "ScreenDimensions.h"
|
#include "ScreenDimensions.h"
|
||||||
#include "InputEventPlus.h"
|
#include "InputEventPlus.h"
|
||||||
@@ -104,7 +102,7 @@ void ScreenMapControllers::Init()
|
|||||||
BitmapText *pSecondary = new BitmapText;
|
BitmapText *pSecondary = new BitmapText;
|
||||||
pSecondary->SetName( "Secondary" );
|
pSecondary->SetName( "Secondary" );
|
||||||
pSecondary->LoadFromFont( THEME->GetPathF("Common","title") );
|
pSecondary->LoadFromFont( THEME->GetPathF("Common","title") );
|
||||||
MenuButton mb = GAMEMAN->GetMenuButtonSecondaryFunction( GAMESTATE->GetCurrentGame(), pKey->m_GameButton );
|
MenuButton mb = INPUTMAPPER->GetInputScheme()->GetMenuButtonSecondaryFunction( pKey->m_GameButton );
|
||||||
RString sText;
|
RString sText;
|
||||||
if( mb != MenuButton_Invalid )
|
if( mb != MenuButton_Invalid )
|
||||||
sText = MenuButtonToLocalizedString( mb );
|
sText = MenuButtonToLocalizedString( mb );
|
||||||
|
|||||||
@@ -3,10 +3,8 @@
|
|||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "InputMapper.h"
|
#include "InputMapper.h"
|
||||||
#include "GameState.h"
|
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "ScreenDimensions.h"
|
#include "ScreenDimensions.h"
|
||||||
#include "GameManager.h"
|
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "RageInput.h"
|
#include "RageInput.h"
|
||||||
#include "InputEventPlus.h"
|
#include "InputEventPlus.h"
|
||||||
@@ -61,7 +59,7 @@ class InputList: public BitmapText
|
|||||||
|
|
||||||
if( !PREFSMAN->m_bOnlyDedicatedMenuButtons )
|
if( !PREFSMAN->m_bOnlyDedicatedMenuButtons )
|
||||||
{
|
{
|
||||||
MenuButton mb = GAMEMAN->GetMenuButtonSecondaryFunction( GAMESTATE->GetCurrentGame(), gi.button );
|
MenuButton mb = INPUTMAPPER->GetInputScheme()->GetMenuButtonSecondaryFunction( gi.button );
|
||||||
if( mb != MenuButton_Invalid )
|
if( mb != MenuButton_Invalid )
|
||||||
sTemp += ssprintf( " - (%s %s)", MenuButtonToLocalizedString(mb).c_str(), SECONDARY.GetValue().c_str() );
|
sTemp += ssprintf( " - (%s %s)", MenuButtonToLocalizedString(mb).c_str(), SECONDARY.GetValue().c_str() );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user