Merge pull request #9244 from lioncash/input-panic

InputCommon: Migrate over to fmt-capable panic alerts
This commit is contained in:
Léo Lam 2020-11-12 14:41:50 +01:00 committed by GitHub
commit c991f00479
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,10 +60,12 @@ 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);
@ -71,7 +73,7 @@ bool InputConfig::LoadConfig(bool isGC)
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;
}