FullscreenUI: Don't show fullscreen resolution when unsupported

pull/3718/head
Stenzek 5 months ago
parent f5d8fbd70a
commit 57a3dc4071
No known key found for this signature in database

@ -4157,29 +4157,31 @@ void FullscreenUI::DrawGraphicsSettingsPage()
std::optional<SmallString> strvalue = bsi->GetOptionalSmallStringValue(
"GPU", "FullscreenMode", game_settings ? std::nullopt : std::optional<const char*>(""));
if (MenuActionButton(FSUI_ICONVSTR(ICON_FA_TV, "Fullscreen Resolution"),
FSUI_VSTR("Selects the resolution to use in fullscreen modes."),
strvalue.has_value() ?
(strvalue->empty() ? FSUI_VSTR("Borderless Fullscreen") : strvalue->view()) :
FSUI_VSTR("Use Global Setting")))
const GPUDevice::AdapterInfo* selected_adapter = nullptr;
if (current_adapter.has_value() && !current_adapter->empty())
{
const GPUDevice::AdapterInfo* selected_adapter = nullptr;
if (current_adapter.has_value() && !current_adapter->empty())
for (const GPUDevice::AdapterInfo& ai : s_settings_locals.graphics_adapter_list_cache)
{
for (const GPUDevice::AdapterInfo& ai : s_settings_locals.graphics_adapter_list_cache)
if (ai.name == current_adapter->view())
{
if (ai.name == current_adapter->view())
{
selected_adapter = &ai;
break;
}
selected_adapter = &ai;
break;
}
}
else
{
if (!s_settings_locals.graphics_adapter_list_cache.empty())
selected_adapter = &s_settings_locals.graphics_adapter_list_cache.front();
}
}
else
{
if (!s_settings_locals.graphics_adapter_list_cache.empty())
selected_adapter = &s_settings_locals.graphics_adapter_list_cache.front();
}
if (selected_adapter && !selected_adapter->fullscreen_modes.empty() &&
MenuActionButton(FSUI_ICONVSTR(ICON_FA_TV, "Fullscreen Resolution"),
FSUI_VSTR("Selects the resolution to use in fullscreen modes."),
strvalue.has_value() ?
(strvalue->empty() ? FSUI_VSTR("Borderless Fullscreen") : strvalue->view()) :
FSUI_VSTR("Use Global Setting")))
{
ChoiceDialogOptions options;
options.reserve((selected_adapter ? selected_adapter->fullscreen_modes.size() : 0) + 2);

Loading…
Cancel
Save