1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

New setting: save_plugin_data

This commit is contained in:
atmaxinger
2014-05-28 11:19:49 +02:00
parent 4ae98b18e6
commit d8b735a1ef
3 changed files with 27 additions and 0 deletions

View File

@@ -88,6 +88,7 @@ general_configuration_t gGeneral_config_default = {
0, // always_show_gridlines
1, // landscape_smoothing
0, // show_height_as_units
1, // save_plugin_data
};
sound_configuration_t gSound_config;
@@ -167,6 +168,14 @@ void config_load()
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS;
}
// save plugin data
if (gGeneral_config.save_plugin_data){
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= CONFIG_FLAG_SAVE_PLUGIN_DATA;
}
else {
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_SAVE_PLUGIN_DATA;
}
//sound configuration
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8) = gSound_config.sound_quality;
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER, sint8) = gSound_config.forced_software_buffering;
@@ -357,6 +366,13 @@ void config_write_ini_general(FILE *fp)
else {
fprintf(fp, "show_height_as_units = false\n");
}
if (gGeneral_config.save_plugin_data){
fprintf(fp, "save_plugin_data = true\n");
}
else {
fprintf(fp, "save_plugin_data = false\n");
}
}
/**
@@ -579,6 +595,14 @@ static void config_general(char *setting, char *value){
gGeneral_config.show_height_as_units = 0;
}
}
else if (strcmp(setting, "save_plugin_data") == 0){
if (strcmp(value, "true") == 0){
gGeneral_config.save_plugin_data = 1;
}
else {
gGeneral_config.save_plugin_data = 0;
}
}
}
/**

View File

@@ -139,6 +139,7 @@ typedef struct general_configuration {
sint8 always_show_gridlines;
sint8 landscape_smoothing;
sint8 show_height_as_units;
sint8 save_plugin_data;
} general_configuration_t;
static const struct { char *key; int value; } _currencyLookupTable[] = {

View File

@@ -270,6 +270,8 @@ static void window_options_mouseup()
break;
case WIDX_SAVE_PLUGIN_DATA_CHECKBOX:
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) ^= CONFIG_FLAG_SAVE_PLUGIN_DATA;
gGeneral_config.save_plugin_data = !(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8)
& CONFIG_FLAG_SAVE_PLUGIN_DATA);
config_save();
window_invalidate(w);
break;