Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 432a65e977 | |||
| 12d38d264c | |||
| 906c6f6581 | |||
| 14d83b1061 | |||
| 662ea7896e | |||
| 3f593c7749 | |||
| bb43194a8a | |||
| 6d21f11c49 | |||
| d7a0275c39 | |||
| 776310c4b6 |
@@ -17,11 +17,11 @@
|
||||
<ClCompile Include="source\game_classes.cpp" />
|
||||
<ClCompile Include="source\hook.cpp" />
|
||||
<ClCompile Include="source\ImGuiFileDialog\ImGuiFileDialog.cpp" />
|
||||
<ClCompile Include="source\ImGuiHotkeys\Hotkey.cpp" />
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_dx11.cpp" />
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_dx12.cpp" />
|
||||
<ClCompile Include="source\ImGui\backends\imgui_impl_win32.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui_demo.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui_draw.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui_tables.cpp" />
|
||||
<ClCompile Include="source\ImGui\imgui_widgets.cpp" />
|
||||
@@ -49,6 +49,7 @@
|
||||
<ClInclude Include="source\ImGuiFileDialog\ImGuiFileDialogConfig.h" />
|
||||
<ClInclude Include="source\ImGuiFileDialog\stb\stb_image.h" />
|
||||
<ClInclude Include="source\ImGuiFileDialog\stb\stb_image_resize.h" />
|
||||
<ClInclude Include="source\ImGuiHotkeys\Hotkey.h" />
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_dx11.h" />
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_dx12.h" />
|
||||
<ClInclude Include="source\ImGui\backends\imgui_impl_win32.h" />
|
||||
@@ -85,13 +86,13 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<PlatformToolset>ClangCL</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<PlatformToolset>ClangCL</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
@@ -137,13 +138,13 @@
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<Optimization>
|
||||
</Optimization>
|
||||
<IntrinsicFunctions>
|
||||
</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>source\ImGui;source\ImGuiFileDialog;source\MinHook\include;</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>source\ImGuiHotkeys;source\ImGui;source\ImGuiFileDialog;source\MinHook\include;</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -171,8 +172,8 @@
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>source\ImGui;source\ImGuiFileDialog;source\MinHook\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>source\ImGuiHotkeys;source\ImGui;source\ImGuiFileDialog;source\MinHook\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
</ClCompile>
|
||||
@@ -184,6 +185,8 @@
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalLibraryDirectories>source\MinHook\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libMinHook-x64-v141-mtd.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ImportLibrary />
|
||||
<AdditionalOptions>/NOIMPLIB %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy /Y "$(SolutionDir)Extra Files\Default Config\EGameTools.ini" "$(SolutionDir)$(PlatformShortName)\$(Configuration)\EGameTools.ini"</Command>
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
<ClCompile Include="source\ImGui\imgui.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_demo.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGui\imgui_draw.cpp">
|
||||
<Filter>ImGui</Filter>
|
||||
</ClCompile>
|
||||
@@ -62,6 +59,9 @@
|
||||
<ClCompile Include="source\menu\world.cpp">
|
||||
<Filter>menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ImGuiHotkeys\Hotkey.cpp">
|
||||
<Filter>ImGuiHotkeys</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="source\memory.h" />
|
||||
@@ -152,6 +152,9 @@
|
||||
<ClInclude Include="source\menu\world.h">
|
||||
<Filter>menu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="source\ImGuiHotkeys\Hotkey.h">
|
||||
<Filter>ImGuiHotkeys</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="MinHook">
|
||||
@@ -187,5 +190,8 @@
|
||||
<Filter Include="config">
|
||||
<UniqueIdentifier>{50f832bc-5ff2-45db-8d20-e8f458c78596}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ImGuiHotkeys">
|
||||
<UniqueIdentifier>{1bf47e0a-f304-4b69-9662-60e65c2c3655}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -38,7 +38,7 @@ HRESULT __stdcall hkPresent11(IDXGISwapChain* pSwapChain, UINT SyncInterval, UIN
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
if (Menu::isOpen)
|
||||
if (Menu::menuToggle.IsEnabled())
|
||||
Menu::Render();
|
||||
|
||||
ImGui::EndFrame();
|
||||
|
||||
@@ -104,7 +104,7 @@ static void RenderImGui_DX12(IDXGISwapChain3* pSwapChain) {
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
if (Menu::isOpen)
|
||||
if (Menu::menuToggle.IsEnabled())
|
||||
Menu::Render();
|
||||
|
||||
ImGui::Render();
|
||||
|
||||
@@ -1,31 +1,43 @@
|
||||
#include <Windows.h>
|
||||
#include <imgui.h>
|
||||
#include <backends\imgui_impl_win32.h>
|
||||
#include <Hotkey.h>
|
||||
#include "..\..\core.h"
|
||||
#include "..\..\menu\menu.h"
|
||||
#include "..\config\config.h"
|
||||
#include "..\..\sigscan\offsets.h"
|
||||
#include "..\..\game_classes.h"
|
||||
#include "..\..\config\config.h"
|
||||
#include "..\..\kiero.h"
|
||||
#include "win32_impl.h"
|
||||
|
||||
static WNDPROC oWndProc = NULL;
|
||||
static bool toggledMenu = false;
|
||||
static bool menuMsgSent = false;
|
||||
static bool wasMenuKeyPressed = false;
|
||||
|
||||
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
LRESULT __stdcall hkWindowProc(_In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam) {
|
||||
switch (uMsg) {
|
||||
case WM_KEYDOWN:
|
||||
if (wParam == Config::menuToggleKey && !wasMenuKeyPressed) {
|
||||
wasMenuKeyPressed = true;
|
||||
Menu::isOpen = !Menu::isOpen;
|
||||
case WM_SYSKEYDOWN:
|
||||
if (ImGui::isAnyHotkeyBtnPressed || !ImGui::timeSinceHotkeyBtnPressed.GetTimePassed() || KeyBindOption::wasAnyKeyPressed)
|
||||
break;
|
||||
|
||||
for (auto& option : KeyBindOption::GetInstances()) {
|
||||
if (wParam == option->GetKeyBind()) {
|
||||
KeyBindOption::wasAnyKeyPressed = true;
|
||||
option->Toggle();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_KEYUP:
|
||||
if (wParam == Config::menuToggleKey && wasMenuKeyPressed)
|
||||
wasMenuKeyPressed = false;
|
||||
case WM_SYSKEYUP:
|
||||
if (!KeyBindOption::wasAnyKeyPressed)
|
||||
break;
|
||||
|
||||
for (auto& option : KeyBindOption::GetInstances()) {
|
||||
if (wParam == option->GetKeyBind())
|
||||
KeyBindOption::wasAnyKeyPressed = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,10 +45,10 @@ LRESULT __stdcall hkWindowProc(_In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wPara
|
||||
if (!pCInput)
|
||||
return CallWindowProc(oWndProc, hwnd, uMsg, wParam, lParam);
|
||||
|
||||
ImGui::GetIO().MouseDrawCursor = Menu::isOpen;
|
||||
ImGui::GetIO().MouseDrawCursor = Menu::menuToggle.IsEnabled();
|
||||
ImGui_ImplWin32_WndProcHandler(hwnd, uMsg, wParam, lParam);
|
||||
|
||||
if (Menu::isOpen) {
|
||||
if (Menu::menuToggle.IsEnabled()) {
|
||||
if (!toggledMenu)
|
||||
pCInput->BlockGameInput();
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include <imgui_internal.h>
|
||||
#include "Hotkey.h"
|
||||
|
||||
bool ImGui::isAnyHotkeyBtnPressed = false;
|
||||
Utils::Timer ImGui::timeSinceHotkeyBtnPressed{ 250 };
|
||||
|
||||
void ImGui::Hotkey(std::string_view label, KeyBindOption& key, float samelineOffset, const ImVec2& size) {
|
||||
const auto id = ImGui::GetID(label.data());
|
||||
ImGui::PushID(label.data());
|
||||
|
||||
if (!label.contains("##"))
|
||||
ImGui::Text("%s", label.data());
|
||||
ImGui::SameLine(samelineOffset);
|
||||
|
||||
if (ImGui::GetActiveID() == id) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetColorU32(ImGuiCol_ButtonActive));
|
||||
ImGui::Button("...", size);
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::GetCurrentContext()->ActiveIdAllowOverlap = true;
|
||||
if ((!ImGui::IsItemHovered() && ImGui::GetIO().MouseClicked[0]) || key.SetToPressedKey()) {
|
||||
timeSinceHotkeyBtnPressed = Utils::Timer(250);
|
||||
isAnyHotkeyBtnPressed = false;
|
||||
ImGui::ClearActiveID();
|
||||
}
|
||||
else
|
||||
ImGui::SetActiveID(id, ImGui::GetCurrentWindow());
|
||||
}
|
||||
else if (ImGui::Button(key.ToString(), size)) {
|
||||
isAnyHotkeyBtnPressed = true;
|
||||
ImGui::SetActiveID(id, ImGui::GetCurrentWindow());
|
||||
}
|
||||
|
||||
ImGui::PopID();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
#include <imgui.h>
|
||||
#include "..\..\core.h"
|
||||
#include "..\utils.h"
|
||||
|
||||
namespace ImGui {
|
||||
extern bool isAnyHotkeyBtnPressed;
|
||||
extern Utils::Timer timeSinceHotkeyBtnPressed;
|
||||
|
||||
void Hotkey(std::string_view label, KeyBindOption& key, float samelineOffset = 0.0f, const ImVec2& size = { 0.0f, 0.0f });
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 xvorost
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,8 +1,14 @@
|
||||
#pragma once
|
||||
#include <windows.h>
|
||||
|
||||
namespace Config {
|
||||
extern const char playerVars[];
|
||||
|
||||
extern int menuToggleKey;
|
||||
|
||||
enum ValueType {
|
||||
OPTION,
|
||||
Float,
|
||||
String
|
||||
};
|
||||
|
||||
extern void SaveConfig();
|
||||
extern void InitConfig();
|
||||
|
||||
@@ -6,13 +6,22 @@
|
||||
#include "ImGui\impl\d3d11_impl.h"
|
||||
#include "ImGui\impl\d3d12_impl.h"
|
||||
#include "menu\menu.h"
|
||||
#include "menu\player.h"
|
||||
#include "menu\camera.h"
|
||||
#include "game_classes.h"
|
||||
#include "sigscan\offsets.h"
|
||||
#include "config\config.h"
|
||||
#include "hook.h"
|
||||
#include "utils.h"
|
||||
|
||||
#pragma region Option
|
||||
std::set<Option*> Option::instances{};
|
||||
std::set<Option*> Option::GetInstances() { return instances; };
|
||||
#pragma endregion
|
||||
|
||||
#pragma region KeyBindOption
|
||||
bool KeyBindOption::wasAnyKeyPressed = false;
|
||||
|
||||
std::set<KeyBindOption*> KeyBindOption::instances{};
|
||||
std::set<KeyBindOption*> KeyBindOption::GetInstances() { return instances; };
|
||||
#pragma endregion
|
||||
|
||||
namespace Core {
|
||||
// Console stuff
|
||||
@@ -114,6 +123,15 @@ namespace Core {
|
||||
|
||||
Menu::Player::Update();
|
||||
Menu::Camera::Update();
|
||||
|
||||
/*Engine::CRTTI* g_BackgroundModuleScreenController = GamePH::BackgroundModuleScreenController::Get();
|
||||
if (!g_BackgroundModuleScreenController)
|
||||
return;
|
||||
|
||||
Engine::CRTTIField* field = g_BackgroundModuleScreenController->FindField("m_LoadingProgress");
|
||||
if (!field)
|
||||
return;
|
||||
*/
|
||||
}
|
||||
|
||||
DWORD64 WINAPI MainThread(HMODULE hModule) {
|
||||
|
||||
@@ -1,40 +1,239 @@
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
#include <array>
|
||||
#include <imgui.h>
|
||||
#include <set>
|
||||
#include <string_view>
|
||||
#include "utils.h"
|
||||
#ifndef VK_NONE
|
||||
#define VK_NONE -1
|
||||
#define VK_MWHEELDOWN 0x100
|
||||
#define VK_MWHEELUP 0x101
|
||||
#endif
|
||||
|
||||
struct SMART_BOOL {
|
||||
bool previousValue;
|
||||
bool value;
|
||||
struct Key {
|
||||
constexpr Key(std::string_view name, int code, ImGuiKey imGuiCode) : name(name), code(code), imGuiCode(imGuiCode) {}
|
||||
|
||||
SMART_BOOL() {
|
||||
changed = false;
|
||||
std::string_view name;
|
||||
int code;
|
||||
ImGuiKey imGuiCode;
|
||||
};
|
||||
|
||||
previousValue = false;
|
||||
value = false;
|
||||
}
|
||||
class Option {
|
||||
public:
|
||||
Option() { instances.insert(this); };
|
||||
~Option() { instances.erase(this); }
|
||||
static std::set<Option*> GetInstances();
|
||||
|
||||
bool Change(bool newValue) {
|
||||
if (changed && newValue == value)
|
||||
return false;
|
||||
bool value = false;
|
||||
|
||||
if (!changed)
|
||||
previousValue = value;
|
||||
void Toggle() { value = !value; }
|
||||
void Set(bool newValue) { value = newValue; }
|
||||
void SetPreviousVal(bool newValue) { previousValue = newValue; }
|
||||
constexpr bool IsEnabled() const { return value; }
|
||||
constexpr bool WasEnabled() const { return previousValue; }
|
||||
constexpr bool HasChanged() const { return previousValue != value; }
|
||||
constexpr bool HasChangedTo(bool toValue) const { return previousValue != value && value == toValue; }
|
||||
|
||||
changed = true;
|
||||
value = newValue;
|
||||
return true;
|
||||
}
|
||||
bool Restore() {
|
||||
if (!changed)
|
||||
return false;
|
||||
constexpr bool Change(bool newValue) {
|
||||
if (changed)
|
||||
return false;
|
||||
|
||||
changed = false;
|
||||
previousValue = value;
|
||||
|
||||
value = previousValue;
|
||||
return true;
|
||||
}
|
||||
changed = true;
|
||||
value = newValue;
|
||||
return true;
|
||||
}
|
||||
constexpr bool Restore(bool noValChange = false) {
|
||||
if (!changed)
|
||||
return false;
|
||||
|
||||
changed = false;
|
||||
|
||||
if (noValChange) {
|
||||
previousValue = value;
|
||||
return true;
|
||||
}
|
||||
value = previousValue;
|
||||
return true;
|
||||
}
|
||||
private:
|
||||
bool changed;
|
||||
bool previousValue = false;
|
||||
bool changed = false;
|
||||
|
||||
static std::set<Option*> instances;
|
||||
};
|
||||
class KeyBindOption : public Option {
|
||||
public:
|
||||
static bool wasAnyKeyPressed;
|
||||
|
||||
KeyBindOption(int keyCode) : keyCode(keyCode) { instances.insert(this); };
|
||||
~KeyBindOption() { instances.erase(this); }
|
||||
static std::set<KeyBindOption*> GetInstances();
|
||||
|
||||
const char* ToString() {
|
||||
if (const auto it = std::ranges::find(keyMap, keyCode, &Key::code); it != keyMap.end())
|
||||
return it->name.data();
|
||||
return "NONE";
|
||||
}
|
||||
constexpr int GetKeyBind() const { return keyCode; }
|
||||
void ChangeKeyBind(int newKeyBind) { keyCode = newKeyBind; }
|
||||
|
||||
bool SetToPressedKey() {
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
||||
ChangeKeyBind(VK_NONE);
|
||||
return true;
|
||||
} else if (!Utils::are_same(ImGui::GetIO().MouseWheel, 0.0f)) {
|
||||
ChangeKeyBind(ImGui::GetIO().MouseWheel < 0.0f ? VK_MWHEELDOWN : VK_MWHEELUP);
|
||||
return true;
|
||||
} else if (GetKeyState(VK_LSHIFT) & 0x8000) {
|
||||
ChangeKeyBind(VK_LSHIFT);
|
||||
return true;
|
||||
} else if (GetKeyState(VK_LMENU) & 0x8000) {
|
||||
ChangeKeyBind(VK_LMENU);
|
||||
return true;
|
||||
} else if (GetKeyState(VK_LCONTROL) & 0x8000) {
|
||||
ChangeKeyBind(VK_LCONTROL);
|
||||
return true;
|
||||
} else if (GetKeyState(VK_XBUTTON1) & 0x8000) {
|
||||
ChangeKeyBind(VK_XBUTTON1);
|
||||
return true;
|
||||
} else if (GetKeyState(VK_XBUTTON2) & 0x8000) {
|
||||
ChangeKeyBind(VK_XBUTTON2);
|
||||
return true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < IM_ARRAYSIZE(ImGui::GetIO().MouseDown); ++i) {
|
||||
if (ImGui::IsMouseClicked(i)) {
|
||||
ChangeKeyBind(i + 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = ImGuiKey_NamedKey_BEGIN; i < ImGuiKey_NamedKey_END; ++i) {
|
||||
if (!ImGui::IsKeyPressed(static_cast<ImGuiKey>(i)))
|
||||
continue;
|
||||
|
||||
if (const auto it = std::ranges::find(keyMap, i, &Key::imGuiCode); it != keyMap.end()) {
|
||||
ChangeKeyBind(it->code);
|
||||
// Treat AltGr as RALT
|
||||
if (GetKeyBind() == VK_LCONTROL && ImGui::IsKeyPressed(static_cast<ImGuiKey>(VK_RMENU)))
|
||||
ChangeKeyBind(VK_RMENU);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
int keyCode = 0;
|
||||
static constexpr auto keyMap = std::to_array<Key>({
|
||||
{ "'", VK_OEM_7, ImGuiKey_Apostrophe },
|
||||
{ ",", VK_OEM_COMMA, ImGuiKey_Comma },
|
||||
{ "-", VK_OEM_MINUS, ImGuiKey_Minus },
|
||||
{ ".", VK_OEM_PERIOD, ImGuiKey_Period },
|
||||
{ "/", VK_OEM_2, ImGuiKey_Slash },
|
||||
{ "0", '0', ImGuiKey_0 },
|
||||
{ "1", '1', ImGuiKey_1 },
|
||||
{ "2", '2', ImGuiKey_2 },
|
||||
{ "3", '3', ImGuiKey_3 },
|
||||
{ "4", '4', ImGuiKey_4 },
|
||||
{ "5", '5', ImGuiKey_5 },
|
||||
{ "6", '6', ImGuiKey_6 },
|
||||
{ "7", '7', ImGuiKey_7 },
|
||||
{ "8", '8', ImGuiKey_8 },
|
||||
{ "9", '9', ImGuiKey_9 },
|
||||
{ ";", VK_OEM_1, ImGuiKey_Semicolon },
|
||||
{ "=", VK_OEM_PLUS, ImGuiKey_Equal },
|
||||
{ "A", 'A', ImGuiKey_A },
|
||||
{ "ADD", VK_ADD, ImGuiKey_KeypadAdd },
|
||||
{ "B", 'B', ImGuiKey_B },
|
||||
{ "BACKSPACE", VK_BACK, ImGuiKey_Backspace },
|
||||
{ "C", 'C', ImGuiKey_C },
|
||||
{ "CAPSLOCK", VK_CAPITAL, ImGuiKey_CapsLock },
|
||||
{ "D", 'D', ImGuiKey_D },
|
||||
{ "DECIMAL", VK_DECIMAL, ImGuiKey_KeypadDecimal },
|
||||
{ "DELETE", VK_DELETE, ImGuiKey_Delete },
|
||||
{ "DIVIDE", VK_DIVIDE, ImGuiKey_KeypadDivide },
|
||||
{ "DOWN", VK_DOWN, ImGuiKey_DownArrow },
|
||||
{ "E", 'E', ImGuiKey_E },
|
||||
{ "END", VK_END, ImGuiKey_End },
|
||||
{ "ENTER", VK_RETURN, ImGuiKey_Enter },
|
||||
{ "F", 'F', ImGuiKey_F },
|
||||
{ "F1", VK_F1, ImGuiKey_F1 },
|
||||
{ "F10", VK_F10, ImGuiKey_F10 },
|
||||
{ "F11", VK_F11, ImGuiKey_F11 },
|
||||
{ "F12", VK_F12, ImGuiKey_F12 },
|
||||
{ "F2", VK_F2, ImGuiKey_F2 },
|
||||
{ "F3", VK_F3, ImGuiKey_F3 },
|
||||
{ "F4", VK_F4, ImGuiKey_F4 },
|
||||
{ "F5", VK_F5, ImGuiKey_F5 },
|
||||
{ "F6", VK_F6, ImGuiKey_F6 },
|
||||
{ "F7", VK_F7, ImGuiKey_F7 },
|
||||
{ "F8", VK_F8, ImGuiKey_F8 },
|
||||
{ "F9", VK_F9, ImGuiKey_F9 },
|
||||
{ "G", 'G', ImGuiKey_G },
|
||||
{ "H", 'H', ImGuiKey_H },
|
||||
{ "HOME", VK_HOME, ImGuiKey_Home },
|
||||
{ "I", 'I', ImGuiKey_I },
|
||||
{ "INSERT", VK_INSERT, ImGuiKey_Insert },
|
||||
{ "J", 'J', ImGuiKey_J },
|
||||
{ "K", 'K', ImGuiKey_K },
|
||||
{ "L", 'L', ImGuiKey_L },
|
||||
{ "LALT", VK_LMENU, ImGuiKey_LeftAlt },
|
||||
{ "LCTRL", VK_LCONTROL, ImGuiKey_LeftCtrl },
|
||||
{ "LEFT", VK_LEFT, ImGuiKey_LeftArrow },
|
||||
{ "LSHIFT", VK_LSHIFT, ImGuiKey_LeftShift },
|
||||
{ "M", 'M', ImGuiKey_M },
|
||||
{ "MOUSE1", VK_LBUTTON, ImGuiKey_MouseLeft },
|
||||
{ "MOUSE2", VK_RBUTTON, ImGuiKey_MouseRight },
|
||||
{ "MOUSE3", VK_MBUTTON, ImGuiKey_MouseMiddle },
|
||||
{ "MOUSE4", VK_XBUTTON1, ImGuiKey_MouseX1 },
|
||||
{ "MOUSE5", VK_XBUTTON2, ImGuiKey_MouseX2 },
|
||||
{ "MULTIPLY", VK_MULTIPLY, ImGuiKey_KeypadMultiply },
|
||||
{ "MWHEEL_DOWN", VK_MWHEELDOWN, ImGuiKey_MouseWheelY },
|
||||
{ "MWHEEL_UP", VK_MWHEELUP, ImGuiKey_MouseWheelY },
|
||||
{ "N", 'N', ImGuiKey_N },
|
||||
{ "NONE", VK_NONE, ImGuiKey_None },
|
||||
{ "NUMPAD_0", VK_NUMPAD0, ImGuiKey_Keypad0 },
|
||||
{ "NUMPAD_1", VK_NUMPAD1, ImGuiKey_Keypad1 },
|
||||
{ "NUMPAD_2", VK_NUMPAD2, ImGuiKey_Keypad2 },
|
||||
{ "NUMPAD_3", VK_NUMPAD3, ImGuiKey_Keypad3 },
|
||||
{ "NUMPAD_4", VK_NUMPAD4, ImGuiKey_Keypad4 },
|
||||
{ "NUMPAD_5", VK_NUMPAD5, ImGuiKey_Keypad5 },
|
||||
{ "NUMPAD_6", VK_NUMPAD6, ImGuiKey_Keypad6 },
|
||||
{ "NUMPAD_7", VK_NUMPAD7, ImGuiKey_Keypad7 },
|
||||
{ "NUMPAD_8", VK_NUMPAD8, ImGuiKey_Keypad8 },
|
||||
{ "NUMPAD_9", VK_NUMPAD9, ImGuiKey_Keypad9 },
|
||||
{ "O", 'O', ImGuiKey_O },
|
||||
{ "P", 'P', ImGuiKey_P },
|
||||
{ "PAGE_DOWN", VK_NEXT, ImGuiKey_PageDown },
|
||||
{ "PAGE_UP", VK_PRIOR, ImGuiKey_PageUp },
|
||||
{ "Q", 'Q', ImGuiKey_Q },
|
||||
{ "R", 'R', ImGuiKey_R },
|
||||
{ "RALT", VK_RMENU, ImGuiKey_RightAlt },
|
||||
{ "RCTRL", VK_RCONTROL, ImGuiKey_RightCtrl },
|
||||
{ "RIGHT", VK_RIGHT, ImGuiKey_RightArrow },
|
||||
{ "RSHIFT", VK_RSHIFT, ImGuiKey_RightShift },
|
||||
{ "S", 'S', ImGuiKey_S },
|
||||
{ "SPACE", VK_SPACE, ImGuiKey_Space },
|
||||
{ "SUBTRACT", VK_SUBTRACT, ImGuiKey_KeypadSubtract },
|
||||
{ "T", 'T', ImGuiKey_T },
|
||||
{ "TAB", VK_TAB, ImGuiKey_Tab },
|
||||
{ "U", 'U', ImGuiKey_U },
|
||||
{ "UP", VK_UP, ImGuiKey_UpArrow },
|
||||
{ "V", 'V', ImGuiKey_V },
|
||||
{ "W", 'W', ImGuiKey_W },
|
||||
{ "X", 'X', ImGuiKey_X },
|
||||
{ "Y", 'Y', ImGuiKey_Y },
|
||||
{ "Z", 'Z', ImGuiKey_Z },
|
||||
{ "[", VK_OEM_4, ImGuiKey_LeftBracket },
|
||||
{ "\\", VK_OEM_5, ImGuiKey_Backslash },
|
||||
{ "]", VK_OEM_6, ImGuiKey_RightBracket },
|
||||
{ "`", VK_OEM_3, ImGuiKey_GraveAccent }
|
||||
});
|
||||
|
||||
static std::set<KeyBindOption*> instances;
|
||||
};
|
||||
|
||||
namespace Core {
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace GamePH {
|
||||
static DWORD64(*pCalculateFreeCamCollision)(LPVOID pFreeCamera, float* finalPos) = nullptr;
|
||||
static DWORD64(*oCalculateFreeCamCollision)(LPVOID pFreeCamera, float* finalPos) = nullptr;
|
||||
DWORD64 detourCalculateFreeCamCollision(LPVOID pFreeCamera, float* finalPos) {
|
||||
if (!Menu::Camera::freeCamEnabled.value && !Menu::Camera::disablePhotoModeLimitsEnabled.value)
|
||||
if (!Menu::Camera::freeCam.IsEnabled() && !Menu::Camera::disablePhotoModeLimits.IsEnabled())
|
||||
return oCalculateFreeCamCollision(pFreeCamera, finalPos);
|
||||
|
||||
return 0;
|
||||
@@ -89,11 +89,19 @@ namespace GamePH {
|
||||
static void(*pLifeSetHealth)(float* pLifeHealth, float health) = nullptr;
|
||||
static void(*oLifeSetHealth)(float* pLifeHealth, float health) = nullptr;
|
||||
void detourLifeSetHealth(float* pLifeHealth, float health) {
|
||||
if (Menu::Player::godModeEnabled.value) {
|
||||
GamePH::PlayerHealthModule* playerHealthModule = GamePH::PlayerHealthModule::Get();
|
||||
if (playerHealthModule && (pLifeHealth + 1) == &playerHealthModule->health && playerHealthModule->health != 0)
|
||||
return;
|
||||
}
|
||||
if (!Menu::Player::godMode.IsEnabled())
|
||||
return oLifeSetHealth(pLifeHealth, health);
|
||||
|
||||
GamePH::PlayerHealthModule* playerHealthModule = GamePH::PlayerHealthModule::Get();
|
||||
if (!playerHealthModule)
|
||||
return oLifeSetHealth(pLifeHealth, health);
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel || !iLevel->IsLoaded())
|
||||
return oLifeSetHealth(pLifeHealth, health);
|
||||
|
||||
if (std::abs(reinterpret_cast<LONG64>(playerHealthModule) - reinterpret_cast<LONG64>(pLifeHealth)) < 0x100 && playerHealthModule->health > 0.0f)
|
||||
return;
|
||||
|
||||
oLifeSetHealth(pLifeHealth, health);
|
||||
}
|
||||
void LoopHookLifeSetHealth() {
|
||||
@@ -114,17 +122,19 @@ namespace GamePH {
|
||||
static void(*pTogglePhotoMode)(LPVOID guiPhotoModeData, bool enabled) = nullptr;
|
||||
static void(*oTogglePhotoMode)(LPVOID guiPhotoModeData, bool enabled) = nullptr;
|
||||
void detourTogglePhotoMode(LPVOID guiPhotoModeData, bool enabled) {
|
||||
Menu::Camera::photoModeEnabled.value = enabled;
|
||||
if (Menu::Camera::freeCamEnabled.value) {
|
||||
GamePH::GameDI_PH* pGameDI_PH = GamePH::GameDI_PH::Get();
|
||||
if (pGameDI_PH) {
|
||||
GamePH::FreeCamera* pFreeCam = GamePH::FreeCamera::Get();
|
||||
if (pFreeCam) {
|
||||
pGameDI_PH->TogglePhotoMode();
|
||||
pFreeCam->AllowCameraMovement(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Menu::Camera::photoMode.Set(enabled);
|
||||
|
||||
if (!Menu::Camera::freeCam.IsEnabled())
|
||||
return oTogglePhotoMode(guiPhotoModeData, enabled);
|
||||
GamePH::GameDI_PH* pGameDI_PH = GamePH::GameDI_PH::Get();
|
||||
if (!pGameDI_PH)
|
||||
return oTogglePhotoMode(guiPhotoModeData, enabled);
|
||||
GamePH::FreeCamera* pFreeCam = GamePH::FreeCamera::Get();
|
||||
if (!pFreeCam)
|
||||
return oTogglePhotoMode(guiPhotoModeData, enabled);
|
||||
|
||||
pGameDI_PH->TogglePhotoMode();
|
||||
pFreeCam->AllowCameraMovement(0);
|
||||
|
||||
oTogglePhotoMode(guiPhotoModeData, enabled);
|
||||
}
|
||||
@@ -146,53 +156,48 @@ namespace GamePH {
|
||||
static void(*pMoveCameraFromForwardUpPos)(LPVOID pCBaseCamera, float* a3, float* a4, Vector3* pos) = nullptr;
|
||||
static void(*oMoveCameraFromForwardUpPos)(LPVOID pCBaseCamera, float* a3, float* a4, Vector3* pos) = nullptr;
|
||||
void detourMoveCameraFromForwardUpPos(LPVOID pCBaseCamera, float* a3, float* a4, Vector3* pos) {
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel || !iLevel->IsLoaded())
|
||||
return oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
|
||||
|
||||
gen_TPPModel* pgen_TPPModel = gen_TPPModel::Get();
|
||||
if (pgen_TPPModel) {
|
||||
if (Menu::Camera::photoModeEnabled.previousValue != Menu::Camera::photoModeEnabled.value && !Menu::Camera::photoModeEnabled.value) {
|
||||
Menu::Camera::tpUseTPPModel.previousValue = !Menu::Camera::tpUseTPPModel.value;
|
||||
Menu::Camera::thirdPersonCameraEnabled.previousValue = Menu::Camera::thirdPersonCameraEnabled.value;
|
||||
if (Menu::Camera::photoMode.HasChangedTo(false)) {
|
||||
Menu::Camera::tpUseTPPModel.SetPreviousVal(!Menu::Camera::tpUseTPPModel.IsEnabled());
|
||||
Menu::Camera::thirdPersonCamera.SetPreviousVal(Menu::Camera::thirdPersonCamera.IsEnabled());
|
||||
}
|
||||
|
||||
if (!Menu::Camera::photoModeEnabled.value && !Menu::Camera::freeCamEnabled.value) {
|
||||
if ((Menu::Camera::tpUseTPPModel.previousValue != Menu::Camera::tpUseTPPModel.value && !Menu::Camera::tpUseTPPModel.value && Menu::Camera::thirdPersonCameraEnabled.value) || (Menu::Camera::thirdPersonCameraEnabled.previousValue != Menu::Camera::thirdPersonCameraEnabled.value && !Menu::Camera::thirdPersonCameraEnabled.value)) {
|
||||
if (!Menu::Camera::photoMode.IsEnabled() && !Menu::Camera::freeCam.IsEnabled()) {
|
||||
if ((Menu::Camera::tpUseTPPModel.HasChangedTo(false) && Menu::Camera::thirdPersonCamera.IsEnabled()) || (Menu::Camera::thirdPersonCamera.HasChangedTo(false))) {
|
||||
pgen_TPPModel->enableTPPModel2 = true;
|
||||
pgen_TPPModel->enableTPPModel1 = true;
|
||||
}
|
||||
ShowTPPModel(Menu::Camera::tpUseTPPModel.value && Menu::Camera::thirdPersonCameraEnabled.value);
|
||||
if (Menu::Camera::tpUseTPPModel.previousValue == Menu::Camera::tpUseTPPModel.value && Menu::Camera::thirdPersonCameraEnabled.previousValue == Menu::Camera::thirdPersonCameraEnabled.value && (Menu::Camera::tpUseTPPModel.value && Menu::Camera::thirdPersonCameraEnabled.value)) {
|
||||
ShowTPPModel(Menu::Camera::tpUseTPPModel.IsEnabled() && Menu::Camera::thirdPersonCamera.IsEnabled());
|
||||
if (!Menu::Camera::tpUseTPPModel.HasChanged() && !Menu::Camera::thirdPersonCamera.HasChanged() && (Menu::Camera::tpUseTPPModel.IsEnabled() && Menu::Camera::thirdPersonCamera.IsEnabled())) {
|
||||
pgen_TPPModel->enableTPPModel2 = false;
|
||||
pgen_TPPModel->enableTPPModel1 = false;
|
||||
}
|
||||
|
||||
Menu::Camera::tpUseTPPModel.previousValue = Menu::Camera::tpUseTPPModel.value;
|
||||
Menu::Camera::thirdPersonCameraEnabled.previousValue = Menu::Camera::thirdPersonCameraEnabled.value;
|
||||
Menu::Camera::tpUseTPPModel.SetPreviousVal(Menu::Camera::tpUseTPPModel.IsEnabled());
|
||||
Menu::Camera::thirdPersonCamera.SetPreviousVal(Menu::Camera::thirdPersonCamera.IsEnabled());
|
||||
}
|
||||
if (Menu::Camera::photoModeEnabled.previousValue != Menu::Camera::photoModeEnabled.value && Menu::Camera::photoModeEnabled.value) {
|
||||
if (Menu::Camera::photoMode.HasChangedTo(true)) {
|
||||
pgen_TPPModel->enableTPPModel2 = false;
|
||||
pgen_TPPModel->enableTPPModel1 = false;
|
||||
}
|
||||
else if (Menu::Camera::photoModeEnabled.previousValue == Menu::Camera::photoModeEnabled.value && Menu::Camera::photoModeEnabled.value) {
|
||||
ShowTPPModel(Menu::Camera::photoModeEnabled.value);
|
||||
else if (!Menu::Camera::photoMode.HasChanged() && Menu::Camera::photoMode.IsEnabled()) {
|
||||
ShowTPPModel(Menu::Camera::photoMode.IsEnabled());
|
||||
}
|
||||
|
||||
Menu::Camera::photoModeEnabled.previousValue = Menu::Camera::photoModeEnabled.value;
|
||||
Menu::Camera::photoMode.SetPreviousVal(Menu::Camera::photoMode.IsEnabled());
|
||||
}
|
||||
|
||||
if (!Menu::Camera::thirdPersonCameraEnabled.value || Menu::Camera::photoModeEnabled.value || Menu::Camera::freeCamEnabled.value || !pos || !GamePH::PlayerObjProperties::Get()) {
|
||||
oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
|
||||
return;
|
||||
}
|
||||
if (!Menu::Camera::thirdPersonCamera.IsEnabled() || Menu::Camera::photoMode.IsEnabled() || Menu::Camera::freeCam.IsEnabled() || !pos)
|
||||
return oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
|
||||
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel) {
|
||||
oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
|
||||
return;
|
||||
}
|
||||
CameraFPPDI* viewCam = static_cast<CameraFPPDI*>(iLevel->GetViewCamera());
|
||||
if (!viewCam) {
|
||||
oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
|
||||
return;
|
||||
}
|
||||
if (!viewCam)
|
||||
return oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
|
||||
|
||||
Vector3 forwardVec{};
|
||||
viewCam->GetForwardVector(&forwardVec);
|
||||
@@ -289,7 +294,7 @@ namespace GamePH {
|
||||
if (it == defaultVars.end())
|
||||
return;
|
||||
|
||||
it->second.first.emplace<T>(varValue);
|
||||
it->second.first.template emplace<T>(varValue);
|
||||
}
|
||||
static void processPlayerVar(PDWORD64*& playerVarsMem, std::pair<std::string, std::pair<LPVOID, std::string>>& var) {
|
||||
while (true) {
|
||||
@@ -335,12 +340,9 @@ namespace GamePH {
|
||||
return;
|
||||
|
||||
PDWORD64* playerVarsMem = reinterpret_cast<PDWORD64*>(Get());
|
||||
bool isFloatPlayerVar = false;
|
||||
bool isBoolPlayerVar = false;
|
||||
|
||||
for (auto& var : playerVars) {
|
||||
for (auto& var : playerVars)
|
||||
processPlayerVar(playerVarsMem, var);
|
||||
}
|
||||
|
||||
gotPlayerVars = true;
|
||||
}
|
||||
@@ -384,9 +386,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
PlayerVariables* ptr = pPlayerState->playerVars;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -401,9 +403,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
PlayerState* ptr = *reinterpret_cast<PlayerState**>(Offsets::Get_PlayerState());
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -440,9 +442,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
TPPCameraDI* ptr = pCoBaseCameraProxy->pTPPCameraDI;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -515,9 +517,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
FreeCamera* ptr = reinterpret_cast<FreeCamera*>(*pg_FreeCamera);
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -539,9 +541,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
DayNightCycle* ptr = *reinterpret_cast<DayNightCycle**>(Offsets::Get_g_DayNightCycle());
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -557,9 +559,9 @@ namespace GamePH {
|
||||
return;
|
||||
|
||||
void(*pSetForcedWeather)(LPVOID timeWeatherSystem, int weather) = (decltype(pSetForcedWeather))Offsets::Get_SetForcedWeather();
|
||||
|
||||
if (!pSetForcedWeather)
|
||||
return;
|
||||
|
||||
pSetForcedWeather(this, weather);
|
||||
}
|
||||
int CSystem::GetCurrentWeather() {
|
||||
@@ -567,9 +569,9 @@ namespace GamePH {
|
||||
return EWeather::TYPE::Default;
|
||||
|
||||
int(*pGetCurrentWeather)(LPVOID timeWeatherSystem) = (decltype(pGetCurrentWeather))Offsets::Get_GetCurrentWeather();
|
||||
|
||||
if (!pGetCurrentWeather)
|
||||
return EWeather::TYPE::Default;
|
||||
|
||||
return pGetCurrentWeather(this);
|
||||
}
|
||||
|
||||
@@ -580,9 +582,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
CSystem* ptr = pLevelDI->GetTimeWeatherSystem();
|
||||
|
||||
if (!Memory::IsValidPtr(ptr))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -598,21 +600,37 @@ namespace GamePH {
|
||||
return true;
|
||||
|
||||
bool(*pIsLoading)(LPVOID iLevel) = (decltype(pIsLoading))Offsets::Get_IsLoading();
|
||||
|
||||
if (!pIsLoading)
|
||||
return true;
|
||||
|
||||
return pIsLoading(this);
|
||||
}
|
||||
bool LevelDI::IsLoaded() {
|
||||
static float loadDeltaTime = 0.0f;
|
||||
if (IsLoading() || !GamePH::PlayerObjProperties::Get()) {
|
||||
loadDeltaTime = 0.0f;
|
||||
return false;
|
||||
}
|
||||
|
||||
loadDeltaTime += GetTimeDelta();
|
||||
if (loadDeltaTime > 3.0f)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
LPVOID LevelDI::GetViewCamera() {
|
||||
if (!Offsets::Get_GetViewCamera())
|
||||
return nullptr;
|
||||
|
||||
LPVOID(*pGetViewCamera)(LPVOID iLevel) = (decltype(pGetViewCamera))Offsets::Get_GetViewCamera();
|
||||
|
||||
if (!pGetViewCamera)
|
||||
return nullptr;
|
||||
|
||||
return pGetViewCamera(this);
|
||||
}
|
||||
float LevelDI::GetTimeDelta() {
|
||||
return Memory::CallVT<176, float>(this);
|
||||
}
|
||||
void LevelDI::SetViewCamera(LPVOID viewCam) {
|
||||
Memory::CallVT<289, void>(this, viewCam);
|
||||
}
|
||||
@@ -625,9 +643,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
TimeWeather::CSystem*(*pGetTimeWeatherSystem)(LevelDI* iLevel) = (decltype(pGetTimeWeatherSystem))Offsets::Get_GetTimeWeatherSystem();
|
||||
|
||||
if (!pGetTimeWeatherSystem)
|
||||
return nullptr;
|
||||
|
||||
return pGetTimeWeatherSystem(this);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -641,9 +659,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
LevelDI* ptr = pCLevel->pLevelDI;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -659,9 +677,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
gen_TPPModel* ptr = pLocalClientDI->pgen_TPPModel;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
@@ -678,9 +696,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
LocalClientDI* ptr = pSessionCooperativeDI->pLocalClientDI;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
@@ -697,9 +715,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
SessionCooperativeDI* ptr = pGameDI_PH->pSessionCooperativeDI;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
@@ -716,9 +734,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
GameDI_PH2* ptr = reinterpret_cast<GameDI_PH2*>(reinterpret_cast<DWORD64>(pGameDI_PH) + Offsets::Get_gameDI_PH2_offset());
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -727,6 +745,16 @@ namespace GamePH {
|
||||
#pragma endregion
|
||||
|
||||
#pragma region GameDI_PH
|
||||
float GameDI_PH::GetGameTimeDelta() {
|
||||
if (!Offsets::Get_GetGameTimeDelta())
|
||||
return -1.0f;
|
||||
|
||||
float(*pGetGameTimeDelta)(LPVOID pGameDI_PH) = (decltype(pGetGameTimeDelta))Offsets::Get_GetGameTimeDelta();
|
||||
if (!pGetGameTimeDelta)
|
||||
return -1.0f;
|
||||
|
||||
return pGetGameTimeDelta(this);
|
||||
}
|
||||
INT64 GameDI_PH::GetCurrentGameVersion() {
|
||||
return Memory::CallVT<225, INT64>(this);
|
||||
}
|
||||
@@ -741,9 +769,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
GameDI_PH* ptr = pCGame->pGameDI_PH;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -758,15 +786,33 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
|
||||
PlayerObjProperties* ptr = *reinterpret_cast<PlayerObjProperties**>(Offsets::Get_g_PlayerObjProperties());
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region BackgroundModuleScreenController
|
||||
BackgroundModuleScreenController* BackgroundModuleScreenController::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_g_BackgroundModuleScreenController())
|
||||
return nullptr;
|
||||
|
||||
BackgroundModuleScreenController* ptr = reinterpret_cast<BackgroundModuleScreenController*>(Offsets::Get_g_BackgroundModuleScreenController());
|
||||
if (!Memory::IsValidPtrMod(ptr, "gamedll_ph_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
@@ -780,9 +826,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
|
||||
CVideoSettings* ptr = pCGame->pCVideoSettings;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -798,9 +844,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
|
||||
CLevel* ptr = pCGame->pCLevel;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -816,9 +862,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
|
||||
CGame* ptr = pCLobbySteam->pCGame;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -833,9 +879,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
|
||||
CLobbySteam* ptr = *reinterpret_cast<CLobbySteam**>(Offsets::Get_CLobbySteam());
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -857,9 +903,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
|
||||
CInput* ptr = *reinterpret_cast<CInput**>(Offsets::Get_g_CInput());
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -886,9 +932,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
|
||||
CBulletPhysicsCharacter* ptr = pCoPhysicsProperty->pCBulletPhysicsCharacter;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
@@ -904,14 +950,40 @@ namespace Engine {
|
||||
return nullptr;
|
||||
|
||||
CoPhysicsProperty* ptr = pPlayerObjProperties->pCoPhysicsProperty;
|
||||
|
||||
if (!Memory::IsValidPtrMod(ptr, "engine_x64_rwdi.dll"))
|
||||
return nullptr;
|
||||
|
||||
return ptr;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CRTTIField
|
||||
DWORD64 CRTTIField::Get_float(CRTTI* crtti, float& out) {
|
||||
if (!Offsets::Get_CRTTIFieldTypedNative_Get_float())
|
||||
return 0;
|
||||
|
||||
DWORD64(*pCRTTIFieldTypedNative_Get_float)(LPVOID pCRTTIFieldTypedNative, CRTTI* crtti, float& out) = (decltype(pCRTTIFieldTypedNative_Get_float))Offsets::Get_CRTTIFieldTypedNative_Get_float();
|
||||
if (!pCRTTIFieldTypedNative_Get_float)
|
||||
return 0;
|
||||
|
||||
return pCRTTIFieldTypedNative_Get_float(this, crtti, out);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CRTTI
|
||||
CRTTIField* CRTTI::FindField(const char* name) {
|
||||
if (!Offsets::Get_CRTTI_FindField())
|
||||
return nullptr;
|
||||
|
||||
CRTTIField*(*pCRTTI_FindField)(LPVOID pCRTTI, const char* name) = (decltype(pCRTTI_FindField))Offsets::Get_CRTTI_FindField();
|
||||
if (!pCRTTI_FindField)
|
||||
return nullptr;
|
||||
|
||||
return pCRTTI_FindField(this, name);
|
||||
}
|
||||
#pragma endregion
|
||||
}
|
||||
#pragma endregion
|
||||
@@ -78,6 +78,18 @@ namespace EWeather {
|
||||
namespace Engine {
|
||||
class CBaseCamera;
|
||||
class CoPhysicsProperty;
|
||||
class CRTTI;
|
||||
|
||||
// Inheritance classes
|
||||
class CRTTIField {
|
||||
public:
|
||||
DWORD64 Get_float(CRTTI* crtti, float& out);
|
||||
};
|
||||
|
||||
class CRTTI {
|
||||
public:
|
||||
CRTTIField* FindField(char const* name);
|
||||
};
|
||||
}
|
||||
|
||||
namespace GamePH {
|
||||
@@ -112,7 +124,7 @@ namespace GamePH {
|
||||
return;
|
||||
|
||||
if (std::is_same<T, std::string>::value) {
|
||||
std::string valueStr = Utils::to_string(valueStr);
|
||||
std::string valueStr = Utils::to_string(value);
|
||||
if (it->second.second == "float") {
|
||||
float* const varValue = reinterpret_cast<float*>(it->second.first);
|
||||
const float actualValue = std::stof(valueStr);
|
||||
@@ -152,6 +164,7 @@ namespace GamePH {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(float, health, 0x2C);
|
||||
DEFINE_MEMBER_N(float, maxHealth, 0x3C);
|
||||
};
|
||||
|
||||
static PlayerHealthModule* pPlayerHealthModule;
|
||||
@@ -227,7 +240,9 @@ namespace GamePH {
|
||||
class LevelDI {
|
||||
public:
|
||||
bool IsLoading();
|
||||
bool IsLoaded();
|
||||
LPVOID GetViewCamera();
|
||||
float GetTimeDelta();
|
||||
void SetViewCamera(LPVOID viewCam);
|
||||
float GetTimePlayed();
|
||||
TimeWeather::CSystem* GetTimeWeatherSystem();
|
||||
@@ -275,6 +290,7 @@ namespace GamePH {
|
||||
DEFINE_MEMBER_N(bool, blockPauseGameOnPlayerAfk, 0x830);
|
||||
};
|
||||
|
||||
float GetGameTimeDelta();
|
||||
INT64 GetCurrentGameVersion();
|
||||
void TogglePhotoMode(bool doNothing = false, bool setAsOptionalCamera = false);
|
||||
|
||||
@@ -289,6 +305,11 @@ namespace GamePH {
|
||||
|
||||
static PlayerObjProperties* Get();
|
||||
};
|
||||
|
||||
class BackgroundModuleScreenController : public Engine::CRTTI {
|
||||
public:
|
||||
static BackgroundModuleScreenController* Get();
|
||||
};
|
||||
}
|
||||
|
||||
namespace Engine {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <imgui.h>
|
||||
#include <Hotkey.h>
|
||||
#include "..\sigscan\offsets.h"
|
||||
#include "..\game_classes.h"
|
||||
#include "..\core.h"
|
||||
@@ -8,27 +9,25 @@ namespace Menu {
|
||||
namespace Camera {
|
||||
int FOV = 57;
|
||||
|
||||
SMART_BOOL photoModeEnabled;
|
||||
Option photoMode{};
|
||||
|
||||
SMART_BOOL freeCamEnabled{};
|
||||
KeyBindOption freeCam{ VK_F3 };
|
||||
float freeCamSpeed = 2.0f;
|
||||
KeyBindOption teleportPlayerToCamera{ VK_F4 };
|
||||
|
||||
SMART_BOOL thirdPersonCameraEnabled;
|
||||
SMART_BOOL tpUseTPPModel;
|
||||
KeyBindOption thirdPersonCamera{ VK_F1 };
|
||||
KeyBindOption tpUseTPPModel{ VK_F2 };
|
||||
float tpDistanceBehindPlayer = 2.0f;
|
||||
float tpHeightAbovePlayer = 1.35f;
|
||||
|
||||
SMART_BOOL disablePhotoModeLimitsEnabled{};
|
||||
bool teleportPlayerToCameraEnabled = false;
|
||||
|
||||
SMART_BOOL disableSafezoneFOVReductionEnabled{};
|
||||
Option disablePhotoModeLimits{};
|
||||
Option disableSafezoneFOVReduction{};
|
||||
|
||||
static const int baseFOV = 57;
|
||||
static const float baseSafezoneFOVReduction = -10.0f;
|
||||
static LPVOID previousViewCam = nullptr;
|
||||
|
||||
static void UpdateFOVWhileMenuClosed() {
|
||||
if (Menu::isOpen)
|
||||
if (Menu::menuToggle.IsEnabled())
|
||||
return;
|
||||
|
||||
Engine::CVideoSettings* videoSettings = Engine::CVideoSettings::Get();
|
||||
@@ -38,10 +37,10 @@ namespace Menu {
|
||||
Menu::Camera::FOV = static_cast<int>(videoSettings->extraFOV) + Menu::Camera::baseFOV;
|
||||
}
|
||||
static void FreeCamUpdate() {
|
||||
if (photoModeEnabled.value)
|
||||
if (photoMode.IsEnabled())
|
||||
return;
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel)
|
||||
if (!iLevel || !iLevel->IsLoaded())
|
||||
return;
|
||||
LPVOID viewCam = iLevel->GetViewCamera();
|
||||
if (!viewCam)
|
||||
@@ -53,10 +52,15 @@ namespace Menu {
|
||||
if (!pFreeCam)
|
||||
return;
|
||||
|
||||
if (freeCamEnabled.value) {
|
||||
if (freeCam.IsEnabled()) {
|
||||
if (viewCam == pFreeCam) {
|
||||
pFreeCam->enableSpeedMultiplier1 = true;
|
||||
pFreeCam->speedMultiplier = freeCamSpeed;
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftShift))
|
||||
pFreeCam->speedMultiplier *= 2.0f;
|
||||
else if (ImGui::IsKeyDown(ImGuiKey_LeftAlt))
|
||||
pFreeCam->speedMultiplier /= 2.0f;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -65,7 +69,7 @@ namespace Menu {
|
||||
|
||||
GamePH::ShowTPPModel(true);
|
||||
} else {
|
||||
if (freeCamEnabled.previousValue) {
|
||||
if (freeCam.WasEnabled()) {
|
||||
pFreeCam->enableSpeedMultiplier1 = false;
|
||||
pFreeCam->speedMultiplier = 0.1f;
|
||||
}
|
||||
@@ -83,25 +87,25 @@ namespace Menu {
|
||||
if (!GamePH::PlayerVariables::gotPlayerVars)
|
||||
return;
|
||||
|
||||
if (disableSafezoneFOVReductionEnabled.value) {
|
||||
if (disableSafezoneFOVReduction.IsEnabled()) {
|
||||
GamePH::PlayerVariables::ChangePlayerVar("CameraDefaultFOVReduction", 0.0f);
|
||||
disableSafezoneFOVReductionEnabled.previousValue = true;
|
||||
} else if (disableSafezoneFOVReductionEnabled.previousValue != disableSafezoneFOVReductionEnabled.value) {
|
||||
disableSafezoneFOVReductionEnabled.previousValue = false;
|
||||
disableSafezoneFOVReduction.Change(true);
|
||||
} else if (disableSafezoneFOVReduction.WasEnabled()) {
|
||||
disableSafezoneFOVReduction.Restore(true);
|
||||
GamePH::PlayerVariables::ChangePlayerVar("CameraDefaultFOVReduction", baseSafezoneFOVReduction);
|
||||
}
|
||||
}
|
||||
|
||||
void Update() {
|
||||
if (photoModeEnabled.value)
|
||||
freeCamEnabled.Change(false);
|
||||
if (photoMode.IsEnabled())
|
||||
freeCam.Change(false);
|
||||
else
|
||||
freeCamEnabled.Restore();
|
||||
freeCam.Restore();
|
||||
|
||||
if (freeCamEnabled.value)
|
||||
disablePhotoModeLimitsEnabled.Change(true);
|
||||
if (freeCam.IsEnabled())
|
||||
disablePhotoModeLimits.Change(true);
|
||||
else
|
||||
disablePhotoModeLimitsEnabled.Restore();
|
||||
disablePhotoModeLimits.Restore();
|
||||
|
||||
UpdateFOVWhileMenuClosed();
|
||||
FreeCamUpdate();
|
||||
@@ -110,19 +114,26 @@ namespace Menu {
|
||||
|
||||
void Render() {
|
||||
ImGui::SeparatorText("Free Camera");
|
||||
ImGui::BeginDisabled(photoModeEnabled.value); {
|
||||
ImGui::Checkbox("Enabled##FreeCam", &freeCamEnabled.value);
|
||||
ImGui::BeginDisabled(photoMode.IsEnabled()); {
|
||||
ImGui::Checkbox("Enabled##FreeCam", &freeCam.value);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##FreeCamToggleKey", freeCam);
|
||||
ImGui::SliderFloat("Speed##FreeCam", &freeCamSpeed, 0.0f, 100.0f);
|
||||
ImGui::Checkbox("Teleport Player to Camera", &teleportPlayerToCameraEnabled);
|
||||
ImGui::Checkbox("Teleport Player to Camera", &teleportPlayerToCamera.value);
|
||||
ImGui::Hotkey("##TeleportPlayerToCamToggleKey", teleportPlayerToCamera);
|
||||
|
||||
ImGui::SeparatorText("Third Person Camera");
|
||||
ImGui::BeginDisabled(freeCamEnabled.value || photoModeEnabled.value); {
|
||||
ImGui::Checkbox("Enabled##ThirdPerson", &thirdPersonCameraEnabled.value);
|
||||
ImGui::BeginDisabled(freeCam.IsEnabled() || photoMode.IsEnabled()); {
|
||||
ImGui::Checkbox("Enabled##ThirdPerson", &thirdPersonCamera.value);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##ThirdPersonToggleKey", thirdPersonCamera);
|
||||
ImGui::BeginDisabled(freeCam.IsEnabled() || photoMode.IsEnabled()); {
|
||||
ImGui::Checkbox("Use Third Person Player (TPP) Model", &tpUseTPPModel.value);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##TPPModelToggleKey", tpUseTPPModel);
|
||||
ImGui::SliderFloat("Distance behind player", &tpDistanceBehindPlayer, 1.0f, 10.0f);
|
||||
ImGui::SliderFloat("Height above player", &tpHeightAbovePlayer, 1.0f, 3.0f);
|
||||
|
||||
@@ -135,11 +146,11 @@ namespace Menu {
|
||||
FOV = static_cast<int>(pCVideoSettings->extraFOV) + Menu::Camera::baseFOV;
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::BeginDisabled(freeCamEnabled.value); {
|
||||
ImGui::Checkbox("Disable Photo Mode Limits", &disablePhotoModeLimitsEnabled.value);
|
||||
ImGui::BeginDisabled(freeCam.IsEnabled()); {
|
||||
ImGui::Checkbox("Disable Photo Mode Limits", &disablePhotoModeLimits.value);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Checkbox("Disable Safezone FOV Reduction", &disableSafezoneFOVReductionEnabled.value);
|
||||
ImGui::Checkbox("Disable Safezone FOV Reduction", &disableSafezoneFOVReduction.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,20 +5,19 @@ namespace Menu {
|
||||
namespace Camera {
|
||||
extern int FOV;
|
||||
|
||||
extern SMART_BOOL photoModeEnabled;
|
||||
extern Option photoMode;
|
||||
|
||||
extern SMART_BOOL freeCamEnabled;
|
||||
extern KeyBindOption freeCam;
|
||||
extern float freeCamSpeed;
|
||||
extern KeyBindOption teleportPlayerToCamera;
|
||||
|
||||
extern SMART_BOOL thirdPersonCameraEnabled;
|
||||
extern SMART_BOOL tpUseTPPModel;
|
||||
extern KeyBindOption thirdPersonCamera;
|
||||
extern KeyBindOption tpUseTPPModel;
|
||||
extern float tpDistanceBehindPlayer;
|
||||
extern float tpHeightAbovePlayer;
|
||||
|
||||
extern SMART_BOOL disablePhotoModeLimitsEnabled;
|
||||
extern bool teleportPlayerToCameraEnabled;
|
||||
|
||||
extern SMART_BOOL disableSafezoneFOVReductionEnabled;
|
||||
extern Option disablePhotoModeLimits;
|
||||
extern Option disableSafezoneFOVReduction;
|
||||
|
||||
extern void Update();
|
||||
extern void Render();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include <imgui.h>
|
||||
#include <Hotkey.h>
|
||||
#include "menu.h"
|
||||
#include "camera.h"
|
||||
#include "player.h"
|
||||
#include "world.h"
|
||||
@@ -8,7 +10,7 @@ namespace Menu {
|
||||
static const ImVec2 minWndSize = ImVec2(0.0f, 0.0f);
|
||||
static const ImVec2 maxWndSize = ImVec2(900.0f, 675.0f);
|
||||
|
||||
bool isOpen = false;
|
||||
KeyBindOption menuToggle = KeyBindOption(VK_F5);
|
||||
float transparency = 99.0f;
|
||||
|
||||
void Render() {
|
||||
@@ -16,7 +18,7 @@ namespace Menu {
|
||||
style->Colors[ImGuiCol_WindowBg] = ImVec4(style->Colors[ImGuiCol_WindowBg].x, style->Colors[ImGuiCol_WindowBg].y, style->Colors[ImGuiCol_WindowBg].z, static_cast<float>(transparency) / 100.0f);
|
||||
|
||||
ImGui::SetNextWindowSizeConstraints(minWndSize, maxWndSize);
|
||||
ImGui::Begin("EGameTools", &Menu::isOpen, windowFlags); {
|
||||
ImGui::Begin("EGameTools", &menuToggle.value, windowFlags); {
|
||||
if (ImGui::BeginTabBar("##MainTabBar")) {
|
||||
if (ImGui::BeginTabItem("Player")) {
|
||||
Menu::Player::Render();
|
||||
@@ -35,6 +37,7 @@ namespace Menu {
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::Hotkey("Menu Toggle Key", menuToggle);
|
||||
ImGui::SliderFloat("Menu Transparency", &transparency, 0.0f, 100.0f, "%.1f%%", ImGuiSliderFlags_AlwaysClamp);
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#pragma once
|
||||
#include "..\core.h"
|
||||
#include "camera.h"
|
||||
#include "player.h"
|
||||
#include "world.h"
|
||||
|
||||
namespace Menu {
|
||||
extern bool isOpen;
|
||||
extern KeyBindOption menuToggle;
|
||||
extern float transparency;
|
||||
|
||||
extern void Render();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <filesystem>
|
||||
#include <imgui.h>
|
||||
#include <ImGuiFileDialog.h>
|
||||
#include <Hotkey.h>
|
||||
#include "..\game_classes.h"
|
||||
#include "..\core.h"
|
||||
#include "..\utils.h"
|
||||
@@ -5994,9 +5995,9 @@ namespace Menu {
|
||||
0x41, 0x75, 0x64, 0x69, 0x6F, 0x45, 0x76, 0x65, 0x6E, 0x74, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6E,
|
||||
0x63, 0x65, 0x22, 0x2C, 0x20, 0x22, 0x38, 0x22, 0x29, 0x3B, 0x0D, 0x0A, 0x7D, 0x0D, 0x0A };
|
||||
|
||||
SMART_BOOL godModeEnabled{};
|
||||
SMART_BOOL freezePlayerEnabled{};
|
||||
bool playerVariablesEnabled = false;
|
||||
KeyBindOption godMode{ VK_F6 };
|
||||
KeyBindOption freezePlayer{ VK_F7 };
|
||||
Option playerVariables{};
|
||||
|
||||
std::string saveSCRPath{};
|
||||
std::string loadSCRFilePath{};
|
||||
@@ -6166,14 +6167,14 @@ namespace Menu {
|
||||
if (!playerCharacter)
|
||||
return;
|
||||
|
||||
if (Menu::Player::freezePlayerEnabled.value) {
|
||||
if (freezePlayer.IsEnabled()) {
|
||||
playerCharacter->FreezeCharacter();
|
||||
return;
|
||||
}
|
||||
|
||||
Engine::CBulletPhysicsCharacter::posBeforeFreeze = playerCharacter->playerPos;
|
||||
|
||||
if (!Menu::Camera::freeCamEnabled.value || !Menu::Camera::teleportPlayerToCameraEnabled)
|
||||
if (!Menu::Camera::freeCam.IsEnabled() || !Menu::Camera::teleportPlayerToCamera.IsEnabled())
|
||||
return;
|
||||
|
||||
GamePH::FreeCamera* freeCam = GamePH::FreeCamera::Get();
|
||||
@@ -6189,7 +6190,7 @@ namespace Menu {
|
||||
}
|
||||
|
||||
static void UpdatePlayerVars() {
|
||||
if (!playerVariablesEnabled)
|
||||
if (!playerVariables.IsEnabled())
|
||||
return;
|
||||
|
||||
auto bgn = GamePH::PlayerVariables::playerVars.begin();
|
||||
@@ -6216,15 +6217,15 @@ namespace Menu {
|
||||
}
|
||||
|
||||
void Update() {
|
||||
if (Menu::Camera::freeCamEnabled.value)
|
||||
godModeEnabled.Change(true);
|
||||
if (Menu::Camera::freeCam.IsEnabled())
|
||||
godMode.Change(true);
|
||||
else
|
||||
godModeEnabled.Restore();
|
||||
godMode.Restore();
|
||||
|
||||
if (Menu::Camera::freeCamEnabled.value)
|
||||
freezePlayerEnabled.Change(!Menu::Camera::teleportPlayerToCameraEnabled);
|
||||
if (Menu::Camera::freeCam.IsEnabled())
|
||||
freezePlayer.Change(!Menu::Camera::teleportPlayerToCamera.IsEnabled());
|
||||
else
|
||||
freezePlayerEnabled.Restore();
|
||||
freezePlayer.Restore();
|
||||
|
||||
PlayerPositionUpdate();
|
||||
UpdatePlayerVars();
|
||||
@@ -6232,19 +6233,21 @@ namespace Menu {
|
||||
|
||||
void Render() {
|
||||
ImGui::SeparatorText("Misc");
|
||||
ImGui::BeginDisabled(!GamePH::PlayerHealthModule::Get() || Menu::Camera::freeCamEnabled.value); {
|
||||
ImGui::Checkbox("God Mode", &godModeEnabled.value);
|
||||
ImGui::BeginDisabled(Menu::Camera::freeCam.IsEnabled()); {
|
||||
ImGui::Checkbox("God Mode", &godMode.value);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##GodModeToggleKey", godMode);
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginDisabled(!Engine::CBulletPhysicsCharacter::Get() || Menu::Camera::freeCamEnabled.value); {
|
||||
ImGui::Checkbox("Freeze Player", &freezePlayerEnabled.value);
|
||||
ImGui::BeginDisabled(!Engine::CBulletPhysicsCharacter::Get() || Menu::Camera::freeCam.IsEnabled()); {
|
||||
ImGui::Checkbox("Freeze Player", &freezePlayer.value);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##FreezePlayerToggleKey", freezePlayer);
|
||||
|
||||
ImGui::SeparatorText("Player Variables");
|
||||
ImGui::Checkbox("Enabled##PlayerVars", &playerVariablesEnabled);
|
||||
if (!playerVariablesEnabled)
|
||||
ImGui::Checkbox("Enabled##PlayerVars", &playerVariables.value);
|
||||
if (!playerVariables.IsEnabled())
|
||||
return;
|
||||
|
||||
ImGui::BeginDisabled(!GamePH::PlayerVariables::gotPlayerVars); {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
namespace Menu {
|
||||
namespace Player {
|
||||
extern SMART_BOOL godModeEnabled;
|
||||
extern SMART_BOOL freezePlayerEnabled;
|
||||
extern bool playerVariablesEnabled;
|
||||
extern KeyBindOption godMode;
|
||||
extern KeyBindOption freezePlayer;
|
||||
extern Option playerVariables;
|
||||
|
||||
extern std::string saveSCRPath;
|
||||
extern std::string loadSCRFilePath;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "..\game_classes.h"
|
||||
|
||||
|
||||
namespace Menu {
|
||||
namespace World {
|
||||
extern float time;
|
||||
|
||||
@@ -2,18 +2,24 @@
|
||||
#include "sigscan.h"
|
||||
#include "..\memory.h"
|
||||
|
||||
#define AddOffset(name, moduleName, pattern, type, retType) \
|
||||
#define AddOffset(name, moduleName, pattern, type, retType)\
|
||||
static retType Get_## name () {\
|
||||
static retType name = NULL;\
|
||||
if (Memory::IsValidPtr(name)) return name; \
|
||||
if (Memory::IsValidPtr(name)) return name;\
|
||||
return name=reinterpret_cast<retType>(PatternScanner::FindPattern(moduleName, {pattern, type}));\
|
||||
}
|
||||
#define AddStaticOffset(name, off) \
|
||||
#define AddStaticOffset(name, off)\
|
||||
static DWORD64 Get_## name () {\
|
||||
static DWORD64 name = 0;\
|
||||
if (name) return name; \
|
||||
return name=static_cast<DWORD64>(off);\
|
||||
}
|
||||
#define AddStaticOffset2(name, moduleName, off) \
|
||||
static DWORD64 Get_## name () {\
|
||||
static DWORD64 name = 0;\
|
||||
if (Memory::IsValidPtr(name)) return name;\
|
||||
return name=reinterpret_cast<DWORD64>(GetModuleHandle(moduleName)) + static_cast<DWORD64>(off);\
|
||||
}
|
||||
|
||||
struct Offsets {
|
||||
// ntdll.dll
|
||||
@@ -38,6 +44,7 @@ struct Offsets {
|
||||
AddOffset(g_DayNightCycle, "gamedll_ph_x64_rwdi.dll", "48 8B 0D [?? ?? ?? ?? 48 85 C9 74 10 E8 ?? ?? ?? ?? 84 C0 74 07 B0 01 48 83 C4 28 C3 32 C0", PatternType::RelativePointer, LPVOID)
|
||||
//AddOffset(g_CameraFPPDI, "gamedll_ph_x64_rwdi.dll", "48 89 05 [?? ?? ?? ?? 40 84 FF", PatternType::RelativePointer, PDWORD64)
|
||||
AddOffset(g_FreeCamera, "gamedll_ph_x64_rwdi.dll", "48 89 05 [?? ?? ?? ?? 48 89 4C 24 ??", PatternType::RelativePointer, PDWORD64)
|
||||
AddStaticOffset2(g_BackgroundModuleScreenController, "gamedll_ph_x64_rwdi.dll", 0x3377760)
|
||||
AddOffset(CameraFPPDI_VT, "gamedll_ph_x64_rwdi.dll", "48 8D 05 [?? ?? ?? ?? 48 89 07 48 8D 4F 60", PatternType::RelativePointer, DWORD64)
|
||||
|
||||
// Functions
|
||||
@@ -57,7 +64,11 @@ struct Offsets {
|
||||
AddOffset(GetForwardVector, "engine_x64_rwdi.dll", "4C 8B 41 38 41 8B 40 48", PatternType::Address, LPVOID)
|
||||
AddOffset(GetUpVector, "engine_x64_rwdi.dll", "4C 8B 41 38 41 8B 40 44", PatternType::Address, LPVOID)
|
||||
AddOffset(IsLoading, "engine_x64_rwdi.dll", "48 8B 05 ?? ?? ?? ?? 48 8B 51 38", PatternType::Address, LPVOID)
|
||||
AddOffset(GetGameTimeDelta, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? F3 0F 59 05 ?? ?? ?? ?? F3 0F 58 03", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(CRTTI_FindField, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 85 C0 75 2C", PatternType::RelativePointer, LPVOID)
|
||||
AddOffset(CRTTIFieldTypedNative_Get_float, "engine_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC 20 8B 41 14 49 8B F8 4C 8B 02 48 8B D9 C1 E8 11 48 8B CA A8 01 74 06 41 FF 50 30 EB 04 41 FF 50 20 4C 8B C8 48 8B 43 60 48 85 C0 74 13 48 8B D7 49 8B C9 48 8B 5C 24 ?? 48 83 C4 20 5F 48 FF E0 48 63 43 50 48 8B 5C 24 ?? 42 8B 0C 08", PatternType::Address, LPVOID)
|
||||
};
|
||||
|
||||
#undef AddOffset
|
||||
#undef AddStaticOffset
|
||||
#undef AddStaticOffset
|
||||
#undef AddStaticOffset2
|
||||
@@ -3,6 +3,21 @@
|
||||
#include "utils.h"
|
||||
|
||||
namespace Utils {
|
||||
Timer::Timer(long timeMs) : timeToPass(timeMs), timePassed(false) {
|
||||
start = std::chrono::time_point_cast<std::chrono::milliseconds>(clock::now());
|
||||
}
|
||||
bool Timer::GetTimePassed() {
|
||||
if (timePassed)
|
||||
return timePassed;
|
||||
|
||||
auto end = clock::now();
|
||||
long timePassedMs = static_cast<long>((end - start).count());
|
||||
|
||||
if (timePassedMs >= timeToPass)
|
||||
timePassed = true;
|
||||
return timePassed;
|
||||
}
|
||||
|
||||
bool are_same(float a, float b) {
|
||||
return abs(a - b) < 0.0001f;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <chrono>
|
||||
|
||||
enum class WindowsVersion {
|
||||
Unknown,
|
||||
@@ -8,6 +9,19 @@ enum class WindowsVersion {
|
||||
};
|
||||
|
||||
namespace Utils {
|
||||
class Timer {
|
||||
using clock = std::chrono::system_clock;
|
||||
using time_point_type = std::chrono::time_point<clock, std::chrono::milliseconds>;
|
||||
public:
|
||||
long timeToPass;
|
||||
Timer(long timeMs);
|
||||
|
||||
bool GetTimePassed();
|
||||
private:
|
||||
time_point_type start;
|
||||
bool timePassed;
|
||||
};
|
||||
|
||||
extern bool are_same(float a, float b);
|
||||
|
||||
extern bool str_replace(std::string& str, const std::string& from, const std::string& to);
|
||||
|
||||
@@ -12,7 +12,13 @@ UseTPPModel=1
|
||||
[Menu]
|
||||
Transparency=99
|
||||
[Menu:Keybinds]
|
||||
ToggleKey=VK_F5
|
||||
FreeCamToggleKey=VK_F3
|
||||
FreezePlayerToggleKey=VK_F7
|
||||
GodModeToggleKey=VK_F6
|
||||
MenuToggleKey=VK_F5
|
||||
TeleportPlayerToCameraToggleKey=VK_F4
|
||||
ThirdPersonToggleKey=VK_F1
|
||||
UseTPPModelToggleKey=VK_F2
|
||||
[Player:Misc]
|
||||
GodMode=0
|
||||
[Player:PlayerVariables]
|
||||
|
||||
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 2.3 MiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 826 KiB |
|
After Width: | Height: | Size: 94 KiB |
@@ -1,7 +1,7 @@
|
||||
-- EGameTools --
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 EricPlayZ
|
||||
Copyright (c) 2024 EricPlayZ
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -230,3 +230,28 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
|
||||
-- ImGui-Custom-Hotkeys --
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 xvorost
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,72 +1,53 @@
|
||||

|
||||
# EGameTools - an ASI mod for Dying Light 2
|
||||
|
||||
## What is EGameTools?
|
||||
EGameTools (short for Eric's Game Tools) is an ASI mod menu developed in C++, using ImGui, which aims to help ease mod developers in the process of creating mods and which also aims to add new, additional features that the game does not provide by default, such as FreeCam, Weather and Time control, etc.
|
||||
|
||||
## What is an ASI?
|
||||
An ASI is basically just a DLL file with a different file extension. There's a certain ASI loader, in this case `winmm.dll`, which gets loaded by the game, and the ASI loader then scans the game folder for ASI files and injects them into the game process.
|
||||
|
||||
## Features
|
||||
Player:
|
||||
- God Mode
|
||||
- Freeze Player
|
||||
- Player Variables editing (with the ability to save and load to/from a `player_variables.scr`, restore to default values)
|
||||
|
||||
Camera:
|
||||
- FreeCam
|
||||
- Teleport Player to Camera
|
||||
- Third Person Mode
|
||||
- FOV slider
|
||||
- Disable PhotoMode Limits
|
||||
- Disable Safezone FOV Reduction
|
||||
|
||||
World:
|
||||
- Time slider
|
||||
- Weather control
|
||||
|
||||
**Check [EGameTools Trello](https://trello.com/b/oRaJQEOi/egametools-dying-light-2) to see what features or bugfixes I'm working on/planning to add!**
|
||||
|
||||
## Installation
|
||||
Download the latest archive from the [Releases](https://github.com/EricPlayZ/DL2GameOverhaul/releases) page and extract the files from inside the archive to the game's exe folder (`Dying Light 2\ph\work\bin\x64`).
|
||||
|
||||
## Uninstallation
|
||||
Delete `winmm.dll`, `EGameTools.asi` and `EGameTools.ini` from the game's exe folder (`Dying Light 2\ph\work\bin\x64`).
|
||||
|
||||
## How do I use it?
|
||||
When you launch the game, a console window will appear. When it does, **DON'T CLOSE IT!** Closing it will also close the game. This console is meant for debugging/troubleshooting purposes later down the road when the mod gets more complex.
|
||||
|
||||
By default, to toggle the mod menu, in-game press **F5** on your keyboard. The same key will open and close the menu. You can use your mouse to navigate the menu.
|
||||
A config file `EGameTools.ini` is stored in the same folder as the mod file. In here, there will be a value called `ToggleKey` where `VK_F5` is specified. This is the key for toggling the mod menu. To change it, visit [this link from Microsoft](https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes) which contains all virtual key codes. Simply write the name of the keycode you want to use and save the config file.
|
||||
|
||||
**YOU DON'T HAVE TO REOPEN THE GAME FOR CHANGES TO THE CONFIG FILE TO TAKE EFFECT!** Changes made to the config file are constantly refreshed in the mod, so you can edit the config file while the game is running. If you want to regenerate the config file, delete it and it will automatically create a new file.
|
||||
|
||||
For now, this config file is not very useful for most people as it saves some useless information such as last paths used in the Player Variables saving/loading dialogs, or toggles such as Disable PhotoMode Limits/Safezone FOV Reduction.
|
||||
|
||||
## Bugs/issues
|
||||
**Visit [EGameTools Trello](https://trello.com/b/oRaJQEOi/egametools-dying-light-2) to check for bugs/issues currently present in the mod, as well as features that I'm working on or planning to add!**
|
||||
|
||||
## Does this work with Multiplayer?
|
||||
It should mostly work, but there's some issues with God Mode for example not working properly, the code is made with singleplayer in mind and doesn't care about other players which can cause bugs. If you encounter bugs, please open a bug report, I will gladly take a look at it and see if I can find a workaround for multiplayer too.
|
||||
|
||||
## This isn't working anymore, what can I do?
|
||||
This mod is supposed to survive game updates, but sometimes it doesn't if there's a huge game update. If it's a big game update that broke the mod, I'm most likely already aware and already working on a fix. If not, please open a bug report!
|
||||
|
||||
## Credits
|
||||
[Ultimate ASI Loader](https://github.com/ThirteenAG/Ultimate-ASI-Loader)
|
||||
|
||||
[ImGui](https://github.com/ocornut/imgui)
|
||||
|
||||
[ImGuiFileDialog](https://github.com/aiekick/ImGuiFileDialog)
|
||||
|
||||
[minhook](https://github.com/TsudaKageyu/minhook)
|
||||
|
||||
[kiero](https://github.com/Rebzzel/kiero)
|
||||
|
||||
[OpenGameCamera](https://github.com/coltonon/OpenGameCamera)
|
||||
|
||||
And **@yeeeeeeee.** for helping me with certain issues I encountered <3
|
||||
Big thanks to **@coltychen** as well! <3
|
||||
|
||||
## License
|
||||
<p align="center">
|
||||
<img src="https://i.imgur.com/s6ZV1cz.png"/><br>
|
||||
<b>EGameTools (short for Eric's Game Tools) is a mod menu developed in C++ which aims to add additional features such as FreeCam, Third Person, Weather and Time control, etc. which the game does not provide by default and also to help ease mod developers in the process of creating mods.</b><br>
|
||||
<img src="https://i.imgur.com/M9VP0cv.png"/><br>
|
||||
<b>PLAYER</b><br>
|
||||
- God Mode<br>
|
||||
- Freeze Player<br>
|
||||
- Player Variables editing (with the ability to save and load to/from a `player_variables.scr`, restore to default values)<br><br>
|
||||
<b>CAMERA</b><br>
|
||||
- FreeCam<br>
|
||||
- Teleport Player to Camera<br>
|
||||
- Third Person<br>
|
||||
- FOV slider<br>
|
||||
- Disable PhotoMode Limits<br>
|
||||
- Disable Safezone FOV Reduction<br><br>
|
||||
<b>WORLD</b><br>
|
||||
- Time slider<br>
|
||||
- Weather control<br><br>
|
||||
<b>Check <a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">EGameTools' Trello</a> page to see what features or bug fixes I'm working on/planning to add!</b><br>
|
||||
<img src="https://i.imgur.com/kOyrZYC.png"/><br>
|
||||
<b>STEP 1: </b>Download the archive from the <a href="https://github.com/EricPlayZ/EGameTools/releases">Releases</a> section<br>
|
||||
<b>STEP 2: </b>Extract the files from inside the archive to the game's exe folder (<b>Dying Light 2\ph\work\bin\x64</b>).<br><br>
|
||||
To uninstall, delete <b>winmm.dll</b>, <b>EGameTools.asi</b> and <b>EGameTools.ini</b> from the game's exe folder (<b>Dying Light 2\ph\work\bin\x64</b>).<br>
|
||||
<img src="https://i.imgur.com/CRAQXjm.png"/><br>
|
||||
When you launch the game, a console window will appear. When it does, <b>DON'T CLOSE IT!</b> Closing it will also close the game.<br><br>
|
||||
To toggle the mod menu, in-game press <b>F5</b> on your keyboard. The same key will open and close the menu.<br>
|
||||
You can use your mouse to navigate the menu.<br><br>
|
||||
A config file <b>EGameTools.ini</b> is stored in the same folder as the mod file. There's a value called <b>ToggleKey</b> where <b>VK_F5</b> is specified.<br>
|
||||
This is the key for toggling the mod menu.<br>
|
||||
To change it through the config file, visit <a href="https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes">this link from Microsoft</a> which contains all virtual key codes. Simply write the name of the keycode you want to use and save the config file.<br><br>
|
||||
The menu includes hotkeys for each option which can be changed through the mod menu by clicking on the hotkey button and then pressing a key on your keyboard.<br><br>
|
||||
Changes to the mod menu or to the config file are always automatically saved or refreshed respectively.<br>
|
||||
You <b>DO NOT NEED</b> to restart the game for changes in the config to be applied!<br>
|
||||
If you want to regenerate the config file, delete it and it will automatically be regenerated.<br>
|
||||
<img src="https://i.imgur.com/m0X9akl.png"/><br>
|
||||
<b>Check <a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">EGameTools' Trello</a> page to see what features or bug fixes I'm working on/planning to add.</b><br><br>
|
||||
<b>DO NOT</b> use the discussions tab for bug reports.<br>
|
||||
If there is a bug you're encountering, open a bug report, otherwise please refrain from using the discussions tab unless you need help or want to request additional features!<br><br>
|
||||
Currently, this mod has been designed with <b>singleplayer</b> in mind. That means certain features might glitch out or completely stop working in <b>multiplayer</b>.<br>
|
||||
If that happens, please open a bug report!<br><br>
|
||||
This mod is supposed to survive game updates, but sometimes it doesn't if there's a huge game update. If it's a big game update that broke the mod, I'm most likely already aware and already working on a fix. If not, please open a bug report!<br>
|
||||
<img src="https://i.imgur.com/nbipzX1.png"/><br>
|
||||
<a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">Ultimate ASI Loader</a><br>
|
||||
<a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">ImGui</a><br>
|
||||
<a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">ImGuiFileDialog</a><br>
|
||||
<a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">minhook</a><br>
|
||||
<a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">kiero</a><br>
|
||||
<a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">OpenGameCamera</a><br>
|
||||
<a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">ImGui-Custom-Hotkeys</a><br><br>
|
||||
And <b>@yeeeeeeee.</b> for helping me with certain issues I encountered <3<br>
|
||||
Big thanks to <b>@coltychen</b> as well! <3<br><br>
|
||||
This mod is licensed under the MIT License (included with the download and source code).
|
||||
</p>
|
||||
|
||||