From 195ac71041cd9601ff20413392d8545bfdec03b2 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Fri, 3 Nov 2023 19:02:44 -0700 Subject: [PATCH] Make ImGuiRedux work standable absense of ImGuiCleo --- .github/workflows/build.yml | 4 ++-- .vscode/c_cpp_properties.json | 3 ++- src/dllmain.cpp | 10 +++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 112318d..68cc60f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: with: artifacts: ImGuiRedux${{matrix.platform}}.zip name: "${{matrix.platform}} Builds" - body: "This release is updated frequently with newer builds.\nImGuiCleo${{matrix.platform}}.cleo for regular CLEO\nImGuiRedux${{matrix.platform}}.cleo for CLEORedux" + body: "This release is updated frequently with newer builds.\n\n- ImGuiCleo${{matrix.platform}}.cleo for regular CLEO\n- ImGuiRedux${{matrix.platform}}.cleo for CLEORedux" allowUpdates: true tag: "${{matrix.platform}}-latest" ImGuiCleo: @@ -76,7 +76,7 @@ jobs: with: artifacts: ImGuiCleoWin32.zip name: "Win32 Builds" - body: "This release is updated frequently with newer builds.\nImGuiCleoWin32.cleo for regular CLEO\nImGuiReduxWin32.cleo for CLEORedux" + body: "This release is updated frequently with newer builds.\n\n-ImGuiCleoWin32.cleo for regular CLEO\n-ImGuiReduxWin32.cleo for CLEORedux" allowUpdates: true tag: "Win32-latest" diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 80e7255..13be1d2 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -9,7 +9,8 @@ ], "defines": [ "_DEBUG", - "_DX9_SDK_INSTALLED" + "_DX9_SDK_INSTALLED", + "RUNTIME_REDUX" ], "windowsSdkVersion": "10.0.19041.0", "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe", diff --git a/src/dllmain.cpp b/src/dllmain.cpp index f9222e5..692464e 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -68,8 +68,16 @@ BOOL WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved) { if (gvm.IsVC()) gGameVer = eGameVer::VC; if (gvm.IsSA()) gGameVer = eGameVer::SA; } -#else +#else + if (GetModuleHandle("ImGuiCleoWin32.cleo")) { + Log("ImGuiReduxWin32: ImGuiCleoWin32 detected. Closing..."); + return TRUE; + } + auto id = GetHostId(); + if (id == HostId::GTA3) gGameVer = eGameVer::III; + if (id == HostId::VC) gGameVer = eGameVer::VC; + if (id == HostId::SA) gGameVer = eGameVer::SA; if (id == HostId::GTA3_UNREAL) gGameVer = eGameVer::III_DE; if (id == HostId::VC_UNREAL) gGameVer = eGameVer::VC_DE; if (id == HostId::SA_UNREAL) gGameVer = eGameVer::SA_DE;