From f7628ff0a82f1fb73f2fc9fc70c2dd50281ef4ac Mon Sep 17 00:00:00 2001
From: Kagernac <tmpsteam760@gmail.com>
Date: Wed, 19 Jun 2024 11:08:05 -0700
Subject: [PATCH] Code cleanup and documentation

Added documentation in GUI.rst for the new settings

Cleaned up the MR with some remnant changes.
---
 components/widgets/tags.cpp                   |  2 +-
 .../source/reference/modding/settings/GUI.rst | 52 +++++++++++++++++++
 files/settings-default.cfg                    |  4 +-
 3 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/components/widgets/tags.cpp b/components/widgets/tags.cpp
index d5796c35b5..ddca0171c8 100644
--- a/components/widgets/tags.cpp
+++ b/components/widgets/tags.cpp
@@ -20,7 +20,7 @@ namespace Gui
             fallbackName += tag.substr(fontcolour.length());
             std::string_view str = Fallback::Map::getString(fallbackName);
             if (str.empty())
-                throw std::runtime_error("Unable to map setting to value: " + fallbackName);
+                throw std::runtime_error("Unknown fallback name: " + fallbackName);
 
             std::string ret[3];
             unsigned int j = 0;
diff --git a/docs/source/reference/modding/settings/GUI.rst b/docs/source/reference/modding/settings/GUI.rst
index edacdc730a..0369e23651 100644
--- a/docs/source/reference/modding/settings/GUI.rst
+++ b/docs/source/reference/modding/settings/GUI.rst
@@ -157,6 +157,32 @@ The alpha value is currently ignored.
 
 A topic response is considered unique if its Actor filter field contains the speaking actor's object ID and hasn't yet been read.
 
+color topic specific over
+--------------------
+
+:Type:		RGBA floating point
+:Range:		0.0 to 1.0
+:Default:	empty
+
+This setting provides an "over" colour to dialogue topics that meet the color topic specific criteria.
+The value is composed of four floating point values representing the red, green, blue and alpha channels.
+The alpha value is currently ignored.
+
+A dialogue topic is considered "over" if it is the active GUI element through keyboard or mouse events.
+
+color topic specific pressed
+--------------------
+
+:Type:		RGBA floating point
+:Range:		0.0 to 1.0
+:Default:	empty
+
+This setting provides an "pressed" colour to dialogue topics that meet the color topic specific criteria.
+The value is composed of four floating point values representing the red, green, blue and alpha channels.
+The alpha value is currently ignored.
+
+A dialogue topic is considered "pressed" if it is the active GUI element and it receives a sustained keyboard or mouse event.
+
 color topic exhausted
 ---------------------
 
@@ -169,3 +195,29 @@ The value is composed of four floating point values representing the red, green,
 The alpha value is currently ignored.
 
 A topic is considered "exhausted" if the response the player is about to see has already been seen.
+
+color topic exhausted over
+--------------------
+
+:Type:		RGBA floating point
+:Range:		0.0 to 1.0
+:Default:	empty
+
+This setting provides an "over" colour to dialogue topics that meet the color topic exhausted criteria.
+The value is composed of four floating point values representing the red, green, blue and alpha channels.
+The alpha value is currently ignored.
+
+A dialogue topic is considered "over" if it is the active GUI element through keyboard or mouse events.
+
+color topic exhausted pressed
+--------------------
+
+:Type:		RGBA floating point
+:Range:		0.0 to 1.0
+:Default:	empty
+
+This setting provides an "pressed" colour to dialogue topics that meet the color topic exhausted criteria.
+The value is composed of four floating point values representing the red, green, blue and alpha channels.
+The alpha value is currently ignored.
+
+A dialogue topic is considered "pressed" if it is the active GUI element and it receives a sustained keyboard or mouse event.
\ No newline at end of file
diff --git a/files/settings-default.cfg b/files/settings-default.cfg
index 1efcec8db4..d5c6e01398 100644
--- a/files/settings-default.cfg
+++ b/files/settings-default.cfg
@@ -218,7 +218,7 @@ keyboard navigation = true
 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
+# Format R G B A or empty for no special formatting
 # Default to blue
 color topic specific = 0.45 0.5 0.8 1
 color topic specific over = 0.58 0.62 0.85 1
@@ -226,7 +226,7 @@ color topic specific pressed = 0.29 0.36 0.75 1
 
 
 # The color of dialogue topic keywords that gives already read responses
-# Format (R,G,B) (255,255,255) or empty for no special formatting
+# Format R G B A or empty for no special formatting
 # Default to grey
 color topic exhausted = 0.3 0.3 0.3 1
 color topic exhausted over = 0.56 0.56 0.56 1