mirror of https://github.com/OpenTTD/OpenTTD
(svn r1222) Currency cleanup. Changed some currency symbols according to forum suggestions (thx ChrisCF) and rearranged the currencies alphabetically (except for the major ones).
parent
5c7decc27d
commit
b7f71b026d
25
economy.c
25
economy.c
|
@ -18,6 +18,31 @@
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "network_data.h"
|
#include "network_data.h"
|
||||||
|
|
||||||
|
// 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 = 2; // this is the index of euro above.
|
||||||
|
AddNewsItem(STR_EURO_INTRODUCE, NEWS_FLAGS(NM_NORMAL,0,NT_ECONOMY,0), 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void UpdatePlayerHouse(Player *p, uint score)
|
void UpdatePlayerHouse(Player *p, uint score)
|
||||||
{
|
{
|
||||||
byte val;
|
byte val;
|
||||||
|
|
|
@ -868,30 +868,31 @@ STR_TOWNNAME_ROMANIAN :Romanian
|
||||||
STR_TOWNNAME_CZECH :Czech
|
STR_TOWNNAME_CZECH :Czech
|
||||||
############ end of townname region
|
############ end of townname region
|
||||||
|
|
||||||
STR_CURR_POUNDS :Pounds ({POUNDSIGN})
|
STR_CURR_GBP :Pounds ({POUNDSIGN})
|
||||||
STR_CURR_DOLLARS :Dollars ($)
|
STR_CURR_USD :Dollars ($)
|
||||||
STR_CURR_FF :Franc (FF)
|
STR_CURR_EUR :Euro (¤)
|
||||||
STR_CURR_DM :Deutschmark (DM)
|
STR_CURR_YEN :Yen ({YENSIGN})
|
||||||
STR_CURR_YEN :Yen ({YENSIGN})
|
STR_CURR_ATS :Austrian Shilling (ATS)
|
||||||
STR_CURR_PT :Peseta (Pt)
|
STR_CURR_BEF :Belgian Franc (BEF)
|
||||||
STR_CURR_FT :Hungarian Forint (Ft)
|
STR_CURR_CHF :Swiss Franc (CHF)
|
||||||
STR_CURR_ZL :Polish Zloty (zl)
|
STR_CURR_CZK :Czech Koruna (CZK)
|
||||||
STR_CURR_ATS :Austrian Shilling (ATS)
|
STR_CURR_DEM :Deutschmark (DEM)
|
||||||
STR_CURR_BEF :Belgian Franc (BEF)
|
STR_CURR_DKK :Danish Krone (DKK)
|
||||||
STR_CURR_DKK :Danish Krone (DKK)
|
STR_CURR_ESP :Peseta (ESP)
|
||||||
STR_CURR_FIM :Finnish Markka (FIM)
|
STR_CURR_FIM :Finnish Markka (FIM)
|
||||||
STR_CURR_GRD :Greek Drachma (GRD)
|
STR_CURR_FRF :Franc (FRF)
|
||||||
STR_CURR_CHF :Swiss Franc (CHF)
|
STR_CURR_GRD :Greek Drachma (GRD)
|
||||||
STR_CURR_NLG :Dutch Guilder (NLG)
|
STR_CURR_HUF :Hungarian Forint (HUF)
|
||||||
STR_CURR_ITL :Italian Lira (ITL)
|
STR_CURR_ISK :Icelandic Krona (ISK)
|
||||||
STR_CURR_CUSTOM :Custom...
|
STR_CURR_ITL :Italian Lira (ITL)
|
||||||
STR_CURR_SEK :Swedish Krona (SEK)
|
STR_CURR_NLG :Dutch Guilder (NLG)
|
||||||
STR_CURR_RUR :Russian Rubel (rur)
|
STR_CURR_NOK :Norwegian Krone (NOK)
|
||||||
STR_CURR_CZK :Czech Koruna (CZK)
|
STR_CURR_PLN :Polish Zloty (PLN)
|
||||||
STR_CURR_ISK :Icelandic Krona (ISK)
|
STR_CURR_ROL :Romanian Leu (ROL)
|
||||||
STR_CURR_NOK :Norwegian Krone (NOK)
|
STR_CURR_RUR :Russian Rubles (RUR)
|
||||||
STR_CURR_ROL :Romanian Leu (Lei)
|
STR_CURR_SEK :Swedish Krona (SEK)
|
||||||
STR_CURR_EUR :Euro (¤)
|
|
||||||
|
STR_CURR_CUSTOM :Custom...
|
||||||
|
|
||||||
STR_OPTIONS_LANG :{BLACK}Language
|
STR_OPTIONS_LANG :{BLACK}Language
|
||||||
STR_OPTIONS_LANG_CBO :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
|
STR_OPTIONS_LANG_CBO :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SAVEGAME_MAJOR_VERSION = 4,
|
SAVEGAME_MAJOR_VERSION = 4,
|
||||||
SAVEGAME_MINOR_VERSION = 1,
|
SAVEGAME_MINOR_VERSION = 2,
|
||||||
|
|
||||||
SAVEGAME_LOADABLE_VERSION = (SAVEGAME_MAJOR_VERSION << 8) + SAVEGAME_MINOR_VERSION
|
SAVEGAME_LOADABLE_VERSION = (SAVEGAME_MAJOR_VERSION << 8) + SAVEGAME_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
|
55
strings.c
55
strings.c
|
@ -33,29 +33,29 @@ typedef struct {
|
||||||
} LanguagePackHeader;
|
} LanguagePackHeader;
|
||||||
|
|
||||||
const uint16 _currency_string_list[] = {
|
const uint16 _currency_string_list[] = {
|
||||||
STR_CURR_POUNDS,
|
STR_CURR_GBP,
|
||||||
STR_CURR_DOLLARS,
|
STR_CURR_USD,
|
||||||
STR_CURR_FF,
|
STR_CURR_EUR,
|
||||||
STR_CURR_DM,
|
|
||||||
STR_CURR_YEN,
|
STR_CURR_YEN,
|
||||||
STR_CURR_PT,
|
|
||||||
STR_CURR_FT,
|
|
||||||
STR_CURR_ZL,
|
|
||||||
STR_CURR_ATS,
|
STR_CURR_ATS,
|
||||||
STR_CURR_BEF,
|
STR_CURR_BEF,
|
||||||
STR_CURR_DKK,
|
|
||||||
STR_CURR_FIM,
|
|
||||||
STR_CURR_GRD,
|
|
||||||
STR_CURR_CHF,
|
STR_CURR_CHF,
|
||||||
STR_CURR_NLG,
|
|
||||||
STR_CURR_ITL,
|
|
||||||
STR_CURR_SEK,
|
|
||||||
STR_CURR_RUR,
|
|
||||||
STR_CURR_CZK,
|
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_ISK,
|
||||||
|
STR_CURR_ITL,
|
||||||
|
STR_CURR_NLG,
|
||||||
STR_CURR_NOK,
|
STR_CURR_NOK,
|
||||||
STR_CURR_EUR,
|
STR_CURR_PLN,
|
||||||
STR_CURR_ROL,
|
STR_CURR_ROL,
|
||||||
|
STR_CURR_RUR,
|
||||||
|
STR_CURR_SEK,
|
||||||
STR_CURR_CUSTOM,
|
STR_CURR_CUSTOM,
|
||||||
INVALID_STRING_ID
|
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}
|
/* 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)
|
static byte *str_cat(byte *dst, const byte *src)
|
||||||
{
|
{
|
||||||
while ( (*dst++ = *src++) != 0) {}
|
while ( (*dst++ = *src++) != 0) {}
|
||||||
|
|
|
@ -1,26 +1,30 @@
|
||||||
|
// exchange rate prefix
|
||||||
|
// | separator | postfix
|
||||||
|
// | | Euro year | |
|
||||||
|
// | | | | |
|
||||||
CurrencySpec _currency_specs[] = {
|
CurrencySpec _currency_specs[] = {
|
||||||
{ 1, ',', CF_NOEURO, "\xA3", "" }, // british pounds
|
{ 1, ',', CF_NOEURO, "\xA3", "" }, // british pounds
|
||||||
{ 2, ',', CF_NOEURO, "$", "" }, // us dollars
|
{ 2, ',', CF_NOEURO, "$", "" }, // us dollars
|
||||||
{ 10, '.', 2002, "FF ", "" }, // french francs
|
{ 2, ',', CF_ISEURO, "¤", "" }, // Euro
|
||||||
{ 4, '.', 2002, "DM ", "" }, // deutsche mark
|
{ 200, ',', CF_NOEURO, "\xA5", "" }, // yen
|
||||||
{ 200, ',', CF_NOEURO, "\xA5", "" }, // yen
|
{ 57, ',', 2002, "BEF ", "" }, // belgian franc
|
||||||
{ 200, '.', 2002, "Pt", "" }, // spanish pesetas
|
{ 2, ',', CF_NOEURO,"CHF ", "" }, // swiss franc
|
||||||
{ 376, ',', 2002, "", " Ft" },
|
{ 480, ',', 2002, "", "Dr." }, // greek drachma
|
||||||
{ 6, ' ', CF_NOEURO, "", " zl" },
|
{ 4, '.', 2002, "DM ", "" }, // deutsche mark
|
||||||
{ 19, ',', 2002, "ATS ", "" },
|
{ 10, '.', 2002, "FF ", "" }, // french francs
|
||||||
{ 57, ',', 2002, "BEF ", "" },
|
{ 376, ',', 2002, "", " Ft" }, // forint
|
||||||
{ 10, '.', CF_NOEURO, "", " kr" },
|
{ 50, ',', CF_NOEURO, "", " Kc" }, // czech koruna // TODO: Should use the "c" with an upside down "^"
|
||||||
{ 8, ',', 2002, "FIM ", "" },
|
{ 13, '.', CF_NOEURO, "", " Kr" }, // swedish krona
|
||||||
{ 480, ',', 2002, "GRD ", "" },
|
{ 130, '.', CF_NOEURO, "", " Kr" }, // icelandic krona
|
||||||
{ 2, ',', CF_NOEURO, "CHF ", "" },
|
{ 11, '.', CF_NOEURO, "", " Kr" }, // norwegian krone
|
||||||
{ 3, ',', 2002, "NLG ", "" },
|
{ 10, '.', CF_NOEURO, "", " kr" }, // danish krone
|
||||||
{ 2730,',', 2002, "ITL ", "" },
|
{ 2730,',', 2002, "", " L." }, // italian lira
|
||||||
{ 13, '.', CF_NOEURO, "", " kr" },
|
{ 6, '.', CF_NOEURO, ""," Lei" }, // romanian Lei
|
||||||
{ 5, ' ', CF_NOEURO, "", " rur" },
|
{ 8, ',', 2002, "", " MK" }, // finnish markka
|
||||||
{ 50, ',', CF_NOEURO, "", " Kc" },
|
{ 3, ',', 2002, "NLG ", "" }, // dutch gulden
|
||||||
{ 130, '.', CF_NOEURO, "", " kr" },
|
{ 5, ' ', CF_NOEURO, "", " p" }, // russian rouble
|
||||||
{ 11, '.', CF_NOEURO, "", " kr" },
|
{ 200, '.', 2002, "Pts ", "" }, // spanish pesetas
|
||||||
{ 2, ',', CF_ISEURO, "¤", "" },
|
{ 19, ',', 2002, "", " S." }, // austrian schilling
|
||||||
{ 6, '.', CF_NOEURO, "", " Lei" },
|
{ 6, ' ', CF_NOEURO, "", " zl" }, // polish zloty
|
||||||
|
{ 1, ' ', CF_NOEURO, "", "" }, // custom currency
|
||||||
};
|
};
|
||||||
|
|
18
ttd.c
18
ttd.c
|
@ -1185,6 +1185,19 @@ void UpdateExclusiveRights()
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
byte covert_currency[] = {
|
||||||
|
0, 1, 12, 8, 3,
|
||||||
|
10, 14, 19, 4, 5,
|
||||||
|
9, 11, 13, 6, 17,
|
||||||
|
16, 22, 21, 7, 15,
|
||||||
|
18, 2, 20, };
|
||||||
|
|
||||||
|
// since savegame version 4.2 the currencies are arranged differently
|
||||||
|
void UpdateCurrencies()
|
||||||
|
{
|
||||||
|
_opt.currency = covert_currency[_opt.currency];
|
||||||
|
}
|
||||||
|
|
||||||
extern void UpdateOldAircraft();
|
extern void UpdateOldAircraft();
|
||||||
|
|
||||||
bool AfterLoadGame(uint version)
|
bool AfterLoadGame(uint version)
|
||||||
|
@ -1202,6 +1215,11 @@ bool AfterLoadGame(uint version)
|
||||||
UpdateExclusiveRights();
|
UpdateExclusiveRights();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// from version 4.2 of the savegame, currencies are in a different order
|
||||||
|
if (version <= 0x401) {
|
||||||
|
UpdateCurrencies();
|
||||||
|
}
|
||||||
|
|
||||||
// convert road side to my format.
|
// convert road side to my format.
|
||||||
if (_opt.road_side) _opt.road_side = 1;
|
if (_opt.road_side) _opt.road_side = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue