From: Holger Schemel Date: Sat, 19 Jul 2003 01:59:05 +0000 (+0200) Subject: rnd-20030719-3-src X-Git-Tag: 3.0.0^2~16 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d6c432b07a5880f361902a689341c84cc3fec342;p=rocksndiamonds.git rnd-20030719-3-src --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 721bf8e4..c7fe8f4b 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -3446,6 +3446,9 @@ struct ConfigInfo image_config[] = { "menu.draw_yoffset.SETUP", "0" }, { "menu.list_size", "-1" }, + { "menu.list_size.LEVELS", "-1" }, + { "menu.list_size.SCORES", "-1" }, + { "menu.list_size.INFO", "-1" }, { "door.step_offset", "2" }, { "door.step_delay", "10" }, diff --git a/src/conftime.h b/src/conftime.h index 0eca52f6..0f93647a 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-07-19 01:53]" +#define COMPILE_DATE_STRING "[2003-07-19 03:57]" diff --git a/src/files.c b/src/files.c index c075e6c5..21717f1d 100644 --- a/src/files.c +++ b/src/files.c @@ -2199,36 +2199,12 @@ void LoadSpecialMenuDesignSettings() 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; diff --git a/src/init.c b/src/init.c index cb782a1f..e2094bb7 100644 --- a/src/init.c +++ b/src/init.c @@ -3091,9 +3091,15 @@ void ReloadCustomArtwork() 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 @@ -3123,7 +3129,7 @@ void ReloadCustomArtwork() /* 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; @@ -3203,7 +3209,7 @@ void ReloadCustomArtwork() 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, @@ -3224,6 +3230,10 @@ void ReloadCustomArtwork() InitImages(); +#if 0 + printf("::: %d\n", menu.list_size[GAME_MODE_LEVELS]); +#endif + FreeTileClipmasks(); InitTileClipmasks(); #if 0 diff --git a/src/screens.c b/src/screens.c index f04ca586..f0f2a51f 100644 --- a/src/screens.c +++ b/src/screens.c @@ -127,6 +127,18 @@ static void drawCursorXY(int xpos, int ypos, int graphic) 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) @@ -1205,6 +1217,7 @@ static void AdjustChooseTreeScrollbar(int id, int first_entry, TreeInfo *ti) 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); } @@ -1306,13 +1319,22 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, 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 */ @@ -1323,7 +1345,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, 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) @@ -1348,8 +1371,15 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, 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 */ { @@ -1377,7 +1407,7 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, 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); } @@ -1391,7 +1421,7 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, 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); } @@ -1417,6 +1447,7 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, node_cursor->cl_cursor = ti->cl_cursor; *ti_ptr = node_cursor->node_group; DrawChooseTree(ti_ptr); + return; } } @@ -1424,6 +1455,7 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, { *ti_ptr = ti->node_parent; DrawChooseTree(ti_ptr); + return; } @@ -1433,8 +1465,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, { 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; } @@ -1570,6 +1602,7 @@ void HandleHallOfFame(int mx, int my, int dx, int dy, int button) first_entry = 0; highlight_position = mx; drawHallOfFameList(first_entry, highlight_position); + return; } @@ -1585,6 +1618,7 @@ void HandleHallOfFame(int mx, int my, int dx, int dy, int button) first_entry = 0; drawHallOfFameList(first_entry, highlight_position); + return; } } @@ -1597,6 +1631,7 @@ void HandleHallOfFame(int mx, int my, int dx, int dy, int button) first_entry = MAX(0, MAX_SCORE_ENTRIES - NUM_MENU_ENTRIES_ON_SCREEN); drawHallOfFameList(first_entry, highlight_position); + return; } }