Add SET_COLOUR string code
This commit is contained in:
@@ -1304,6 +1304,14 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
break;
|
||||
}
|
||||
|
||||
case SCC_SET_COLOUR: {// {SET_COLOUR}
|
||||
int64 tc = args->GetInt64(SCC_SET_COLOUR);
|
||||
if (tc >= 0 && tc < TC_END) {
|
||||
buff += Utf8Encode(buff, SCC_BLUE + tc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SCC_REVISION: // {REV}
|
||||
buff = strecpy(buff, _openttd_revision, last);
|
||||
break;
|
||||
|
@@ -132,6 +132,7 @@ enum StringControlCode {
|
||||
SCC_BLACK,
|
||||
SCC_PUSH_COLOUR,
|
||||
SCC_POP_COLOUR,
|
||||
SCC_SET_COLOUR,
|
||||
|
||||
SCC_CONSUME_ARG,
|
||||
|
||||
|
@@ -60,6 +60,7 @@ static const CmdStruct _cmd_structs[] = {
|
||||
{"BLACK", EmitSingleChar, SCC_BLACK, 0, -1, C_DONTCOUNT},
|
||||
{"PUSH_COLOUR", EmitSingleChar, SCC_PUSH_COLOUR, 0, -1, C_DONTCOUNT},
|
||||
{"POP_COLOUR", EmitSingleChar, SCC_POP_COLOUR, 0, -1, C_DONTCOUNT},
|
||||
{"SET_COLOUR", EmitSingleChar, SCC_SET_COLOUR, 1, -1, C_NONE},
|
||||
|
||||
{"REV", EmitSingleChar, SCC_REVISION, 0, -1, C_NONE}, // openttd revision string
|
||||
|
||||
|
Reference in New Issue
Block a user