From c607991f163a9a5c125fa9b65a0c169c4fa60861 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 10 Nov 2018 11:05:33 -0500 Subject: [PATCH] Implement music switching for prompts --- src/f_finale.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/f_finale.c b/src/f_finale.c index 0be8dd0bc..b78bd14d9 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -2172,6 +2172,11 @@ static void F_AdvanceToNextPage(void) // on timer mode, number of tics until page advances timetonext = textprompts[cutnum]->page[scenenum].timetonext ? textprompts[cutnum]->page[scenenum].timetonext : TICRATE/10; F_PreparePageText(textprompts[cutnum]->page[scenenum].text); + + if (textprompts[cutnum]->page[scenenum].musswitch[0]) + S_ChangeMusic(textprompts[cutnum]->page[scenenum].musswitch, + textprompts[cutnum]->page[scenenum].musswitchflags, + textprompts[cutnum]->page[scenenum].musicloop); } } @@ -2228,6 +2233,11 @@ void F_StartTextPrompt(INT32 promptnum, INT32 pagenum, mobj_t *mo, UINT16 postex // on timer mode, number of tics until page advances timetonext = textprompts[cutnum]->page[scenenum].timetonext ? textprompts[cutnum]->page[scenenum].timetonext : TICRATE/10; F_PreparePageText(textprompts[cutnum]->page[scenenum].text); + + if (textprompts[cutnum]->page[scenenum].musswitch[0]) + S_ChangeMusic(textprompts[cutnum]->page[scenenum].musswitch, + textprompts[cutnum]->page[scenenum].musswitchflags, + textprompts[cutnum]->page[scenenum].musicloop); } else F_EndTextPrompt(true, false); // run the post-effects immediately