mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r25191) -Codechange/Fix: [strgen] Make -export-commands use the actual command classification from strgen_tables.h instead of using something incompletely duplicated.
This commit is contained in:
parent
e4c3528a78
commit
b09bf08044
|
@ -434,24 +434,14 @@ int CDECL main(int argc, char *argv[])
|
||||||
printf("args\tflags\tcommand\treplacement\n");
|
printf("args\tflags\tcommand\treplacement\n");
|
||||||
for (const CmdStruct *cs = _cmd_structs; cs < endof(_cmd_structs); cs++) {
|
for (const CmdStruct *cs = _cmd_structs; cs < endof(_cmd_structs); cs++) {
|
||||||
char flags;
|
char flags;
|
||||||
switch (cs->value) {
|
if (cs->proc == EmitGender) {
|
||||||
case 0x200E: case 0x200F: // Implicit BIDI controls
|
flags = 'g'; // Command needs number of parameters defined by number of genders
|
||||||
case 0x202A: case 0x202B: case 0x202C: case 0x202D: case 0x202E: // Explicit BIDI controls
|
} else if (cs->proc == EmitPlural) {
|
||||||
case 0xA0: // Non breaking space
|
flags = 'p'; // Command needs number of parameters defined by plural value
|
||||||
case '\n': // Newlines may be added too
|
} else if (cs->flags & C_DONTCOUNT) {
|
||||||
case '{': // This special
|
flags = 'i'; // Command may be in the translation when it is not in base
|
||||||
/* This command may be in the translation when it is not in base */
|
} else {
|
||||||
flags = 'i';
|
flags = '0'; // Command needs no parameters
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
if (cs->proc == EmitGender) {
|
|
||||||
flags = 'g'; // Command needs number of parameters defined by number of genders
|
|
||||||
} else if (cs->proc == EmitPlural) {
|
|
||||||
flags = 'p'; // Command needs number of parameters defined by plural value
|
|
||||||
} else {
|
|
||||||
flags = '0'; // Command needs no parameters
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
printf("%i\t%c\t\"%s\"\t\"%s\"\n", cs->consumes, flags, cs->cmd, strstr(cs->cmd, "STRING") ? "STRING" : cs->cmd);
|
printf("%i\t%c\t\"%s\"\t\"%s\"\n", cs->consumes, flags, cs->cmd, strstr(cs->cmd, "STRING") ? "STRING" : cs->cmd);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue