(svn r6108) -NewGRF Feature: Implement currencies replacment via grf file.

All properties can now be modified i.e:
Introduction date for euro conversion
Currency name, decimal separator, currency symbol (before or after amount)
and the rate compared to the base currency, the british pound
This commit is contained in:
belugas
2006-08-25 00:41:10 +00:00
parent 7875e07373
commit 473885c615
5 changed files with 178 additions and 78 deletions

View File

@@ -6,6 +6,8 @@
enum {
CF_NOEURO = 0,
CF_ISEURO = 1,
NUM_CURRENCY = 25,
CUSTOM_CURRENCY_ID = NUM_CURRENCY + 1,
};
typedef struct {
@@ -14,17 +16,24 @@ typedef struct {
Year to_euro;
char prefix[16];
char suffix[16];
/**
* Position of the currency symbol on the amount string.
* 0 = placed before, 1 = placed after
*/
byte symbol_pos;
StringID name;
} CurrencySpec;
extern CurrencySpec _currency_specs[];
extern const StringID _currency_string_list[];
extern CurrencySpec _currency_specs[NUM_CURRENCY];
// XXX small hack, but makes the rest of the code a bit nicer to read
#define CUSTOM_CURRENCY_ID 24
#define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
#define _currency ((const CurrencySpec*)&_currency_specs[_opt_ptr->currency])
uint GetMaskOfAllowedCurrencies(void);
void CheckSwitchToEuro(void);
void ResetCurrencies(void);
StringID* BuildCurrencyDropdown(void);
#endif /* CURRENCY_H */