From 2cb8155ca1b6006761bc6013f9996236601b09dd Mon Sep 17 00:00:00 2001 From: iArtorias Date: Sat, 19 Mar 2022 11:00:02 +0200 Subject: [PATCH] Add further compatibility with Elden Ring Mod Loader by techiew. --- README.md | 9 +++++---- elden_pause/include/stub.h | 14 +++++++++----- elden_pause/main.cpp | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0e1333a..3bf687e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ⚔️⏸️ **EldenPause** _v1.1.1_ +# ⚔️⏸️ **EldenPause** _v1.1.2_ [![GitHub All Releases](https://img.shields.io/github/downloads/iArtorias/elden_pause/total.svg)](https://github.com/iArtorias/elden_pause/releases) ### A useful mod for Elden Ring allowing you to pause the game any time you want. @@ -7,10 +7,11 @@ 1. Download the [latest release](https://github.com/iArtorias/elden_pause/releases/latest) 2. Copy the `dinput8.dll` and `elden_pause.ini` to your Elden Ring game folder -3. Launch the game with EAC disabled + * If you're using [Elden Ring Mod Loader](https://www.nexusmods.com/eldenring/mods/117) by [techiew](https://github.com/techiew/EldenRingModLoader), copy `dinput8.dll` and `elden_pause.ini` to the `mods` directory and rename the library to something like `elden_pause.dll` +4. Launch the game with EAC disabled * To do this, create the file `steam_appid.txt` with the text `1245620` in your game folder and run `eldenring.exe` directly -4. Press `P` button to pause the game. Press the same button again to resume the game. -5. If you're using controller, press `Start` button +5. Press `P` button to pause the game. Press the same button again to resume the game. +6. If you're using controller, press `Start` button ## Remapping the keys diff --git a/elden_pause/include/stub.h b/elden_pause/include/stub.h index e53c952..f5f5c5b 100644 --- a/elden_pause/include/stub.h +++ b/elden_pause/include/stub.h @@ -43,6 +43,9 @@ class CProxyStub const char* m_OldProxyDll{ "version.dll" }; const char* m_ProxyDll{ "dinput8.dll" }; + // A full path to the proxy library + fs::path m_proxyPath{}; + public: /// @@ -54,10 +57,11 @@ class CProxyStub return instance; } - - // A full path to the proxy library - fs::path m_proxy_path{}; - + // Get the current loaded proxy path + fs::path get_proxy_path() const + { + return m_proxyPath; + } // Resolve typedefs __typedef_func( DirectInput8Create, HRESULT, HINSTANCE, DWORD, const IID* const, LPVOID*, LPUNKNOWN ); @@ -79,7 +83,7 @@ class CProxyStub wchar_t proxy_path[4096]{}; GetModuleFileNameW( mod, proxy_path, (sizeof( proxy_path )) ); - m_proxy_path = fs::path( proxy_path ).parent_path(); + m_proxyPath = fs::path( proxy_path ).parent_path(); wchar_t sys_path[MAX_PATH]{}; GetSystemDirectoryW( sys_path, MAX_PATH ); diff --git a/elden_pause/main.cpp b/elden_pause/main.cpp index 8ab53c5..30d0af1 100644 --- a/elden_pause/main.cpp +++ b/elden_pause/main.cpp @@ -145,7 +145,7 @@ BOOL APIENTRY DllMain( HMODULE hModule, auto const size = section->Misc.VirtualSize; // Read the data from configuration file - read_config( "elden_pause.ini" ); + read_config( CProxyStub::instance().get_proxy_path() / "elden_pause.ini" ); /* je eldenring.XXXXXXXXXXXX