X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ffiles.c;h=3f456937a028f80f6b1929211d4cc8fa44433541;hb=73b48f8afe7e1e1faf0e87436d7d74b27bba5f27;hp=497d12c87f8941ee063762c3dda96738adad977c;hpb=c1835c332851f0f30f4bc907d4cc995b56472227;p=rocksndiamonds.git diff --git a/src/files.c b/src/files.c index 497d12c8..3f456937 100644 --- a/src/files.c +++ b/src/files.c @@ -18,6 +18,7 @@ #include "files.h" #include "init.h" +#include "screens.h" #include "tools.h" #include "tape.h" #include "config.h" @@ -8896,17 +8897,22 @@ static char *getHideSetupToken(void *setup_value) return hide_setup_token; } -static void setHideSetupEntry(void *setup_value_raw) +void setHideSetupEntry(void *setup_value) { - /* !!! DIRTY WORKAROUND; TO BE FIXED AFTER THE MM ENGINE RELEASE !!! */ - void *setup_value = setup_value_raw - (void *)&si + (void *)&setup; - char *hide_setup_token = getHideSetupToken(setup_value); if (setup_value != NULL) setHashEntry(hide_setup_hash, hide_setup_token, ""); } +static void setHideSetupEntryRaw(char *token_text, void *setup_value_raw) +{ + /* !!! DIRTY WORKAROUND; TO BE FIXED AFTER THE MM ENGINE RELEASE !!! */ + void *setup_value = setup_value_raw - (void *)&si + (void *)&setup; + + setHideSetupEntry(setup_value); +} + boolean hideSetupEntry(void *setup_value) { char *hide_setup_token = getHideSetupToken(setup_value); @@ -8927,7 +8933,7 @@ static void setSetupInfoFromTokenText(SetupFileHash *setup_file_hash, /* check if this setup option should be hidden in the setup menu */ if (token_hide_value != NULL && get_boolean_from_string(token_hide_value)) - setHideSetupEntry(token_info[token_nr].value); + setHideSetupEntryRaw(token_text, token_info[token_nr].value); } static void setSetupInfoFromTokenInfo(SetupFileHash *setup_file_hash, @@ -9008,6 +9014,8 @@ static void decodeSetupFileHash(SetupFileHash *setup_file_hash) for (i = 0; i < NUM_OPTIONS_SETUP_TOKENS; i++) setSetupInfoFromTokenInfo(setup_file_hash, options_setup_tokens, i); setup.options = soi; + + setHideRelatedSetupEntries(); } static void decodeSetupFileHash_AutoSetup(SetupFileHash *setup_file_hash) @@ -9763,22 +9771,34 @@ static void LoadMenuDesignSettingsFromFilename(char *filename) /* (eg, init "menu.line_spacing.INFO[XXX]" from "menu.line_spacing.INFO") */ for (i = 0; i < NUM_SPECIAL_GFX_INFO_ARGS; i++) { - char *value_1 = getHashEntry(setup_file_hash,"menu.paragraph_spacing.INFO"); - char *value_2 = getHashEntry(setup_file_hash,"menu.headline1_spacing.INFO"); - char *value_3 = getHashEntry(setup_file_hash,"menu.headline2_spacing.INFO"); - char *value_4 = getHashEntry(setup_file_hash,"menu.line_spacing.INFO"); - char *value_5 = getHashEntry(setup_file_hash,"menu.extra_spacing.INFO"); + char *value_1 = getHashEntry(setup_file_hash,"menu.left_spacing.INFO"); + char *value_2 = getHashEntry(setup_file_hash,"menu.right_spacing.INFO"); + char *value_3 = getHashEntry(setup_file_hash,"menu.top_spacing.INFO"); + char *value_4 = getHashEntry(setup_file_hash,"menu.bottom_spacing.INFO"); + char *value_5 = getHashEntry(setup_file_hash,"menu.paragraph_spacing.INFO"); + char *value_6 = getHashEntry(setup_file_hash,"menu.headline1_spacing.INFO"); + char *value_7 = getHashEntry(setup_file_hash,"menu.headline2_spacing.INFO"); + char *value_8 = getHashEntry(setup_file_hash,"menu.line_spacing.INFO"); + char *value_9 = getHashEntry(setup_file_hash,"menu.extra_spacing.INFO"); if (value_1 != NULL) - menu.paragraph_spacing_info[i] = get_integer_from_string(value_1); + menu.left_spacing_info[i] = get_integer_from_string(value_1); if (value_2 != NULL) - menu.headline1_spacing_info[i] = get_integer_from_string(value_2); + menu.right_spacing_info[i] = get_integer_from_string(value_2); if (value_3 != NULL) - menu.headline2_spacing_info[i] = get_integer_from_string(value_3); + menu.top_spacing_info[i] = get_integer_from_string(value_3); if (value_4 != NULL) - menu.line_spacing_info[i] = get_integer_from_string(value_4); + menu.bottom_spacing_info[i] = get_integer_from_string(value_4); if (value_5 != NULL) - menu.extra_spacing_info[i] = get_integer_from_string(value_5); + menu.paragraph_spacing_info[i] = get_integer_from_string(value_5); + if (value_6 != NULL) + menu.headline1_spacing_info[i] = get_integer_from_string(value_6); + if (value_7 != NULL) + menu.headline2_spacing_info[i] = get_integer_from_string(value_7); + if (value_8 != NULL) + menu.line_spacing_info[i] = get_integer_from_string(value_8); + if (value_9 != NULL) + menu.extra_spacing_info[i] = get_integer_from_string(value_9); } /* special case: initialize with default values that may be overwritten */