X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=3245e4474e97a78c89ab312416431b95784a566c;hb=8c1ac40c6c66b49fa4df93d2f1937ba5ceb78e7e;hp=c036c5a2531b2c7db1cef126d03da8685488710f;hpb=12c67d929d1bacfa688be49a25ee0bf847ed7ae6;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index c036c5a2..3245e447 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1688,8 +1688,6 @@ void DrawMainMenu(void) // store valid level series information leveldir_last_valid = leveldir_current; - init_last = init; // switch to new busy animation - // needed if last screen (level choice) changed graphics, sounds or music ReloadCustomArtwork(0); @@ -5114,8 +5112,13 @@ static void drawChooseTreeScreen_Scores_NotAvailable(void) static TreeInfo *setHallOfFameActiveEntry(TreeInfo **ti_ptr) { + int score_pos = scores.last_added; + + if (game_status_last_screen == GAME_MODE_SCOREINFO) + score_pos = scores.last_entry_nr; + // set current tree entry to last added score entry - *ti_ptr = getTreeInfoFromIdentifier(score_entries, i_to_a(scores.last_added)); + *ti_ptr = getTreeInfoFromIdentifier(score_entries, i_to_a(score_pos)); // if that fails, set current tree entry to first entry (back link) if (*ti_ptr == NULL) @@ -5710,6 +5713,7 @@ void HandleChooseLevelNr(int mx, int my, int dx, int dy, int button) static void DrawHallOfFame_setScoreEntries(void) { + int num_visible_score_entries = NUM_MENU_ENTRIES_ON_SCREEN - 1; int score_pos = (scores.last_added >= 0 ? scores.last_added : 0); int i; @@ -5722,9 +5726,10 @@ static void DrawHallOfFame_setScoreEntries(void) for (i = 0; i < MAX_SCORE_ENTRIES; i++) { - // do not add empty score entries + // do not add empty score entries if off-screen if (scores.entry[i].score == 0 && - scores.entry[i].time == 0) + scores.entry[i].time == 0 && + i >= num_visible_score_entries) break; TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_SCORE_ENTRY); @@ -5837,6 +5842,7 @@ static void HandleHallOfFame_SelectLevel(int step, int direction) PlaySound(SND_MENU_ITEM_SELECTING); scores.last_level_nr = level_nr = new_level_nr; + scores.last_entry_nr = 0; LoadLevel(level_nr); LoadLocalAndServerScore(level_nr, TRUE); @@ -5858,8 +5864,6 @@ static void HandleHallOfFame_SelectLevel(int step, int direction) } else { - scores.last_entry_nr = 0; - DrawScoreInfo_Content(scores.last_entry_nr); }