From 99a412ddce5cfd72750c8e634f92cc9f5451f231 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 5 Feb 2022 17:35:40 -0800 Subject: feat(soyuz): countdown when unable to locate lunar --- include/soyuz/library.hh | 8 ++++++++ soyuz/soyuz.cc | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/include/soyuz/library.hh b/include/soyuz/library.hh index c63f976..27feeae 100644 --- a/include/soyuz/library.hh +++ b/include/soyuz/library.hh @@ -25,6 +25,14 @@ namespace soyuz { // high, // red // }; +const std::string numbers_as_string[] = { + "zero", + "one", + "two", + "three", + "four", +}; + static BOOL CALLBACK enum_windows_proc(HWND, LPARAM); auto find_lunar() -> DWORD; auto delete_handle(DWORD) -> int; diff --git a/soyuz/soyuz.cc b/soyuz/soyuz.cc index 02085a0..e7cad1e 100644 --- a/soyuz/soyuz.cc +++ b/soyuz/soyuz.cc @@ -76,6 +76,11 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int show) { DWORD pid = soyuz::find_lunar(); if (pid == 0 || pid == 3435973836) { soyuz::log("could not locate lunar client"); + soyuz::log("this window will close in five seconds"); + for (int i = 4; i > -1; --i) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + soyuz::log(fmt::format("> {} second{}", soyuz::numbers_as_string[i], i != 1 ? "s" : "")); + } soyuz::exit(1); } -- cgit v1.2.3