@@ -9,7 +9,7 @@ BindContext::BindContext( const pString& name )
9
9
10
10
void BindContext::LoadFromConfig ( Config& cfg, const pVector<pString> descriptions ) {
11
11
for ( auto & title : m_ActionTitleToAction ) {
12
- pString keyName = cfg.GetString ( m_Name + " . primary." + title.first , SDL_GetScancodeName ( title.second .DefaultScancode ),
12
+ pString keyName = cfg.GetString ( m_Name + " primary." + title.first , SDL_GetScancodeName ( title.second .DefaultScancode ),
13
13
descriptions.at ( static_cast <int >( title.second .Action ) ) );
14
14
if ( keyName != " " ) {
15
15
SDL_Scancode scanCode = SDL_GetScancodeFromName ( keyName.c_str () );
@@ -21,7 +21,7 @@ void BindContext::LoadFromConfig( Config& cfg, const pVector<pString> descriptio
21
21
}
22
22
}
23
23
for ( auto & title : m_ActionTitleToAction ) {
24
- pString keyName = cfg.GetString ( m_Name + " . secondary." + title.first , " " , descriptions.at ( static_cast <int >( title.second .Action ) ) );
24
+ pString keyName = cfg.GetString ( m_Name + " secondary." + title.first , " " , descriptions.at ( static_cast <int >( title.second .Action ) ) );
25
25
if ( keyName != " " ) {
26
26
SDL_Scancode scanCode = SDL_GetScancodeFromName ( keyName.c_str () );
27
27
if ( scanCode == SDL_SCANCODE_UNKNOWN ) {
@@ -33,7 +33,7 @@ void BindContext::LoadFromConfig( Config& cfg, const pVector<pString> descriptio
33
33
}
34
34
for ( auto & title : m_ActionTitleToAction ) {
35
35
pString buttonName =
36
- cfg.GetString ( m_Name + " . gamepad." + title.first , title.second .DefaultButton != SDL_CONTROLLER_BUTTON_INVALID ? SDL_GameControllerGetStringForButton (
36
+ cfg.GetString ( m_Name + " gamepad." + title.first , title.second .DefaultButton != SDL_CONTROLLER_BUTTON_INVALID ? SDL_GameControllerGetStringForButton (
37
37
title.second .DefaultButton ) : " " ,
38
38
descriptions.at ( static_cast <int >( title.second .Action ) ) );
39
39
if ( buttonName != " " ) {
@@ -50,15 +50,15 @@ void BindContext::LoadFromConfig( Config& cfg, const pVector<pString> descriptio
50
50
void BindContext::SaveToConfig ( Config& cfg ) const {
51
51
for ( auto & keybinding : m_ActionTitleToAction ) {
52
52
SDL_Scancode primary = m_KeyBindingCollection.GetPrimaryScancodeFromAction ( keybinding.second .Action );
53
- cfg.SetString ( m_Name + " . primary." + keybinding.first , SDL_GetScancodeName ( primary ) );
53
+ cfg.SetString ( m_Name + " primary." + keybinding.first , SDL_GetScancodeName ( primary ) );
54
54
}
55
55
for ( auto & keybinding : m_ActionTitleToAction ) {
56
56
SDL_Scancode secondary = m_KeyBindingCollection.GetSecondaryScancodeFromAction ( keybinding.second .Action );
57
- cfg.SetString ( m_Name + " . secondary." + keybinding.first , SDL_GetScancodeName ( secondary ) );
57
+ cfg.SetString ( m_Name + " secondary." + keybinding.first , SDL_GetScancodeName ( secondary ) );
58
58
}
59
59
for ( auto & buttonBinding : m_ActionTitleToAction ) {
60
60
SDL_GameControllerButton button = m_GamepadBindingCollection.GetButtonFromAction ( buttonBinding.second .Action );
61
- cfg.SetString ( m_Name + " . gamepad." + buttonBinding.first , SDL_GameControllerGetStringForButton ( button ) );
61
+ cfg.SetString ( m_Name + " gamepad." + buttonBinding.first , SDL_GameControllerGetStringForButton ( button ) );
62
62
}
63
63
}
64
64
0 commit comments