mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-03 01:12:55 +00:00
82 lines
2.2 KiB
Text
82 lines
2.2 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.
|
|
/*
|
|
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);
|
|
*/
|
|
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;
|
|
|
|
ScreenJob Init(IntermissionController ctrl)
|
|
{
|
|
controller = ctrl;
|
|
return self;
|
|
}
|
|
|
|
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 StatusScreenJob : ScreenJob
|
|
{
|
|
StatusScreen controller;
|
|
|
|
ScreenJob Init(StatusScreen scr, bool allowwipe)
|
|
{
|
|
if (allowwipe && wipetype != 0) flags |= wipetype << ScreenJob.transition_shift;
|
|
controller = scr;
|
|
return self;
|
|
}
|
|
|
|
override void OnTick() { controller.Ticker(); if (controller.CurState == StatusScreen.LeavingIntermission) jobstate = finished; }
|
|
override void Draw(double smoothratio) { controller.Drawer(); }
|
|
override bool OnEvent(InputEvent evt) { return controller.Responder(evt); }
|
|
|
|
override void OnDestroy()
|
|
{
|
|
controller.Destroy();
|
|
Super.OnDestroy();
|
|
}
|
|
}
|
|
|
|
|
|
class DoomCutscenes ui
|
|
{
|
|
//---------------------------------------------------------------------------
|
|
//
|
|
//
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
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, status != nullptr));
|
|
}
|
|
}
|
|
}
|