aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-02-05 17:35:40 -0800
committerFuwn <[email protected]>2022-02-05 17:35:40 -0800
commit99a412ddce5cfd72750c8e634f92cc9f5451f231 (patch)
tree17dc17bff84a491162eb51a18c094fda745e9bb1
parentchore: update version and tag (diff)
downloadsoyuz-99a412ddce5cfd72750c8e634f92cc9f5451f231.tar.xz
soyuz-99a412ddce5cfd72750c8e634f92cc9f5451f231.zip
feat(soyuz): countdown when unable to locate lunar
-rw-r--r--include/soyuz/library.hh8
-rw-r--r--soyuz/soyuz.cc5
2 files changed, 13 insertions, 0 deletions
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);
}