move GetMenuButtonSecondaryFunction into InputScheme

This commit is contained in:
Glenn Maynard
2006-11-21 07:16:19 +00:00
parent 52a878504b
commit 91ee16754f
6 changed files with 12 additions and 18 deletions
-11
View File
@@ -2490,17 +2490,6 @@ const Style* GameManager::GameAndStringToStyle( const Game *game, RString sStyle
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
#include "LuaBinding.h"
-1
View File
@@ -37,7 +37,6 @@ public:
static const Game* StringToGameType( RString sGameType );
const Style* GameAndStringToStyle( const Game* pGame, RString sStyle );
static RString StyleToLocalizedString( const Style* s );
MenuButton GetMenuButtonSecondaryFunction( const Game *pGame, GameButton gb ) const;
// Lua
void PushSelf( lua_State *L );
+9
View File
@@ -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
* All rights reserved.
+1
View File
@@ -31,6 +31,7 @@ public:
GameButton ButtonNameToIndex( const RString &sButtonName ) const;
MenuButton GameInputToMenuButton( GameInput GameI ) 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 ) )
+1 -3
View File
@@ -4,8 +4,6 @@
#include "RageLog.h"
#include "RageInput.h"
#include "InputMapper.h"
#include "GameManager.h"
#include "GameState.h"
#include "ThemeManager.h"
#include "ScreenDimensions.h"
#include "InputEventPlus.h"
@@ -104,7 +102,7 @@ void ScreenMapControllers::Init()
BitmapText *pSecondary = new BitmapText;
pSecondary->SetName( "Secondary" );
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;
if( mb != MenuButton_Invalid )
sText = MenuButtonToLocalizedString( mb );
+1 -3
View File
@@ -3,10 +3,8 @@
#include "ScreenManager.h"
#include "RageLog.h"
#include "InputMapper.h"
#include "GameState.h"
#include "ThemeManager.h"
#include "ScreenDimensions.h"
#include "GameManager.h"
#include "PrefsManager.h"
#include "RageInput.h"
#include "InputEventPlus.h"
@@ -61,7 +59,7 @@ class InputList: public BitmapText
if( !PREFSMAN->m_bOnlyDedicatedMenuButtons )
{
MenuButton mb = GAMEMAN->GetMenuButtonSecondaryFunction( GAMESTATE->GetCurrentGame(), gi.button );
MenuButton mb = INPUTMAPPER->GetInputScheme()->GetMenuButtonSecondaryFunction( gi.button );
if( mb != MenuButton_Invalid )
sTemp += ssprintf( " - (%s %s)", MenuButtonToLocalizedString(mb).c_str(), SECONDARY.GetValue().c_str() );
}