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

59 lines
1.4 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.
native bool Responder(InputEvent ev);
native bool Ticker();
native void Drawer();
native bool NextPage();
}
// Wrapper to play the native intermissions within a screen job.
class IntermissionScreenJob : ScreenJob
{
IntermissionController controller;
2022-04-11 11:12:37 +00:00
ScreenJob Init(IntermissionController ctrl, bool allowwipe)
{
Super.Init();
if (allowwipe && wipetype != 0) flags = wipetype << ScreenJob.transition_shift;
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();
}
}
class DoomCutscenes ui
2022-04-11 11:12:37 +00:00
{
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void BuildMapTransition(ScreenJobRunner runner, IntermissionController inter, StatusScreen status)
{
if (status)
{
runner.Append(status);
2022-04-11 11:12:37 +00:00
}
if (inter)
{
runner.Append(new("IntermissionScreenJob").Init(inter, status != null));
2022-04-11 11:12:37 +00:00
}
}
}