From ae27ad6bcdba6685f3a1cf17e1a470b1134e25a1 Mon Sep 17 00:00:00 2001 From: fredzio Date: Mon, 22 Jun 2020 03:24:41 +0200 Subject: [PATCH 1/2] Follow up to MR 126 Fill settings-default.cfg with default values as RGBA values are not intuitive for end users. Add a boolean setting to enable the formatting (disabled by default). --- apps/openmw/mwgui/dialogue.cpp | 3 +++ docs/source/reference/modding/settings/GUI.rst | 9 +++++++++ files/settings-default.cfg | 13 +++++++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index 233fc0f6b..a674dd36e 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -737,6 +737,9 @@ namespace MWGui void DialogueWindow::updateTopicFormat() { + if (!Settings::Manager::getBool("color topic enable", "GUI")) + return; + std::string specialColour = Settings::Manager::getString("color topic specific", "GUI"); std::string oldColour = Settings::Manager::getString("color topic exhausted", "GUI"); diff --git a/docs/source/reference/modding/settings/GUI.rst b/docs/source/reference/modding/settings/GUI.rst index b881221b3..bbe6b8336 100644 --- a/docs/source/reference/modding/settings/GUI.rst +++ b/docs/source/reference/modding/settings/GUI.rst @@ -141,6 +141,15 @@ This setting can only be configured by editing the settings configuration file. This setting has no effect if the crosshair setting in the HUD Settings Section is false. This setting has no effect if the show owned setting in the Game Settings Section is false. +color topic enable +------------------ + +:Type: boolean +:Range: True/False +:Default: False + +Control wether additionnal formatting will be applied to dialogs topic. See 'color topic specific' and 'color topic exhausted' for details. + color topic specific -------------------- diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 617aca3f1..a1071b269 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -202,13 +202,18 @@ color crosshair owned = 1.0 0.15 0.15 1.0 # Controls whether Arrow keys, Movement keys, Tab/Shift-Tab and Spacebar/Enter/Activate may be used to navigate GUI buttons. keyboard navigation = true +# Apply the defined color to dialogue topic. +color topic enable = false + # The color of dialogue topic keywords that gives unique actor responses -# Format R G B A or empty for default -color topic specific = +# Format R G B A or empty for no special formatting +# Default to blue +color topic specific = 0.45 0.5 0.8 1 # The color of dialogue topic keywords that gives already read responses -# Format R G B A or empty for default -color topic exhausted = +# Format R G B A or empty for no special formatting +# Default to grey +color topic exhausted = 0.3 0.3 0.3 1 [HUD] From 6d4d53fc7c3558180bd3910ca0f471ad71f85eaf Mon Sep 17 00:00:00 2001 From: fredzio Date: Mon, 22 Jun 2020 23:18:01 +0200 Subject: [PATCH 2/2] Add a setting to the launcher to enable/disable the dialogue topic formatting stuff. --- apps/launcher/advancedpage.cpp | 2 ++ files/ui/advancedpage.ui | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index e1a5d28af..866cec728 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -104,6 +104,7 @@ bool Launcher::AdvancedPage::loadSettings() loadSettingBool(showEnchantChanceCheckBox, "show enchant chance", "Game"); loadSettingBool(showMeleeInfoCheckBox, "show melee info", "Game"); loadSettingBool(showProjectileDamageCheckBox, "show projectile damage", "Game"); + loadSettingBool(changeDialogTopicsCheckBox, "color topic enable", "GUI"); int showOwnedIndex = mEngineSettings.getInt("show owned", "Game"); // Match the index with the option (only 0, 1, 2, or 3 are valid). Will default to 0 if invalid. if (showOwnedIndex >= 0 && showOwnedIndex <= 3) @@ -171,6 +172,7 @@ void Launcher::AdvancedPage::saveSettings() saveSettingBool(showEnchantChanceCheckBox, "show enchant chance", "Game"); saveSettingBool(showMeleeInfoCheckBox, "show melee info", "Game"); saveSettingBool(showProjectileDamageCheckBox, "show projectile damage", "Game"); + saveSettingBool(changeDialogTopicsCheckBox, "color topic enable", "GUI"); int showOwnedCurrentIndex = showOwnedComboBox->currentIndex(); if (showOwnedCurrentIndex != mEngineSettings.getInt("show owned", "Game")) mEngineSettings.setInt("show owned", "Game", showOwnedCurrentIndex); diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index 2ea5d777c..fed547b8c 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -459,6 +459,16 @@ + + + + <html><head/><body><p>If this setting is true, dialogue topics will have a different color if the topic is specific to the NPC you're talking to or the topic was previously seen. Color can be change in settings.cfg.</p><p>The default value is false.</p></body></html> + + + Change dialogue topic color + + +