20 #include "table/strings.h"
30 { 1,
"",
CF_NOEURO,
"\u00a3",
"",
"GBP", 0, STR_GAME_OPTIONS_CURRENCY_GBP },
31 { 2,
"",
CF_NOEURO,
"$",
"",
"USD", 0, STR_GAME_OPTIONS_CURRENCY_USD },
32 { 2,
"",
CF_ISEURO,
"\u20ac",
"",
"EUR", 0, STR_GAME_OPTIONS_CURRENCY_EUR },
33 { 220,
"",
CF_NOEURO,
"\u00a5",
"",
"JPY", 0, STR_GAME_OPTIONS_CURRENCY_JPY },
34 { 27,
"", 2002,
"",
NBSP "S.",
"ATS", 1, STR_GAME_OPTIONS_CURRENCY_ATS },
35 { 81,
"", 2002,
"BEF" NBSP,
"",
"BEF", 0, STR_GAME_OPTIONS_CURRENCY_BEF },
36 { 2,
"",
CF_NOEURO,
"CHF" NBSP,
"",
"CHF", 0, STR_GAME_OPTIONS_CURRENCY_CHF },
37 { 41,
"",
CF_NOEURO,
"",
NBSP "K\u010d",
"CZK", 1, STR_GAME_OPTIONS_CURRENCY_CZK },
38 { 4,
"", 2002,
"DM" NBSP,
"",
"DEM", 0, STR_GAME_OPTIONS_CURRENCY_DEM },
39 { 11,
"",
CF_NOEURO,
"",
NBSP "kr",
"DKK", 1, STR_GAME_OPTIONS_CURRENCY_DKK },
40 { 333,
"", 2002,
"Pts" NBSP,
"",
"ESP", 0, STR_GAME_OPTIONS_CURRENCY_ESP },
41 { 12,
"", 2002,
"",
NBSP "mk",
"FIM", 1, STR_GAME_OPTIONS_CURRENCY_FIM },
42 { 13,
"", 2002,
"FF" NBSP,
"",
"FRF", 0, STR_GAME_OPTIONS_CURRENCY_FRF },
43 { 681,
"", 2002,
"",
"Dr.",
"GRD", 1, STR_GAME_OPTIONS_CURRENCY_GRD },
44 { 378,
"",
CF_NOEURO,
"",
NBSP "Ft",
"HUF", 1, STR_GAME_OPTIONS_CURRENCY_HUF },
45 { 130,
"",
CF_NOEURO,
"",
NBSP "Kr",
"ISK", 1, STR_GAME_OPTIONS_CURRENCY_ISK },
46 { 3873,
"", 2002,
"",
NBSP "L.",
"ITL", 1, STR_GAME_OPTIONS_CURRENCY_ITL },
47 { 4,
"", 2002,
"NLG" NBSP,
"",
"NLG", 0, STR_GAME_OPTIONS_CURRENCY_NLG },
48 { 12,
"",
CF_NOEURO,
"",
NBSP "Kr",
"NOK", 1, STR_GAME_OPTIONS_CURRENCY_NOK },
49 { 6,
"",
CF_NOEURO,
"",
NBSP "z\u0142",
"PLN", 1, STR_GAME_OPTIONS_CURRENCY_PLN },
50 { 5,
"",
CF_NOEURO,
"",
NBSP "Lei",
"RON", 1, STR_GAME_OPTIONS_CURRENCY_RON },
51 { 50,
"",
CF_NOEURO,
"",
NBSP "p",
"RUR", 1, STR_GAME_OPTIONS_CURRENCY_RUR },
52 { 479,
"", 2007,
"",
NBSP "SIT",
"SIT", 1, STR_GAME_OPTIONS_CURRENCY_SIT },
53 { 13,
"",
CF_NOEURO,
"",
NBSP "Kr",
"SEK", 1, STR_GAME_OPTIONS_CURRENCY_SEK },
54 { 3,
"",
CF_NOEURO,
"",
NBSP "TL",
"TRY", 1, STR_GAME_OPTIONS_CURRENCY_TRY },
55 { 60,
"", 2009,
"",
NBSP "Sk",
"SKK", 1, STR_GAME_OPTIONS_CURRENCY_SKK },
56 { 4,
"",
CF_NOEURO,
"R$" NBSP,
"",
"BRL", 0, STR_GAME_OPTIONS_CURRENCY_BRL },
57 { 31,
"", 2011,
"",
NBSP "EEK",
"EEK", 1, STR_GAME_OPTIONS_CURRENCY_EEK },
58 { 4,
"", 2015,
"",
NBSP "Lt",
"LTL", 1, STR_GAME_OPTIONS_CURRENCY_LTL },
59 { 1850,
"",
CF_NOEURO,
"\u20a9",
"",
"KRW", 0, STR_GAME_OPTIONS_CURRENCY_KRW },
60 { 13,
"",
CF_NOEURO,
"R" NBSP,
"",
"ZAR", 0, STR_GAME_OPTIONS_CURRENCY_ZAR },
61 { 1,
"",
CF_NOEURO,
"",
"",
"", 2, STR_GAME_OPTIONS_CURRENCY_CUSTOM },
62 { 3,
"",
CF_NOEURO,
"",
NBSP "GEL",
"GEL", 1, STR_GAME_OPTIONS_CURRENCY_GEL },
63 { 4901,
"",
CF_NOEURO,
"",
NBSP "Rls",
"IRR", 1, STR_GAME_OPTIONS_CURRENCY_IRR },
64 { 80,
"",
CF_NOEURO,
"",
NBSP "rub",
"RUB", 1, STR_GAME_OPTIONS_CURRENCY_RUB },
65 { 24,
"",
CF_NOEURO,
"$",
"",
"MXN", 0, STR_GAME_OPTIONS_CURRENCY_MXN },
66 { 40,
"",
CF_NOEURO,
"NTD" NBSP,
"",
"NTD", 0, STR_GAME_OPTIONS_CURRENCY_NTD },
67 { 8,
"",
CF_NOEURO,
"\u00a5",
"",
"CNY", 0, STR_GAME_OPTIONS_CURRENCY_CNY },
68 { 10,
"",
CF_NOEURO,
"HKD" NBSP,
"",
"HKD", 0, STR_GAME_OPTIONS_CURRENCY_HKD },
69 { 90,
"",
CF_NOEURO,
"\u20b9",
"",
"INR", 0, STR_GAME_OPTIONS_CURRENCY_INR },
70 { 19,
"",
CF_NOEURO,
"Rp",
"",
"IDR", 0, STR_GAME_OPTIONS_CURRENCY_IDR },
71 { 5,
"",
CF_NOEURO,
"RM",
"",
"MYR", 0, STR_GAME_OPTIONS_CURRENCY_MYR },
72 { 1,
"", 2014,
"",
NBSP "Ls",
"LVL", 1, STR_GAME_OPTIONS_CURRENCY_LVL },
73 { 400,
"", 2002,
"",
"$00",
"PTE", 1, STR_GAME_OPTIONS_CURRENCY_PTE },
Functions related to bit mathematics.
constexpr T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
static Year year
Current year, starting at 0.
void ResetCurrencies(bool preserve_custom)
Will fill _currency_specs array with default values from origin_currency_specs Called only from newgr...
static const std::array< CurrencySpec, CURRENCY_END > origin_currency_specs
The original currency specifications.
uint64_t GetMaskOfAllowedCurrencies()
get a mask of the allowed currencies depending on the year
const uint8_t TTDPatch_To_OTTDIndex[]
This array represent the position of OpenTTD's currencies, compared to TTDPatch's ones.
static IntervalTimer< TimerGameCalendar > _check_switch_to_euro({TimerGameCalendar::YEAR, TimerGameCalendar::Priority::NONE}, [](auto) { if(_currency_specs[_settings_game.locale.currency].to_euro !=CF_NOEURO &&_currency_specs[_settings_game.locale.currency].to_euro !=CF_ISEURO &&TimerGameCalendar::year >=_currency_specs[_settings_game.locale.currency].to_euro) { _settings_game.locale.currency=2;AddNewsItem(STR_NEWS_EURO_INTRODUCTION, NT_ECONOMY, NF_NORMAL);} })
Verify if the currency chosen by the user is about to be converted to Euro.
uint8_t GetNewgrfCurrencyIdConverted(uint8_t grfcurr_id)
Will return the ottd's index correspondence to the ttdpatch's id.
std::array< CurrencySpec, CURRENCY_END > _currency_specs
Array of currencies used by the system.
Functions to handle different currencies.
static constexpr TimerGameCalendar::Year CF_ISEURO
Currency is the Euro.
static constexpr TimerGameCalendar::Year CF_NOEURO
Currency never switches to the Euro (as far as known).
@ CURRENCY_GBP
British Pound.
@ CURRENCY_ESP
Spanish Peseta.
@ CURRENCY_FRF
French Franc.
@ CURRENCY_SEK
Swedish Krona.
@ CURRENCY_GRD
Greek Drachma.
@ CURRENCY_JPY
Japanese Yen.
@ CURRENCY_DKK
Danish Krona.
@ CURRENCY_ATS
Austrian Schilling.
@ CURRENCY_END
always the last item
@ CURRENCY_FIM
Finish Markka.
@ CURRENCY_DEM
Deutsche Mark.
@ CURRENCY_BEF
Belgian Franc.
@ CURRENCY_ITL
Italian Lira.
@ CURRENCY_PLN
Polish Zloty.
@ CURRENCY_RUR
Russian Rouble.
@ CURRENCY_CHF
Swiss Franc.
@ CURRENCY_CUSTOM
Custom currency.
@ CURRENCY_NLG
Dutch Gulden.
@ CURRENCY_HUF
Hungarian Forint.
Functions related to news.
void AddNewsItem(StringID string, NewsType type, NewsFlag flags, NewsReferenceType reftype1=NR_NONE, uint32_t ref1=UINT32_MAX, NewsReferenceType reftype2=NR_NONE, uint32_t ref2=UINT32_MAX, const NewsAllocatedData *data=nullptr)
Add a new newsitem to be shown.
@ NT_ECONOMY
Economic changes (recession, industry up/dowm)
@ NF_NORMAL
Normal news item. (Newspaper with text only)
A number of safeguards to prevent using unsafe methods.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Types related to global configuration settings.
Definition of base types and functions in a cross-platform compatible way.
#define lengthof(array)
Return the length of an fixed size array.
#define NBSP
A non-breaking space.
LocaleSettings locale
settings related to used currency/unit system in the current game
uint8_t currency
currency we currently use
Templated helper to make a type-safe 'typedef' representing a single POD value.
Definition of Interval and OneShot timers.
Definition of the game-calendar-timer.