tron@2292: /* $Id$ */ tron@2292: rubidium@9111: /** @file currency.h Functions to handle different currencies. */ belugas@6123: tron@2291: #ifndef CURRENCY_H tron@2291: #define CURRENCY_H tron@2291: rubidium@8140: #include "date_type.h" rubidium@8264: #include "strings_type.h" rubidium@8140: tron@2291: enum { tron@2291: CF_NOEURO = 0, tron@2291: CF_ISEURO = 1, Darkvater@5091: NUM_CURRENCY = 28, tron@4380: CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1 tron@2291: }; tron@2291: rubidium@6248: struct CurrencySpec { tron@2291: uint16 rate; tron@2291: char separator; rubidium@4297: Year to_euro; tron@2291: char prefix[16]; tron@2291: char suffix[16]; belugas@4377: /** belugas@4602: * The currency symbol is represented by two possible values, prefix and suffix belugas@4602: * Usage of one or the other is determined by symbol_pos. belugas@4602: * 0 = prefix belugas@4602: * 1 = suffix belugas@4602: * 2 = both : Special case only for custom currency. belugas@4602: * It is not a spec from Newgrf, belugas@4602: * rather a way to let users do what they want with custom curency belugas@4377: */ belugas@4377: byte symbol_pos; belugas@4377: StringID name; rubidium@6248: }; tron@2291: belugas@4377: belugas@4377: extern CurrencySpec _currency_specs[NUM_CURRENCY]; tron@2291: tron@2306: // XXX small hack, but makes the rest of the code a bit nicer to read peter1138@3596: #define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID]) rubidium@9346: #define _currency ((const CurrencySpec*)&_currency_specs[(_game_mode == GM_MENU) ? _opt_newgame.currency : _opt.currency]) tron@2306: rubidium@6247: uint GetMaskOfAllowedCurrencies(); rubidium@6247: void CheckSwitchToEuro(); belugas@6379: void ResetCurrencies(bool preserve_custom = true); rubidium@6247: StringID* BuildCurrencyDropdown(); belugas@4625: byte GetNewgrfCurrencyIdConverted(byte grfcurr_id); tron@2291: Darkvater@2436: #endif /* CURRENCY_H */