From 75d99e1a81bfbd0dbbaf0b1ace144a8156a47148 Mon Sep 17 00:00:00 2001 From: p0358 Date: Mon, 24 Jan 2022 19:43:21 +0100 Subject: Misc improvements --- NorthstarDedicatedTest/languagehooks.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'NorthstarDedicatedTest') diff --git a/NorthstarDedicatedTest/languagehooks.cpp b/NorthstarDedicatedTest/languagehooks.cpp index 0929b73d..3a69df9d 100644 --- a/NorthstarDedicatedTest/languagehooks.cpp +++ b/NorthstarDedicatedTest/languagehooks.cpp @@ -26,6 +26,9 @@ std::vector file_list(fs::path dir, std::regex ext_pattern) { std::vector result; + if (!fs::exists(dir) || !fs::is_directory(dir)) + return result; + using iterator = fs::directory_iterator; const iterator end; @@ -77,7 +80,8 @@ char* GetGameLanguageHook() auto lang = GetGameLanguageOriginal(); if (!CheckLangAudioExists(lang)) { - spdlog::info("Origin detected language \"{}\", but we do not have audio for it installed, falling back to the next option", lang); + if (strcmp(lang, "russian") != 0) // don't log for "russian" since it's the default and that means Origin detection just didn't change it most likely + spdlog::info("Origin detected language \"{}\", but we do not have audio for it installed, falling back to the next option", lang); } else @@ -95,7 +99,7 @@ char* GetGameLanguageHook() { spdlog::warn("Caution, audio for this language does NOT exist. You might want to override your game language with -language command line option."); auto lang = GetAnyInstalledAudioLanguage(); - spdlog::warn("Falling back to first installed audio language: {}", lang.c_str()); + spdlog::warn("Falling back to the first installed audio language: {}", lang.c_str()); strncpy(ingameLang1, lang.c_str(), 256); return ingameLang1; } -- cgit v1.2.3 From b85b357a496ab633bb42f46735c42ef0abade392 Mon Sep 17 00:00:00 2001 From: p0358 Date: Mon, 24 Jan 2022 22:17:52 +0100 Subject: check for -northstar in wrong place --- NorthstarDedicatedTest/hooks.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'NorthstarDedicatedTest') diff --git a/NorthstarDedicatedTest/hooks.cpp b/NorthstarDedicatedTest/hooks.cpp index ce4d75ad..cdb5fef9 100644 --- a/NorthstarDedicatedTest/hooks.cpp +++ b/NorthstarDedicatedTest/hooks.cpp @@ -73,6 +73,10 @@ LPSTR GetCommandLineAHook() argBuffer << cmdlineArgFile.rdbuf(); cmdlineArgFile.close(); + // if some other command line option includes "-northstar" in the future then you have to refactor this check to check with both either space after or ending with + if (!isDedi && argBuffer.str().find("-northstar") != std::string::npos) + MessageBoxA(NULL, "The \"-northstar\" command line option is NOT supposed to go into ns_startup_args.txt file!\n\nThis option is supposed to go into Origin/Steam game launch options, and then you are supposed to launch the original Titanfall2.exe rather than NorthstarLauncher.exe to make use of it.", "Northstar Warning", MB_ICONWARNING); + args.append(argBuffer.str()); } -- cgit v1.2.3