diff --git a/src/marked-up_text.cpp b/src/marked-up_text.cpp index 1084e0f5b86..46f87a3b048 100644 --- a/src/marked-up_text.cpp +++ b/src/marked-up_text.cpp @@ -14,6 +14,7 @@ #include "font.hpp" #include "marked-up_text.hpp" +#include "team.hpp" #include "video.hpp" #include "wassert.hpp" @@ -64,6 +65,27 @@ static std::string::const_iterator parse_markup(std::string::const_iterator i1, break; case NULL_MARKUP: return i1+1; + // semi ANSI colour escape sequences at the start of the line for now only + case '\033': + if(i2 - i1 >= 4) { + ++i1; + if(*i1 == '[') { + ++i1; + if(*i1 == '3') { + ++i1; + if(*i1 >= '0' && *i1 <= '9' && *(i1 + 1) == 'm') + { + if(*i1 != '0') + { + Uint32 rgb = team::get_side_rgb(lexical_cast(*i1)); + *colour = int_to_color(rgb); + } + ++i1; + } + } + } + } + break; case COLOR_TEXT: { //very primitive parsing for rgb value