diff --git a/src/config.c b/src/config.c index ea93527872..e038dc3cab 100644 --- a/src/config.c +++ b/src/config.c @@ -87,6 +87,7 @@ general_configuration_t gGeneral_config_default = { 1, // edge_scrolling 0, // always_show_gridlines 1, // landscape_smoothing + 0, // show_height_as_units }; sound_configuration_t gSound_config; @@ -158,7 +159,13 @@ void config_load() RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE; } - + // show height as units + if (gGeneral_config.show_height_as_units){ + RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS; + } + else { + RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS; + } //sound configuration RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8) = gSound_config.sound_quality; @@ -343,6 +350,13 @@ void config_write_ini_general(FILE *fp) else { fprintf(fp, "landscape_smoothing = false\n"); } + + if (gGeneral_config.show_height_as_units){ + fprintf(fp, "show_height_as_units = true\n"); + } + else { + fprintf(fp, "show_height_as_units = false\n"); + } } /** @@ -557,6 +571,14 @@ static void config_general(char *setting, char *value){ gGeneral_config.landscape_smoothing = 0; } } + else if (strcmp(setting, "show_height_as_units") == 0){ + if (strcmp(value, "true") == 0){ + gGeneral_config.show_height_as_units = 1; + } + else { + gGeneral_config.show_height_as_units = 0; + } + } } /** diff --git a/src/config.h b/src/config.h index 9bdb7d6f4c..be7d72c473 100644 --- a/src/config.h +++ b/src/config.h @@ -138,6 +138,7 @@ typedef struct general_configuration { sint8 edge_scrolling; sint8 always_show_gridlines; sint8 landscape_smoothing; + sint8 show_height_as_units; } general_configuration_t; static const struct { char *key; int value; } _currencyLookupTable[] = { diff --git a/src/window_options.c b/src/window_options.c index 26f8d4d1d0..9aaf38e397 100644 --- a/src/window_options.c +++ b/src/window_options.c @@ -451,9 +451,12 @@ static void window_options_dropdown() case WIDX_HEIGHT_LABELS_DROPDOWN: // reset flag and set it to 1 if height as units is selected RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= ~CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS; + gGeneral_config.show_height_as_units = 0; - if (dropdownIndex == 0) - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS; + if (dropdownIndex == 0) { + RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS; + gGeneral_config.show_height_as_units = 1; + } window_options_update_height_markers(); break;