diff --git a/apps/openmw/mwgui/textcolours.cpp b/apps/openmw/mwgui/textcolours.cpp index c3c293297c..981817a4a9 100644 --- a/apps/openmw/mwgui/textcolours.cpp +++ b/apps/openmw/mwgui/textcolours.cpp @@ -11,6 +11,7 @@ namespace MWGui return MyGUI::Colour::parse(MyGUI::LanguageManager::getInstance().replaceTags("#{fontcolour=" + type + "}")); } + void TextColours::loadColours() { header = getTextColour("header"); @@ -33,12 +34,5 @@ namespace MWGui 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 add251a1c9..83bc1d3f5a 100644 --- a/apps/openmw/mwgui/textcolours.hpp +++ b/apps/openmw/mwgui/textcolours.hpp @@ -27,14 +27,6 @@ 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 5728880354..f6868e56f4 100644 --- a/components/fallback/validate.cpp +++ b/components/fallback/validate.cpp @@ -109,8 +109,7 @@ 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", "FontColor_color_specific", "FontColor_color_specific_over", - "FontColor_color_specific_pressed", "FontColor_color_exhausted", "FontColor_color_exhausted_over", "FontColor_color_exhausted_pressed", + "FontColor_color_positive", "FontColor_color_weapon_fill", "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", diff --git a/components/settings/categories/gui.hpp b/components/settings/categories/gui.hpp index 88f6924638..a26364c5dd 100644 --- a/components/settings/categories/gui.hpp +++ b/components/settings/categories/gui.hpp @@ -32,12 +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", "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" }; + SettingValue mColorTopicSpecific{ mIndex, "GUI", "color topic specific" }; + SettingValue mColorTopicSpecificOver{ mIndex, "GUI", "color topic specific over" }; + SettingValue mColorTopicSpecificPressed{ mIndex, "GUI", "color topic specific pressed" }; + SettingValue mColorTopicExhausted{ mIndex, "GUI", "color topic exhausted" }; + SettingValue mColorTopicExhaustedOver{ mIndex, "GUI", "color topic exhausted over" }; + SettingValue mColorTopicExhaustedPressed{ mIndex, "GUI", "color topic exhausted pressed" }; }; } diff --git a/components/widgets/tags.cpp b/components/widgets/tags.cpp index e10cbeda88..ae55e4b76d 100644 --- a/components/widgets/tags.cpp +++ b/components/widgets/tags.cpp @@ -12,6 +12,7 @@ namespace Gui { std::string_view fontcolour = "fontcolour="; std::string_view fontcolourhtml = "fontcolourhtml="; + std::string_view fontcolouroptional = "fontcolouroptional="; if (tag.starts_with(fontcolour)) { @@ -19,12 +20,7 @@ namespace Gui fallbackName += tag.substr(fontcolour.length()); std::string_view str = Fallback::Map::getString(fallbackName); if (str.empty()) - { - 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); - } + throw std::runtime_error("Unable to map setting to value: " + fallbackName); std::string ret[3]; unsigned int j = 0; @@ -63,6 +59,30 @@ namespace Gui out = html.str(); return true; } + else if (tag.starts_with(fontcolouroptional)) + { + std::string settingprefix = "color topic "; + std::string_view category = "GUI"; + settingprefix += tag.substr(fontcolouroptional.length()); + std::replace(settingprefix.begin(), settingprefix.end(), '_', ' '); + std::string str = Settings::Manager::getString(settingprefix, category); + if (str.empty()) + throw std::runtime_error("Unable to map setting to value: " + settingprefix); + + std::string ret[3]; + unsigned int j = 0; + for (unsigned int i = 0; i < str.length(); ++i) + { + if (str[i] == ',') + j++; + else if (str[i] != ' ') + ret[j] += str[i]; + } + MyGUI::Colour col(MyGUI::utility::parseInt(ret[0]) / 255.f, MyGUI::utility::parseInt(ret[1]) / 255.f, + MyGUI::utility::parseInt(ret[2]) / 255.f); + out = col.print(); + return true; + } return false; } diff --git a/files/data/mygui/openmw_list.skin.xml b/files/data/mygui/openmw_list.skin.xml index 10524c6d1f..0e57f44992 100644 --- a/files/data/mygui/openmw_list.skin.xml +++ b/files/data/mygui/openmw_list.skin.xml @@ -129,9 +129,9 @@ - - - + + + @@ -140,9 +140,9 @@ - - - + + + diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 3f2963dc17..9a262260e7 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -220,17 +220,17 @@ color topic enable = false # The color of dialogue topic keywords that gives unique actor responses # Format (R,G,B) (255,255,255) or empty for no special formatting # Default to blue -FontColor_color_specific = 112,126,207 -FontColor_color_specific_over = 143,155,218 -FontColor_color_specific_pressed = 175,184,228 +color topic specific = 112,126,207 +color topic specific over = 143,155,218 +color topic specific pressed = 175,184,228 # The color of dialogue topic keywords that gives already read responses # Format (R,G,B) (255,255,255) or empty for no special formatting # Default to grey -FontColor_color_exhausted = 103,103,111 -FontColor_color_exhausted_over = 170,170,188 -FontColor_color_exhausted_pressed = 69,69,85 +color topic exhausted = 103,103,111 +color topic exhausted over = 170,170,188 +color topic exhausted pressed= 69,69,85 [HUD]