diff --git a/thprac/src/thprac/thprac_launcher_games.cpp b/thprac/src/thprac/thprac_launcher_games.cpp index cc439f1..07ce7c7 100644 --- a/thprac/src/thprac/thprac_launcher_games.cpp +++ b/thprac/src/thprac/thprac_launcher_games.cpp @@ -2253,7 +2253,15 @@ class THGameGui { ImGui::TextUnformatted(title); ImGui::Columns(columns); - for (auto& gameRef : gGameDefs) { + for (size_t i = 0; i < elementsof(gGameDefs); i++) { + // In case I need multiple gameDefs for the same game cause I, let's say + // want to support multiple versions of the same game + // + // Yes I'm comparing string pointers and not actual strings. This is OK here. + auto& gameRef = gGameDefs[i]; + if (i != 0 && gameRef.idStr == gGameDefs[i - 1].idStr) { + continue; + } if (gameRef.catagory == catagory) { auto& game = mGames[gameRef.idStr]; if (!(i % columns)) { diff --git a/thprac/src/thprac/thprac_launcher_games_def.h b/thprac/src/thprac/thprac_launcher_games_def.h index 5875946..68b0161 100644 --- a/thprac/src/thprac/thprac_launcher_games_def.h +++ b/thprac/src/thprac/thprac_launcher_games_def.h @@ -68,7 +68,8 @@ extern void TH165Init(); extern void TH17Init(); extern void TH18Init(); extern void TH185Init(); -extern void TH19Init(); +extern void TH19_v1_00a_Init(); +extern void TH19_v1_10c_Init(); static THKnownGame gKnownGames[] { { "th06", @@ -516,12 +517,24 @@ static THGameSig gGameDefs[] { CAT_MAIN, nullptr, L"%APPDATA%\\ShanghaiAlice\\th19", - TH19Init, + TH19_v1_00a_Init, { 1690598468, 1433600, { 0xdfa9, 0x4247, 0xaa43, 0xba3e, 0xbaba, 0x0e2e, 0x1d90, 0xb748, 0x8d5c, 0x1fbb }, { 0x1ef2d050, 0xbddd8da2, 0x56cedb87, 0xe674cd2c } } }, + { "th19", + L"2400340", + TH19_TITLE, + CAT_MAIN, + nullptr, + L"%APPDATA%\\ShanghaiAlice\\th19", + TH19_v1_10c_Init, + { 1720429610, 1544704, + { 0xb3a9, 0x4245, 0xaa43, 0xba3e, 0xbaba, + 0x0e2e, 0x1a4a, 0xb748, 0xad5c, 0x1dfb }, + { 0x4951fa2e, 0x63b2d14d, + 0x4b3ab26a, 0x3ee8b40d } } }, }; #pragma region Game Roll Def diff --git a/thprac/src/thprac/thprac_th19.cpp b/thprac/src/thprac/thprac_th19.cpp index 1d8c783..73df7b3 100644 --- a/thprac/src/thprac/thprac_th19.cpp +++ b/thprac/src/thprac/thprac_th19.cpp @@ -818,9 +818,13 @@ namespace TH19 { } -void TH19Init() +void TH19_v1_00a_Init() { ingame_image_base = (uintptr_t)GetModuleHandleW(NULL); TH19::THInitHook::singleton().EnableAllHooks(); } + +void TH19_v1_10c_Init() { + MessageBoxW(NULL, L"TODO: add support for v1.10c", L"", MB_ICONINFORMATION); +} } \ No newline at end of file