From 38d9939eb7e115206b7ecb3ec93764c38d89d11f Mon Sep 17 00:00:00 2001 From: bicarus <202771338+bicarus-dev@users.noreply.github.com> Date: Wed, 4 Feb 2026 11:40:07 -0800 Subject: [PATCH] cfg: fix early game detection for Polaris Chord and MFG (#551) ## Link to GitHub Issue, if one exists ## Description of change Some parts of the UI (e.g., Card tab) rely on early auto detection of the game, which relies on file hints and not the game code. Two games (PC and MFG) rely on directory presence and not file presence. --- src/spice2x/games/io.cpp | 2 +- src/spice2x/launcher/launcher.cpp | 2 +- src/spice2x/overlay/windows/config.cpp | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/spice2x/games/io.cpp b/src/spice2x/games/io.cpp index eb38e6e3..e350be94 100644 --- a/src/spice2x/games/io.cpp +++ b/src/spice2x/games/io.cpp @@ -324,7 +324,7 @@ namespace games { buttons_help.insert({ pc, pc::get_buttons_help() }); analogs.insert({ pc, pc::get_analogs() }); lights.insert({ pc, pc::get_lights() }); - file_hints[pc].emplace_back("game/svm_Data"); + file_hints[pc].emplace_back("game/svm.exe"); } const std::vector &get_games() { diff --git a/src/spice2x/launcher/launcher.cpp b/src/spice2x/launcher/launcher.cpp index dd8a8d1d..77a879bc 100644 --- a/src/spice2x/launcher/launcher.cpp +++ b/src/spice2x/launcher/launcher.cpp @@ -1879,7 +1879,7 @@ int main_implementation(int argc, char *argv[]) { } // Polaris Chord - if (check_dll("kamunity.dll") && fileutils::dir_exists("game/svm_Data")) { + if (check_dll("kamunity.dll") && fileutils::file_exists("game/svm.exe")) { avs::game::DLL_NAME = "kamunity.dll"; attach_io = true; attach_pc = true; diff --git a/src/spice2x/overlay/windows/config.cpp b/src/spice2x/overlay/windows/config.cpp index bc5b1d07..d30924bf 100644 --- a/src/spice2x/overlay/windows/config.cpp +++ b/src/spice2x/overlay/windows/config.cpp @@ -89,10 +89,11 @@ namespace overlay::windows { // standalone configurator should look for file hints if (cfg::CONFIGURATOR_STANDALONE) { - auto file_hints = games::get_game_file_hints(game_name); + const auto file_hints = games::get_game_file_hints(game_name); if (file_hints) { for (auto &file_hint : *file_hints) { if (fileutils::file_exists(file_hint) || + fileutils::dir_exists(file_hint) || fileutils::file_exists(std::filesystem::path("modules") / file_hint) || fileutils::file_exists(std::filesystem::path("contents") / file_hint) || fileutils::file_exists(MODULE_PATH / file_hint)) @@ -100,6 +101,7 @@ namespace overlay::windows { this->games_selected = games_list.size() - 1; this->games_selected_name = game_name; eamuse_set_game(game_name); + break; } } }