mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 05:00:41 +00:00
- Allow CON-based games to have multiplayer episodes filtered from menu.
* Fixes #461. * Fixes #462.
This commit is contained in:
parent
593bbe10ef
commit
d0e6a7ea29
7 changed files with 49 additions and 0 deletions
|
@ -949,6 +949,13 @@ int RunGame()
|
||||||
colorset = true;
|
colorset = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (grp.FileInfo.mpepisodes.Size())
|
||||||
|
{
|
||||||
|
for (auto& mpepisode : grp.FileInfo.mpepisodes)
|
||||||
|
{
|
||||||
|
gi->AddMultiplayerEpisode(mpepisode);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
I_SetIWADInfo();
|
I_SetIWADInfo();
|
||||||
|
|
||||||
|
|
|
@ -132,6 +132,7 @@ struct GrpInfo
|
||||||
TArray<FString> tobedeleted;
|
TArray<FString> tobedeleted;
|
||||||
TArray<FString> loadfiles;
|
TArray<FString> loadfiles;
|
||||||
TArray<FString> loadart;
|
TArray<FString> loadart;
|
||||||
|
TArray<FString> mpepisodes;
|
||||||
uint32_t FgColor = 0, BgColor = 0;
|
uint32_t FgColor = 0, BgColor = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,7 @@ struct GameInterface
|
||||||
virtual void LeavePortal(spritetype* viewer, int type) {}
|
virtual void LeavePortal(spritetype* viewer, int type) {}
|
||||||
virtual bool GetGeoEffect(GeoEffect* eff, int viewsector) { return false; }
|
virtual bool GetGeoEffect(GeoEffect* eff, int viewsector) { return false; }
|
||||||
virtual int Voxelize(int sprnum) { return -1; }
|
virtual int Voxelize(int sprnum) { return -1; }
|
||||||
|
virtual void AddMultiplayerEpisode(FString name) {}
|
||||||
|
|
||||||
virtual FString statFPS()
|
virtual FString statFPS()
|
||||||
{
|
{
|
||||||
|
|
|
@ -588,6 +588,15 @@ static TArray<GrpInfo> ParseGrpInfo(const char *fn, FileReader &fr, TMap<FString
|
||||||
}
|
}
|
||||||
while (sc.CheckToken(','));
|
while (sc.CheckToken(','));
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("mpepisodes"))
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
sc.MustGetToken(TK_StringConst);
|
||||||
|
grp.mpepisodes.Push(sc.String);
|
||||||
|
}
|
||||||
|
while (sc.CheckToken(','));
|
||||||
|
}
|
||||||
else sc.ScriptError(nullptr);
|
else sc.ScriptError(nullptr);
|
||||||
}
|
}
|
||||||
if (grp.dependencyCRC == 0 && (grp.flags & (GAMEFLAG_DUKE | GAMEFLAG_NAM | GAMEFLAG_NAPALM | GAMEFLAG_WW2GI | GAMEFLAG_RRALL | GAMEFLAG_BLOOD | GAMEFLAG_SW | GAMEFLAG_PSEXHUMED)) == 0)
|
if (grp.dependencyCRC == 0 && (grp.flags & (GAMEFLAG_DUKE | GAMEFLAG_NAM | GAMEFLAG_NAPALM | GAMEFLAG_WW2GI | GAMEFLAG_RRALL | GAMEFLAG_BLOOD | GAMEFLAG_SW | GAMEFLAG_PSEXHUMED)) == 0)
|
||||||
|
|
|
@ -67,6 +67,7 @@ struct GameInterface : public ::GameInterface
|
||||||
void EnterPortal(spritetype* viewer, int type) override;
|
void EnterPortal(spritetype* viewer, int type) override;
|
||||||
void LeavePortal(spritetype* viewer, int type) override;
|
void LeavePortal(spritetype* viewer, int type) override;
|
||||||
bool GetGeoEffect(GeoEffect* eff, int viewsector) override;
|
bool GetGeoEffect(GeoEffect* eff, int viewsector) override;
|
||||||
|
void AddMultiplayerEpisode(FString name) override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,20 @@ BEGIN_DUKE_NS
|
||||||
|
|
||||||
enum { VERSIONCHECK = 41 };
|
enum { VERSIONCHECK = 41 };
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static TArray<FString> mpEpisodes;
|
||||||
|
|
||||||
|
void GameInterface::AddMultiplayerEpisode(FString name)
|
||||||
|
{
|
||||||
|
mpEpisodes.Push(FStringTable::MakeMacro(name.GetChars()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// definitions needed by the parser.
|
// definitions needed by the parser.
|
||||||
|
@ -1667,6 +1681,16 @@ int ConCompiler::parsecommand()
|
||||||
auto clust = MustFindCluster(j + 1);
|
auto clust = MustFindCluster(j + 1);
|
||||||
vol->name = clust->name = FStringTable::MakeMacro(parsebuffer.Data(), i);
|
vol->name = clust->name = FStringTable::MakeMacro(parsebuffer.Data(), i);
|
||||||
if (j > 0) vol->flags |= VF_SHAREWARELOCK;
|
if (j > 0) vol->flags |= VF_SHAREWARELOCK;
|
||||||
|
if (mpEpisodes.Size())
|
||||||
|
{
|
||||||
|
for (auto& mpEpisode : mpEpisodes)
|
||||||
|
{
|
||||||
|
if (vol->name == mpEpisode)
|
||||||
|
{
|
||||||
|
vol->flags |= VF_HIDEFROMSP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case concmd_defineskillname:
|
case concmd_defineskillname:
|
||||||
|
|
|
@ -717,6 +717,7 @@ grpinfo
|
||||||
FgColor 0xbc9e89
|
FgColor 0xbc9e89
|
||||||
BkColor 0x7f3300
|
BkColor 0x7f3300
|
||||||
GameID "Redneck"
|
GameID "Redneck"
|
||||||
|
mpepisodes "PISSIN' CONTEST"
|
||||||
}
|
}
|
||||||
|
|
||||||
grpinfo
|
grpinfo
|
||||||
|
@ -731,6 +732,7 @@ grpinfo
|
||||||
FgColor 0xbc9e89
|
FgColor 0xbc9e89
|
||||||
BkColor 0x7f3300
|
BkColor 0x7f3300
|
||||||
GameID "RedneckRides"
|
GameID "RedneckRides"
|
||||||
|
mpepisodes "PISSIN' CONTEST"
|
||||||
}
|
}
|
||||||
|
|
||||||
grpinfo
|
grpinfo
|
||||||
|
@ -772,6 +774,7 @@ grpinfo
|
||||||
FgColor 0
|
FgColor 0
|
||||||
BkColor 0x78720d
|
BkColor 0x78720d
|
||||||
GameID "Nam"
|
GameID "Nam"
|
||||||
|
mpepisodes "MULTIPLAYER I", "MULTIPLAYER II"
|
||||||
}
|
}
|
||||||
|
|
||||||
grpinfo
|
grpinfo
|
||||||
|
@ -785,6 +788,7 @@ grpinfo
|
||||||
FgColor 0
|
FgColor 0
|
||||||
BkColor 0x78720d
|
BkColor 0x78720d
|
||||||
GameID "Nam"
|
GameID "Nam"
|
||||||
|
mpepisodes "MULTIPLAYER I", "MULTIPLAYER II"
|
||||||
}
|
}
|
||||||
|
|
||||||
grpinfo
|
grpinfo
|
||||||
|
@ -798,6 +802,7 @@ grpinfo
|
||||||
FgColor 0
|
FgColor 0
|
||||||
BkColor 0x78720d
|
BkColor 0x78720d
|
||||||
GameID "WW2GI"
|
GameID "WW2GI"
|
||||||
|
mpepisodes "MULTIPLAYER I", "MULTIPLAYER II"
|
||||||
}
|
}
|
||||||
|
|
||||||
grpinfo
|
grpinfo
|
||||||
|
@ -810,6 +815,7 @@ grpinfo
|
||||||
dependency WW2GI_CRC
|
dependency WW2GI_CRC
|
||||||
gamefilter "WW2GI.Platoon"
|
gamefilter "WW2GI.Platoon"
|
||||||
GameID "PlatoonLeader"
|
GameID "PlatoonLeader"
|
||||||
|
mpepisodes "MULTIPLAYER I", "MULTIPLAYER II"
|
||||||
}
|
}
|
||||||
|
|
||||||
grpinfo
|
grpinfo
|
||||||
|
|
Loading…
Reference in a new issue