mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 07:41:22 +00:00
e639030276
The starting of the first screen's music must be delayed until the playback of this screen actually starts. Since the controller objects are created up front it cannot be done in the Init() method anymore.
60 lines
1.5 KiB
Text
60 lines
1.5 KiB
Text
|
|
|
|
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 void Start();
|
|
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;
|
|
|
|
ScreenJob Init(IntermissionController ctrl, bool allowwipe)
|
|
{
|
|
Super.Init();
|
|
if (allowwipe && wipetype != 0) flags = wipetype << ScreenJob.transition_shift;
|
|
controller = ctrl;
|
|
return self;
|
|
}
|
|
|
|
override void Start() { controller.Start(); }
|
|
override bool OnEvent(InputEvent evt) { return controller.Responder(evt); }
|
|
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
|
|
{
|
|
//---------------------------------------------------------------------------
|
|
//
|
|
//
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
static void BuildMapTransition(ScreenJobRunner runner, IntermissionController inter, StatusScreen status)
|
|
{
|
|
if (status)
|
|
{
|
|
runner.Append(status);
|
|
}
|
|
if (inter)
|
|
{
|
|
runner.Append(new("IntermissionScreenJob").Init(inter, status != null));
|
|
}
|
|
}
|
|
}
|