mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
Move loading custom currency-related preferences code into currency.c
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../config.h"
|
||||
#include "currency.h"
|
||||
#include "string_ids.h"
|
||||
|
||||
@@ -36,3 +37,10 @@ currency_descriptor CurrencyDescriptors[CURRENCY_END] = {
|
||||
{ "CNY", 100, CURRENCY_PREFIX, "CN\xC2\xA5", CURRENCY_PREFIX, "CNY", STR_CHINESE_YUAN }, // Chinese Yuan
|
||||
{ "CTM", 10, CURRENCY_PREFIX, "Ctm", CURRENCY_PREFIX, "Ctm", STR_CUSTOM_CURRENCY }, // Customizable currency
|
||||
};
|
||||
|
||||
void currency_load_custom_currency_config()
|
||||
{
|
||||
CurrencyDescriptors[CURRENCY_CUSTOM].rate = gConfigGeneral.custom_currency_rate;
|
||||
CurrencyDescriptors[CURRENCY_CUSTOM].affix_unicode = gConfigGeneral.custom_currency_affix;
|
||||
strncpy(CurrencyDescriptors[CURRENCY_CUSTOM].symbol_unicode, gConfigGeneral.custom_currency_symbol, CURRENCY_SYMBOL_MAX_SIZE);
|
||||
}
|
||||
|
||||
@@ -65,4 +65,10 @@ typedef struct currency_descriptor {
|
||||
// List of currency formats
|
||||
extern currency_descriptor CurrencyDescriptors[CURRENCY_END];
|
||||
|
||||
/**
|
||||
* Loads custom currency saved parameters into {@link CurrencyDescriptors}'
|
||||
* custom currency entry
|
||||
*/
|
||||
void currency_load_custom_currency_config();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "interface/window.h"
|
||||
#include "interface/viewport.h"
|
||||
#include "intro.h"
|
||||
#include "localisation/currency.h"
|
||||
#include "localisation/localisation.h"
|
||||
#include "network/http.h"
|
||||
#include "network/network.h"
|
||||
@@ -260,6 +261,8 @@ bool openrct2_initialise()
|
||||
}
|
||||
}
|
||||
|
||||
currency_load_custom_currency_config();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -323,11 +326,6 @@ void openrct2_launch()
|
||||
}
|
||||
#endif // DISABLE_NETWORK
|
||||
|
||||
// Set custom currency properties
|
||||
CurrencyDescriptors[CURRENCY_CUSTOM].rate = gConfigGeneral.custom_currency_rate;
|
||||
CurrencyDescriptors[CURRENCY_CUSTOM].affix_unicode = gConfigGeneral.custom_currency_affix;
|
||||
strncpy(CurrencyDescriptors[CURRENCY_CUSTOM].symbol_unicode, gConfigGeneral.custom_currency_symbol, CURRENCY_SYMBOL_MAX_SIZE);
|
||||
|
||||
openrct2_loop();
|
||||
}
|
||||
openrct2_dispose();
|
||||
|
||||
Reference in New Issue
Block a user