Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9244 from lioncash/input-panic
InputCommon: Migrate over to fmt-capable panic alerts
  • Loading branch information
leoetlino committed Nov 12, 2020
2 parents 9321204 + d8e1921 commit c991f00
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/Core/InputCommon/InputConfig.cpp
Expand Up @@ -60,18 +60,20 @@ bool InputConfig::LoadConfig(bool isGC)

for (int i = 0; i < 4; i++)
{
if (control_section->Exists(type + "Profile" + std::string(num[i])))
const auto profile_name = fmt::format("{}Profile{}", type, num[i]);

if (control_section->Exists(profile_name))
{
std::string profile_setting;
if (control_section->Get(type + "Profile" + std::string(num[i]), &profile_setting))
if (control_section->Get(profile_name, &profile_setting))
{
auto profiles = InputProfile::GetProfilesFromSetting(
profile_setting, File::GetUserPath(D_CONFIG_IDX) + path);

if (profiles.empty())
{
// TODO: PanicAlert shouldn't be used for this.
PanicAlertT("No profiles found for game setting '%s'", profile_setting.c_str());
PanicAlertFmtT("No profiles found for game setting '{}'", profile_setting);
continue;
}

Expand Down

0 comments on commit c991f00

Please sign in to comment.