Meaning of [/COLOR] in UI strings

psparky

King
Joined
Feb 24, 2011
Messages
623
Is this just the same as [ENDCOLOR] or does it have a different effect?

[ENDCOLOR] always sets the text to white, correct? Or does it actually revert to the previous color?

I'm asking because I have an example where text following a [/COLOR] is red or green and I can't see why.

Also, could [/COLOR] cause a problem if no color had been set before, or any that were set had been terminated by an [ENDCOLOR] already?

Thanks for any info/help.
 
Only guessing here ...

[/COLOR] only occurs once outside of advisor text, and that's at the end of a string where the colour would be reverted anyway ...
... so, my guess is that one of the game staff writing the advisor text had some knowledge of XML tags and used [/COLOR] instead of [ENDCOLOR]. When this was discovered, rather than doing a search-and-replace across many files one of the programmers said "doesn't matter, I'll just add [/COLOR] to work the same as [ENDCOLOR]"

As far as I can remember (and it was a very long time ago I dug into all of this) colours do not stack, so one [ENDCOLOR] "closes" all [COLOR*] tags, and the colour reverted to will be whatever the ColorSet has set, which is not always white
 
Thanks for your thoughts and also the info on ColorSet that I wasn't aware of.

I've just been doing a few experiments...

[ENDCOLOR] does end all color tags and revert to white (or Colorset) as you say and as I already thought.

[/COLOR] on the other hand, seems to revert to the last color set. This applies even in that color was terminated with an [ENDCOLOR]. Furthermore, it does seem to stack and unstack!

At first glance this sounds useful. Perhaps I could add a [COLOR_xxx] [/COLOR] around the names of all civilizations to make them stand out in notifications and other occurrences. Then, if the surrounding text was already colored, it wouldn't be affected in the way that an ENDCOLOR would. Unfortunately, if the civ name was used in plain white text, but an earlier part of the string was colored, then [/COLOR] would pick up that earlier color and apply it to the text after the civ name.

Also unfortunately, the results don't seem to fully explain the original example that I was investigating.

I have, however, tentatively concluded that [/COLOR] is only useful when defining a single string or TXT_KEY which sets one color, switches to another, and then needs to revert to the first color.
 
As you're experimenting, there is also a [COLOR_REVERT] tag (used once in the debug system)
 
As you're experimenting, there is also a [COLOR_REVERT] tag (used once in the debug system)
That one appears to have no effect.
 
Top Bottom