Implement music switching for prompts

This commit is contained in:
mazmazz 2018-11-10 11:05:33 -05:00
parent 3d9ce630d2
commit 631c6f93f5

View file

@ -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