From 9dcad64ad5ba52afef9da92e9b80aae90041dc23 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Mon, 12 Feb 2024 06:23:25 +0100 Subject: [PATCH] [Loader] [Missing] Allow rechecking Completes P0275, funded by Ember2528. --- GIAN07/LOADER.CPP | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/GIAN07/LOADER.CPP b/GIAN07/LOADER.CPP index b3424b65..b725677b 100644 --- a/GIAN07/LOADER.CPP +++ b/GIAN07/LOADER.CPP @@ -386,9 +386,20 @@ namespace DAT_MISSING { constexpr Narrow::string_view TITLE = "Missing game data files"; WINDOW_SYSTEM Window; + bool FoundAll = false; + + bool FnRecheck(INPUT_BITS key) { + if((key == KEY_BOMB) || (key == KEY_ESC)) { + return false; + } else if(CWinOptionKeyDelta(key) && DAT::Check()) { + FoundAll = true; + return false; + } + return true; + } constexpr auto CENTER = WINDOW_INFO::FLAGS::CENTER; - std::array Info = {{ + std::array Info = {{ { }, { }, { }, @@ -398,6 +409,7 @@ namespace DAT_MISSING { { }, { "Must be provided from an original game copy.", "", nullptr, CENTER }, { }, + { "Recheck", "", FnRecheck, CENTER }, { "Quit", "", CWinExitFn, CENTER }, }}; @@ -405,7 +417,11 @@ namespace DAT_MISSING { { CWinMove(&Window); if(Window.State == CWIN_DEAD) { - quit = true; + if(FoundAll) { + SProjectInit(); + } else { + quit = true; + } } if(IsDraw()) { GrpCls(); @@ -431,7 +447,7 @@ namespace DAT_MISSING { Window.Parent.Flags = CENTER; Window.Init(TITLE.data(), Info, w); - Window.OpenCentered(w, (Info.size() - 1)); + Window.OpenCentered(w, (Info.size() - 2)); GameMain = Proc; } }