Attached Files | winnerloser_picmusic.patch [^] (3,730 bytes) 2024-03-23 08:46 [Show Content] [Hide Content]diff -r 75a8bf29c784 src/g_level.h
--- a/src/g_level.h Sun Mar 17 13:08:15 2024 -0400
+++ b/src/g_level.h Sat Mar 23 00:16:20 2024 -0700
@@ -328,6 +328,13 @@
FString EnterPic;
FString ExitPic;
FString InterMusic;
+
+ //Winner and Loser Intermissions for maps
+ FString WinnerPic;
+ FString WinnerMusic;
+ FString LoserPic;
+ FString LoserMusic;
+
int intermusicorder;
FString SoundInfo;
diff -r 75a8bf29c784 src/g_mapinfo.cpp
--- a/src/g_mapinfo.cpp Sun Mar 17 13:08:15 2024 -0400
+++ b/src/g_mapinfo.cpp Sat Mar 23 00:16:20 2024 -0700
@@ -285,6 +285,10 @@
EnterPic = "";
ExitPic = "";
InterMusic = "";
+ WinnerPic = "";
+ WinnerMusic = "";
+ LoserPic = "";
+ LoserMusic = "";
intermusicorder = 0;
SoundInfo = "";
SndSeq = "";
@@ -980,6 +984,18 @@
parse.ParseMusic(info->InterMusic, info->intermusicorder);
}
+DEFINE_MAP_OPTION(winnermusic, true)
+{
+ parse.ParseAssign();
+ parse.ParseMusic(info->WinnerMusic, info->intermusicorder);
+}
+
+DEFINE_MAP_OPTION(losermusic, true)
+{
+ parse.ParseAssign();
+ parse.ParseMusic(info->LoserMusic, info->intermusicorder);
+}
+
DEFINE_MAP_OPTION(fadetable, true)
{
parse.ParseAssign();
@@ -1068,6 +1084,20 @@
info->EnterPic = parse.sc.String;
}
+DEFINE_MAP_OPTION(winnerpic, true)
+{
+ parse.ParseAssign();
+ parse.sc.MustGetString();
+ info->WinnerPic = parse.sc.String;
+}
+
+DEFINE_MAP_OPTION(loserpic, true)
+{
+ parse.ParseAssign();
+ parse.sc.MustGetString();
+ info->LoserPic = parse.sc.String;
+}
+
DEFINE_MAP_OPTION(specialaction, true)
{
parse.ParseAssign();
diff -r 75a8bf29c784 src/wi_stuff.cpp
--- a/src/wi_stuff.cpp Sun Mar 17 13:08:15 2024 -0400
+++ b/src/wi_stuff.cpp Sat Mar 23 00:16:20 2024 -0700
@@ -516,9 +516,13 @@
{
// [BB] Possibly select a custom winner / loser pic.
if ( WI_CalcRank( ) <= 1 )
- lumpname = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::WinnerPic, "WINERPIC" );
+ lumpname = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::WinnerPic,
+ TexMan.CheckForTexture(level.info->WinnerPic, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny).isValid() == false
+ ? level.info->WinnerPic : "WINERPIC");
else
- lumpname = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::LoserPic, "LOSERPIC" );
+ lumpname = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::LoserPic,
+ TexMan.CheckForTexture(level.info->LoserPic, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny).isValid() == false
+ ? level.info->LoserPic : "LOSERPIC");
// [BB] If the selected pic doesn't exist (Zandronum itself doesn't have WINERPIC or LOSERPIC)
// and is no script, fall back to the default one.
@@ -2564,9 +2568,11 @@
{
FString musicName;
if ( CAMPAIGN_DidPlayerBeatMap( ))
- musicName = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::WinnerTheme, "d_stwin" );
+ musicName = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::WinnerTheme,
+ level.info->WinnerMusic.IsNotEmpty() ? level.info->WinnerMusic : "d_stwin");
else
- musicName = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::LoserTheme, "d_stlose" );
+ musicName = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::LoserTheme,
+ level.info->LoserMusic.IsNotEmpty() ? level.info->LoserMusic : "d_stlose" );
// [BB] In case we want to use Skulltag's built-in intermission music,
// check if the lump exists and fall back to the default music if it doesn't.
winnerloser_picmusic(quickfix).patch [^] (3,538 bytes) 2024-03-23 08:51 [Show Content] [Hide Content]diff -r 75a8bf29c784 src/g_level.h
--- a/src/g_level.h Sun Mar 17 13:08:15 2024 -0400
+++ b/src/g_level.h Sat Mar 23 01:49:18 2024 -0700
@@ -328,6 +328,13 @@
FString EnterPic;
FString ExitPic;
FString InterMusic;
+
+ //Winner and Loser Intermissions for maps
+ FString WinnerPic;
+ FString WinnerMusic;
+ FString LoserPic;
+ FString LoserMusic;
+
int intermusicorder;
FString SoundInfo;
diff -r 75a8bf29c784 src/g_mapinfo.cpp
--- a/src/g_mapinfo.cpp Sun Mar 17 13:08:15 2024 -0400
+++ b/src/g_mapinfo.cpp Sat Mar 23 01:49:18 2024 -0700
@@ -285,6 +285,10 @@
EnterPic = "";
ExitPic = "";
InterMusic = "";
+ WinnerPic = "";
+ WinnerMusic = "";
+ LoserPic = "";
+ LoserMusic = "";
intermusicorder = 0;
SoundInfo = "";
SndSeq = "";
@@ -980,6 +984,18 @@
parse.ParseMusic(info->InterMusic, info->intermusicorder);
}
+DEFINE_MAP_OPTION(winnermusic, true)
+{
+ parse.ParseAssign();
+ parse.ParseMusic(info->WinnerMusic, info->intermusicorder);
+}
+
+DEFINE_MAP_OPTION(losermusic, true)
+{
+ parse.ParseAssign();
+ parse.ParseMusic(info->LoserMusic, info->intermusicorder);
+}
+
DEFINE_MAP_OPTION(fadetable, true)
{
parse.ParseAssign();
@@ -1068,6 +1084,20 @@
info->EnterPic = parse.sc.String;
}
+DEFINE_MAP_OPTION(winnerpic, true)
+{
+ parse.ParseAssign();
+ parse.sc.MustGetString();
+ info->WinnerPic = parse.sc.String;
+}
+
+DEFINE_MAP_OPTION(loserpic, true)
+{
+ parse.ParseAssign();
+ parse.sc.MustGetString();
+ info->LoserPic = parse.sc.String;
+}
+
DEFINE_MAP_OPTION(specialaction, true)
{
parse.ParseAssign();
diff -r 75a8bf29c784 src/wi_stuff.cpp
--- a/src/wi_stuff.cpp Sun Mar 17 13:08:15 2024 -0400
+++ b/src/wi_stuff.cpp Sat Mar 23 01:49:18 2024 -0700
@@ -516,9 +516,11 @@
{
// [BB] Possibly select a custom winner / loser pic.
if ( WI_CalcRank( ) <= 1 )
- lumpname = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::WinnerPic, "WINERPIC" );
+ lumpname = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::WinnerPic,
+ level.info->WinnerPic.IsNotEmpty() ? level.info->WinnerPic : "WINERPIC");
else
- lumpname = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::LoserPic, "LOSERPIC" );
+ lumpname = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::LoserPic,
+ level.info->LoserPic.IsNotEmpty() ? level.info->LoserPic : "LOSERPIC");
// [BB] If the selected pic doesn't exist (Zandronum itself doesn't have WINERPIC or LOSERPIC)
// and is no script, fall back to the default one.
@@ -2564,9 +2566,11 @@
{
FString musicName;
if ( CAMPAIGN_DidPlayerBeatMap( ))
- musicName = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::WinnerTheme, "d_stwin" );
+ musicName = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::WinnerTheme,
+ level.info->WinnerMusic.IsNotEmpty() ? level.info->WinnerMusic : "d_stwin");
else
- musicName = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::LoserTheme, "d_stlose" );
+ musicName = TEAM_SelectCustomStringForPlayer( &players[consoleplayer], &TEAMINFO::LoserTheme,
+ level.info->LoserMusic.IsNotEmpty() ? level.info->LoserMusic : "d_stlose" );
// [BB] In case we want to use Skulltag's built-in intermission music,
// check if the lump exists and fall back to the default music if it doesn't.
|