#include "date_type.h"
#include "strings_type.h"
Go to the source code of this file.
Data Structures | |
struct | CurrencySpec |
Defines | |
#define | _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID]) |
#define | _currency ((const CurrencySpec*)&_currency_specs[_opt_ptr->currency]) |
Enumerations | |
enum | { CF_NOEURO = 0, CF_ISEURO = 1, NUM_CURRENCY = 28, CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1 } |
Functions | |
uint | GetMaskOfAllowedCurrencies () |
get a mask of the allowed currencies depending on the year | |
void | CheckSwitchToEuro () |
Verify if the currency chosen by the user is about to be converted to Euro. | |
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. | |
StringID * | BuildCurrencyDropdown () |
Build a list of currency names StringIDs to use in a dropdown list. | |
byte | GetNewgrfCurrencyIdConverted (byte grfcurr_id) |
Will return the ottd's index correspondance to the ttdpatch's id. | |
Variables | |
CurrencySpec | _currency_specs [NUM_CURRENCY] |
Definition in file currency.h.
StringID* BuildCurrencyDropdown | ( | ) |
Build a list of currency names StringIDs to use in a dropdown list.
Definition at line 179 of file currency.cpp.
uint GetMaskOfAllowedCurrencies | ( | ) |
get a mask of the allowed currencies depending on the year
Definition at line 132 of file currency.cpp.
byte GetNewgrfCurrencyIdConverted | ( | byte | grfcurr_id | ) |
Will return the ottd's index correspondance to the ttdpatch's id.
If the id is bigger then the array, it is a grf written for ottd, thus returning the same id. Only called from newgrf.c
grfcurr_id | currency id coming from newgrf |
Definition at line 123 of file currency.cpp.
References TTDPatch_To_OTTDIndex.
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 (the latest one on the list) if ever it is flagged to true. In which case, the total size of the memory to move will be one currency spec less, thus preserving the custom curreny from been overwritten. |
Definition at line 170 of file currency.cpp.
Referenced by LoadFromConfig(), and ResetNewGRFData().