From 3cc00ee09569a0665f763c05540f27a5418795ba Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 25 Feb 2023 23:11:09 +0000 Subject: [PATCH] Command_Tunes_f: Additional functionality - `tunes -show` now shows music_name rather than mapmusname - `tunes -showdefault` does the previous mapmusname behaviour --- src/s_sound.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/s_sound.c b/src/s_sound.c index 6416080a7..6deab1f91 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2493,6 +2493,7 @@ static void Command_Tunes_f(void) CONS_Printf(M_GetText("Play an arbitrary music lump. If a map number is used, 'MAP##M' is played.\n")); CONS_Printf(M_GetText("If the format supports multiple songs, you can specify which one to play.\n\n")); CONS_Printf(M_GetText("* With \"-show\", shows the currently playing tune and track.\n")); + CONS_Printf(M_GetText("* With \"-showdefault\", shows the current music for the level.\n")); CONS_Printf(M_GetText("* With \"-default\", returns to the default music for the map.\n")); CONS_Printf(M_GetText("* With \"-none\", any music playing will be stopped.\n")); return; @@ -2503,9 +2504,22 @@ static void Command_Tunes_f(void) if (!strcasecmp(tunearg, "-show")) { - const musicdef_t *def = S_FindMusicDef(mapmusname); + const musicdef_t *def = S_FindMusicDef(music_name); CONS_Printf(M_GetText("The current tune is: %s [track %d]\n"), + music_name, (music_flags & MUSIC_TRACKMASK)); + + if (def != NULL) + { + PrintSongAuthors(def); + } + return; + } + if (!strcasecmp(tunearg, "-showdefault")) + { + const musicdef_t *def = S_FindMusicDef(mapmusname); + + CONS_Printf(M_GetText("The default tune is: %s [track %d]\n"), mapmusname, (mapmusflags & MUSIC_TRACKMASK)); if (def != NULL)