From 07a0f43d96ff82b3254cfe4c6fcec5fe769d6e20 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 12 Apr 2023 13:54:25 +0200 Subject: [PATCH] added showing configured level on music info screen --- src/screens.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/screens.c b/src/screens.c index 60637697..a7e16439 100644 --- a/src/screens.c +++ b/src/screens.c @@ -3595,6 +3595,35 @@ void HandleInfoScreen_Music(int dx, int dy, int button) ystart += ystep_head; } + int music_level_nr = -1; + int i; + + if (!list->is_sound) + { + // check if this music is configured for a certain level + for (i = leveldir_current->first_level; + i <= leveldir_current->last_level; i++) + { + // (special case: "list->music" may be negative for unconfigured music) + if (levelset.music[i] != MUS_UNDEFINED && + levelset.music[i] == list->music) + { + music_level_nr = i; + + break; + } + } + + if (music_level_nr != -1) + { + DrawTextSCentered(ystart, font_head, "played in"); + ystart += ystep_head; + + DrawTextFCentered(ystart, font_text, "level %03d", music_level_nr); + ystart += ystep_head; + } + } + DrawTextSCentered(ybottom, font_foot, TEXT_NEXT_PAGE); if (button != MB_MENU_INITIALIZE) -- 2.34.1