1
0
Fork 0

(svn r1255) Renamed "postfix" to "suffix", for strings and variable names

release/0.4.5
dominik 2004-12-23 18:28:13 +00:00
parent 60052ffb45
commit 58c153b9ac
5 changed files with 20 additions and 20 deletions

View File

@ -2739,7 +2739,7 @@ STR_CURRENCY_WINDOW :{WHITE}Custom currency
STR_CURRENCY_EXCHANGE_RATE :{LTBLUE}Exchange rate: {ORANGE}{CURRENCY} = {POUNDSIGN} {COMMA16} STR_CURRENCY_EXCHANGE_RATE :{LTBLUE}Exchange rate: {ORANGE}{CURRENCY} = {POUNDSIGN} {COMMA16}
STR_CURRENCY_SEPARATOR :{LTBLUE}Separator: STR_CURRENCY_SEPARATOR :{LTBLUE}Separator:
STR_CURRENCY_PREFIX :{LTBLUE}Prefix: STR_CURRENCY_PREFIX :{LTBLUE}Prefix:
STR_CURRENCY_POSTFIX :{LTBLUE}Postfix: STR_CURRENCY_SUFFIX :{LTBLUE}Suffix:
STR_CURRENCY_SWITCH_TO_EURO :{LTBLUE}Switch to Euro: {ORANGE}{INT32} STR_CURRENCY_SWITCH_TO_EURO :{LTBLUE}Switch to Euro: {ORANGE}{INT32}
STR_CURRENCY_SWITCH_TO_EURO_NEVER :{LTBLUE}Switch to Euro: {ORANGE}never STR_CURRENCY_SWITCH_TO_EURO_NEVER :{LTBLUE}Switch to Euro: {ORANGE}never
STR_CURRENCY_PREVIEW :{LTBLUE}Preview: {ORANGE}{CURRENCY} STR_CURRENCY_PREVIEW :{LTBLUE}Preview: {ORANGE}{CURRENCY}

View File

@ -910,8 +910,8 @@ static const SettingDesc currency_settings[] = {
{"rate", SDT_UINT16, (void*)1, &_currency_specs[23].rate, NULL}, {"rate", SDT_UINT16, (void*)1, &_currency_specs[23].rate, NULL},
{"separator", SDT_STRINGQUOT | (2) << 16, ".", &_currency_specs[23].separator, NULL}, {"separator", SDT_STRINGQUOT | (2) << 16, ".", &_currency_specs[23].separator, NULL},
{"to_euro", SDT_UINT16, (void*)0, &_currency_specs[23].to_euro, NULL}, {"to_euro", SDT_UINT16, (void*)0, &_currency_specs[23].to_euro, NULL},
{"pre", SDT_STRINGQUOT | (16) << 16, NULL, &_currency_specs[23].pre, NULL}, {"prefix", SDT_STRINGQUOT | (16) << 16, NULL, &_currency_specs[23].prefix, NULL},
{"post", SDT_STRINGQUOT | (16) << 16, " credits", &_currency_specs[23].post, NULL}, {"suffix", SDT_STRINGQUOT | (16) << 16, " credits", &_currency_specs[23].suffix, NULL},
{NULL, 0, NULL, NULL, NULL} {NULL, 0, NULL, NULL, NULL}
}; };

View File

@ -1308,15 +1308,15 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e)
// prefix // prefix
DrawFrameRect(10, y+1, 29, y+9, 0, ((clk >> (i*2)) & 0x03)?0x20:0x00); DrawFrameRect(10, y+1, 29, y+9, 0, ((clk >> (i*2)) & 0x03)?0x20:0x00);
x = DrawString(x, y + 1, STR_CURRENCY_PREFIX, 0); x = DrawString(x, y + 1, STR_CURRENCY_PREFIX, 0);
DoDrawString(_currency_specs[23].pre, x + 4, y + 1, 6); DoDrawString(_currency_specs[23].prefix, x + 4, y + 1, 6);
x = 35; x = 35;
y+=12; y+=12;
i++; i++;
// postfix // suffix
DrawFrameRect(10, y+1, 29, y+9, 0, ((clk >> (i*2)) & 0x03)?0x20:0x00); DrawFrameRect(10, y+1, 29, y+9, 0, ((clk >> (i*2)) & 0x03)?0x20:0x00);
x = DrawString(x, y + 1, STR_CURRENCY_POSTFIX, 0); x = DrawString(x, y + 1, STR_CURRENCY_SUFFIX, 0);
DoDrawString(_currency_specs[23].post, x + 4, y + 1, 6); DoDrawString(_currency_specs[23].suffix, x + 4, y + 1, 6);
x = 35; x = 35;
y+=12; y+=12;
i++; i++;
@ -1369,14 +1369,14 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e)
case 2: // prefix case 2: // prefix
if ( IS_INT_INSIDE(x, 10, 30) ) // clicked button if ( IS_INT_INSIDE(x, 10, 30) ) // clicked button
WP(w,def_d).data_1 = (1 << (line * 2 + 1)); WP(w,def_d).data_1 = (1 << (line * 2 + 1));
str = AllocateName(_currency_specs[23].pre, 0); str = AllocateName(_currency_specs[23].prefix, 0);
len = 12; len = 12;
edittext = true; edittext = true;
break; break;
case 3: // postfix case 3: // suffix
if ( IS_INT_INSIDE(x, 10, 30) ) // clicked button if ( IS_INT_INSIDE(x, 10, 30) ) // clicked button
WP(w,def_d).data_1 = (1 << (line * 2 + 1)); WP(w,def_d).data_1 = (1 << (line * 2 + 1));
str = AllocateName(_currency_specs[23].post, 0); str = AllocateName(_currency_specs[23].suffix, 0);
len = 12; len = 12;
edittext = true; edittext = true;
break; break;
@ -1431,10 +1431,10 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e)
ttd_strlcpy(str_separator, b, 16); ttd_strlcpy(str_separator, b, 16);
break; break;
case 2: case 2:
ttd_strlcpy(_currency_specs[23].pre, b, 16); ttd_strlcpy(_currency_specs[23].prefix, b, 16);
break; break;
case 3: case 3:
ttd_strlcpy(_currency_specs[23].post, b, 16); ttd_strlcpy(_currency_specs[23].suffix, b, 16);
break; break;
case 4: case 4:
val = atoi(b); val = atoi(b);

View File

@ -276,9 +276,9 @@ static byte *FormatGenericCurrency(byte *buff, const CurrencySpec *spec, int64 n
// convert from negative // convert from negative
if (number < 0) { *buff++ = '-'; number = -number; } if (number < 0) { *buff++ = '-'; number = -number; }
// add pre part // add prefix part
s = spec->pre; s = spec->prefix;
while (s != spec->pre + lengthof(spec->pre) && (c=*s++)) *buff++ = c; while (s != spec->prefix + lengthof(spec->prefix) && (c=*s++)) *buff++ = c;
// for huge numbers, compact the number into k or M // for huge numbers, compact the number into k or M
if (compact) { if (compact) {
@ -303,9 +303,9 @@ static byte *FormatGenericCurrency(byte *buff, const CurrencySpec *spec, int64 n
if (compact) *buff++ = compact; if (compact) *buff++ = compact;
// add post part // add suffix part
s = spec->post; s = spec->suffix;
while (s != spec->post + lengthof(spec->post) && (c=*s++)) *buff++ = c; while (s != spec->suffix + lengthof(spec->suffix) && (c=*s++)) *buff++ = c;
return buff; return buff;
} }

View File

@ -45,8 +45,8 @@ typedef struct {
uint16 rate; uint16 rate;
char separator; char separator;
uint16 to_euro; uint16 to_euro;
char pre[16]; char prefix[16];
char post[16]; char suffix[16];
} CurrencySpec; } CurrencySpec;
VARDEF CurrencySpec _currency_specs[24]; VARDEF CurrencySpec _currency_specs[24];