SetupFileHash *setup_file_hash;
int i, j;
-#if 0
- for (i=0; image_config_vars[i].token != NULL; i++)
- printf("::: '%s'\n", image_config_vars[i].token);
-
- printf("!!! '%lx'\n", image_config[353].token);
-
-#if 0
- for (j=0; image_config[j].token != NULL; j++)
- {
- printf("!!! %d: '%lx'\n", j, image_config[j].token);
- printf("!!! %d: '%s'\n", j, image_config[j].token);
- }
-
- printf("::: DONE\n");
-#endif
-#endif
-
-
/* always start with reliable default values from default config */
for (i=0; image_config_vars[i].token != NULL; i++)
- {
- /*
- printf("::: %d\n", 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;
static boolean last_override_level_sounds = FALSE;
static boolean last_override_level_music = FALSE;
/* identifier for new artwork; default: artwork configured in setup */
+#if 0
char *gfx_new_identifier = artwork.gfx_current->identifier;
char *snd_new_identifier = artwork.snd_current->identifier;
char *mus_new_identifier = artwork.mus_current->identifier;
+#else
+ char *gfx_new_identifier = artwork.gfx_current_identifier;
+ char *snd_new_identifier = artwork.snd_current_identifier;
+ char *mus_new_identifier = artwork.mus_current_identifier;
+#endif
boolean redraw_screen = FALSE;
#if 0
/* when a new level series was selected, check if there was a change
in custom artwork stored in level series directory */
- if (leveldir_current_identifier != leveldir_current->identifier)
+ if (1 || leveldir_current_identifier != leveldir_current->identifier)
{
#if 0
char *identifier_old = leveldir_current_identifier;
if (strcmp(artwork.gfx_current_identifier, gfx_new_identifier) != 0 ||
last_override_level_graphics != setup.override_level_graphics)
{
-#if 0
+#if 1
printf("RELOADING GRAPHICS '%s' -> '%s' ['%s']\n",
artwork.gfx_current_identifier,
gfx_new_identifier,
InitImages();
+#if 0
+ printf("::: %d\n", menu.list_size[GAME_MODE_LEVELS]);
+#endif
+
FreeTileClipmasks();
InitTileClipmasks();
#if 0
drawCursorExt(xpos, ypos, -1, graphic);
}
+static void drawChooseTreeCursor(int ypos, int color)
+{
+ int last_game_status = game_status; /* save current game status */
+
+ /* force LEVELS draw offset on artwork setup screen */
+ game_status = GAME_MODE_LEVELS;
+
+ drawCursorExt(0, ypos, color, 0);
+
+ game_status = last_game_status; /* restore current game status */
+}
+
static void PlaySound_Menu_Start(int sound)
{
if (sound_info[sound].loop)
item_position = items_max - items_visible;
ModifyGadget(gi, GDI_SCROLLBAR_ITEMS_MAX, items_max,
+ GDI_SCROLLBAR_ITEMS_VISIBLE, items_visible,
GDI_SCROLLBAR_ITEM_POSITION, item_position, GDI_END);
}
if (button == MB_MENU_INITIALIZE)
{
+ int num_entries = numTreeInfoInGroup(ti);
int entry_pos = posTreeInfo(ti);
if (ti->cl_first == -1)
{
+ /* only on initialization */
ti->cl_first = MAX(0, entry_pos - num_page_entries + 1);
- ti->cl_cursor =
- entry_pos - ti->cl_first;
+ ti->cl_cursor = entry_pos - ti->cl_first;
+ }
+ else if (ti->cl_cursor >= num_page_entries ||
+ (num_entries > num_page_entries &&
+ num_entries - ti->cl_first < num_page_entries))
+ {
+ /* only after change of list size (by custom graphic configuration) */
+ ti->cl_first = MAX(0, entry_pos - num_page_entries + 1);
+ ti->cl_cursor = entry_pos - ti->cl_first;
}
if (dx == 999) /* first entry is set by scrollbar position */
drawChooseTreeList(ti->cl_first, num_page_entries, ti);
drawChooseTreeInfo(ti->cl_first + ti->cl_cursor, ti);
- drawCursor(ti->cl_cursor, FC_RED);
+ drawChooseTreeCursor(ti->cl_cursor, FC_RED);
+
return;
}
else if (button == MB_MENU_LEAVE)
if (mx || my) /* mouse input */
{
+ int last_game_status = game_status; /* save current game status */
+
+ /* force LEVELS draw offset on artwork setup screen */
+ game_status = GAME_MODE_LEVELS;
+
x = (mx - mSX) / 32;
y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS;
+
+ game_status = last_game_status; /* restore current game status */
}
else if (dx || dy) /* keyboard or scrollbar/scrollbutton input */
{
drawChooseTreeList(ti->cl_first, num_page_entries, ti);
drawChooseTreeInfo(ti->cl_first + ti->cl_cursor, ti);
- drawCursor(ti->cl_cursor, FC_RED);
+ drawChooseTreeCursor(ti->cl_cursor, FC_RED);
AdjustChooseTreeScrollbar(SCREEN_CTRL_ID_SCROLL_VERTICAL,
ti->cl_first, ti);
}
drawChooseTreeList(ti->cl_first, num_page_entries, ti);
drawChooseTreeInfo(ti->cl_first + ti->cl_cursor, ti);
- drawCursor(ti->cl_cursor, FC_RED);
+ drawChooseTreeCursor(ti->cl_cursor, FC_RED);
AdjustChooseTreeScrollbar(SCREEN_CTRL_ID_SCROLL_VERTICAL,
ti->cl_first, ti);
}
node_cursor->cl_cursor = ti->cl_cursor;
*ti_ptr = node_cursor->node_group;
DrawChooseTree(ti_ptr);
+
return;
}
}
{
*ti_ptr = ti->node_parent;
DrawChooseTree(ti_ptr);
+
return;
}
{
if (y != ti->cl_cursor)
{
- drawCursor(y, FC_RED);
- drawCursor(ti->cl_cursor, FC_BLUE);
+ drawChooseTreeCursor(y, FC_RED);
+ drawChooseTreeCursor(ti->cl_cursor, FC_BLUE);
drawChooseTreeInfo(ti->cl_first + y, ti);
ti->cl_cursor = y;
}
first_entry = 0;
highlight_position = mx;
drawHallOfFameList(first_entry, highlight_position);
+
return;
}
first_entry = 0;
drawHallOfFameList(first_entry, highlight_position);
+
return;
}
}
first_entry = MAX(0, MAX_SCORE_ENTRIES - NUM_MENU_ENTRIES_ON_SCREEN);
drawHallOfFameList(first_entry, highlight_position);
+
return;
}
}