From 599ab41377d2ab8b05bbee143f3aa12423a2e31b Mon Sep 17 00:00:00 2001 From: iota97 Date: Mon, 11 Jul 2022 14:28:29 +0200 Subject: [PATCH] Dynamic update --- UI/GameSettingsScreen.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 035efcd3d5..b174072751 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1828,18 +1828,19 @@ void DeveloperToolsScreen::CreateViews() { Choice *createTextureIni = list->Add(new Choice(dev->T("Create/Open textures.ini file for current game"))); createTextureIni->OnClick.Handle(this, &DeveloperToolsScreen::OnOpenTexturesIniFile); + createTextureIni->SetEnabledFunc([] { + if (!PSP_IsInited()) + return false; - // Disable the choice to Open/Create if the textures.ini file already exists, and we can't open it due to platform support limitations. - if (!System_GetPropertyBool(SYSPROP_SUPPORTS_OPEN_FILE_IN_EDITOR)) { - std::string gameID = g_paramSFO.GetDiscID(); - if (TextureReplacer::IniExists(gameID)) { - createTextureIni->SetEnabled(false); + // Disable the choice to Open/Create if the textures.ini file already exists, and we can't open it due to platform support limitations. + if (!System_GetPropertyBool(SYSPROP_SUPPORTS_OPEN_FILE_IN_EDITOR)) { + std::string gameID = g_paramSFO.GetDiscID(); + if (TextureReplacer::IniExists(gameID)) { + return false; + } } - } - - if (!PSP_IsInited()) { - createTextureIni->SetEnabled(false); - } + return true; + }); } void DeveloperToolsScreen::onFinish(DialogResult result) {