diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2014-03-16 23:49:12 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2014-03-16 23:49:12 +0100 |
| commit | fe37a772a467d4d6ef811b7bb402f9be18f3a217 (patch) | |
| tree | 5c987fec2a61c7959eeddfa4fdda12ca49c7c957 /Source/Core | |
| parent | 09dc5c9703c5f9c58280047394a22e0b93eacc1e (diff) | |
| parent | 291c95b78082abd0cbe5ab46a09c7e6869aceb7d (diff) | |
Merge pull request #178 from lioncash/phack-cleanup
Clean up a little bit of the PHackSettings.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinWX/PHackSettings.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/Core/DolphinWX/PHackSettings.cpp b/Source/Core/DolphinWX/PHackSettings.cpp index 2f6921ab04..3326a85ae9 100644 --- a/Source/Core/DolphinWX/PHackSettings.cpp +++ b/Source/Core/DolphinWX/PHackSettings.cpp @@ -87,20 +87,25 @@ void CPHackSettings::CreateGUIControls() void CPHackSettings::LoadPHackData() { std::string sTemp; - char sIndex[15]; + std::string sIndex; PHackChoice->Clear(); PHackChoice->Append(_("[Custom]")); - for (int i=0 ; ; i++) + for (int i = 0; ; i++) { - sprintf(sIndex,"%d",i); + sIndex = std::to_string(i); + if (!PHPresetsIni.Exists(sIndex, "Title")) break; + PHPresetsIni.Get(sIndex, "Title", &sTemp); + if (sTemp.empty()) - sTemp = wxString(_("(UNKNOWN)")).char_str(); + sTemp = WxStrToStr(_("(UNKNOWN)")); + if (i == 0) PHackChoice->Append(StrToWxStr("-------------")); + PHackChoice->Append(StrToWxStr(sTemp)); } PHackChoice->Select(0); @@ -116,12 +121,13 @@ void CPHackSettings::SetRefresh(wxCommandEvent& event) { bool bTemp; std::string sTemp; - char sIndex[15]; + std::string sIndex; + int index = event.GetSelection(); if (index > 1) { index -= 2; - sprintf(sIndex,"%d", index); + sIndex = std::to_string(index); PHPresetsIni.Get(sIndex, "PH_SZNear", &bTemp); PHackSZNear->Set3StateValue((wxCheckBoxState)bTemp); |
