From 082daccd2d3aefae2d765e8a2e0b9d00caf93aea Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 22 Apr 2022 13:39:44 +0200 Subject: [PATCH] - summary screen is working again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit minus the initial wipe… --- src/d_main.cpp | 11 ++++------- src/g_game.cpp | 15 +++++++++++++++ wadsrc/static/zscript/ui/intermission.zs | 4 ++-- wadsrc/static/zscript/ui/statscreen/statscreen.zs | 12 ++++++++---- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 97397cc83..9b85b2c95 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1025,11 +1025,7 @@ void D_Display () case GS_CUTSCENE: case GS_INTRO: - if (ScreenJobTick()) - { - // synchronize termination with the playsim. - Net_WriteByte(DEM_ENDSCREENJOB); - } + ScreenJobDraw(); break; @@ -3699,7 +3695,8 @@ void D_Cleanup() AM_ClearColorsets(); DeinitSWColorMaps(); FreeSBarInfoScript(); - + DeleteScreenJob(); + // clean up game state D_ErrorCleanup (); P_Shutdown(); @@ -3728,7 +3725,7 @@ void D_Cleanup() GameStartupInfo.LoadWidescreen = GameStartupInfo.LoadLights = GameStartupInfo.LoadBrightmaps = -1; GameStartupInfo.DiscordAppId = ""; GameStartupInfo.SteamAppId = ""; - + GC::FullGC(); // clean up before taking down the object list. // Delete the reference to the VM functions here which were deleted and will be recreated after the restart. diff --git a/src/g_game.cpp b/src/g_game.cpp index 6e7088663..0361c943f 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -87,6 +87,7 @@ #include "d_buttons.h" #include "hwrenderer/scene/hw_drawinfo.h" #include "doommenu.h" +#include "screenjob.h" static FRandom pr_dmspawn ("DMSpawn"); @@ -969,6 +970,11 @@ bool G_Responder (event_t *ev) if (ev->type != EV_Mouse && primaryLevel->localEventManager->Responder(ev)) // [ZZ] ZScript ate the event // update 07.03.17: mouse events are handled directly return true; + if (gamestate == GS_INTRO || gamestate == GS_CUTSCENE) + { + return ScreenJobResponder(ev); + } + // any other key pops up menu if in demos // [RH] But only if the key isn't bound to a "special" command if (gameaction == ga_nothing && @@ -1295,6 +1301,15 @@ void G_Ticker () } break; + case GS_CUTSCENE: + case GS_INTRO: + if (ScreenJobTick()) + { + // synchronize termination with the playsim. + Net_WriteByte(DEM_ENDSCREENJOB); + } + break; + default: break; } diff --git a/wadsrc/static/zscript/ui/intermission.zs b/wadsrc/static/zscript/ui/intermission.zs index 424278e76..2c4c8895c 100644 --- a/wadsrc/static/zscript/ui/intermission.zs +++ b/wadsrc/static/zscript/ui/intermission.zs @@ -37,7 +37,7 @@ class IntermissionScreenJob : ScreenJob } -class StatusScreenJob : SkippableScreenJob +class StatusScreenJob : ScreenJob { StatusScreen controller; @@ -49,7 +49,7 @@ class StatusScreenJob : SkippableScreenJob 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 bool OnEvent(InputEvent evt) { return controller.Responder(evt); } override void OnDestroy() { diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen.zs b/wadsrc/static/zscript/ui/statscreen/statscreen.zs index 614f56739..3914f6b08 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen.zs @@ -796,11 +796,16 @@ class StatusScreen abstract ui version("2.5") // // ==================================================================== - void nextStage(void) + virtual bool Responder(InputEvent evt) { - accelerateStage = 1; + if (evt.type == InputEvent.Type_KeyDown) + { + accelerateStage = 1; + return true; + } + return false; } - + void checkForAccelerate() { // no longer used, but still needed for old content. @@ -836,7 +841,6 @@ class StatusScreen abstract ui version("2.5") StartMusic(); } - checkForAccelerate(); bg.updateAnimatedBack(); switch (CurState)