Files @ r6353:98010ef327e3
Branch filter:

Location: cpp/openttd-patchpack/source/src/currency.h

miham
(svn r9392) -Update: WebTranslator2 update to 2007-03-21 19:54:29
brazilian_portuguese - 2 changed by fukumori (2)
danish - 11 fixed, 2 changed by ThomasA (13)
esperanto - 8 fixed by LaPingvino (8)
estonian - 28 fixed by vermon (27), t2t2 (1)
finnish - 19 fixed, 66 changed by pallokala (9), habazi (76)
french - 9 changed by Skiper (9)
italian - 1 fixed, 49 changed by sidew (50)
traditional_chinese - 2 fixed by thomasau (2)
ukrainian - 9 changed by mad (9)
/* $Id$ */

/** @file currency.h */

#ifndef CURRENCY_H
#define CURRENCY_H

enum {
	CF_NOEURO = 0,
	CF_ISEURO = 1,
	NUM_CURRENCY = 28,
	CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1
};

struct CurrencySpec {
	uint16 rate;
	char separator;
	Year to_euro;
	char prefix[16];
	char suffix[16];
	/**
	 * The currency symbol is represented by two possible values, prefix and suffix
	 * Usage of one or the other is determined by symbol_pos.
	 * 0 = prefix
	 * 1 = suffix
	 * 2 = both : Special case only for custom currency.
	 *            It is not a spec from Newgrf,
	 *            rather a way to let users do what they want with custom curency
	 */
	byte symbol_pos;
	StringID name;
};


extern CurrencySpec _currency_specs[NUM_CURRENCY];

// XXX small hack, but makes the rest of the code a bit nicer to read
#define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
#define _currency ((const CurrencySpec*)&_currency_specs[_opt_ptr->currency])

uint GetMaskOfAllowedCurrencies();
void CheckSwitchToEuro();
void ResetCurrencies();
StringID* BuildCurrencyDropdown();
byte GetNewgrfCurrencyIdConverted(byte grfcurr_id);

#endif /* CURRENCY_H */