+
+void LoadCustomElementDescriptions()
+{
+ char *filename = getCustomArtworkConfigFilename(ARTWORK_TYPE_GRAPHICS);
+ SetupFileHash *setup_file_hash;
+ int i;
+
+ for (i=0; i<NUM_FILE_ELEMENTS; i++)
+ {
+ if (element_info[i].custom_description != NULL)
+ {
+ free(element_info[i].custom_description);
+ element_info[i].custom_description = NULL;
+ }
+ }
+
+ if ((setup_file_hash = loadSetupFileHash(filename)) == NULL)
+ return;
+
+ for (i=0; i<NUM_FILE_ELEMENTS; i++)
+ {
+ char *token = getStringCat2(element_info[i].token_name, ".name");
+ char *value = getHashEntry(setup_file_hash, token);
+
+ if (value != NULL)
+ element_info[i].custom_description = getStringCopy(value);
+
+ free(token);
+ }
+
+ freeSetupFileHash(setup_file_hash);
+}
+
+void LoadSpecialMenuDesignSettings()
+{
+ char *filename = getCustomArtworkConfigFilename(ARTWORK_TYPE_GRAPHICS);
+ SetupFileHash *setup_file_hash;
+ int i, j;
+
+ /* always start with reliable default values from default config */
+ for (i=0; image_config_vars[i].token != NULL; i++)
+ for (j=0; image_config[j].token != NULL; j++)
+ if (strcmp(image_config_vars[i].token, image_config[j].token) == 0)
+ *image_config_vars[i].value =
+ get_integer_from_string(image_config[j].value);
+
+ if ((setup_file_hash = loadSetupFileHash(filename)) == NULL)
+ return;
+
+ /* special case: initialize with default values that may be overwrittem */
+ for (i=0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ {
+ char *value_x = getHashEntry(setup_file_hash, "menu.draw_xoffset");
+ char *value_y = getHashEntry(setup_file_hash, "menu.draw_yoffset");
+
+ if (value_x != NULL)
+ menu.draw_xoffset[i] = get_integer_from_string(value_x);
+ if (value_y != NULL)
+ menu.draw_yoffset[i] = get_integer_from_string(value_y);
+ }
+
+ /* read (and overwrite with) values that may be specified in config file */
+ for (i=0; image_config_vars[i].token != NULL; i++)
+ {
+ char *value = getHashEntry(setup_file_hash, image_config_vars[i].token);
+
+ if (value != NULL)
+ *image_config_vars[i].value = get_integer_from_string(value);
+ }
+
+ freeSetupFileHash(setup_file_hash);
+}