1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 18:09:09 +00:00

(svn r1222) Currency cleanup. Changed some currency symbols according to forum suggestions (thx ChrisCF) and rearranged the currencies alphabetically (except for the major ones).

This commit is contained in:
dominik
2004-12-22 16:54:55 +00:00
parent 5c7decc27d
commit b7f71b026d
6 changed files with 112 additions and 89 deletions

View File

@@ -33,29 +33,29 @@ typedef struct {
} LanguagePackHeader;
const uint16 _currency_string_list[] = {
STR_CURR_POUNDS,
STR_CURR_DOLLARS,
STR_CURR_FF,
STR_CURR_DM,
STR_CURR_GBP,
STR_CURR_USD,
STR_CURR_EUR,
STR_CURR_YEN,
STR_CURR_PT,
STR_CURR_FT,
STR_CURR_ZL,
STR_CURR_ATS,
STR_CURR_BEF,
STR_CURR_DKK,
STR_CURR_FIM,
STR_CURR_GRD,
STR_CURR_CHF,
STR_CURR_NLG,
STR_CURR_ITL,
STR_CURR_SEK,
STR_CURR_RUR,
STR_CURR_CZK,
STR_CURR_DEM,
STR_CURR_DKK,
STR_CURR_ESP,
STR_CURR_FIM,
STR_CURR_FRF,
STR_CURR_GRD,
STR_CURR_HUF,
STR_CURR_ISK,
STR_CURR_ITL,
STR_CURR_NLG,
STR_CURR_NOK,
STR_CURR_EUR,
STR_CURR_PLN,
STR_CURR_ROL,
STR_CURR_RUR,
STR_CURR_SEK,
STR_CURR_CUSTOM,
INVALID_STRING_ID
};
@@ -67,31 +67,6 @@ static const uint16 _cargo_string_list[NUM_LANDSCAPE][NUM_CARGO] = {
/* LT_CANDY */ {STR_PASSENGERS, STR_TONS, STR_BAGS, STR_NOTHING, STR_NOTHING, STR_TONS, STR_TONS, STR_LITERS, STR_TONS, STR_NOTHING, STR_LITERS, STR_NOTHING}
};
// get a mask of the allowed currencies depending on the year
uint GetMaskOfAllowedCurrencies()
{
int i;
uint mask = 0;
for(i=0; i!=lengthof(_currency_specs); i++) {
uint16 to_euro = _currency_specs[i].to_euro;
if (i == 23) mask |= (1 << 23); // always allow custom currency
if (to_euro != CF_NOEURO && to_euro != CF_ISEURO && _cur_year >= (to_euro-1920)) continue;
if (_cur_year < (2000-1920) && (to_euro == CF_ISEURO)) continue;
mask |= (1 << i);
}
return mask;
}
void CheckSwitchToEuro()
{
if (_currency_specs[_opt.currency].to_euro != CF_NOEURO &&
_currency_specs[_opt.currency].to_euro != CF_ISEURO &&
_cur_year >= (_currency_specs[_opt.currency].to_euro-1920)) {
_opt.currency = 21; // this is the index of euro above.
AddNewsItem(STR_EURO_INTRODUCE, NEWS_FLAGS(NM_NORMAL,0,NT_ECONOMY,0), 0, 0);
}
}
static byte *str_cat(byte *dst, const byte *src)
{
while ( (*dst++ = *src++) != 0) {}