- made status bar configurable through rmapinfo.

This commit is contained in:
Christoph Oelckers 2021-05-16 10:43:47 +02:00
parent ee559b7ba9
commit f2d75d4146
12 changed files with 168 additions and 24 deletions

View file

@ -1128,6 +1128,14 @@ void FMapInfoParser::ParseGameInfo()
sc.SetCMode(false); sc.SetCMode(false);
globalCutscenes.MPSummaryScreen = sc.String; globalCutscenes.MPSummaryScreen = sc.String;
} }
else if (sc.Compare("statusbarclass"))
{
ParseAssign();
sc.SetCMode(false);
sc.MustGetString();
sc.SetCMode(false);
globalCutscenes.StatusBarClass = sc.String;
}
else if (!ParseCloseBrace()) else if (!ParseCloseBrace())
{ {
// Unknown // Unknown

View file

@ -797,30 +797,7 @@ void InitLanguages()
void CreateStatusBar() void CreateStatusBar()
{ {
int flags = g_gameType; auto stbarclass = PClass::FindClass(globalCutscenes.StatusBarClass);
PClass* stbarclass = nullptr;
GC::AddMarkerFunc([]() { GC::Mark(StatusBar); });
if (flags & GAMEFLAG_BLOOD)
{
stbarclass = PClass::FindClass("BloodStatusBar");
}
else if (flags & GAMEFLAG_SW)
{
stbarclass = PClass::FindClass("SWStatusBar");
}
else if (flags & GAMEFLAG_PSEXHUMED)
{
stbarclass = PClass::FindClass("ExhumedStatusBar");
}
else if (flags & GAMEFLAG_RRALL)
{
stbarclass = PClass::FindClass("RedneckStatusBar");
}
else
{
stbarclass = PClass::FindClass("DukeStatusBar");
}
if (!stbarclass) if (!stbarclass)
{ {
I_FatalError("No status bar defined"); I_FatalError("No status bar defined");
@ -828,6 +805,7 @@ void CreateStatusBar()
StatusBar = static_cast<DStatusBarCore*>(stbarclass->CreateNew()); StatusBar = static_cast<DStatusBarCore*>(stbarclass->CreateNew());
StatusBar->SetSize(0, 320, 200); StatusBar->SetSize(0, 320, 200);
InitStatusBar(); InitStatusBar();
GC::AddMarkerFunc([]() { GC::Mark(StatusBar); });
} }

View file

@ -104,6 +104,7 @@ struct GlobalCutscenes
CutsceneDef LoadingScreen; CutsceneDef LoadingScreen;
FString MPSummaryScreen; FString MPSummaryScreen;
FString SummaryScreen; FString SummaryScreen;
FString StatusBarClass;
}; };
struct ClusterDef struct ClusterDef

View file

@ -18,4 +18,5 @@ gameinfo
{ {
summaryscreen = BloodCutscenes.BuildSPSummary summaryscreen = BloodCutscenes.BuildSPSummary
mpsummaryscreen = BloodCutscenes.BuildMPSummary mpsummaryscreen = BloodCutscenes.BuildMPSummary
statusbarclass = BloodStatusBar
} }

View file

@ -71,4 +71,5 @@ gameinfo
{ {
summaryscreen = DukeCutscenes.BuildSPSummary summaryscreen = DukeCutscenes.BuildSPSummary
mpsummaryscreen = DukeCutscenes.BuildMPSummary mpsummaryscreen = DukeCutscenes.BuildMPSummary
statusbarclass = DukeStatusBar
} }

View file

@ -300,4 +300,5 @@ cutscenes
gameinfo gameinfo
{ {
summaryscreen = ExhumedCutscenes.BuildMap summaryscreen = ExhumedCutscenes.BuildMap
statusbarclass = ExhumedStatusBar
} }

View file

@ -0,0 +1,75 @@
//This sets up the missing things that cannot be inferred from the setup in the .CON files.
cluster 1
{
outro
{
function = DukeCutscenes.BuildE1End
}
}
cluster 2
{
outro
{
function = DukeCutscenes.BuildE2End
}
interbackground = "BONUSSCREEN2"
}
cluster 3
{
outro
{
function = DukeCutscenes.BuildE3End
}
}
cluster 4
{
outro
{
function = DukeCutscenes.BuildE4End
}
}
cluster 5
{
outro
{
function = DukeCutscenes.BuildE5End
}
}
map { 4, 1 }
{
intro
{
function = DukeCutscenes.BuildE4Intro
}
}
cutscenes
{
intro
{
function = DukeCutscenes.BuildIntro
}
sharewareend
{
function = DukeCutscenes.BuildSharewareEnd
}
loadscreen
{
function = DukeCutscenes.BuildLoading
}
}
gameinfo
{
summaryscreen = DukeCutscenes.BuildSPSummary
mpsummaryscreen = DukeCutscenes.BuildMPSummary
statusbarclass = DukeStatusBar
}

View file

@ -121,4 +121,5 @@ gameinfo
{ {
summaryscreen = RRCutscenes.BuildSPSummary summaryscreen = RRCutscenes.BuildSPSummary
mpsummaryscreen = DukeCutscenes.BuildMPSummary // identical with Duke's mpsummaryscreen = DukeCutscenes.BuildMPSummary // identical with Duke's
statusbarclass = RedneckStatusBar
} }

View file

@ -117,4 +117,5 @@ gameinfo
{ {
summaryscreen = RRCutscenes.BuildSPSummary summaryscreen = RRCutscenes.BuildSPSummary
mpsummaryscreen = DukeCutscenes.BuildMPSummary // identical with Duke's mpsummaryscreen = DukeCutscenes.BuildMPSummary // identical with Duke's
statusbarclass = RedneckStatusBar
} }

View file

@ -106,4 +106,5 @@ gameinfo
{ {
summaryscreen = RRCutscenes.BuildSPSummary summaryscreen = RRCutscenes.BuildSPSummary
mpsummaryscreen = DukeCutscenes.BuildMPSummary // identical with Duke's mpsummaryscreen = DukeCutscenes.BuildMPSummary // identical with Duke's
statusbarclass = RedneckStatusBar
} }

View file

@ -59,5 +59,6 @@ gameinfo
{ {
summaryscreen = SWCutscenes.BuildSPSummary summaryscreen = SWCutscenes.BuildSPSummary
mpsummaryscreen = SWCutscenes.BuildMPSummary mpsummaryscreen = SWCutscenes.BuildMPSummary
statusbarclass = SWStatusBar
} }

View file

@ -0,0 +1,75 @@
//This sets up the missing things that cannot be inferred from the setup in the .CON files.
cluster 1
{
outro
{
function = DukeCutscenes.BuildE1End
}
}
cluster 2
{
outro
{
function = DukeCutscenes.BuildE2End
}
interbackground = "BONUSSCREEN2"
}
cluster 3
{
outro
{
function = DukeCutscenes.BuildE3End
}
}
cluster 4
{
outro
{
function = DukeCutscenes.BuildE4End
}
}
cluster 5
{
outro
{
function = DukeCutscenes.BuildE5End
}
}
map { 4, 1 }
{
intro
{
function = DukeCutscenes.BuildE4Intro
}
}
cutscenes
{
intro
{
function = DukeCutscenes.BuildIntro
}
sharewareend
{
function = DukeCutscenes.BuildSharewareEnd
}
loadscreen
{
function = DukeCutscenes.BuildLoading
}
}
gameinfo
{
summaryscreen = DukeCutscenes.BuildSPSummary
mpsummaryscreen = DukeCutscenes.BuildMPSummary
statusbarclass = DukeStatusBar
}