only save mappings for user-changable mapping slots (less cluttered keymaps.ini)

This commit is contained in:
Chris Danford
2006-01-26 06:05:35 +00:00
parent 73afc606b5
commit e507e4ab9e
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -526,7 +526,7 @@ void InputMapper::SaveMappingsToDisk()
RString sNameString = GameI.toString( pGame );
vector<RString> asValues;
for( int slot = 0; slot < NUM_GAME_TO_DEVICE_SLOTS; ++slot )
for( int slot = 0; slot < NUM_USER_GAME_TO_DEVICE_SLOTS; ++slot ) // don't save data from the last (keyboard automap) slot
asValues.push_back( m_GItoDI[i][j][slot].ToString() );
while( asValues.size() && asValues.back() == "" )
+2
View File
@@ -10,6 +10,8 @@
#include "GameConstantsAndTypes.h"
const int NUM_GAME_TO_DEVICE_SLOTS = 5; // five device inputs may map to one game input
const int NUM_SHOWN_GAME_TO_DEVICE_SLOTS = 3;
const int NUM_USER_GAME_TO_DEVICE_SLOTS = 2;
class InputMapper
{
+2 -2
View File
@@ -14,9 +14,9 @@
#include "InputEventPlus.h"
#include "LocalizedString.h"
#define BUTTONS_TO_MAP THEME->GetMetric ( m_sName, "ButtonsToMap" )
#define BUTTONS_TO_MAP THEME->GetMetric ( m_sName, "ButtonsToMap" )
static LocalizedString INVALID_BUTTON ( "ScreenMapControllers", "InvalidButton" );
#define MAPPED_TO_COMMAND(gc,slot) THEME->GetMetricA( m_sName, ssprintf("MappedToP%iS%iCommand", gc+1, slot+1) )
#define MAPPED_TO_COMMAND(gc,slot) THEME->GetMetricA( m_sName, ssprintf("MappedToP%iS%iCommand", gc+1, slot+1) )
static const float g_fSecondsToWaitForInput = 0.05f;