|
OpenTTD Source 20260711-master-g3fb3006dff
|
Functions to handle different currencies. More...
Go to the source code of this file.
Functions | |
| CurrencySpec & | GetCustomCurrency () |
| Get the custom currency. | |
| const CurrencySpec & | GetCurrency () |
| Get the currently selected currency. | |
| Currencies | GetMaskOfAllowedCurrencies () |
| get a mask of the allowed currencies depending on the year | |
| void | ResetCurrencies (bool preserve_custom=true) |
| Will fill _currency_specs array with default values from _origin_currency_specs Called only from newgrf.cpp and settings.cpp. | |
| Currency | GetNewgrfCurrencyIdConverted (uint8_t grfcurr_id) |
| Will return the ottd's index correspondence to the ttdpatch's id. | |
Variables | |
| EnumIndexArray< CurrencySpec, Currency, Currency::End > | _currency_specs |
| Array of currencies used by the system. | |
Functions to handle different currencies.
Definition in file currency_func.h.
|
inline |
Get the currently selected currency.
Definition at line 31 of file currency_func.h.
References _currency_specs, LocaleSettings::currency, GetGameSettings(), and GameSettings::locale.
Referenced by FormatString(), CheatWindow::OnQueryTextFinished(), CompanyWindow::OnQueryTextFinished(), GameOptionsWindow::OnQueryTextFinished(), and PerformanceRatingDetailWindow::UpdateWidgetSize().
|
inline |
Get the custom currency.
Definition at line 22 of file currency_func.h.
References _currency_specs, and Custom.
Referenced by CustomCurrencyWindow::GetWidgetString(), CustomCurrencyWindow::OnClick(), CustomCurrencyWindow::OnQueryTextFinished(), and SurveySettings().
| Currencies GetMaskOfAllowedCurrencies | ( | ) |
get a mask of the allowed currencies depending on the year
Definition at line 128 of file currency.cpp.
References _currency_specs, CF_ISEURO, CF_NOEURO, Custom, End, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), and TimerGameCalendar::year.
Referenced by GameOptionsWindow::BuildDropDownList().
| Currency GetNewgrfCurrencyIdConverted | ( | uint8_t | grfcurr_id | ) |
Will return the ottd's index correspondence to the ttdpatch's id.
If the id is bigger than the array, it is a grf written for ottd, thus returning the same id. Only called from newgrf.cpp
| grfcurr_id | currency id coming from newgrf |
Currency::End when invalid. Definition at line 118 of file currency.cpp.
References _ttdpatch_to_ottd_currency, and End.
Referenced by GlobalVarChangeInfo().
| void ResetCurrencies | ( | bool | preserve_custom | ) |
Will fill _currency_specs array with default values from _origin_currency_specs Called only from newgrf.cpp and settings.cpp.
| preserve_custom | will not reset custom currency |
Definition at line 162 of file currency.cpp.
References _currency_specs, _origin_currency_specs, Custom, and End.
Referenced by LoadFromConfig(), and ResetNewGRFData().
|
extern |
Array of currencies used by the system.
Definition at line 80 of file currency.cpp.
Referenced by GameOptionsWindow::BuildDropDownList(), GetCurrency(), GetCustomCurrency(), GetMaskOfAllowedCurrencies(), GameOptionsWindow::GetWidgetString(), GlobalVarChangeInfo(), and ResetCurrencies().