fixed using same background music for hall of fame and score info page
[rocksndiamonds.git] / src / screens.c
index 7d4a22822bacaf43588209688d2c3cc186166433..8f893cbfb4c28e149bc037797c23635cf2ae0c14 100644 (file)
@@ -4833,6 +4833,8 @@ static int getAlignYOffsetFromTreeInfo(TreeInfo *ti)
 static void DrawChooseTree(TreeInfo **ti_ptr)
 {
   int fade_mask = REDRAW_FIELD;
+  boolean restart_music = (game_status != game_status_last_screen &&
+                          game_status_last_screen != GAME_MODE_SCOREINFO);
 
   if (CheckFadeAll())
     fade_mask = REDRAW_ALL;
@@ -4858,7 +4860,7 @@ static void DrawChooseTree(TreeInfo **ti_ptr)
   FreeScreenGadgets();
   CreateScreenGadgets();
 
-  if (game_status != game_status_last_screen)
+  if (restart_music)
     FadeMenuSoundsAndMusic();
 
   FadeOut(fade_mask);
@@ -4889,7 +4891,7 @@ static void DrawChooseTree(TreeInfo **ti_ptr)
 
   DrawMaskedBorder(fade_mask);
 
-  if (game_status != game_status_last_screen)
+  if (restart_music)
     PlayMenuSoundsAndMusic();
 
   FadeIn(fade_mask);
@@ -4907,8 +4909,10 @@ static void drawChooseTreeText(TreeInfo *ti, int y, boolean active)
 {
   int num_entries = numTreeInfoInGroup(ti);
   boolean scrollbar_needed = (num_entries > NUM_MENU_ENTRIES_ON_SCREEN);
+  boolean scrollbar_always = (game_status == GAME_MODE_SCORES);
+  boolean scrollbar_keep_space = (scrollbar_needed || scrollbar_always);
   int scrollbar_xpos = SC_SCROLLBAR_XPOS + menu.scrollbar_xoffset;
-  int screen_width = (scrollbar_needed ? scrollbar_xpos : SXSIZE);
+  int screen_width = (scrollbar_keep_space ? scrollbar_xpos : SXSIZE);
   int first_entry = ti->cl_first;
   int entry_pos = first_entry + y;
   TreeInfo *node_first = getTreeInfoFirstGroupEntry(ti);