mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Merge pull request #833 from ThomasdenH/develop
Use locale info to create default config
This commit is contained in:
19
src/config.c
19
src/config.c
@@ -201,7 +201,24 @@ void config_set_defaults()
|
||||
config_property_definition *property = §ion->property_definitions[j];
|
||||
|
||||
value_union *destValue = (value_union*)((size_t)section->base_address + (size_t)property->offset);
|
||||
memcpy(destValue, &property->default_value, _configValueTypeSize[property->type]);
|
||||
|
||||
if (strcmp(property->property_name, "language") == 0){
|
||||
destValue->value_uint16 = platform_get_locale_language();
|
||||
if (destValue->value_uint16 == LANGUAGE_UNDEFINED)
|
||||
memcpy(destValue, &property->default_value, _configValueTypeSize[property->type]);
|
||||
}
|
||||
else if (strcmp(property->property_name, "currency_format") == 0){
|
||||
destValue->value_uint8 = platform_get_locale_currency();
|
||||
}
|
||||
else if (strcmp(property->property_name, "measurement_format") == 0){
|
||||
destValue->value_uint8 = platform_get_locale_measurement_format();
|
||||
}
|
||||
else if (strcmp(property->property_name, "temperature_format") == 0){
|
||||
destValue->value_uint8 = platform_get_locale_temperature_format();
|
||||
}
|
||||
else {
|
||||
memcpy(destValue, &property->default_value, _configValueTypeSize[property->type]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user