Permalink
Browse files

Merge pull request #10218 from LunaMoo/minorUI

Hide post process option in unsupported backends(d3d9)
  • Loading branch information...
hrydgard committed Dec 1, 2017
2 parents 24e5fbc + 3b98b37 commit 495b743f6fdeabc2bcfa46eb89c15c703105310e
Showing with 21 additions and 13 deletions.
  1. +8 −5 UI/GameSettingsScreen.cpp
  2. +13 −8 Windows/MainWindowMenu.cpp
View
@@ -256,11 +256,14 @@ void GameSettingsScreen::CreateViews() {
altSpeed->SetZeroLabel(gr->T("Unlimited"));
graphicsSettings->Add(new ItemHeader(gr->T("Features")));
I18NCategory *ps = GetI18NCategory("PostShaders");
postProcChoice_ = graphicsSettings->Add(new ChoiceWithValueDisplay(&g_Config.sPostShaderName, gr->T("Postprocessing Shader"), ps->GetName()));
postProcChoice_->OnClick.Handle(this, &GameSettingsScreen::OnPostProcShader);
postProcEnable_ = !g_Config.bSoftwareRendering && (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE);
postProcChoice_->SetEnabledPtr(&postProcEnable_);
// Hide postprocess option on unsupported backends to avoid confusion.
if (g_Config.iGPUBackend != GPU_BACKEND_DIRECT3D9) {
I18NCategory *ps = GetI18NCategory("PostShaders");
postProcChoice_ = graphicsSettings->Add(new ChoiceWithValueDisplay(&g_Config.sPostShaderName, gr->T("Postprocessing Shader"), ps->GetName()));
postProcChoice_->OnClick.Handle(this, &GameSettingsScreen::OnPostProcShader);
postProcEnable_ = !g_Config.bSoftwareRendering && (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE);
postProcChoice_->SetEnabledPtr(&postProcEnable_);
}
#if !defined(MOBILE_DEVICE)
graphicsSettings->Add(new CheckBox(&g_Config.bFullScreen, gr->T("FullScreen")))->OnClick.Handle(this, &GameSettingsScreen::OnFullscreenChange);
View
@@ -195,16 +195,21 @@ namespace MainWindow {
const char *translatedShaderName = nullptr;
availableShaders.clear();
for (auto i = info.begin(); i != info.end(); ++i) {
checkedStatus = MF_UNCHECKED;
availableShaders.push_back(i->section);
if (g_Config.sPostShaderName == i->section) {
checkedStatus = MF_CHECKED;
}
if (g_Config.iGPUBackend == GPU_BACKEND_DIRECT3D9) {
translatedShaderName = ps->T("Not available in Direct3D9 backend");
AppendMenu(shaderMenu, MF_STRING | MF_BYPOSITION | MF_GRAYED, item++, ConvertUTF8ToWString(translatedShaderName).c_str());
} else {
for (auto i = info.begin(); i != info.end(); ++i) {
checkedStatus = MF_UNCHECKED;
availableShaders.push_back(i->section);
if (g_Config.sPostShaderName == i->section) {
checkedStatus = MF_CHECKED;
}
translatedShaderName = ps->T(i->section.c_str());
translatedShaderName = ps->T(i->section.c_str());
AppendMenu(shaderMenu, MF_STRING | MF_BYPOSITION | checkedStatus, item++, ConvertUTF8ToWString(translatedShaderName).c_str());
AppendMenu(shaderMenu, MF_STRING | MF_BYPOSITION | checkedStatus, item++, ConvertUTF8ToWString(translatedShaderName).c_str());
}
}
menuShaderInfo = info;

0 comments on commit 495b743

Please sign in to comment.