From f9577d904cf0b2c351919b3e70a47020470cb056 Mon Sep 17 00:00:00 2001 From: Kagernac Date: Wed, 22 May 2024 20:25:58 -0700 Subject: [PATCH] This commit introduces six new color settings for dialogue topic keywords referencing settings.cfg and settings-default.cfg. These settings work similarly to the color references found in openmw.cfg and Morrowind.ini. Changes include: Removal of deprecated settings: color topic specific color topic exhausted Addition of six new color settings to settings.cfg and settings-default.cfg Updated description in settings-default.cfg to reflect the new color format --- apps/openmw/mwgui/textcolours.cpp | 8 ++++++++ apps/openmw/mwgui/textcolours.hpp | 8 ++++++++ components/fallback/validate.cpp | 4 +++- components/settings/categories/gui.hpp | 8 ++++++-- components/widgets/tags.cpp | 9 +++++++-- files/data/mygui/openmw_list.skin.xml | 16 ++++++++-------- files/settings-default.cfg | 13 +++++++++---- 7 files changed, 49 insertions(+), 17 deletions(-) diff --git a/apps/openmw/mwgui/textcolours.cpp b/apps/openmw/mwgui/textcolours.cpp index 77afa5e265..c3c293297c 100644 --- a/apps/openmw/mwgui/textcolours.cpp +++ b/apps/openmw/mwgui/textcolours.cpp @@ -32,5 +32,13 @@ namespace MWGui journalTopic = getTextColour("journal_topic"); journalTopicOver = getTextColour("journal_topic_over"); journalTopicPressed = getTextColour("journal_topic_pressed"); + + specific = getTextColour("specific"); + specificOver = getTextColour("specific_over"); + specificPressed = getTextColour("specific_pressed"); + + exhausted = getTextColour("exhausted"); + exhaustedOver = getTextColour("exhausted_over"); + exhaustedPressed = getTextColour("exhausted_pressed"); } } diff --git a/apps/openmw/mwgui/textcolours.hpp b/apps/openmw/mwgui/textcolours.hpp index 83bc1d3f5a..add251a1c9 100644 --- a/apps/openmw/mwgui/textcolours.hpp +++ b/apps/openmw/mwgui/textcolours.hpp @@ -27,6 +27,14 @@ namespace MWGui MyGUI::Colour journalTopicOver; MyGUI::Colour journalTopicPressed; + MyGUI::Colour specific; + MyGUI::Colour specificOver; + MyGUI::Colour specificPressed; + + MyGUI::Colour exhausted; + MyGUI::Colour exhaustedOver; + MyGUI::Colour exhaustedPressed; + public: void loadColours(); }; diff --git a/components/fallback/validate.cpp b/components/fallback/validate.cpp index 571f0f9b19..5728880354 100644 --- a/components/fallback/validate.cpp +++ b/components/fallback/validate.cpp @@ -109,7 +109,9 @@ static const std::set allowedKeysNonNumeric = { "Blood_Model_0 "FontColor_color_link", "FontColor_color_link_over", "FontColor_color_link_pressed", "FontColor_color_magic", "FontColor_color_magic_fill", "FontColor_color_misc", "FontColor_color_negative", "FontColor_color_normal", "FontColor_color_normal_over", "FontColor_color_normal_pressed", "FontColor_color_notify", - "FontColor_color_positive", "FontColor_color_weapon_fill", "Fonts_Font_0", "Fonts_Font_1", "Fonts_Font_2", + "FontColor_color_positive", "FontColor_color_weapon_fill", "FontColor_color_specific", "FontColor_color_specific_over", + "FontColor_color_specific_pressed", "FontColor_color_exhausted", "FontColor_color_exhausted_over", "FontColor_color_exhausted_pressed", + "Fonts_Font_0", "Fonts_Font_1", "Fonts_Font_2", "Level_Up_Default", "Moons_Script_Color", "Movies_Company_Logo", "Movies_Morrowind_Logo", "Movies_New_Game", "Question_10_AnswerOne", "Question_10_AnswerThree", "Question_10_AnswerTwo", "Question_10_Question", "Question_10_Sound", "Question_1_AnswerOne", "Question_1_AnswerThree", "Question_1_AnswerTwo", diff --git a/components/settings/categories/gui.hpp b/components/settings/categories/gui.hpp index 4a5e50fd8a..88f6924638 100644 --- a/components/settings/categories/gui.hpp +++ b/components/settings/categories/gui.hpp @@ -32,8 +32,12 @@ namespace Settings SettingValue mColorCrosshairOwned{ mIndex, "GUI", "color crosshair owned" }; SettingValue mKeyboardNavigation{ mIndex, "GUI", "keyboard navigation" }; SettingValue mColorTopicEnable{ mIndex, "GUI", "color topic enable" }; - SettingValue mColorTopicSpecific{ mIndex, "GUI", "color topic specific" }; - SettingValue mColorTopicExhausted{ mIndex, "GUI", "color topic exhausted" }; + SettingValue mColorTopicSpecific{ mIndex, "GUI", "FontColor_color_specific" }; + SettingValue mColorTopicSpecificOver{ mIndex, "GUI", "FontColor_color_specific_over" }; + SettingValue mColorTopicSpecificPressed{ mIndex, "GUI", "FontColor_color_specific_pressed" }; + SettingValue mColorTopicExhausted{ mIndex, "GUI", "FontColor_color_exhausted" }; + SettingValue mColorTopicExhaustedOver{ mIndex, "GUI", "FontColor_color_exhausted_over" }; + SettingValue mColorTopicExhaustedPressed{ mIndex, "GUI", "FontColor_color_exhausted_pressed" }; }; } diff --git a/components/widgets/tags.cpp b/components/widgets/tags.cpp index 3fe72480b7..e10cbeda88 100644 --- a/components/widgets/tags.cpp +++ b/components/widgets/tags.cpp @@ -1,5 +1,6 @@ #include "tags.hpp" +#include #include #include @@ -10,7 +11,6 @@ namespace Gui bool replaceTag(std::string_view tag, MyGUI::UString& out) { std::string_view fontcolour = "fontcolour="; - std::string_view fontcolourhtml = "fontcolourhtml="; if (tag.starts_with(fontcolour)) @@ -19,7 +19,12 @@ namespace Gui fallbackName += tag.substr(fontcolour.length()); std::string_view str = Fallback::Map::getString(fallbackName); if (str.empty()) - throw std::runtime_error("Unknown fallback name: " + fallbackName); + { + std::string_view category = "GUI"; + str = Settings::Manager::getString(fallbackName, category); + if (str.empty()) + throw std::runtime_error("Unable to map setting to value: " + fallbackName); + } std::string ret[3]; unsigned int j = 0; diff --git a/files/data/mygui/openmw_list.skin.xml b/files/data/mygui/openmw_list.skin.xml index 877c827833..10524c6d1f 100644 --- a/files/data/mygui/openmw_list.skin.xml +++ b/files/data/mygui/openmw_list.skin.xml @@ -127,22 +127,22 @@ - + - - - + + + - + - - - + + + diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 9d15f44401..3f2963dc17 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -218,14 +218,19 @@ keyboard navigation = true color topic enable = false # The color of dialogue topic keywords that gives unique actor responses -# Format R G B A or empty for no special formatting +# Format (R,G,B) (255,255,255) or empty for no special formatting # Default to blue -color topic specific = 0.45 0.5 0.8 1 +FontColor_color_specific = 112,126,207 +FontColor_color_specific_over = 143,155,218 +FontColor_color_specific_pressed = 175,184,228 + # The color of dialogue topic keywords that gives already read responses -# Format R G B A or empty for no special formatting +# Format (R,G,B) (255,255,255) or empty for no special formatting # Default to grey -color topic exhausted = 0.3 0.3 0.3 1 +FontColor_color_exhausted = 103,103,111 +FontColor_color_exhausted_over = 170,170,188 +FontColor_color_exhausted_pressed = 69,69,85 [HUD]