client: instructions when only 1 frame rate is reported
This commit is contained in:
@@ -222,15 +222,19 @@ void settings_video(const settings_context & ctx)
|
||||
auto & default_config = ctx.default_config;
|
||||
const std::string disconnect_tip = ctx.in_game ? _C("tooltip for disabled settings", "Disconnect to change this setting.") : std::string{};
|
||||
std::vector<setting> list;
|
||||
const auto rates = ctx.session.get_refresh_rates();
|
||||
|
||||
if (const auto rates = ctx.session.get_refresh_rates(); not rates.empty())
|
||||
if (not rates.empty())
|
||||
{
|
||||
const auto system_managed = rates.size() < 2;
|
||||
int default_rate_index = index(rates, default_config.preferred_refresh_rate).value_or(-1) + 1;
|
||||
|
||||
list.push_back({
|
||||
.id = "##refresh",
|
||||
.label = _("Refresh rate"),
|
||||
.description = _("Use 'auto' to select the refresh rate based on measured application performance. May cause flicker when a change happens."),
|
||||
.description = system_managed
|
||||
? _("WiVRn can't directly change the refresh rate on this device. See your device's settings to change the refresh rate.")
|
||||
: _("Use 'auto' to select the refresh rate based on measured application performance. May cause flicker when a change happens."),
|
||||
.ui = rates.size() < 7 ? ui_kind::segmented : ui_kind::combo,
|
||||
.get_int = [&config, rates] {
|
||||
for (size_t i = 0; i < rates.size(); ++i)
|
||||
@@ -258,6 +262,7 @@ void settings_video(const settings_context & ctx)
|
||||
opts.push_back(fmt::format("{}", int(r)));
|
||||
return opts; },
|
||||
.default_int = default_rate_index,
|
||||
.enabled = [system_managed] { return not system_managed; },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -280,7 +285,7 @@ void settings_video(const settings_context & ctx)
|
||||
});
|
||||
}
|
||||
|
||||
if (ctx.instance.has_extension(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME))
|
||||
if (rates.size() > 1 && ctx.instance.has_extension(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME))
|
||||
{
|
||||
list.push_back({
|
||||
.id = "##spacewarp",
|
||||
|
||||
Reference in New Issue
Block a user