From 166ff6f4297f74ee4785da4268b38d57320ea39c Mon Sep 17 00:00:00 2001 From: Maurice Heumann Date: Tue, 21 Mar 2023 17:36:39 +0100 Subject: [PATCH] Notify about initial network requirement --- src/client/launcher/launcher.cpp | 7 ++++++- src/client/launcher/launcher.hpp | 1 + src/client/main.cpp | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/client/launcher/launcher.cpp b/src/client/launcher/launcher.cpp index e0d73345..d0267c91 100644 --- a/src/client/launcher/launcher.cpp +++ b/src/client/launcher/launcher.cpp @@ -38,9 +38,14 @@ namespace launcher //window.get_html_frame()->load_html(utils::nt::load_resource(MENU_MAIN)); window.get_html_frame()->load_url( - utils::string::va("file:///%s/data/launcher/main.html", game::get_appdata_path().generic_string().data())); + utils::string::va("file:///%s", get_launcher_ui_file().generic_string().data())); window::run(); return run_game; } + + std::filesystem::path get_launcher_ui_file() + { + return game::get_appdata_path() / "data/launcher/main.html"; + } } diff --git a/src/client/launcher/launcher.hpp b/src/client/launcher/launcher.hpp index ee128bcd..88e82032 100644 --- a/src/client/launcher/launcher.hpp +++ b/src/client/launcher/launcher.hpp @@ -3,4 +3,5 @@ namespace launcher { bool run(); + std::filesystem::path get_launcher_ui_file(); } diff --git a/src/client/main.cpp b/src/client/main.cpp index cc75e8e3..2601dc63 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -279,6 +279,11 @@ namespace remove_crash_file(); updater::update(); + if(!utils::io::file_exists(launcher::get_launcher_ui_file().generic_wstring())) + { + throw std::runtime_error("BOIII needs an active internet connection for the first time you launch it."); + } + const auto client_binary = "BlackOps3.exe"s; const auto server_binary = "BlackOps3_UnrankedDedicatedServer.exe"s; @@ -335,7 +340,7 @@ namespace } catch (std::exception& e) { - MessageBoxA(nullptr, e.what(), "ERROR", MB_ICONERROR | MB_SETFOREGROUND | MB_TOPMOST); + MessageBoxA(nullptr, e.what(), "Error", MB_ICONERROR | MB_SETFOREGROUND | MB_TOPMOST); return 1; } }