Skip to content

Commit

Permalink
[Loader] [Missing] Allow rechecking
Browse files Browse the repository at this point in the history
Completes P0275, funded by Ember2528.
  • Loading branch information
nmlgc committed Mar 8, 2024
1 parent d84aeea commit 9dcad64
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions GIAN07/LOADER.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -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<WINDOW_INFO, (DAT::BASENAMES.size() + 5)> Info = {{
std::array<WINDOW_INFO, (DAT::BASENAMES.size() + 6)> Info = {{
{ },
{ },
{ },
Expand All @@ -398,14 +409,19 @@ namespace DAT_MISSING {
{ },
{ "Must be provided from an original game copy.", "", nullptr, CENTER },
{ },
{ "Recheck", "", FnRecheck, CENTER },
{ "Quit", "", CWinExitFn, CENTER },
}};

void Proc(bool& quit)
{
CWinMove(&Window);
if(Window.State == CWIN_DEAD) {
quit = true;
if(FoundAll) {
SProjectInit();
} else {
quit = true;
}
}
if(IsDraw()) {
GrpCls();
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 9dcad64

Please sign in to comment.