Don't duplicate the data for common GameButtons.
InputScheme separates the generic, low-level engine data from the Game*-specific high-level data. GameButtonType is a high-level distinction; in fact, it's only needed for custom GameButtons (eg. DANCE_BUTTON_*), since the function of generic GameButtons (GAME_BUTTON_*) can simply be identified by their value--that's why, for example, we don't have GameButtonType for GAME_BUTTON_COIN.
This commit is contained in:
@@ -15,6 +15,28 @@ TapNoteScore Game::MapTapNoteScore( TapNoteScore tns ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const Game::PerButtonInfo g_CommonButtonInfo[] =
|
||||||
|
{
|
||||||
|
{ GameButtonType_INVALID }, // GAME_BUTTON_MENULEFT
|
||||||
|
{ GameButtonType_INVALID }, // GAME_BUTTON_MENURIGHT
|
||||||
|
{ GameButtonType_INVALID }, // GAME_BUTTON_MENUUP
|
||||||
|
{ GameButtonType_INVALID }, // GAME_BUTTON_MENUDOWN
|
||||||
|
{ GameButtonType_INVALID }, // GAME_BUTTON_START
|
||||||
|
{ GameButtonType_INVALID }, // GAME_BUTTON_SELECT
|
||||||
|
{ GameButtonType_INVALID }, // GAME_BUTTON_BACK
|
||||||
|
{ GameButtonType_INVALID }, // GAME_BUTTON_COIN
|
||||||
|
{ GameButtonType_INVALID }, // GAME_BUTTON_OPERATOR
|
||||||
|
};
|
||||||
|
|
||||||
|
const Game::PerButtonInfo *Game::GetPerButtonInfo( GameButton gb ) const
|
||||||
|
{
|
||||||
|
COMPILE_ASSERT( GAME_BUTTON_NEXT == ARRAYLEN(g_CommonButtonInfo) );
|
||||||
|
if( gb < GAME_BUTTON_NEXT )
|
||||||
|
return &g_CommonButtonInfo[gb];
|
||||||
|
else
|
||||||
|
return &m_PerButtonInfo[gb-GAME_BUTTON_NEXT];
|
||||||
|
}
|
||||||
|
|
||||||
// lua start
|
// lua start
|
||||||
#include "LuaBinding.h"
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,14 @@ public:
|
|||||||
bool m_bAllowHopos; // allow Hammer-ons and Pull-offs? Only useful for guitar type input.
|
bool m_bAllowHopos; // allow Hammer-ons and Pull-offs? Only useful for guitar type input.
|
||||||
InputScheme m_InputScheme;
|
InputScheme m_InputScheme;
|
||||||
|
|
||||||
|
struct PerButtonInfo
|
||||||
|
{
|
||||||
|
GameButtonType m_gbt;
|
||||||
|
};
|
||||||
|
/* Data for each Game-specific GameButton. This starts at GAME_BUTTON_NEXT. */
|
||||||
|
PerButtonInfo m_PerButtonInfo[NUM_GameButton];
|
||||||
|
const PerButtonInfo *GetPerButtonInfo( GameButton gb ) const;
|
||||||
|
|
||||||
TapNoteScore MapTapNoteScore( TapNoteScore tns ) const;
|
TapNoteScore MapTapNoteScore( TapNoteScore tns ) const;
|
||||||
TapNoteScore m_mapW1To;
|
TapNoteScore m_mapW1To;
|
||||||
TapNoteScore m_mapW2To;
|
TapNoteScore m_mapW2To;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ StringToX( GameController );
|
|||||||
|
|
||||||
RString GameButtonToString( const InputScheme* pInputs, GameButton i )
|
RString GameButtonToString( const InputScheme* pInputs, GameButton i )
|
||||||
{
|
{
|
||||||
return pInputs->m_GameButtonInfo[i].m_szName;
|
return pInputs->GetGameButtonName(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
RString GameButtonToLocalizedString( const InputScheme* pInputs, GameButton i )
|
RString GameButtonToLocalizedString( const InputScheme* pInputs, GameButton i )
|
||||||
|
|||||||
+160
-160
@@ -127,21 +127,12 @@ static const Game g_Game_Dance =
|
|||||||
"dance", // m_szName
|
"dance", // m_szName
|
||||||
NUM_DANCE_BUTTONS, // m_iButtonsPerController
|
NUM_DANCE_BUTTONS, // m_iButtonsPerController
|
||||||
{ // m_szButtonNames
|
{ // m_szButtonNames
|
||||||
{ "MenuLeft", GameButtonType_INVALID },
|
"Left",
|
||||||
{ "MenuRight", GameButtonType_INVALID },
|
"Right",
|
||||||
{ "MenuUp", GameButtonType_INVALID },
|
"Up",
|
||||||
{ "MenuDown", GameButtonType_INVALID },
|
"Down",
|
||||||
{ "Start", GameButtonType_INVALID },
|
"UpLeft",
|
||||||
{ "Select", GameButtonType_INVALID },
|
"UpRight",
|
||||||
{ "Back", GameButtonType_INVALID },
|
|
||||||
{ "Coin", GameButtonType_INVALID },
|
|
||||||
{ "Operator", GameButtonType_INVALID },
|
|
||||||
{ "Left", GameButtonType_Step },
|
|
||||||
{ "Right", GameButtonType_Step },
|
|
||||||
{ "Up", GameButtonType_Step },
|
|
||||||
{ "Down", GameButtonType_Step },
|
|
||||||
{ "UpLeft", GameButtonType_Step },
|
|
||||||
{ "UpRight", GameButtonType_Step },
|
|
||||||
},
|
},
|
||||||
{ // m_SecondaryMenuButton
|
{ // m_SecondaryMenuButton
|
||||||
DANCE_BUTTON_LEFT, // MENU_BUTTON_LEFT
|
DANCE_BUTTON_LEFT, // MENU_BUTTON_LEFT
|
||||||
@@ -156,6 +147,14 @@ static const Game g_Game_Dance =
|
|||||||
},
|
},
|
||||||
g_AutoKeyMappings_Dance
|
g_AutoKeyMappings_Dance
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
},
|
||||||
TNS_W1, // m_mapW1To
|
TNS_W1, // m_mapW1To
|
||||||
TNS_W2, // m_mapW2To
|
TNS_W2, // m_mapW2To
|
||||||
TNS_W3, // m_mapW3To
|
TNS_W3, // m_mapW3To
|
||||||
@@ -194,20 +193,11 @@ static const Game g_Game_Pump =
|
|||||||
"pump", // m_szName
|
"pump", // m_szName
|
||||||
NUM_PUMP_BUTTONS, // m_iButtonsPerController
|
NUM_PUMP_BUTTONS, // m_iButtonsPerController
|
||||||
{ // m_szButtonNames
|
{ // m_szButtonNames
|
||||||
{ "MenuLeft", GameButtonType_INVALID},
|
"UpLeft",
|
||||||
{ "MenuRight", GameButtonType_INVALID },
|
"UpRight",
|
||||||
{ "MenuUp", GameButtonType_INVALID },
|
"Center",
|
||||||
{ "MenuDown", GameButtonType_INVALID },
|
"DownLeft",
|
||||||
{ "Start", GameButtonType_INVALID },
|
"DownRight",
|
||||||
{ "Select", GameButtonType_INVALID },
|
|
||||||
{ "Back", GameButtonType_INVALID },
|
|
||||||
{ "Coin", GameButtonType_INVALID },
|
|
||||||
{ "Operator", GameButtonType_INVALID },
|
|
||||||
{ "UpLeft", GameButtonType_Step },
|
|
||||||
{ "UpRight", GameButtonType_Step },
|
|
||||||
{ "Center", GameButtonType_Step },
|
|
||||||
{ "DownLeft", GameButtonType_Step },
|
|
||||||
{ "DownRight", GameButtonType_Step },
|
|
||||||
},
|
},
|
||||||
{ // m_SecondaryMenuButton
|
{ // m_SecondaryMenuButton
|
||||||
PUMP_BUTTON_DOWNLEFT, // MENU_BUTTON_LEFT
|
PUMP_BUTTON_DOWNLEFT, // MENU_BUTTON_LEFT
|
||||||
@@ -222,6 +212,13 @@ static const Game g_Game_Pump =
|
|||||||
},
|
},
|
||||||
g_AutoKeyMappings_Pump
|
g_AutoKeyMappings_Pump
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
},
|
||||||
TNS_W1, // m_mapW1To
|
TNS_W1, // m_mapW1To
|
||||||
TNS_W2, // m_mapW2To
|
TNS_W2, // m_mapW2To
|
||||||
TNS_W3, // m_mapW3To
|
TNS_W3, // m_mapW3To
|
||||||
@@ -250,22 +247,13 @@ static const Game g_Game_Ez2 =
|
|||||||
"ez2", // m_szName
|
"ez2", // m_szName
|
||||||
NUM_EZ2_BUTTONS, // m_iButtonsPerController
|
NUM_EZ2_BUTTONS, // m_iButtonsPerController
|
||||||
{ // m_szButtonNames
|
{ // m_szButtonNames
|
||||||
{ "MenuLeft", GameButtonType_INVALID },
|
"FootUpLeft",
|
||||||
{ "MenuRight", GameButtonType_INVALID },
|
"FootUpRight",
|
||||||
{ "MenuUp", GameButtonType_INVALID },
|
"FootDown",
|
||||||
{ "MenuDown", GameButtonType_INVALID },
|
"HandUpLeft",
|
||||||
{ "Start", GameButtonType_INVALID },
|
"HandUpRight",
|
||||||
{ "Select", GameButtonType_INVALID },
|
"HandLrLeft",
|
||||||
{ "Back", GameButtonType_INVALID },
|
"HandLrRight",
|
||||||
{ "Coin", GameButtonType_INVALID },
|
|
||||||
{ "Operator", GameButtonType_INVALID },
|
|
||||||
{ "FootUpLeft", GameButtonType_Step },
|
|
||||||
{ "FootUpRight", GameButtonType_Step },
|
|
||||||
{ "FootDown", GameButtonType_Step },
|
|
||||||
{ "HandUpLeft", GameButtonType_Step },
|
|
||||||
{ "HandUpRight", GameButtonType_Step },
|
|
||||||
{ "HandLrLeft", GameButtonType_Step },
|
|
||||||
{ "HandLrRight", GameButtonType_Step },
|
|
||||||
},
|
},
|
||||||
{ // m_SecondaryMenuButton
|
{ // m_SecondaryMenuButton
|
||||||
EZ2_BUTTON_HANDUPLEFT, // MENU_BUTTON_LEFT
|
EZ2_BUTTON_HANDUPLEFT, // MENU_BUTTON_LEFT
|
||||||
@@ -280,6 +268,15 @@ static const Game g_Game_Ez2 =
|
|||||||
},
|
},
|
||||||
g_AutoKeyMappings_Ez2
|
g_AutoKeyMappings_Ez2
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
},
|
||||||
TNS_W2, // m_mapW1To
|
TNS_W2, // m_mapW1To
|
||||||
TNS_W2, // m_mapW2To
|
TNS_W2, // m_mapW2To
|
||||||
TNS_W2, // m_mapW3To
|
TNS_W2, // m_mapW3To
|
||||||
@@ -306,20 +303,11 @@ static const Game g_Game_Para =
|
|||||||
"para", // m_szName
|
"para", // m_szName
|
||||||
NUM_PARA_BUTTONS, // m_iButtonsPerController
|
NUM_PARA_BUTTONS, // m_iButtonsPerController
|
||||||
{ // m_szButtonNames
|
{ // m_szButtonNames
|
||||||
{ "MenuLeft", GameButtonType_INVALID },
|
"Left",
|
||||||
{ "MenuRight", GameButtonType_INVALID },
|
"UpLeft",
|
||||||
{ "MenuUp", GameButtonType_INVALID },
|
"Up",
|
||||||
{ "MenuDown", GameButtonType_INVALID },
|
"UpRight",
|
||||||
{ "Start", GameButtonType_INVALID },
|
"Right",
|
||||||
{ "Select", GameButtonType_INVALID },
|
|
||||||
{ "Back", GameButtonType_INVALID },
|
|
||||||
{ "Coin", GameButtonType_INVALID },
|
|
||||||
{ "Operator", GameButtonType_INVALID },
|
|
||||||
{ "Left", GameButtonType_Step },
|
|
||||||
{ "UpLeft", GameButtonType_Step },
|
|
||||||
{ "Up", GameButtonType_Step },
|
|
||||||
{ "UpRight", GameButtonType_Step },
|
|
||||||
{ "Right", GameButtonType_Step },
|
|
||||||
},
|
},
|
||||||
{ // m_SecondaryMenuButton
|
{ // m_SecondaryMenuButton
|
||||||
PARA_BUTTON_LEFT, // MENU_BUTTON_LEFT
|
PARA_BUTTON_LEFT, // MENU_BUTTON_LEFT
|
||||||
@@ -334,6 +322,13 @@ static const Game g_Game_Para =
|
|||||||
},
|
},
|
||||||
g_AutoKeyMappings_Para
|
g_AutoKeyMappings_Para
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
},
|
||||||
TNS_W1, // m_mapW1To
|
TNS_W1, // m_mapW1To
|
||||||
TNS_W2, // m_mapW2To
|
TNS_W2, // m_mapW2To
|
||||||
TNS_W3, // m_mapW3To
|
TNS_W3, // m_mapW3To
|
||||||
@@ -363,23 +358,14 @@ static const Game g_Game_DS3DDX =
|
|||||||
"ds3ddx", // m_szName
|
"ds3ddx", // m_szName
|
||||||
NUM_DS3DDX_BUTTONS, // m_iButtonsPerController
|
NUM_DS3DDX_BUTTONS, // m_iButtonsPerController
|
||||||
{ // m_szButtonNames
|
{ // m_szButtonNames
|
||||||
{ "MenuLeft", GameButtonType_INVALID },
|
"HandLeft",
|
||||||
{ "MenuRight", GameButtonType_INVALID },
|
"FootDownLeft",
|
||||||
{ "MenuUp", GameButtonType_INVALID },
|
"FootUpLeft",
|
||||||
{ "MenuDown", GameButtonType_INVALID },
|
"HandUp",
|
||||||
{ "Start", GameButtonType_INVALID },
|
"HandDown",
|
||||||
{ "Select", GameButtonType_INVALID },
|
"FootUpRight",
|
||||||
{ "Back", GameButtonType_INVALID },
|
"FootDownRight",
|
||||||
{ "Coin", GameButtonType_INVALID },
|
"HandRight",
|
||||||
{ "Operator", GameButtonType_INVALID },
|
|
||||||
{ "HandLeft", GameButtonType_Step },
|
|
||||||
{ "FootDownLeft", GameButtonType_Step },
|
|
||||||
{ "FootUpLeft", GameButtonType_Step },
|
|
||||||
{ "HandUp", GameButtonType_Step },
|
|
||||||
{ "HandDown", GameButtonType_Step },
|
|
||||||
{ "FootUpRight", GameButtonType_Step },
|
|
||||||
{ "FootDownRight", GameButtonType_Step },
|
|
||||||
{ "HandRight", GameButtonType_Step },
|
|
||||||
},
|
},
|
||||||
{ // m_SecondaryMenuButton
|
{ // m_SecondaryMenuButton
|
||||||
DS3DDX_BUTTON_HANDLEFT, // MENU_BUTTON_LEFT
|
DS3DDX_BUTTON_HANDLEFT, // MENU_BUTTON_LEFT
|
||||||
@@ -394,6 +380,16 @@ static const Game g_Game_DS3DDX =
|
|||||||
},
|
},
|
||||||
g_AutoKeyMappings_DS3DDX
|
g_AutoKeyMappings_DS3DDX
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
},
|
||||||
TNS_W1, // m_mapW1To
|
TNS_W1, // m_mapW1To
|
||||||
TNS_W2, // m_mapW2To
|
TNS_W2, // m_mapW2To
|
||||||
TNS_W3, // m_mapW3To
|
TNS_W3, // m_mapW3To
|
||||||
@@ -423,24 +419,15 @@ static const Game g_Game_Beat =
|
|||||||
"beat", // m_szName
|
"beat", // m_szName
|
||||||
NUM_BEAT_BUTTONS, // m_iButtonsPerController
|
NUM_BEAT_BUTTONS, // m_iButtonsPerController
|
||||||
{ // m_szButtonNames
|
{ // m_szButtonNames
|
||||||
{ "MenuLeft", GameButtonType_INVALID },
|
"Key1",
|
||||||
{ "MenuRight", GameButtonType_INVALID },
|
"Key2",
|
||||||
{ "MenuUp", GameButtonType_INVALID },
|
"Key3",
|
||||||
{ "MenuDown", GameButtonType_INVALID },
|
"Key4",
|
||||||
{ "Start", GameButtonType_INVALID },
|
"Key5",
|
||||||
{ "Select", GameButtonType_INVALID },
|
"Key6",
|
||||||
{ "Back", GameButtonType_INVALID },
|
"Key7",
|
||||||
{ "Coin", GameButtonType_INVALID },
|
"Scratch up",
|
||||||
{ "Operator", GameButtonType_INVALID },
|
"Scratch down",
|
||||||
{ "Key1", GameButtonType_Step },
|
|
||||||
{ "Key2", GameButtonType_Step },
|
|
||||||
{ "Key3", GameButtonType_Step },
|
|
||||||
{ "Key4", GameButtonType_Step },
|
|
||||||
{ "Key5", GameButtonType_Step },
|
|
||||||
{ "Key6", GameButtonType_Step },
|
|
||||||
{ "Key7", GameButtonType_Step },
|
|
||||||
{ "Scratch up", GameButtonType_Step },
|
|
||||||
{ "Scratch down", GameButtonType_Step },
|
|
||||||
},
|
},
|
||||||
{ // m_SecondaryMenuButton
|
{ // m_SecondaryMenuButton
|
||||||
BEAT_BUTTON_KEY1, // MENU_BUTTON_LEFT
|
BEAT_BUTTON_KEY1, // MENU_BUTTON_LEFT
|
||||||
@@ -455,6 +442,17 @@ static const Game g_Game_Beat =
|
|||||||
},
|
},
|
||||||
g_AutoKeyMappings_Beat
|
g_AutoKeyMappings_Beat
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
},
|
||||||
TNS_W1, // m_mapW1To
|
TNS_W1, // m_mapW1To
|
||||||
TNS_W2, // m_mapW2To
|
TNS_W2, // m_mapW2To
|
||||||
TNS_W3, // m_mapW3To
|
TNS_W3, // m_mapW3To
|
||||||
@@ -484,19 +482,10 @@ static const Game g_Game_Maniax =
|
|||||||
"maniax", // m_szName
|
"maniax", // m_szName
|
||||||
NUM_MANIAX_BUTTONS, // m_iButtonsPerController
|
NUM_MANIAX_BUTTONS, // m_iButtonsPerController
|
||||||
{ // m_szButtonNames
|
{ // m_szButtonNames
|
||||||
{ "MenuLeft", GameButtonType_INVALID },
|
"HandUpLeft",
|
||||||
{ "MenuRight", GameButtonType_INVALID },
|
"HandUpRight",
|
||||||
{ "MenuUp", GameButtonType_INVALID },
|
"HandLrLeft",
|
||||||
{ "MenuDown", GameButtonType_INVALID },
|
"HandLrRight",
|
||||||
{ "Start", GameButtonType_INVALID },
|
|
||||||
{ "Select", GameButtonType_INVALID },
|
|
||||||
{ "Back", GameButtonType_INVALID },
|
|
||||||
{ "Coin", GameButtonType_INVALID },
|
|
||||||
{ "Operator", GameButtonType_INVALID },
|
|
||||||
{ "HandUpLeft", GameButtonType_Step },
|
|
||||||
{ "HandUpRight", GameButtonType_Step },
|
|
||||||
{ "HandLrLeft", GameButtonType_Step },
|
|
||||||
{ "HandLrRight", GameButtonType_Step },
|
|
||||||
},
|
},
|
||||||
{ // m_SecondaryMenuButton
|
{ // m_SecondaryMenuButton
|
||||||
MANIAX_BUTTON_HANDUPLEFT, // MENU_BUTTON_LEFT
|
MANIAX_BUTTON_HANDUPLEFT, // MENU_BUTTON_LEFT
|
||||||
@@ -511,6 +500,12 @@ static const Game g_Game_Maniax =
|
|||||||
},
|
},
|
||||||
g_AutoKeyMappings_Maniax
|
g_AutoKeyMappings_Maniax
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
},
|
||||||
TNS_W1, // m_mapW1To
|
TNS_W1, // m_mapW1To
|
||||||
TNS_W2, // m_mapW2To
|
TNS_W2, // m_mapW2To
|
||||||
TNS_W3, // m_mapW3To
|
TNS_W3, // m_mapW3To
|
||||||
@@ -550,24 +545,15 @@ static const Game g_Game_Techno =
|
|||||||
"techno", // m_szName
|
"techno", // m_szName
|
||||||
NUM_TECHNO_BUTTONS, // m_iButtonsPerController
|
NUM_TECHNO_BUTTONS, // m_iButtonsPerController
|
||||||
{ // m_szButtonNames
|
{ // m_szButtonNames
|
||||||
{ "MenuLeft", GameButtonType_INVALID },
|
"Left",
|
||||||
{ "MenuRight", GameButtonType_INVALID },
|
"Right",
|
||||||
{ "MenuUp", GameButtonType_INVALID },
|
"Up",
|
||||||
{ "MenuDown", GameButtonType_INVALID },
|
"Down",
|
||||||
{ "Start", GameButtonType_INVALID },
|
"UpLeft",
|
||||||
{ "Select", GameButtonType_INVALID },
|
"UpRight",
|
||||||
{ "Back", GameButtonType_INVALID },
|
"Center",
|
||||||
{ "Coin", GameButtonType_INVALID },
|
"DownLeft",
|
||||||
{ "Operator", GameButtonType_INVALID },
|
"DownRight",
|
||||||
{ "Left", GameButtonType_Step },
|
|
||||||
{ "Right", GameButtonType_Step },
|
|
||||||
{ "Up", GameButtonType_Step },
|
|
||||||
{ "Down", GameButtonType_Step },
|
|
||||||
{ "UpLeft", GameButtonType_Step },
|
|
||||||
{ "UpRight", GameButtonType_Step },
|
|
||||||
{ "Center", GameButtonType_Step },
|
|
||||||
{ "DownLeft", GameButtonType_Step },
|
|
||||||
{ "DownRight", GameButtonType_Step },
|
|
||||||
},
|
},
|
||||||
{ // m_SecondaryMenuButton
|
{ // m_SecondaryMenuButton
|
||||||
TECHNO_BUTTON_LEFT, // MENU_BUTTON_LEFT
|
TECHNO_BUTTON_LEFT, // MENU_BUTTON_LEFT
|
||||||
@@ -582,6 +568,17 @@ static const Game g_Game_Techno =
|
|||||||
},
|
},
|
||||||
g_AutoKeyMappings_Techno
|
g_AutoKeyMappings_Techno
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
},
|
||||||
TNS_W1, // m_mapW1To
|
TNS_W1, // m_mapW1To
|
||||||
TNS_W2, // m_mapW2To
|
TNS_W2, // m_mapW2To
|
||||||
TNS_W3, // m_mapW3To
|
TNS_W3, // m_mapW3To
|
||||||
@@ -612,24 +609,15 @@ static const Game g_Game_Popn =
|
|||||||
"popn", // m_szName
|
"popn", // m_szName
|
||||||
NUM_POPN_BUTTONS, // m_iButtonsPerController
|
NUM_POPN_BUTTONS, // m_iButtonsPerController
|
||||||
{ // m_szButtonNames
|
{ // m_szButtonNames
|
||||||
{ "MenuLeft", GameButtonType_Step },
|
"Left White",
|
||||||
{ "MenuRight", GameButtonType_Step },
|
"Left Yellow",
|
||||||
{ "MenuUp", GameButtonType_Step },
|
"Left Green",
|
||||||
{ "MenuDown", GameButtonType_Step },
|
"Left Blue",
|
||||||
{ "Start", GameButtonType_Step },
|
"Red",
|
||||||
{ "Back", GameButtonType_Step },
|
"Right Blue",
|
||||||
{ "Select", GameButtonType_Step },
|
"Right Green",
|
||||||
{ "Coin", GameButtonType_Step },
|
"Right Yellow",
|
||||||
{ "Operator", GameButtonType_Step },
|
"Right White",
|
||||||
{ "Left White", GameButtonType_Step },
|
|
||||||
{ "Left Yellow", GameButtonType_Step },
|
|
||||||
{ "Left Green", GameButtonType_Step },
|
|
||||||
{ "Left Blue", GameButtonType_Step },
|
|
||||||
{ "Red", GameButtonType_Step },
|
|
||||||
{ "Right Blue", GameButtonType_Step },
|
|
||||||
{ "Right Green", GameButtonType_Step },
|
|
||||||
{ "Right Yellow", GameButtonType_Step },
|
|
||||||
{ "Right White", GameButtonType_Step },
|
|
||||||
},
|
},
|
||||||
{ // m_SecondaryMenuButton
|
{ // m_SecondaryMenuButton
|
||||||
POPN_BUTTON_LEFT_BLUE, // MENU_BUTTON_LEFT
|
POPN_BUTTON_LEFT_BLUE, // MENU_BUTTON_LEFT
|
||||||
@@ -644,6 +632,17 @@ static const Game g_Game_Popn =
|
|||||||
},
|
},
|
||||||
g_AutoKeyMappings_Popn
|
g_AutoKeyMappings_Popn
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
},
|
||||||
TNS_W2, // m_mapW1To
|
TNS_W2, // m_mapW1To
|
||||||
TNS_W2, // m_mapW2To
|
TNS_W2, // m_mapW2To
|
||||||
TNS_W3, // m_mapW3To
|
TNS_W3, // m_mapW3To
|
||||||
@@ -673,23 +672,14 @@ static const Game g_Game_Lights =
|
|||||||
"lights", // m_szName
|
"lights", // m_szName
|
||||||
NUM_LIGHTS_BUTTONS, // m_iButtonsPerController
|
NUM_LIGHTS_BUTTONS, // m_iButtonsPerController
|
||||||
{ // m_szButtonNames
|
{ // m_szButtonNames
|
||||||
{ "MenuLeft", GameButtonType_INVALID },
|
"MarqueeUpLeft",
|
||||||
{ "MenuRight", GameButtonType_INVALID },
|
"MarqueeUpRight",
|
||||||
{ "MenuUp", GameButtonType_INVALID },
|
"MarqueeLrLeft",
|
||||||
{ "MenuDown", GameButtonType_INVALID },
|
"MarqueeLrRight",
|
||||||
{ "Start", GameButtonType_INVALID },
|
"ButtonsLeft",
|
||||||
{ "Select", GameButtonType_INVALID },
|
"ButtonsRight",
|
||||||
{ "Back", GameButtonType_INVALID },
|
"BassLeft",
|
||||||
{ "Coin", GameButtonType_INVALID },
|
"BassRight",
|
||||||
{ "Operator", GameButtonType_INVALID },
|
|
||||||
{ "MarqueeUpLeft", GameButtonType_Step },
|
|
||||||
{ "MarqueeUpRight", GameButtonType_Step },
|
|
||||||
{ "MarqueeLrLeft", GameButtonType_Step },
|
|
||||||
{ "MarqueeLrRight", GameButtonType_Step },
|
|
||||||
{ "ButtonsLeft", GameButtonType_Step },
|
|
||||||
{ "ButtonsRight", GameButtonType_Step },
|
|
||||||
{ "BassLeft", GameButtonType_Step },
|
|
||||||
{ "BassRight", GameButtonType_Step },
|
|
||||||
},
|
},
|
||||||
{ // m_SecondaryMenuButton
|
{ // m_SecondaryMenuButton
|
||||||
LIGHTS_BUTTON_MARQUEE_UP_LEFT, // MENU_BUTTON_LEFT
|
LIGHTS_BUTTON_MARQUEE_UP_LEFT, // MENU_BUTTON_LEFT
|
||||||
@@ -704,6 +694,16 @@ static const Game g_Game_Lights =
|
|||||||
},
|
},
|
||||||
g_AutoKeyMappings_Lights
|
g_AutoKeyMappings_Lights
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
{ GameButtonType_Step },
|
||||||
|
},
|
||||||
TNS_W1, // m_mapW1To
|
TNS_W1, // m_mapW1To
|
||||||
TNS_W2, // m_mapW2To
|
TNS_W2, // m_mapW2To
|
||||||
TNS_W3, // m_mapW3To
|
TNS_W3, // m_mapW3To
|
||||||
|
|||||||
@@ -964,7 +964,7 @@ MultiPlayer InputMapper::InputDeviceToMultiPlayer( InputDevice id )
|
|||||||
GameButton InputScheme::ButtonNameToIndex( const RString &sButtonName ) const
|
GameButton InputScheme::ButtonNameToIndex( const RString &sButtonName ) const
|
||||||
{
|
{
|
||||||
for( int i=0; i<m_iButtonsPerController; i++ )
|
for( int i=0; i<m_iButtonsPerController; i++ )
|
||||||
if( stricmp(m_GameButtonInfo[i].m_szName, sButtonName) == 0 )
|
if( stricmp(GetGameButtonName(i), sButtonName) == 0 )
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
return GameButton_Invalid;
|
return GameButton_Invalid;
|
||||||
@@ -1032,6 +1032,28 @@ MenuButton InputScheme::GetMenuButtonSecondaryFunction( GameButton gb ) const
|
|||||||
return MenuButton_Invalid;
|
return MenuButton_Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *g_szCommonGameButtonNames[] =
|
||||||
|
{
|
||||||
|
"MenuLeft",
|
||||||
|
"MenuRight",
|
||||||
|
"MenuUp",
|
||||||
|
"MenuDown",
|
||||||
|
"Start",
|
||||||
|
"Select",
|
||||||
|
"Back",
|
||||||
|
"Coin",
|
||||||
|
"Operator",
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *InputScheme::GetGameButtonName( GameButton gb ) const
|
||||||
|
{
|
||||||
|
COMPILE_ASSERT( GAME_BUTTON_NEXT == ARRAYLEN(g_szCommonGameButtonNames) );
|
||||||
|
if( gb < GAME_BUTTON_NEXT )
|
||||||
|
return g_szCommonGameButtonNames[gb];
|
||||||
|
else
|
||||||
|
return m_szGameButtonNames[gb-GAME_BUTTON_NEXT];
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2003 Chris Danford
|
* (c) 2001-2003 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ public:
|
|||||||
struct GameButtonInfo
|
struct GameButtonInfo
|
||||||
{
|
{
|
||||||
char m_szName[60]; // The name used by the button graphics system. e.g. "left", "right", "middle C", "snare"
|
char m_szName[60]; // The name used by the button graphics system. e.g. "left", "right", "middle C", "snare"
|
||||||
GameButtonType m_gbt;
|
|
||||||
};
|
};
|
||||||
GameButtonInfo m_GameButtonInfo[NUM_GameButton];
|
/* Data for each Game-specific GameButton. This starts at GAME_BUTTON_NEXT. */
|
||||||
|
const char *m_szGameButtonNames[NUM_GameButton];
|
||||||
GameButton m_SecondaryMenuButton[NUM_MenuButton];
|
GameButton m_SecondaryMenuButton[NUM_MenuButton];
|
||||||
const InputMapping *m_Maps;
|
const InputMapping *m_Maps;
|
||||||
|
|
||||||
@@ -51,6 +51,7 @@ public:
|
|||||||
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;
|
MenuButton GetMenuButtonSecondaryFunction( GameButton gb ) const;
|
||||||
|
const char *GetGameButtonName( 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 ) )
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ RString Style::ColToButtonName( int iCol ) const
|
|||||||
return pzColumnName;
|
return pzColumnName;
|
||||||
|
|
||||||
GameInput GI = StyleInputToGameInput( iCol, PLAYER_1 );
|
GameInput GI = StyleInputToGameInput( iCol, PLAYER_1 );
|
||||||
return INPUTMAPPER->GetInputScheme()->m_GameButtonInfo[GI.button].m_szName;
|
return INPUTMAPPER->GetInputScheme()->GetGameButtonName(GI.button);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lua bindings
|
// Lua bindings
|
||||||
|
|||||||
Reference in New Issue
Block a user