mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 22:33:17 +00:00
- allow specification of intermission music based on the destination map.
This commit is contained in:
parent
03ac816e83
commit
bb7e191208
3 changed files with 17 additions and 1 deletions
|
@ -324,6 +324,7 @@ struct level_info_t
|
|||
FString ExitPic;
|
||||
FString InterMusic;
|
||||
int intermusicorder;
|
||||
TMap <FName, std::pair<FString, int> > MapInterMusic;
|
||||
|
||||
FString SoundInfo;
|
||||
FString SndSeq;
|
||||
|
|
|
@ -915,6 +915,18 @@ DEFINE_MAP_OPTION(intermusic, true)
|
|||
parse.ParseMusic(info->InterMusic, info->intermusicorder);
|
||||
}
|
||||
|
||||
DEFINE_MAP_OPTION(mapintermusic, true)
|
||||
{
|
||||
parse.ParseAssign();
|
||||
parse.sc.MustGetString();
|
||||
FString mapname = parse.sc.String;
|
||||
FString music;
|
||||
int order;
|
||||
parse.ParseComma();
|
||||
parse.ParseMusic(music, order);
|
||||
info->MapInterMusic[FName(mapname)] = std::make_pair(music, order);
|
||||
}
|
||||
|
||||
DEFINE_MAP_OPTION(fadetable, true)
|
||||
{
|
||||
parse.ParseAssign();
|
||||
|
|
|
@ -2020,7 +2020,10 @@ public:
|
|||
if (bcnt == 1)
|
||||
{
|
||||
// intermission music - use the defaults if none specified
|
||||
if (level.info->InterMusic.IsNotEmpty())
|
||||
auto mus = level.info->MapInterMusic.CheckKey(wbs->next);
|
||||
if (mus != nullptr)
|
||||
S_ChangeMusic(mus->first, mus->second);
|
||||
else if (level.info->InterMusic.IsNotEmpty())
|
||||
S_ChangeMusic(level.info->InterMusic, level.info->intermusicorder);
|
||||
else
|
||||
S_ChangeMusic (gameinfo.intermissionMusic.GetChars(), gameinfo.intermissionOrder);
|
||||
|
|
Loading…
Reference in a new issue