From 370807281f9b5d50a7070ba02d210718ada1301d Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 7 Aug 2023 22:31:56 +0400 Subject: [PATCH 1/6] Do not use deprecated MyGUI features for progress bars --- .../data/mygui/openmw_hud_energybar.skin.xml | 79 ++++++++++--------- files/data/mygui/openmw_progress.skin.xml | 68 ++++++++-------- 2 files changed, 78 insertions(+), 69 deletions(-) diff --git a/files/data/mygui/openmw_hud_energybar.skin.xml b/files/data/mygui/openmw_hud_energybar.skin.xml index dab5bcfb2b..e1a0dbe2a9 100644 --- a/files/data/mygui/openmw_hud_energybar.skin.xml +++ b/files/data/mygui/openmw_hud_energybar.skin.xml @@ -59,51 +59,58 @@ - - - - - - - - - - - - - + + + + + + + - - - - - - + + + + + + + - - - - - - + + + + + + + - - - - - - + + + + + + + - - - + + + + + + + + - - + + + + + + + diff --git a/files/data/mygui/openmw_progress.skin.xml b/files/data/mygui/openmw_progress.skin.xml index 177b53b7a3..1f860f550d 100644 --- a/files/data/mygui/openmw_progress.skin.xml +++ b/files/data/mygui/openmw_progress.skin.xml @@ -49,46 +49,48 @@ - - - - - - + + + + + + + - - - - - - + + + + + + + - - - - - - + + + + + + + - - - - + + + + + + - - - - - - - - - - - + + + + + + + + From f3cf61627c4a218890c0f5dda9a24da77bb2d4b7 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 8 Aug 2023 09:06:05 +0400 Subject: [PATCH 2/6] Do not use deprecated MyGUI features for list boxes --- components/fontloader/fontloader.cpp | 19 ++++++++- files/data/mygui/openmw_list.skin.xml | 55 +++++++++++++-------------- 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/components/fontloader/fontloader.cpp b/components/fontloader/fontloader.cpp index fcee1bcd28..5a94e1aeed 100644 --- a/components/fontloader/fontloader.cpp +++ b/components/fontloader/fontloader.cpp @@ -610,6 +610,7 @@ namespace Gui void FontLoader::overrideLineHeight(MyGUI::xml::ElementPtr _node, const std::string& _file, MyGUI::Version _version) { + // We should adjust line height for MyGUI widgets depending on font size MyGUI::xml::ElementEnumerator resourceNode = _node->getElementEnumerator(); while (resourceNode.next("Resource")) { @@ -618,11 +619,27 @@ namespace Gui if (Misc::StringUtils::ciEqual(type, "ResourceSkin") || Misc::StringUtils::ciEqual(type, "AutoSizedResourceSkin")) { - // We should adjust line height for MyGUI widgets depending on font size + MyGUI::xml::ElementPtr heightNode = resourceNode->createChild("Property"); heightNode->addAttribute("key", "HeightLine"); heightNode->addAttribute("value", std::to_string(Settings::gui().mFontSize + 2)); } + + if (Misc::StringUtils::ciEqual(type, "ResourceLayout")) + { + MyGUI::xml::ElementEnumerator resourceRootNode = resourceNode->getElementEnumerator(); + while (resourceRootNode.next("Widget")) + { + if (resourceRootNode->findAttribute("name") != "Root") + continue; + + MyGUI::xml::ElementPtr heightNode = resourceRootNode->createChild("UserString"); + heightNode->addAttribute("key", "HeightLine"); + heightNode->addAttribute("value", std::to_string(Settings::gui().mFontSize + 2)); + + break; + } + } } MyGUI::ResourceManager::getInstance().loadFromXmlNode(_node, _file, _version); diff --git a/files/data/mygui/openmw_list.skin.xml b/files/data/mygui/openmw_list.skin.xml index 9a54a10683..9ec1a9326a 100644 --- a/files/data/mygui/openmw_list.skin.xml +++ b/files/data/mygui/openmw_list.skin.xml @@ -123,39 +123,36 @@ - - - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + From a2d509a4b5d419433e34aa24743d49701d42e7d8 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 8 Aug 2023 09:29:48 +0400 Subject: [PATCH 3/6] Do not use deprecated MyGUI features for scrollbars --- files/data/mygui/openmw_list.skin.xml | 87 ++++++++++++++------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/files/data/mygui/openmw_list.skin.xml b/files/data/mygui/openmw_list.skin.xml index 9ec1a9326a..75f4b9e850 100644 --- a/files/data/mygui/openmw_list.skin.xml +++ b/files/data/mygui/openmw_list.skin.xml @@ -4,39 +4,40 @@ - - - - - - + + + + + + + - - - + + + - + - + - + - - + + - + - - + + - - + + - + + - @@ -47,41 +48,41 @@ - - - - - + + + + + + - - - + + + - + - + - + - - + + - + - - + + - - + + - - - + + + - From 3fe5cc497bf562ffa289331e8666f86d27626ee4 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 8 Aug 2023 09:31:24 +0400 Subject: [PATCH 4/6] Add a changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcf13ef602..fb1674d245 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,6 +89,7 @@ Feature #7284: Searching in the console with regex and toggleable case-sensitivity Feature #7477: NegativeLight Magic Effect flag Feature #7499: OpenMW-CS: Generate record filters by drag & dropping cell content to the filters field + Task #5896: Do not use deprecated MyGUI properties Task #7113: Move from std::atoi to std::from_char Task #7117: Replace boost::scoped_array with std::vector Task #7151: Do not use std::strerror to get errno error message From 5cfd21e9ab1e2a301d2ad62c0786915eec10dd8b Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 8 Aug 2023 09:48:40 +0400 Subject: [PATCH 5/6] Do not place deprecated MyGUI property dynamically --- components/fontloader/fontloader.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/components/fontloader/fontloader.cpp b/components/fontloader/fontloader.cpp index 5a94e1aeed..9434578220 100644 --- a/components/fontloader/fontloader.cpp +++ b/components/fontloader/fontloader.cpp @@ -616,15 +616,6 @@ namespace Gui { std::string type = resourceNode->findAttribute("type"); - if (Misc::StringUtils::ciEqual(type, "ResourceSkin") - || Misc::StringUtils::ciEqual(type, "AutoSizedResourceSkin")) - { - - MyGUI::xml::ElementPtr heightNode = resourceNode->createChild("Property"); - heightNode->addAttribute("key", "HeightLine"); - heightNode->addAttribute("value", std::to_string(Settings::gui().mFontSize + 2)); - } - if (Misc::StringUtils::ciEqual(type, "ResourceLayout")) { MyGUI::xml::ElementEnumerator resourceRootNode = resourceNode->getElementEnumerator(); From 84e44cedc22540ac836a471a5a477ca6059da8d8 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 8 Aug 2023 11:29:58 +0400 Subject: [PATCH 6/6] Remove redundant configuration --- extern/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 864237ed31..9a536069e6 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -69,10 +69,6 @@ if(NOT OPENMW_USE_SYSTEM_MYGUI) set(MYGUI_BUILD_PLUGINS OFF CACHE BOOL "") set(MYGUI_BUILD_TOOLS OFF CACHE BOOL "") - # We appear to be using some obsolete properties in the XML. - # See https://gitlab.com/OpenMW/openmw/-/issues/5896 - set(MYGUI_DONT_USE_OBSOLETE OFF CACHE BOOL "") - if(MYGUI_STATIC) set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) else()