diff --git a/Source/Core/InputCommon/Src/SDL.h b/Source/Core/InputCommon/Src/SDL.h index 803c29b329..c3b0597954 100644 --- a/Source/Core/InputCommon/Src/SDL.h +++ b/Source/Core/InputCommon/Src/SDL.h @@ -86,7 +86,6 @@ struct CONTROLLER_MAPPING // GC PAD MAPPING int triggertype; // Triggers range std::string SDiagonal; bool bSquareToCircle; - bool bNoTriggerFilter; int eventnum; // Linux Event Number, Can't be found dynamically yet }; @@ -181,7 +180,6 @@ struct CONTROLLER_MAPPING_NEW // GC PAD MAPPING int triggertype; // SDL or XInput trigger std::string SDiagonal; bool bSquareToCircle; - bool bNoTriggerFilter; }; //////////////////////////// diff --git a/Source/Plugins/Plugin_Wiimote/Src/Config.cpp b/Source/Plugins/Plugin_Wiimote/Src/Config.cpp index dbd0ed7353..4d952bf4a9 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/Config.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/Config.cpp @@ -59,6 +59,7 @@ void Config::Load(bool ChangePad) // Slot specific settings // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ std::string SectionName = StringFromFormat("Wiimote%i", i + 1); + iniFile.Get(SectionName.c_str(), "NoTriggerFilter", &bNoTriggerFilter, false); // Don't update this when we are loading settings from the ConfigBox if(!ChangePad) @@ -91,7 +92,6 @@ void Config::Load(bool ChangePad) iniFile.Get(SectionName.c_str(), "TriggerType", &WiiMoteEmu::PadMapping[i].triggertype, 0); iniFile.Get(SectionName.c_str(), "Diagonal", &WiiMoteEmu::PadMapping[i].SDiagonal, "100%"); iniFile.Get(SectionName.c_str(), "SquareToCircle", &WiiMoteEmu::PadMapping[i].bSquareToCircle, false); - iniFile.Get(SectionName.c_str(), "NoTriggerFilter", &WiiMoteEmu::PadMapping[i].bNoTriggerFilter, false); } // ============================= Console::Print("Load()\n"); @@ -124,6 +124,7 @@ void Config::Save() // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ std::string SectionName = StringFromFormat("Wiimote%i", i + 1); iniFile.Set(SectionName.c_str(), "Enabled", WiiMoteEmu::PadMapping[i].enabled); + iniFile.Set(SectionName.c_str(), "NoTriggerFilter", bNoTriggerFilter); // Save the physical device ID number iniFile.Set(SectionName.c_str(), "DeviceID", WiiMoteEmu::PadMapping[i].ID); @@ -154,7 +155,6 @@ void Config::Save() iniFile.Set(SectionName.c_str(), "TriggerType", WiiMoteEmu::PadMapping[i].triggertype); //iniFile.Set(SectionName.c_str(), "Diagonal", PadMapping[i].SDiagonal); //iniFile.Set(SectionName.c_str(), "SquareToCircle", PadMapping[i].bSquareToCircle); - iniFile.Set(SectionName.c_str(), "NoTriggerFilter", WiiMoteEmu::PadMapping[i].bNoTriggerFilter); // ====================================== } diff --git a/Source/Plugins/Plugin_Wiimote/Src/Config.h b/Source/Plugins/Plugin_Wiimote/Src/Config.h index 5e10225603..7139eed991 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/Config.h +++ b/Source/Plugins/Plugin_Wiimote/Src/Config.h @@ -33,6 +33,9 @@ struct Config bool bConnectRealWiimote, bUseRealWiimote, bUpdateRealWiimote; int iAccNeutralX, iAccNeutralY, iAccNeutralZ; int iAccNunNeutralX, iAccNunNeutralY, iAccNunNeutralZ; + + // Gamepad + bool bNoTriggerFilter; }; extern Config g_Config; diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp index fc1631ca19..34be1853c7 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp @@ -254,7 +254,7 @@ void ConfigDialog::DoGetButtons(int GetId) bool Hat = false; // No hats allowed - bool NoTriggerFilter = WiiMoteEmu::PadMapping[Controller].bNoTriggerFilter; + bool NoTriggerFilter = g_Config.bNoTriggerFilter; // Values used in this function char format[128]; diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp index 2c8adda1e8..7bbd0a8ac8 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp @@ -109,6 +109,7 @@ void Config::Save(int Slot) file.Set("General", "ShowAdvanced", g_Config.bShowAdvanced); file.Set("General", "SaveByID", g_Config.bSaveByID); file.Set("General", "CheckForFocus", g_Config.bCheckFocus); + file.Set("General", "NoTriggerFilter", g_Config.bNoTriggerFilter); // ======================== for (int i = 0; i < 4; i++) @@ -167,8 +168,7 @@ void Config::Save(int Slot) file.Set(SectionName.c_str(), "eventnum", PadMapping[i].eventnum); file.Set(SectionName.c_str(), "Diagonal", PadMapping[i].SDiagonal); - file.Set(SectionName.c_str(), "SquareToCircle", PadMapping[i].bSquareToCircle); - file.Set(SectionName.c_str(), "AdvancedMapFilter", PadMapping[i].bNoTriggerFilter); + file.Set(SectionName.c_str(), "SquareToCircle", PadMapping[i].bSquareToCircle); // ====================================== // Debugging @@ -197,6 +197,8 @@ void Config::Load(bool ChangePad, bool ChangeSaveByID) // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ file.Get("General", "ShowAdvanced", &g_Config.bShowAdvanced, false); file.Get("General", "CheckForFocus", &g_Config.bCheckFocus, false); + file.Get("General", "NoTriggerFilter", &g_Config.bNoTriggerFilter, false); + if(!ChangeSaveByID) { file.Get("General", "SaveByID", &Tmp, false); g_Config.bSaveByID = Tmp; @@ -255,7 +257,6 @@ void Config::Load(bool ChangePad, bool ChangeSaveByID) file.Get(SectionName.c_str(), "Diagonal", &PadMapping[i].SDiagonal, "100%"); file.Get(SectionName.c_str(), "SquareToCircle", &Tmp, false); PadMapping[i].bSquareToCircle = Tmp; - file.Get(SectionName.c_str(), "AdvancedMapFilter", &Tmp, false); PadMapping[i].bNoTriggerFilter = Tmp; // ============================= // Debugging diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.h b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.h index de1a91e86a..6dec72a99b 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.h +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.h @@ -29,6 +29,7 @@ struct Config bool bShowAdvanced; // Only allow one of these bool bSaveByID; bool bCheckFocus; + bool bNoTriggerFilter; }; extern Config g_Config; diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp index d745935257..df8ce9c43f 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp @@ -426,6 +426,7 @@ void ConfigBox::ChangeSettings( wxCommandEvent& event ) } SizeWindow(); break; + // Advanced settings case IDCB_CHECKFOCUS: g_Config.bCheckFocus = m_CBCheckFocus[notebookpage]->IsChecked(); for(int i = 0; i < 4; i++) @@ -433,9 +434,21 @@ void ConfigBox::ChangeSettings( wxCommandEvent& event ) m_CBCheckFocus[i]->SetValue(g_Config.bCheckFocus); } break; + case IDCB_FILTER_SETTINGS: + g_Config.bNoTriggerFilter = m_AdvancedMapFilter[notebookpage]->IsChecked(); + for(int i = 0; i < 4; i++) + { + m_AdvancedMapFilter[i]->SetValue(g_Config.bNoTriggerFilter); + } + break; + case IDC_CONTROLTYPE: case IDC_TRIGGERTYPE: - //UpdateGUI(notebookpage); + if(!g_Config.bSaveByID) + { + PadMapping[notebookpage].controllertype = m_ControlType[notebookpage]->GetSelection(); + UpdateGUI(notebookpage); + } break; case IDC_JOYNAME: @@ -506,6 +519,7 @@ void ConfigBox::UpdateGUI(int _notebookpage) m_CBSaveByID[_notebookpage]->SetValue(g_Config.bSaveByID); m_CBShowAdvanced[_notebookpage]->SetValue(g_Config.bShowAdvanced); m_CBCheckFocus[_notebookpage]->SetValue(g_Config.bCheckFocus); + m_AdvancedMapFilter[_notebookpage]->SetValue(g_Config.bNoTriggerFilter); LogMsg("Update: %i\n", g_Config.bSaveByID); diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp index 3d80ecb3c7..367beb2780 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp @@ -79,14 +79,14 @@ void ConfigBox::UpdateGUIButtonMapping(int controller) m_Deadzone[controller]->SetSelection(PadMapping[controller].deadzone); m_CoBDiagonal[controller]->SetValue(wxString::FromAscii(PadMapping[controller].SDiagonal.c_str())); m_CBS_to_C[controller]->SetValue(PadMapping[controller].bSquareToCircle); - m_AdvancedMapFilter[controller]->SetValue(PadMapping[controller].bNoTriggerFilter); + m_AdvancedMapFilter[controller]->SetValue(g_Config.bNoTriggerFilter); //LogMsg("m_TriggerType[%i] = %i\n", controller, PadMapping[controller].triggertype); // Update D-Pad if(PadMapping[controller].controllertype == InputCommon::CTL_DPAD_HAT) { - tmp << PadMapping[controller].dpad; m_JoyDpadUp[controller]->SetValue(tmp); tmp.clear(); + tmp << PadMapping[controller].dpad; m_JoyDpadDown[controller]->SetValue(tmp); tmp.clear(); } else { @@ -122,8 +122,7 @@ void ConfigBox::SaveButtonMapping(int controller, bool DontChangeId, int FromSlo PadMapping[controller].triggertype = m_TriggerType[FromSlot]->GetSelection(); PadMapping[controller].deadzone = m_Deadzone[FromSlot]->GetSelection(); PadMapping[controller].SDiagonal = m_CoBDiagonal[FromSlot]->GetLabel().mb_str(); - PadMapping[controller].bSquareToCircle = m_CBS_to_C[FromSlot]->IsChecked(); - PadMapping[controller].bNoTriggerFilter = m_AdvancedMapFilter[FromSlot]->IsChecked(); + PadMapping[controller].bSquareToCircle = m_CBS_to_C[FromSlot]->IsChecked(); // The analog buttons m_JoyAnalogMainX[FromSlot]->GetValue().ToLong(&value); PadMapping[controller].axis[InputCommon::CTL_MAIN_X] = value; tmp.clear(); @@ -152,7 +151,7 @@ void ConfigBox::SaveButtonMapping(int controller, bool DontChangeId, int FromSlo // The digital pad if(PadMapping[controller].controllertype == InputCommon::CTL_DPAD_HAT) { - m_JoyDpadUp[FromSlot]->GetValue().ToLong(&value); PadMapping[controller].dpad = value; tmp.clear(); + m_JoyDpadDown[FromSlot]->GetValue().ToLong(&value); PadMapping[controller].dpad = value; tmp.clear(); } else { @@ -297,7 +296,7 @@ void ConfigBox::DoGetButtons(int GetId) bool Hat = (GetId >= IDB_DPAD_UP && GetId <= IDB_DPAD_RIGHT) // All DPads && (PadMapping[Controller].controllertype == InputCommon::CTL_DPAD_HAT); // Not with the hat option defined - bool NoTriggerFilter = PadMapping[Controller].bNoTriggerFilter; + bool NoTriggerFilter = g_Config.bNoTriggerFilter; // Values used in this function char format[128];