mirror of
https://github.com/EricPlayZ/EGameTools.git
synced 2025-07-18 17:37:53 +08:00
- Added compatibility with v1.15.2 "Firearms" update
This commit is contained in:
@ -34,7 +34,16 @@ That's it for this update! The next few updates will include some more bug fixes
|
||||
- Fixed Slow Motion not changing back to the original game speed when deactivated
|
||||
- (Hopefully) fixed certain features like Use TPP Model or Player Variables not working at all for some users (if it still happens, please let me know!))" },
|
||||
{ "v1.1.2",
|
||||
R"(- Added compatibility with v1.15.1 "Firearms" update
|
||||
- Bug fixes for various features will come in later updates, please be patient!)" }
|
||||
R"(- Added compatibility with v1.15.2 "Firearms" update
|
||||
- If you get a message pop-up, or an error in the console window about a problem creating a shortcut, please open Windows Settings and, for Windows 11, go to System -> For developers and enable "Developer Mode", or for Windows 10, go to Update & Security -> For developers and enable "Developer Mode"; after doing this, restart the game and there should be no issues with shortcut creation anymore (blame Microsoft, I have no idea why you have to enable this setting just to create some shortcuts!)
|
||||
|
||||
Bug fixes for various features will come in later updates, please be patient!
|
||||
|
||||
Sorry for the long wait! I haven't had enough time on my hands to update the mod, and I had some issues with how I would be handling updates from now on. I wanted a way to make the latest mod version support older game versions too.
|
||||
So e.g. 5 months from now, I'd want the latest mod version to support the latest game version (e.g. v1.19.1) AND support every other older version, down to v1.14.x, this way people could use the latest features of this mod, with older game versions.
|
||||
Unfortunately, I haven't found a way to do this yet, so I will be setting this aside for some other time. For now, I'll release this compatibility patch!
|
||||
|
||||
You should also expect less updates in the future, as I'm going to be pretty busy this year, with my final exam, driving school, and so many other things!
|
||||
Thank you everyone for the support <3)" }
|
||||
};
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,7 @@
|
||||
#include "config\config.h"
|
||||
#include "core.h"
|
||||
#include "game\GamePH\LevelDI.h"
|
||||
#include "game\GamePH\Other.h"
|
||||
#include "game\GamePH\PlayerVariables.h"
|
||||
#include "menu\menu.h"
|
||||
|
||||
@ -124,7 +125,7 @@ namespace Core {
|
||||
return;
|
||||
|
||||
std::thread([]() {
|
||||
int msgBoxResult = MessageBoxA(nullptr, "EGameTools has failed creating a folder shortcut \"EGameTools\" inside \"Dying Light 2\\ph\\work\\bin\\x64\".\n\nIn order to install mods inside the \"UserModFiles\" folder, please manually navigate to \"Dying Light 2\\ph\\source\\data\\EGameTools\\UserModFiles\".\n\nAlternatively, run the game once as administrator from the exe and once a shortcut has been created, close the game and open up the game from Steam or whatever platform you're using.\n\nDo you want to continue seeing this warning message every game launch?", "Error creating EGameTools folder shortcut", MB_ICONWARNING | MB_YESNO | MB_SETFOREGROUND);
|
||||
int msgBoxResult = MessageBoxA(nullptr, "EGameTools has failed creating a folder shortcut \"EGameTools\" inside \"Dying Light 2\\ph\\work\\bin\\x64\".\n\nTo fix this, please open Windows Settings and, for Windows 11, go to System -> For developers and enable \"Developer Mode\", or for Windows 10, go to Update & Security -> For developers and enable \"Developer Mode\".\nAfter doing this, restart the game and there should be no issues with shortcut creation anymore.\n\nIf the above solution doesn't work, then in order to install mods inside the \"UserModFiles\" folder, please manually navigate to \"Dying Light 2\\ph\\source\\data\\EGameTools\\UserModFiles\".\n\nAlternatively, run the game once as administrator from the exe and once a shortcut has been created, close the game and open up the game from Steam or whatever platform you're using.\n\nDo you want to continue seeing this warning message every game launch?", "Error creating EGameTools folder shortcut", MB_ICONWARNING | MB_YESNO | MB_SETFOREGROUND);
|
||||
|
||||
switch (msgBoxResult) {
|
||||
case IDNO:
|
||||
@ -158,6 +159,20 @@ namespace Core {
|
||||
}
|
||||
}
|
||||
|
||||
DWORD64 gameVer = 0;
|
||||
static void LoopGetGameVer() {
|
||||
while (true) {
|
||||
if (exiting)
|
||||
return;
|
||||
|
||||
gameVer = GamePH::GetCurrentGameVersion();
|
||||
if (!gameVer)
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnPostUpdate() {
|
||||
if (!createdConfigThread) {
|
||||
std::thread(Config::ConfigLoop).detach();
|
||||
@ -214,6 +229,15 @@ namespace Core {
|
||||
MH_Initialize();
|
||||
spdlog::info("Initialized MinHook");
|
||||
|
||||
spdlog::warn("Getting game version");
|
||||
std::thread([]() {
|
||||
LoopGetGameVer();
|
||||
spdlog::info("Got game version: v{}", GamePH::GameVerToStr(gameVer));
|
||||
if (Core::gameVer != GAME_VER_COMPAT) {
|
||||
spdlog::error("Please note that your game version has not been officially tested with this mod, therefore expect bugs, glitches or the mod to completely stop working. If so, please {}", Core::gameVer > GAME_VER_COMPAT ? "wait for a new patch." : "upgrade your game version to one that the mod supports.");
|
||||
}
|
||||
}).detach();
|
||||
|
||||
spdlog::warn("Hooking DX11/DX12 renderer");
|
||||
std::thread([]() {
|
||||
LoopHookRenderer();
|
||||
|
@ -16,10 +16,9 @@
|
||||
#define VK_MWHEELUP 0x101
|
||||
#endif
|
||||
|
||||
constexpr auto MOD_VERSION_STR = "v1.1.1";
|
||||
constexpr auto MOD_VERSION = 10101;
|
||||
constexpr auto GAME_VER_COMPAT_STR = ">= v1.14.0";
|
||||
constexpr auto GAME_VER_COMPAT = 11400;
|
||||
constexpr auto MOD_VERSION_STR = "v1.1.2";
|
||||
constexpr auto MOD_VERSION = 10102;
|
||||
constexpr auto GAME_VER_COMPAT = 11502;
|
||||
|
||||
struct Key {
|
||||
constexpr Key(std::string_view name, int code, ImGuiKey imGuiCode) : name(name), code(code), imGuiCode(imGuiCode) {}
|
||||
@ -228,5 +227,6 @@ namespace Core {
|
||||
extern bool exiting;
|
||||
|
||||
extern int rendererAPI;
|
||||
extern DWORD64 gameVer;
|
||||
extern void OnPostUpdate();
|
||||
}
|
@ -26,12 +26,12 @@ namespace Engine {
|
||||
#pragma endregion
|
||||
|
||||
#pragma region MoveCameraFromForwardUpPos
|
||||
static void detourMoveCameraFromForwardUpPos(LPVOID pCBaseCamera, float* a3, float* a4, Vector3* pos);
|
||||
static Utils::Hook::MHook<LPVOID, void(*)(LPVOID, float*, float*, Vector3*)> MoveCameraFromForwardUpPosHook{ "MoveCameraFromForwardUpPos", &Offsets::Get_MoveCameraFromForwardUpPos, &detourMoveCameraFromForwardUpPos };
|
||||
|
||||
bool switchedFreeCamByGamePause = false;
|
||||
Vector3 freeCamPosBeforeGamePause{};
|
||||
|
||||
static void detourMoveCameraFromForwardUpPos(LPVOID pCBaseCamera, float* a3, float* a4, Vector3* pos);
|
||||
static Utils::Hook::MHook<LPVOID, void(*)(LPVOID, float*, float*, Vector3*)> MoveCameraFromForwardUpPosHook{ "MoveCameraFromForwardUpPos", &Offsets::Get_MoveCameraFromForwardUpPos, &detourMoveCameraFromForwardUpPos };
|
||||
|
||||
static void detourMoveCameraFromForwardUpPos(LPVOID pCBaseCamera, float* a3, float* a4, Vector3* pos) {
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel || !iLevel->IsLoaded() || iLevel->IsTimerFrozen())
|
||||
|
@ -15,10 +15,10 @@ namespace GamePH {
|
||||
}
|
||||
}
|
||||
DWORD64 GameDI_PH::GetCurrentGameVersion() {
|
||||
return Utils::Memory::CallVT<225, DWORD64>(this);
|
||||
return Utils::Memory::CallVT<228, DWORD64>(this);
|
||||
}
|
||||
void GameDI_PH::TogglePhotoMode(bool doNothing, bool setAsOptionalCamera) {
|
||||
Utils::Memory::CallVT<258>(this, doNothing, setAsOptionalCamera);
|
||||
Utils::Memory::CallVT<260>(this, doNothing, setAsOptionalCamera);
|
||||
}
|
||||
|
||||
GameDI_PH* GameDI_PH::Get() {
|
||||
|
@ -8,8 +8,8 @@ namespace GamePH {
|
||||
class GameDI_PH {
|
||||
public:
|
||||
union {
|
||||
buffer<0xF0, SessionCooperativeDI*> pSessionCooperativeDI;
|
||||
buffer<0x830, bool> blockPauseGameOnPlayerAfk;
|
||||
buffer<0x130, SessionCooperativeDI*> pSessionCooperativeDI;
|
||||
buffer<0x880, bool> blockPauseGameOnPlayerAfk;
|
||||
};
|
||||
|
||||
float GetGameTimeDelta();
|
||||
|
@ -42,13 +42,37 @@ namespace GamePH {
|
||||
}
|
||||
}
|
||||
float LevelDI::GetTimeDelta() {
|
||||
return Utils::Memory::CallVT<176, float>(this);
|
||||
__try {
|
||||
float(*pGetTimeDelta)(LPVOID iLevel) = (decltype(pGetTimeDelta))Utils::Memory::GetProcAddr("gamedll_ph_x64_rwdi.dll", "?GetTimeDelta@IGSObject@@UEBAMXZ");
|
||||
if (!pGetTimeDelta)
|
||||
return 0.0f;
|
||||
|
||||
return pGetTimeDelta(this);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
void LevelDI::SetViewCamera(LPVOID viewCam) {
|
||||
Utils::Memory::CallVT<289, void>(this, viewCam);
|
||||
__try {
|
||||
void(*pSetViewCamera)(LPVOID iLevel, LPVOID viewCam) = (decltype(pSetViewCamera))Utils::Memory::GetProcAddr("gamedll_ph_x64_rwdi.dll", "?SetViewCamera@ILevel@@UEAAXPEAVIBaseCamera@@@Z_0");
|
||||
if (!pSetViewCamera)
|
||||
return;
|
||||
|
||||
pSetViewCamera(this, viewCam);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
float LevelDI::GetTimePlayed() {
|
||||
return Utils::Memory::CallVT<317, float>(this);
|
||||
__try {
|
||||
float(*pGetTimePlayed)(LPVOID iLevel) = (decltype(pGetTimePlayed))Utils::Memory::GetProcAddr("gamedll_ph_x64_rwdi.dll", "?GetTimePlayed@ILevel@@UEBAMXZ");
|
||||
if (!pGetTimePlayed)
|
||||
return 0.0f;
|
||||
|
||||
return pGetTimePlayed(this);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
void LevelDI::ShowUIManager(bool enabled) {
|
||||
__try {
|
||||
@ -96,7 +120,7 @@ namespace GamePH {
|
||||
}
|
||||
TimeWeather::CSystem* LevelDI::GetTimeWeatherSystem() {
|
||||
__try {
|
||||
TimeWeather::CSystem* (*pGetTimeWeatherSystem)(LevelDI * iLevel) = (decltype(pGetTimeWeatherSystem))Utils::Memory::GetProcAddr("engine_x64_rwdi.dll", "?GetTimeWeatherSystem@ILevel@@QEBAPEAVCSystem@TimeWeather@@XZ");
|
||||
TimeWeather::CSystem* (*pGetTimeWeatherSystem)(LevelDI* iLevel) = (decltype(pGetTimeWeatherSystem))Utils::Memory::GetProcAddr("engine_x64_rwdi.dll", "?GetTimeWeatherSystem@ILevel@@QEBAPEAVCSystem@TimeWeather@@XZ");
|
||||
if (!pGetTimeWeatherSystem)
|
||||
return nullptr;
|
||||
|
||||
|
@ -22,13 +22,7 @@ namespace GamePH {
|
||||
if (!GetCurrentGameVersion())
|
||||
return "UNKNOWN";
|
||||
|
||||
DWORD64 version = GetCurrentGameVersion();
|
||||
|
||||
DWORD64 major = version / 10000;
|
||||
DWORD64 minor = (version / 100) % 100;
|
||||
DWORD64 patch = version % 100;
|
||||
|
||||
return std::string(std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(patch));
|
||||
return GameVerToStr(GetCurrentGameVersion());
|
||||
}
|
||||
|
||||
static DWORD64 ShowTPPModelFunc2(GameDI_PH* pGameDI_PH) {
|
||||
|
@ -4,14 +4,6 @@
|
||||
#include "PlayerDI_PH.h"
|
||||
|
||||
namespace GamePH {
|
||||
bool PlayerDI_PH::IsInAir() {
|
||||
bool(*pIsInAir)(LPVOID instance) = (decltype(pIsInAir))Offsets::Get_IsInAir();
|
||||
if (!pIsInAir)
|
||||
return false;
|
||||
|
||||
return pIsInAir(this);
|
||||
}
|
||||
|
||||
PlayerDI_PH* PlayerDI_PH::Get() {
|
||||
__try {
|
||||
LevelDI* iLevel = LevelDI::Get();
|
||||
|
@ -4,8 +4,6 @@
|
||||
namespace GamePH {
|
||||
class PlayerDI_PH {
|
||||
public:
|
||||
bool IsInAir();
|
||||
|
||||
static PlayerDI_PH* Get();
|
||||
};
|
||||
}
|
@ -10,8 +10,8 @@ namespace GamePH {
|
||||
public:
|
||||
union {
|
||||
buffer<0xF0, Engine::CoPhysicsProperty*> pCoPhysicsProperty;
|
||||
buffer<0x2E80, bool> isOutOfBounds;
|
||||
buffer<0x2E84, float> outOfBoundsTimer;
|
||||
//buffer<0x2E80, bool> isOutOfBounds;
|
||||
//buffer<0x2E84, float> outOfBoundsTimer;
|
||||
};
|
||||
|
||||
static PlayerObjProperties* Get();
|
||||
|
@ -7,7 +7,7 @@ namespace GamePH {
|
||||
class PlayerState {
|
||||
public:
|
||||
union {
|
||||
buffer<0x290, PlayerVariables*> playerVars;
|
||||
buffer<0x2B0, PlayerVariables*> playerVars;
|
||||
};
|
||||
|
||||
static PlayerState* Get();
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "GameDI_PH2.h"
|
||||
#include "LevelDI.h"
|
||||
#include "PlayerHealthModule.h"
|
||||
#include "PlayerDI_PH.h"
|
||||
#include "gen_TPPModel.h"
|
||||
|
||||
namespace GamePH {
|
||||
|
@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "..\buffer.h"
|
||||
|
||||
namespace GamePH {
|
||||
class gen_TPPModel {
|
||||
public:
|
||||
union {
|
||||
buffer<0x2CF9, bool> enableTPPModel1;
|
||||
buffer<0x2CFA, bool> enableTPPModel2;
|
||||
buffer<0x2D59, bool> enableTPPModel1;
|
||||
buffer<0x2D5A, bool> enableTPPModel2;
|
||||
};
|
||||
|
||||
static gen_TPPModel* Get();
|
||||
|
@ -52,14 +52,12 @@ namespace Menu {
|
||||
ImGui::TextCentered(thankYou.c_str());
|
||||
ImGui::Spacing(ImVec2(0.0f, 5.0f));
|
||||
|
||||
const std::string gameCompat = "This version of the mod is compatible with game version " + std::string(GAME_VER_COMPAT_STR) + ".";
|
||||
const std::string gameCompat = "This version of the mod is compatible with game version v" + GamePH::GameVerToStr(GAME_VER_COMPAT) + ".";
|
||||
ImGui::TextCentered(gameCompat.c_str());
|
||||
const std::string gameVer = "The game version you are currently running is v" + GamePH::GetCurrentGameVersionStr() + ".";
|
||||
const std::string gameVer = "The game version you are currently running is v" + GamePH::GameVerToStr(Core::gameVer) + ".";
|
||||
ImGui::TextCentered(gameVer.c_str());
|
||||
const std::string gameTestedVer = "This mod has last been tested with version v" + GamePH::GameVerToStr(GAME_VER_COMPAT) + ".";
|
||||
ImGui::TextCentered(gameTestedVer.c_str());
|
||||
if (GamePH::GetCurrentGameVersion() < 11400 || GamePH::GetCurrentGameVersion() > GAME_VER_COMPAT) {
|
||||
const std::string gameNotCompat = "Please note that your game version has not been officially tested with this mod, therefore expect bugs, glitches or the mod to completely stop working. If so, please " + std::string(GamePH::GetCurrentGameVersion() > GAME_VER_COMPAT ? "wait for a new patch." : "upgrade your game version to one that the mod supports.");
|
||||
if (Core::gameVer != GAME_VER_COMPAT) {
|
||||
const std::string gameNotCompat = "Please note that your game version has not been officially tested with this mod, therefore expect bugs, glitches or the mod to completely stop working. If so, please " + std::string(Core::gameVer > GAME_VER_COMPAT ? "wait for a new patch." : "upgrade your game version to one that the mod supports.");
|
||||
ImGui::TextCenteredColored(gameNotCompat.c_str(), IM_COL32(200, 0, 0, 255));
|
||||
}
|
||||
ImGui::Spacing(ImVec2(0.0f, 5.0f));
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <pch.h>
|
||||
#include "..\game\GamePH\Other.h"
|
||||
#include "menu.h"
|
||||
|
||||
namespace Menu {
|
||||
@ -34,7 +35,7 @@ namespace Menu {
|
||||
ImGui::SetCursorPosX((ImGui::GetWindowWidth() / 2.0f) - (EGTLogoSize.x / 2.0f));
|
||||
ImGui::Image(EGTLogoTexture, EGTLogoSize);
|
||||
|
||||
const float footerHeight = ImGui::GetFrameHeightWithSpacing() * 3.0f + GImGui->Style.WindowPadding.y * 2.0f + GImGui->Style.FramePadding.y * 2.0f;
|
||||
const float footerHeight = ImGui::GetFrameHeightWithSpacing() * 3.0f + (Core::gameVer != GAME_VER_COMPAT ? (ImGui::CalcTextSize("").y * 2.0f) + GImGui->Style.FramePadding.y + GImGui->Style.ItemSpacing.y : 0.0f) + GImGui->Style.WindowPadding.y * 2.0f + GImGui->Style.FramePadding.y * 2.0f;
|
||||
const float remainingHeight = ImGui::GetContentRegionAvail().y - footerHeight;
|
||||
|
||||
if (ImGui::BeginTabBar("##MainTabBar")) {
|
||||
@ -44,7 +45,7 @@ namespace Menu {
|
||||
ImGui::SpanNextTabAcrossWidth(childWidth, MenuTab::GetInstances()->size());
|
||||
if (ImGui::BeginTabItem(tab.second->tabName.data())) {
|
||||
ImGui::SetNextWindowBgAlpha(static_cast<float>(opacity) / 100.0f);
|
||||
ImGui::SetNextWindowSizeConstraints(ImVec2(minWndSize.x - GImGui->Style.WindowPadding.x * 2.0f, remainingHeight), ImVec2(maxWndSize.x - GImGui->Style.WindowPadding.x * 2.0f, remainingHeight));
|
||||
ImGui::SetNextWindowSizeConstraints(ImVec2(std::fmax(minWndSize.x - GImGui->Style.WindowPadding.x * 2.0f, ImGui::CalcTextSize(Core::gameVer > GAME_VER_COMPAT ? "Please wait for a new mod update." : "Upgrade your game version to one that the mod supports.").x), remainingHeight), ImVec2(maxWndSize.x - GImGui->Style.WindowPadding.x * 2.0f, remainingHeight));
|
||||
if (ImGui::BeginChild("##TabChild", ImVec2(0.0f, 0.0f), ImGuiChildFlags_AlwaysAutoResize | ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_Border)) {
|
||||
childWidth = ImGui::GetItemRectSize().x;
|
||||
tab.second->Render();
|
||||
@ -59,6 +60,10 @@ namespace Menu {
|
||||
ImGui::Hotkey("Menu Toggle Key", &menuToggle);
|
||||
ImGui::SliderFloat("Menu Opacity", &opacity, 0.0f, 100.0f, "%.1f%%", ImGuiSliderFlags_AlwaysClamp);
|
||||
ImGui::SliderFloat("Menu Scale", &scale, 1.0f, 2.5f, "%.1f%%", ImGuiSliderFlags_AlwaysClamp);
|
||||
if (Core::gameVer != GAME_VER_COMPAT) {
|
||||
ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(IM_COL32(200, 0, 0, 255)), "Incompatible game version detected!");
|
||||
ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(IM_COL32(200, 0, 0, 255)), Core::gameVer > GAME_VER_COMPAT ? "Please wait for a new mod update." : "Upgrade your game version to one that the mod supports.");
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,6 @@ struct Offsets {
|
||||
AddOffset(CalculateFallHeight, "gamedll_ph_x64_rwdi.dll", "40 55 56 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 44 0F 29 9C 24", Utils::SigScan::PatternType::Address, LPVOID)
|
||||
//AddOffset(HandleFallHeight, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC ?? 0F B6 FA 48 8B D9 0F B6 91", Utils::SigScan::PatternType::Address, LPVOID)
|
||||
//AddOffset(HandlePlayerFall, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC ?? 0F 29 74 24 ?? 48 8B FA 0F 28 F2", Utils::SigScan::PatternType::Address, LPVOID)
|
||||
AddOffset(IsInAir, "gamedll_ph_x64_rwdi.dll", "40 53 48 83 EC ?? 83 B9 ?? ?? ?? ?? ?? 48 8B D9 75 ?? 8B 15", Utils::SigScan::PatternType::Address, LPVOID)
|
||||
//AddOffset(GetTimeWeatherSystem, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 33 D2 48 8B C8 E8 ?? ?? ?? ?? 49 8D 4F 38", PatternType::RelativePointer, LPVOID)
|
||||
//AddOffset(SetForcedWeather, "engine_x64_rwdi.dll", "89 51 68 C3 CC CC CC CC CC CC CC CC CC CC CC CC", PatternType::Address, LPVOID)
|
||||
//AddOffset(GetCurrentWeather, "engine_x64_rwdi.dll", "48 8B 41 78 48 85 C0 75 0F", PatternType::Address, LPVOID)
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user