From 89e0de2314742a2900212cfd92d2274372b41778 Mon Sep 17 00:00:00 2001 From: Cody Glassman Date: Sat, 30 Jul 2022 08:07:24 +0000 Subject: [PATCH] Bring back empty script message --- apps/openmw/mwgui/settingswindow.cpp | 4 +++- apps/openmw/mwgui/settingswindow.hpp | 1 + files/data/l10n/SettingsMenu/en.yaml | 1 + files/data/l10n/SettingsMenu/ru.yaml | 1 + files/data/mygui/openmw_settings_window.layout | 9 ++++++++- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index eab0f572b0..f333ff2727 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -268,6 +268,7 @@ namespace MWGui getWidget(mScriptBox, "ScriptBox"); getWidget(mScriptView, "ScriptView"); getWidget(mScriptAdapter, "ScriptAdapter"); + getWidget(mScriptDisabled, "ScriptDisabled"); #ifndef WIN32 // hide gamma controls since it currently does not work under Linux @@ -899,11 +900,12 @@ namespace MWGui for (const WeightedPage& weightedPage : weightedPages) mScriptList->addItem(weightedPage.mName, weightedPage.mIndex); - // Hide script settings tab when the game world isn't loaded and scripts couldn't add their settings + // Hide script settings when the game world isn't loaded bool disabled = LuaUi::scriptSettingsPageCount() == 0; mScriptFilter->setVisible(!disabled); mScriptList->setVisible(!disabled); mScriptBox->setVisible(!disabled); + mScriptDisabled->setVisible(disabled); LuaUi::attachPageAt(mCurrentPage, mScriptAdapter); mScriptView->setCanvasSize(mScriptAdapter->getSize()); diff --git a/apps/openmw/mwgui/settingswindow.hpp b/apps/openmw/mwgui/settingswindow.hpp index 451ba7a7a5..5851457e9c 100644 --- a/apps/openmw/mwgui/settingswindow.hpp +++ b/apps/openmw/mwgui/settingswindow.hpp @@ -53,6 +53,7 @@ namespace MWGui MyGUI::EditBox* mScriptFilter; MyGUI::ListBox* mScriptList; MyGUI::Widget* mScriptBox; + MyGUI::Widget* mScriptDisabled; MyGUI::ScrollView* mScriptView; LuaUi::LuaAdapter* mScriptAdapter; int mCurrentPage; diff --git a/files/data/l10n/SettingsMenu/en.yaml b/files/data/l10n/SettingsMenu/en.yaml index d57377ceef..3af577967e 100644 --- a/files/data/l10n/SettingsMenu/en.yaml +++ b/files/data/l10n/SettingsMenu/en.yaml @@ -45,6 +45,7 @@ ReflectionShaderDetailWorld: "World" Refraction: "Refraction" Screenshot: "Screenshot" Scripts: "Scripts" +ScriptsDisabled: "Load a game to access script settings." SecondaryLanguage: "Secondary Language" SecondaryLanguageTooltip: "Localization files for this language may be used if the primary language files lack the necessary lines." TextureFiltering: "Texture Filtering" diff --git a/files/data/l10n/SettingsMenu/ru.yaml b/files/data/l10n/SettingsMenu/ru.yaml index 5108702adf..528aff49a1 100644 --- a/files/data/l10n/SettingsMenu/ru.yaml +++ b/files/data/l10n/SettingsMenu/ru.yaml @@ -45,6 +45,7 @@ ReflectionShaderDetailWorld: "Мир" Refraction: "Рефракция" Screenshot: "Снимок экрана" Scripts: "Скрипты" +ScriptsDisabled: "Загрузите игру, чтобы получить доступ к настройкам скриптов." SecondaryLanguage: "Дополнительный язык" SecondaryLanguageTooltip: "Язык, строки на котором будут использоваться, если соответствующие строки на основном языке не найдены." TextureFiltering: "Фильтрация текстур" diff --git a/files/data/mygui/openmw_settings_window.layout b/files/data/mygui/openmw_settings_window.layout index 0d6d68d6c7..79afa0687b 100644 --- a/files/data/mygui/openmw_settings_window.layout +++ b/files/data/mygui/openmw_settings_window.layout @@ -639,10 +639,17 @@ + + + + + + + + -