mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-28 14:20:30 +00:00
GameDatabase: Missing newline in compatibility report
And refactor the Append*Setting() functions to reduce duplication.
This commit is contained in:
parent
0c3ad8a78b
commit
69399f3449
@ -841,6 +841,15 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
|
|||||||
#undef BIT_FOR
|
#undef BIT_FOR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void AppendSettingsHeading(SmallStringBase& str, bool& heading)
|
||||||
|
{
|
||||||
|
if (!heading)
|
||||||
|
{
|
||||||
|
heading = true;
|
||||||
|
str.append_format("**{}**\n\n", TRANSLATE_SV("GameDatabase", "Settings"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static inline void AppendIntegerSetting(SmallStringBase& str, bool& heading, std::string_view title,
|
static inline void AppendIntegerSetting(SmallStringBase& str, bool& heading, std::string_view title,
|
||||||
const std::optional<T>& value)
|
const std::optional<T>& value)
|
||||||
@ -848,12 +857,7 @@ static inline void AppendIntegerSetting(SmallStringBase& str, bool& heading, std
|
|||||||
if (!value.has_value())
|
if (!value.has_value())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!heading)
|
AppendSettingsHeading(str, heading);
|
||||||
{
|
|
||||||
heading = true;
|
|
||||||
str.append_format("**{}**\n\n", TRANSLATE_SV("GameDatabase", "Settings"));
|
|
||||||
}
|
|
||||||
|
|
||||||
str.append_format(" - {}: {}\n", title, value.value());
|
str.append_format(" - {}: {}\n", title, value.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -863,12 +867,7 @@ static inline void AppendFloatSetting(SmallStringBase& str, bool& heading, std::
|
|||||||
if (!value.has_value())
|
if (!value.has_value())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!heading)
|
AppendSettingsHeading(str, heading);
|
||||||
{
|
|
||||||
heading = true;
|
|
||||||
str.append_format("**{}**\n\n", TRANSLATE_SV("GameDatabase", "Settings"));
|
|
||||||
}
|
|
||||||
|
|
||||||
str.append_format(" - {}: {:.2f}\n", title, value.value());
|
str.append_format(" - {}: {:.2f}\n", title, value.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -879,12 +878,7 @@ static inline void AppendEnumSetting(SmallStringBase& str, bool& heading, std::s
|
|||||||
if (!value.has_value())
|
if (!value.has_value())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!heading)
|
AppendSettingsHeading(str, heading);
|
||||||
{
|
|
||||||
heading = true;
|
|
||||||
str.append_format("**{}**\n\n", TRANSLATE_SV("GameDatabase", "Settings"));
|
|
||||||
}
|
|
||||||
|
|
||||||
str.append_format(" - {}: {}\n", title, get_display_name_func(value.value()));
|
str.append_format(" - {}: {}\n", title, get_display_name_func(value.value()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -958,6 +952,9 @@ std::string GameDatabase::Entry::GenerateCompatibilityReport() const
|
|||||||
AppendEnumSetting(ret, settings_heading, TRANSLATE_SV("GameDatabase", "GPU Line Detect Mode"),
|
AppendEnumSetting(ret, settings_heading, TRANSLATE_SV("GameDatabase", "GPU Line Detect Mode"),
|
||||||
&Settings::GetLineDetectModeDisplayName, gpu_line_detect_mode);
|
&Settings::GetLineDetectModeDisplayName, gpu_line_detect_mode);
|
||||||
|
|
||||||
|
if (settings_heading)
|
||||||
|
ret.append("\n");
|
||||||
|
|
||||||
if (!disc_set_name.empty())
|
if (!disc_set_name.empty())
|
||||||
{
|
{
|
||||||
ret.append_format("**{}:** {}\n", TRANSLATE_SV("GameDatabase", "Disc Set"), disc_set_name);
|
ret.append_format("**{}:** {}\n", TRANSLATE_SV("GameDatabase", "Disc Set"), disc_set_name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user