gzdoom/wadsrc/static/zscript/ui/intermission.zs

82 lines
2.1 KiB
Text
Raw Normal View History

2022-04-11 11:12:37 +00:00
class IntermissionController native ui
{
// This is mostly a black box to the native intermission code.
// May be scriptified later, but right now we do not need it.
2022-04-11 11:12:37 +00:00
/*
static native IntermissionController Create(String music, int musicorder, String flat, String text, int textInLump, int finalePic, int lookupText, bool ending, Name endsequence);
static native IntermissionController CreateNamed(Name nm);
2022-04-11 11:12:37 +00:00
*/
native bool Responder(InputEvent ev);
native bool Ticker();
native void Drawer();
native bool NextPage();
}
// Wrappers to play the old intermissions and status screens within a screen job.
class IntermissionScreenJob : ScreenJob
{
IntermissionController controller;
2022-04-11 11:12:37 +00:00
ScreenJob Init(IntermissionController ctrl)
{
controller = ctrl;
return self;
}
override bool OnEvent(InputEvent evt) { return controller.Responder(evt); }
2022-04-11 11:12:37 +00:00
override void OnTick() { if (!controller.Ticker()) jobstate = finished; }
override void Draw(double smoothratio) { controller.Drawer(); }
override void OnDestroy()
{
controller.Destroy();
Super.OnDestroy();
}
}
2022-04-11 11:12:37 +00:00
class StatusScreenJob : SkippableScreenJob
{
StatusScreen controller;
ScreenJob Init(StatusScreen scr)
{
controller = scr;
return self;
}
2022-04-11 11:12:37 +00:00
override void OnTick() { controller.Ticker(); if (controller.CurState == StatusScreen.LeavingIntermission) jobstate = finished; }
override void Draw(double smoothratio) { controller.Drawer(); }
override void OnSkip() { controller.NextStage(); } // skipping status screens is asynchronous, so yields no result
override void OnDestroy()
{
controller.Destroy();
Super.OnDestroy();
}
2022-04-11 11:12:37 +00:00
}
class DoomCutscenes ui
2022-04-11 11:12:37 +00:00
{
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void BuildMapTransition(ScreenJobRunner runner, IntermissionController inter, StatusScreen status)
{
if (status)
{
runner.Append(new("StatusScreenJob").Init(status));
}
if (inter)
{
runner.Append(new("IntermissionScreenJob").Init(inter));
}
}
}