mirror of https://github.com/OpenTTD/OpenTTD
(svn r21445) -Fix: [NewGRF] fix gender choice lists in newgrf strings.
Change: strgen no longer writes the type of a string for a gender choice listrelease/1.1
parent
475ac872c9
commit
74d608a67e
|
@ -398,7 +398,6 @@ static void EmitGender(char *buf, int value)
|
||||||
|
|
||||||
assert(IsInsideBS(cmd->value, SCC_CONTROL_START, UINT8_MAX));
|
assert(IsInsideBS(cmd->value, SCC_CONTROL_START, UINT8_MAX));
|
||||||
PutUtf8(SCC_GENDER_LIST);
|
PutUtf8(SCC_GENDER_LIST);
|
||||||
PutByte(cmd->value - SCC_CONTROL_START);
|
|
||||||
PutByte(TranslateArgumentIdx(argidx, offset));
|
PutByte(TranslateArgumentIdx(argidx, offset));
|
||||||
EmitWordList(words, nw);
|
EmitWordList(words, nw);
|
||||||
}
|
}
|
||||||
|
|
|
@ -792,16 +792,15 @@ static char *FormatString(char *buff, const char *str, int64 *argv, const int64
|
||||||
|
|
||||||
case SCC_GENDER_LIST: { // {G 0 Der Die Das}
|
case SCC_GENDER_LIST: { // {G 0 Der Die Das}
|
||||||
/* First read the meta data from the language file. */
|
/* First read the meta data from the language file. */
|
||||||
WChar fmt = SCC_CONTROL_START + (byte)*str++;
|
|
||||||
byte offset = (byte)*str++;
|
byte offset = (byte)*str++;
|
||||||
assert(argv_orig + offset < argve);
|
assert(argv_orig + offset < argve);
|
||||||
assert(dry_run || argt == NULL || argt_orig[offset] == fmt);
|
int gender = 0;
|
||||||
|
if (!dry_run && argt != NULL && argt_orig[offset] != 0) {
|
||||||
/* Now we need to figure out what text to resolve, i.e.
|
/* Now we need to figure out what text to resolve, i.e.
|
||||||
* what do we need to draw? So get the actual raw string
|
* what do we need to draw? So get the actual raw string
|
||||||
* first using the control code to get said string. */
|
* first using the control code to get said string. */
|
||||||
char input[4 + 1];
|
char input[4 + 1];
|
||||||
char *p = input + Utf8Encode(input, fmt);
|
char *p = input + Utf8Encode(input, argt_orig[offset]);
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
/* Now do the string formatting. */
|
/* Now do the string formatting. */
|
||||||
|
@ -813,11 +812,11 @@ static char *FormatString(char *buff, const char *str, int64 *argv, const int64
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
/* And determine the string. */
|
/* And determine the string. */
|
||||||
int gender = 0;
|
|
||||||
const char *s = buf;
|
const char *s = buf;
|
||||||
WChar c = Utf8Consume(&s);
|
WChar c = Utf8Consume(&s);
|
||||||
/* Does this string have a gender, if so, set it */
|
/* Does this string have a gender, if so, set it */
|
||||||
if (c == SCC_GENDER_INDEX) gender = (byte)s[0];
|
if (c == SCC_GENDER_INDEX) gender = (byte)s[0];
|
||||||
|
}
|
||||||
str = ParseStringChoice(str, gender, &buff, last);
|
str = ParseStringChoice(str, gender, &buff, last);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue