Add string control code to consume an argument.
This commit is contained in:
@@ -1682,6 +1682,10 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case SCC_CONSUME_ARG:
|
||||||
|
// do nothing
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (buff + Utf8CharLen(b) < last) buff += Utf8Encode(buff, b);
|
if (buff + Utf8CharLen(b) < last) buff += Utf8Encode(buff, b);
|
||||||
break;
|
break;
|
||||||
|
@@ -116,6 +116,8 @@ enum StringControlCode {
|
|||||||
SCC_BLACK,
|
SCC_BLACK,
|
||||||
SCC_PREVIOUS_COLOUR,
|
SCC_PREVIOUS_COLOUR,
|
||||||
|
|
||||||
|
SCC_CONSUME_ARG,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The next variables are part of a NewGRF subsystem for creating text strings.
|
* The next variables are part of a NewGRF subsystem for creating text strings.
|
||||||
* It uses a "stack" of bytes and reads from there.
|
* It uses a "stack" of bytes and reads from there.
|
||||||
|
@@ -139,6 +139,8 @@ static const CmdStruct _cmd_structs[] = {
|
|||||||
{"SMALL_LEFT_ARROW", EmitSingleChar, SCC_LESS_THAN, 0, -1, C_DONTCOUNT},
|
{"SMALL_LEFT_ARROW", EmitSingleChar, SCC_LESS_THAN, 0, -1, C_DONTCOUNT},
|
||||||
{"SMALL_RIGHT_ARROW", EmitSingleChar, SCC_GREATER_THAN, 0, -1, C_DONTCOUNT},
|
{"SMALL_RIGHT_ARROW", EmitSingleChar, SCC_GREATER_THAN, 0, -1, C_DONTCOUNT},
|
||||||
|
|
||||||
|
{"CONSUME_ARG", EmitSingleChar, SCC_CONSUME_ARG, 1, 0, C_NONE},
|
||||||
|
|
||||||
/* The following are directional formatting codes used to get the RTL strings right:
|
/* The following are directional formatting codes used to get the RTL strings right:
|
||||||
* http://www.unicode.org/unicode/reports/tr9/#Directional_Formatting_Codes */
|
* http://www.unicode.org/unicode/reports/tr9/#Directional_Formatting_Codes */
|
||||||
{"LRM", EmitSingleChar, CHAR_TD_LRM, 0, -1, C_DONTCOUNT},
|
{"LRM", EmitSingleChar, CHAR_TD_LRM, 0, -1, C_DONTCOUNT},
|
||||||
|
Reference in New Issue
Block a user