23 Commits

Author SHA1 Message Date
EricPlayZ 5f1f6732cc Update README.md 2024-02-03 00:28:08 +02:00
EricPlayZ fb5ccd7ffe Update README.md 2024-02-03 00:27:24 +02:00
EricPlayZ 7469f1e9b7 Update README.md 2024-02-03 00:25:05 +02:00
EricPlayZ abc4a8a697 Update README.md 2024-02-03 00:24:37 +02:00
EricPlayZ 5b82f7512f update default config 2024-02-03 00:22:02 +02:00
EricPlayZ 154362f6a1 - Added Horizontal distance from player slider for Third Person
- Fixed a bug with hotkeys sometimes not working unless you opened the menu
2024-02-03 00:12:50 +02:00
EricPlayZ 0db4be9b19 - Fixed game crashing when Misc tab is open while exiting to main menu
- Fixed Disable HUD getting grayed out and not being able to toggle it back to false when exiting to main menu
- Fixed Player Variables loading/saving not working properly
2024-01-31 18:37:11 +02:00
EricPlayZ 781e97bf77 Update README.md 2024-01-29 02:15:30 +02:00
EricPlayZ 2749d19fc9 stop MSVC from creating .exp in Release folder 2024-01-29 02:12:25 +02:00
EricPlayZ 6853aa0bee switched back to MSVC for the compiler cuz Clang doesnt handle exceptions properly :( 2024-01-29 02:10:23 +02:00
EricPlayZ 447291d036 Added Player Health slider, added Disable Out of Bounds Timer, added Disable HUD, now using less function signatures, therefore less effort is required when updating the mod! Also cleaned up the code a lot, it's now a bit more organized. 2024-01-29 01:52:08 +02:00
EricPlayZ e303f5e134 fixed some issues with toggling hotkeys and third person logic 2024-01-27 19:59:26 +02:00
EricPlayZ cc244db9fd fixed a small config bug for boolean options 2024-01-26 22:31:54 +02:00
EricPlayZ 432a65e977 Update README.md 2024-01-26 18:48:45 +02:00
EricPlayZ 12d38d264c upload images 2024-01-26 18:03:38 +02:00
EricPlayZ 906c6f6581 change default config, upload extra images 2024-01-26 16:56:22 +02:00
EricPlayZ 14d83b1061 switched to Clang cuz its better, fixed some broken code... idk how it even worked in the first place!! 2024-01-25 02:37:10 +02:00
EricPlayZ 662ea7896e remove duplicate switch cases, oops :) 2024-01-25 01:45:44 +02:00
EricPlayZ 3f593c7749 fixed an issue with F10 not getting detected as a key press when switching hotkeys 2024-01-25 01:28:24 +02:00
EricPlayZ bb43194a8a cleaned up the code a lil' bit, its still a mess but eh... itll do for now :) 2024-01-25 00:58:38 +02:00
EricPlayZ 6d21f11c49 Added hotkeys! Code is very unorganiezd, will clean in later updates 2024-01-22 01:04:19 +02:00
EricPlayZ d7a0275c39 - Config overhaul
- Soon adding hotkeys
2024-01-21 02:58:32 +02:00
EricPlayZ 776310c4b6 - Fixed "Having third-person enabled in the game menu, before loading up the game, will cause infinite loading until you disable third-person"
- Fixed "When loading up the game with God Mode enabled, your health drops to 80 and stays there until you disable God Mode"
- Added a way to check if the game is still loading or not
2024-01-20 22:05:06 +02:00
41 changed files with 11438 additions and 10654 deletions
@@ -16,12 +16,13 @@
<ClCompile Include="source\dllmain.cpp" />
<ClCompile Include="source\game_classes.cpp" />
<ClCompile Include="source\hook.cpp" />
<ClCompile Include="source\ImGuiEx\ImGuiEx.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" />
@@ -32,6 +33,7 @@
<ClCompile Include="source\memory.cpp" />
<ClCompile Include="source\menu\camera.cpp" />
<ClCompile Include="source\menu\menu.cpp" />
<ClCompile Include="source\menu\misc.cpp" />
<ClCompile Include="source\menu\player.cpp" />
<ClCompile Include="source\menu\world.cpp" />
<ClCompile Include="source\sigscan\sigscan.cpp" />
@@ -44,11 +46,13 @@
<ClInclude Include="source\core.h" />
<ClInclude Include="source\game_classes.h" />
<ClInclude Include="source\hook.h" />
<ClInclude Include="source\ImGuiEx\ImGuiEx.h" />
<ClInclude Include="source\ImGuiFileDialog\dirent\dirent.h" />
<ClInclude Include="source\ImGuiFileDialog\ImGuiFileDialog.h" />
<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" />
@@ -65,6 +69,7 @@
<ClInclude Include="source\memory.h" />
<ClInclude Include="source\menu\camera.h" />
<ClInclude Include="source\menu\menu.h" />
<ClInclude Include="source\menu\misc.h" />
<ClInclude Include="source\menu\player.h" />
<ClInclude Include="source\menu\world.h" />
<ClInclude Include="source\MinHook\include\MinHook.h" />
@@ -137,13 +142,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\ImGuiEx;source\ImGuiHotkeys;source\ImGui;source\ImGuiFileDialog;source\MinHook\include;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -171,8 +176,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\ImGuiEx;source\ImGuiHotkeys;source\ImGui;source\ImGuiFileDialog;source\MinHook\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>None</DebugInformationFormat>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
@@ -184,6 +189,8 @@
<EnableUAC>false</EnableUAC>
<AdditionalLibraryDirectories>source\MinHook\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libMinHook-x64-v141-mtd.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
<ImportLibrary />
<AdditionalOptions>/NOIMPLIB /NOEXP %(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,15 @@
<ClCompile Include="source\menu\world.cpp">
<Filter>menu</Filter>
</ClCompile>
<ClCompile Include="source\ImGuiHotkeys\Hotkey.cpp">
<Filter>ImGuiHotkeys</Filter>
</ClCompile>
<ClCompile Include="source\ImGuiEx\ImGuiEx.cpp">
<Filter>ImGuiEx</Filter>
</ClCompile>
<ClCompile Include="source\menu\misc.cpp">
<Filter>menu</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\memory.h" />
@@ -152,6 +158,15 @@
<ClInclude Include="source\menu\world.h">
<Filter>menu</Filter>
</ClInclude>
<ClInclude Include="source\ImGuiHotkeys\Hotkey.h">
<Filter>ImGuiHotkeys</Filter>
</ClInclude>
<ClInclude Include="source\ImGuiEx\ImGuiEx.h">
<Filter>ImGuiEx</Filter>
</ClInclude>
<ClInclude Include="source\menu\misc.h">
<Filter>menu</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="MinHook">
@@ -187,5 +202,11 @@
<Filter Include="config">
<UniqueIdentifier>{50f832bc-5ff2-45db-8d20-e8f458c78596}</UniqueIdentifier>
</Filter>
<Filter Include="ImGuiHotkeys">
<UniqueIdentifier>{1bf47e0a-f304-4b69-9662-60e65c2c3655}</UniqueIdentifier>
</Filter>
<Filter Include="ImGuiEx">
<UniqueIdentifier>{c4339f5a-8efb-4f84-bb49-bd25a24d04d9}</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.GetValue())
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.GetValue())
Menu::Render();
ImGui::Render();
@@ -1,31 +1,45 @@
#include <Windows.h>
#include <imgui.h>
#include <Hotkey.h>
#include <Windows.h>
#include <backends\imgui_impl_win32.h>
#include <imgui.h>
#include "..\..\core.h"
#include "..\..\game_classes.h"
#include "..\..\kiero.h"
#include "..\..\menu\menu.h"
#include "..\..\sigscan\offsets.h"
#include "..\..\game_classes.h"
#include "..\..\config\config.h"
#include "..\..\kiero.h"
#include "..\config\config.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 (option->GetChangesAreDisabled())
continue;
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 +47,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.GetValue();
ImGui_ImplWin32_WndProcHandler(hwnd, uMsg, wParam, lParam);
if (Menu::isOpen) {
if (Menu::menuToggle.GetValue()) {
if (!toggledMenu)
pCInput->BlockGameInput();
@@ -0,0 +1,56 @@
#define IMGUI_DEFINE_MATH_OPERATORS
#include <imgui_internal.h>
#include "..\core.h"
namespace ImGui {
bool Checkbox(const char* label, Option* v) {
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
const ImVec2 label_size = CalcTextSize(label, NULL, true);
const float square_sz = GetFrameHeight();
const ImVec2 pos = window->DC.CursorPos;
const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f));
ItemSize(total_bb, style.FramePadding.y);
if (!ItemAdd(total_bb, id)) {
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (v->GetValue() ? ImGuiItemStatusFlags_Checked : 0));
return false;
}
bool hovered, held;
bool pressed = ButtonBehavior(total_bb, id, &hovered, &held);
if (pressed) {
v->Toggle();
MarkItemEdited(id);
}
const ImRect check_bb(pos, pos + ImVec2(square_sz, square_sz));
RenderNavHighlight(total_bb, id);
RenderFrame(check_bb.Min, check_bb.Max, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding);
ImU32 check_col = GetColorU32(ImGuiCol_CheckMark);
bool mixed_value = (g.LastItemData.InFlags & ImGuiItemFlags_MixedValue) != 0;
if (mixed_value) {
// Undocumented tristate/mixed/indeterminate checkbox (#2644)
// This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all widgets (not just checkbox)
ImVec2 pad(ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)), ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)));
window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding);
} else if (v->GetValue()) {
const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f));
RenderCheckMark(window->DrawList, check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad * 2.0f);
}
ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y);
if (g.LogEnabled)
LogRenderedText(&label_pos, mixed_value ? "[~]" : v->GetValue() ? "[x]" : "[ ]");
if (label_size.x > 0.0f)
RenderText(label_pos, label);
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (v->GetValue() ? ImGuiItemStatusFlags_Checked : 0));
return pressed;
}
}
@@ -0,0 +1,6 @@
#pragma once
#include "..\core.h"
namespace ImGui {
bool Checkbox(const char* label, Option* v);
}
@@ -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.
File diff suppressed because it is too large Load Diff
+8 -2
View File
@@ -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();
+24 -16
View File
@@ -1,18 +1,19 @@
#include <MinHook.h>
#include <Windows.h>
#include <iostream>
#include <thread>
#include <MinHook.h>
#include "kiero.h"
#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 "game_classes.h"
#include "hook.h"
#include "utils.h"
#include "kiero.h"
#include "menu\menu.h"
#include "sigscan\offsets.h"
#pragma region KeyBindOption
bool KeyBindOption::wasAnyKeyPressed = false;
#pragma endregion
namespace Core {
// Console stuff
@@ -112,8 +113,17 @@ namespace Core {
if (!GamePH::PlayerVariables::gotPlayerVars)
GamePH::PlayerVariables::GetPlayerVars();
Menu::Player::Update();
Menu::Camera::Update();
for (auto& menuTab : *Menu::MenuTab::GetInstances())
menuTab.second->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) {
@@ -128,12 +138,10 @@ namespace Core {
hookRendererThread = std::thread(LoopHookRenderer);
hookRendererThread.detach();
GamePH::LoopHookCreatePlayerHealthModule();
GamePH::LoopHookOnUpdate();
GamePH::LoopHookCalculateFreeCamCollision();
GamePH::LoopHookLifeSetHealth();
GamePH::LoopHookTogglePhotoMode();
GamePH::LoopHookMoveCameraFromForwardUpPos();
for (auto& hook : *Hook::HookBase::GetInstances())
hook->HookLoop();
for (auto& hook : *Hook::HookBase::GetInstances())
hook->HookLoop();
const HANDLE proc = GetCurrentProcess();
WaitForSingleObject(proc, INFINITE);
+204 -29
View File
@@ -1,40 +1,215 @@
#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() { GetInstances()->insert(this); };
~Option() { GetInstances()->erase(this); }
static std::set<Option*>* GetInstances() { static std::set<Option*> instances{}; return &instances; };
bool Change(bool newValue) {
if (changed && newValue == value)
return false;
if (!changed)
previousValue = value;
changed = true;
value = newValue;
return true;
}
bool Restore() {
if (!changed)
return false;
changed = false;
value = previousValue;
return true;
}
bool value = false;
void SetChangesAreDisabled(bool newValue) { changesAreDisabled = newValue; }
bool GetChangesAreDisabled() const { return changesAreDisabled; }
void Toggle() { previousValue = value; value = !value; }
void Set(bool newValue) { previousValue = value; value = newValue; }
void SetBothValues(bool newValue) { previousValue = newValue; value = newValue; }
void SetValue(bool newValue) { value = newValue; }
void SetPrevValue(bool newValue) { previousValue = newValue; }
constexpr bool GetValue() const { return value; }
constexpr bool GetPrevValue() const { return previousValue; }
constexpr bool HasChanged() const { return previousValue != value; }
constexpr bool HasChangedTo(bool toValue) const { return previousValue != value && value == toValue; }
private:
bool changed;
bool changesAreDisabled = false;
bool previousValue = false;
};
class KeyBindOption : public Option {
public:
static bool wasAnyKeyPressed;
KeyBindOption(int keyCode) : keyCode(keyCode) { GetInstances()->insert(this); };
~KeyBindOption() { GetInstances()->erase(this); }
static std::set<KeyBindOption*>* GetInstances() { static std::set<KeyBindOption*> instances{}; return &instances; };
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 }
});
};
namespace Core {
File diff suppressed because it is too large Load Diff
+48 -35
View File
@@ -1,10 +1,10 @@
#pragma once
#include <Windows.h>
#include <map>
#include <vector>
#include <string>
#include <memory>
#include <any>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "hook.h"
#include "utils.h"
@@ -76,18 +76,37 @@ namespace EWeather {
// Forward decl
namespace Engine {
class CBaseCamera;
class CBaseCamera {
public:
union {
DEFINE_MEMBER_N(float, yaw, 0x48);
DEFINE_MEMBER_N(float, X, 0x4C);
DEFINE_MEMBER_N(float, pitch, 0x58);
DEFINE_MEMBER_N(float, Y, 0x5C);
DEFINE_MEMBER_N(float, Z, 0x6C);
};
Vector3* GetForwardVector(Vector3* outForwardVec);
Vector3* GetUpVector(Vector3* outUpVec);
Vector3* GetLeftVector(Vector3* outLeftVec);
Vector3* GetPosition(Vector3* outPos);
};
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 {
extern void LoopHookCreatePlayerHealthModule();
extern void LoopHookOnUpdate();
extern void LoopHookCalculateFreeCamCollision();
extern void LoopHookLifeSetHealth();
extern void LoopHookTogglePhotoMode();
extern void LoopHookMoveCameraFromForwardUpPos();
extern void ShowTPPModel(bool showTPPModel);
class PlayerVariables {
@@ -112,7 +131,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,27 +171,24 @@ namespace GamePH {
public:
union {
DEFINE_MEMBER_N(float, health, 0x2C);
DEFINE_MEMBER_N(float, maxHealth, 0x3C);
};
static PlayerHealthModule* pPlayerHealthModule;
static PlayerHealthModule* Get();
};
class TPPCameraDI {
class TPPCameraDI : public Engine::CBaseCamera {
public:
static TPPCameraDI* Get();
};
class CameraFPPDI {
class CameraFPPDI : public Engine::CBaseCamera {
public:
union {
DEFINE_MEMBER_N(Engine::CBaseCamera*, pCBaseCamera, 0x38);
};
Vector3* GetForwardVector(Vector3* outForwardVec);
Vector3* GetUpVector(Vector3* outUpVec);
Vector3* GetPosition(Vector3* posIN);
//static CameraFPPDI* Get();
};
@@ -183,7 +199,7 @@ namespace GamePH {
};
};
class FreeCamera {
class FreeCamera : public Engine::CBaseCamera {
public:
union {
DEFINE_MEMBER_N(CoBaseCameraProxy*, pCoBaseCameraProxy, 0x18);
@@ -193,9 +209,6 @@ namespace GamePH {
DEFINE_MEMBER_N(float, speedMultiplier, 0x1CC);
};
Vector3* GetForwardVector(Vector3* outForwardVec);
Vector3* GetUpVector(Vector3* outUpVec);
Vector3* GetPosition(Vector3* posIN);
void AllowCameraMovement(int mode = 2);
static FreeCamera* Get();
@@ -227,9 +240,12 @@ namespace GamePH {
class LevelDI {
public:
bool IsLoading();
bool IsLoaded();
LPVOID GetViewCamera();
float GetTimeDelta();
void SetViewCamera(LPVOID viewCam);
float GetTimePlayed();
void ShowUIManager(bool enabled);
TimeWeather::CSystem* GetTimeWeatherSystem();
static LevelDI* Get();
@@ -275,7 +291,8 @@ namespace GamePH {
DEFINE_MEMBER_N(bool, blockPauseGameOnPlayerAfk, 0x830);
};
INT64 GetCurrentGameVersion();
float GetGameTimeDelta();
DWORD64 GetCurrentGameVersion();
void TogglePhotoMode(bool doNothing = false, bool setAsOptionalCamera = false);
static GameDI_PH* Get();
@@ -285,10 +302,17 @@ namespace GamePH {
public:
union {
DEFINE_MEMBER_N(Engine::CoPhysicsProperty*, pCoPhysicsProperty, 0xF0);
DEFINE_MEMBER_N(bool, isOutOfBounds, 0x2E80);
DEFINE_MEMBER_N(float, outOfBoundsTimer, 0x2E84);
};
static PlayerObjProperties* Get();
};
class BackgroundModuleScreenController : public Engine::CRTTI {
public:
static BackgroundModuleScreenController* Get();
};
}
namespace Engine {
@@ -338,17 +362,6 @@ namespace Engine {
static CInput* Get();
};
class CBaseCamera {
public:
union {
DEFINE_MEMBER_N(float, yaw, 0x48);
DEFINE_MEMBER_N(float, X, 0x4C);
DEFINE_MEMBER_N(float, pitch, 0x58);
DEFINE_MEMBER_N(float, Y, 0x5C);
DEFINE_MEMBER_N(float, Z, 0x6C);
};
};
class CBulletPhysicsCharacter {
public:
union {
+2 -2
View File
@@ -1,7 +1,7 @@
#include <cstdint>
#include <iostream>
#include "sigscan\offsets.h"
#include "hook.h"
#include "sigscan\offsets.h"
namespace Hook {
// VTable hooking
@@ -17,7 +17,7 @@ namespace Hook {
VirtualProtect(mbi.BaseAddress, mbi.RegionSize, protection, &mbi.Protect);
}
void VTHook(LPVOID instance, LPVOID pDetour, LPVOID* ppOriginal, const DWORD offset) {
void HookVT(LPVOID instance, LPVOID pDetour, LPVOID* ppOriginal, const DWORD offset) {
PDWORD64* entry = reinterpret_cast<PDWORD64*>(*reinterpret_cast<DWORD64*>(instance) + offset);
*ppOriginal = *entry;
+68 -1
View File
@@ -1,6 +1,8 @@
#pragma once
#include <Windows.h>
#include <functional>
#include <set>
#include "MinHook\include\MinHook.h"
namespace Hook {
struct DETOUR_INFO {
@@ -18,7 +20,7 @@ namespace Hook {
}
};
extern void VTHook(LPVOID instance, LPVOID pDetour, LPVOID* ppOriginal, const DWORD offset);
extern void HookVT(LPVOID instance, LPVOID pDetour, LPVOID* ppOriginal, const DWORD offset);
extern DETOUR_INFO MidFuncHook(LPVOID pTarget, LPVOID hookedFunc, const size_t nops = 0, const size_t bytesToSkip = 0);
@@ -36,4 +38,69 @@ namespace Hook {
void Disable();
~BreakpointHook();
};
class HookBase {
public:
HookBase() { GetInstances()->insert(this); }
~HookBase() { GetInstances()->erase(this); }
static std::set<HookBase*>* GetInstances() { static std::set<HookBase*> instances{}; return &instances; };
virtual void HookLoop() {};
};
template <typename GetTargetOffsetRetType, typename OrigType>
class MHook : HookBase {
public:
MHook(GetTargetOffsetRetType(*pGetOffsetFunc)(), OrigType pDetour) : pGetOffsetFunc(pGetOffsetFunc), pDetour(pDetour) {}
void HookLoop() override {
while (true) {
Sleep(250);
if (!pGetOffsetFunc)
continue;
if (!pTarget)
pTarget = reinterpret_cast<OrigType>(pGetOffsetFunc());
else if (!pOriginal && MH_CreateHook(pTarget, pDetour, reinterpret_cast<LPVOID*>(&pOriginal)) == MH_OK) {
MH_EnableHook(pTarget);
break;
}
}
}
OrigType pOriginal = nullptr;
OrigType pTarget = nullptr;
private:
GetTargetOffsetRetType(*pGetOffsetFunc)() = nullptr;
OrigType pDetour = nullptr;
};
template <typename GetTargetOffsetRetType, typename OrigType>
class VTHook : HookBase {
public:
VTHook(GetTargetOffsetRetType(*pGetOffsetFunc)(), OrigType pDetour, DWORD offset) : pGetOffsetFunc(pGetOffsetFunc), pDetour(pDetour), offset(offset) {}
void HookLoop() override {
while (true) {
Sleep(250);
if (!pGetOffsetFunc)
continue;
if (!pInstance)
pInstance = pGetOffsetFunc();
else if (!pOriginal) {
Hook::HookVT(pInstance, pDetour, reinterpret_cast<LPVOID*>(&pOriginal), offset);
break;
}
}
}
OrigType pOriginal = nullptr;
private:
GetTargetOffsetRetType(*pGetOffsetFunc)() = nullptr;
LPVOID pInstance = nullptr;
OrigType pDetour = nullptr;
DWORD offset = 0x0;
};
}
+65 -53
View File
@@ -1,47 +1,49 @@
#include <Hotkey.h>
#include <ImGuiEx.h>
#include <imgui.h>
#include "..\sigscan\offsets.h"
#include "..\game_classes.h"
#include "..\core.h"
#include "..\game_classes.h"
#include "..\sigscan\offsets.h"
#include "camera.h"
#include "menu.h"
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;
float tpHorizontalDistanceFromPlayer = 0.0f;
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)
static void UpdateFOV() {
if (menuToggle.GetValue())
return;
Engine::CVideoSettings* videoSettings = Engine::CVideoSettings::Get();
if (!videoSettings)
return;
Menu::Camera::FOV = static_cast<int>(videoSettings->extraFOV) + Menu::Camera::baseFOV;
FOV = static_cast<int>(videoSettings->extraFOV) + baseFOV;
}
static void FreeCamUpdate() {
if (photoModeEnabled.value)
if (photoMode.GetValue())
return;
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
if (!iLevel)
if (!iLevel || !iLevel->IsLoaded())
return;
LPVOID viewCam = iLevel->GetViewCamera();
if (!viewCam)
@@ -53,19 +55,24 @@ namespace Menu {
if (!pFreeCam)
return;
if (freeCamEnabled.value) {
if (freeCam.GetValue()) {
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;
}
pGameDI_PH->TogglePhotoMode();
pFreeCam->AllowCameraMovement(2);
GamePH::ShowTPPModel(true);
freeCam.SetPrevValue(true);
} else {
if (freeCamEnabled.previousValue) {
if (freeCam.GetPrevValue()) {
pFreeCam->enableSpeedMultiplier1 = false;
pFreeCam->speedMultiplier = 0.1f;
}
@@ -75,56 +82,64 @@ namespace Menu {
pGameDI_PH->TogglePhotoMode();
pFreeCam->AllowCameraMovement(0);
GamePH::ShowTPPModel(false);
freeCam.SetPrevValue(false);
}
}
static void UpdatePlayerVars() {
if (!GamePH::PlayerVariables::gotPlayerVars)
return;
if (disableSafezoneFOVReductionEnabled.value) {
if (disableSafezoneFOVReduction.GetValue()) {
GamePH::PlayerVariables::ChangePlayerVar("CameraDefaultFOVReduction", 0.0f);
disableSafezoneFOVReductionEnabled.previousValue = true;
} else if (disableSafezoneFOVReductionEnabled.previousValue != disableSafezoneFOVReductionEnabled.value) {
disableSafezoneFOVReductionEnabled.previousValue = false;
disableSafezoneFOVReduction.SetPrevValue(true);
} else if (disableSafezoneFOVReduction.GetPrevValue()) {
disableSafezoneFOVReduction.SetPrevValue(false);
GamePH::PlayerVariables::ChangePlayerVar("CameraDefaultFOVReduction", baseSafezoneFOVReduction);
}
}
void Update() {
if (photoModeEnabled.value)
freeCamEnabled.Change(false);
else
freeCamEnabled.Restore();
if (freeCamEnabled.value)
disablePhotoModeLimitsEnabled.Change(true);
else
disablePhotoModeLimitsEnabled.Restore();
UpdateFOVWhileMenuClosed();
FreeCamUpdate();
UpdatePlayerVars();
static void UpdateDisabledOptions() {
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
freeCam.SetChangesAreDisabled(!iLevel || !iLevel->IsLoaded() || photoMode.GetValue());
teleportPlayerToCamera.SetChangesAreDisabled(!iLevel || !iLevel->IsLoaded());
thirdPersonCamera.SetChangesAreDisabled(freeCam.GetValue() || photoMode.GetValue());
tpUseTPPModel.SetChangesAreDisabled(freeCam.GetValue() || photoMode.GetValue());
}
void Render() {
Tab Tab::instance{};
void Tab::Update() {
UpdateFOV();
FreeCamUpdate();
UpdatePlayerVars();
UpdateDisabledOptions();
}
void Tab::Render() {
ImGui::SeparatorText("Free Camera");
ImGui::BeginDisabled(photoModeEnabled.value); {
ImGui::Checkbox("Enabled##FreeCam", &freeCamEnabled.value);
ImGui::BeginDisabled(freeCam.GetChangesAreDisabled() || photoMode.GetValue()); {
ImGui::Checkbox("Enabled##FreeCam", &freeCam);
ImGui::EndDisabled();
}
ImGui::Hotkey("##FreeCamToggleKey", freeCam);
ImGui::SliderFloat("Speed##FreeCam", &freeCamSpeed, 0.0f, 100.0f);
ImGui::Checkbox("Teleport Player to Camera", &teleportPlayerToCameraEnabled);
ImGui::BeginDisabled(teleportPlayerToCamera.GetChangesAreDisabled()); {
ImGui::Checkbox("Teleport Player to Camera", &teleportPlayerToCamera);
ImGui::EndDisabled();
}
ImGui::Hotkey("##TeleportPlayerToCamToggleKey", teleportPlayerToCamera);
ImGui::SeparatorText("Third Person Camera");
ImGui::BeginDisabled(freeCamEnabled.value || photoModeEnabled.value); {
ImGui::Checkbox("Enabled##ThirdPerson", &thirdPersonCameraEnabled.value);
ImGui::Checkbox("Use Third Person Player (TPP) Model", &tpUseTPPModel.value);
ImGui::BeginDisabled(thirdPersonCamera.GetChangesAreDisabled()); {
ImGui::Checkbox("Enabled##ThirdPerson", &thirdPersonCamera);
ImGui::EndDisabled();
}
ImGui::Hotkey("##ThirdPersonToggleKey", thirdPersonCamera);
ImGui::BeginDisabled(tpUseTPPModel.GetChangesAreDisabled()); {
ImGui::Checkbox("Use Third Person Player (TPP) Model", &tpUseTPPModel);
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);
ImGui::SliderFloat("Horizontal distance from player", &tpHorizontalDistanceFromPlayer, -2.0f, 2.0f);
ImGui::SeparatorText("Misc");
Engine::CVideoSettings* pCVideoSettings = Engine::CVideoSettings::Get();
@@ -132,14 +147,11 @@ namespace Menu {
if (ImGui::SliderInt("FOV", &FOV, 20, 160) && pCVideoSettings)
pCVideoSettings->extraFOV = static_cast<float>(FOV - baseFOV);
else if (pCVideoSettings)
FOV = static_cast<int>(pCVideoSettings->extraFOV) + Menu::Camera::baseFOV;
FOV = static_cast<int>(pCVideoSettings->extraFOV) + baseFOV;
ImGui::EndDisabled();
}
ImGui::BeginDisabled(freeCamEnabled.value); {
ImGui::Checkbox("Disable Photo Mode Limits", &disablePhotoModeLimitsEnabled.value);
ImGui::EndDisabled();
}
ImGui::Checkbox("Disable Safezone FOV Reduction", &disableSafezoneFOVReductionEnabled.value);
ImGui::Checkbox("Disable Photo Mode Limits", &disablePhotoModeLimits);
ImGui::Checkbox("Disable Safezone FOV Reduction", &disableSafezoneFOVReduction);
}
}
}
+16 -9
View File
@@ -1,26 +1,33 @@
#pragma once
#include "..\core.h"
#include "menu.h"
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 float tpHorizontalDistanceFromPlayer;
extern SMART_BOOL disablePhotoModeLimitsEnabled;
extern bool teleportPlayerToCameraEnabled;
extern Option disablePhotoModeLimits;
extern Option disableSafezoneFOVReduction;
extern SMART_BOOL disableSafezoneFOVReductionEnabled;
class Tab : MenuTab {
public:
Tab() : MenuTab("Camera", 1) {}
void Update() override;
void Render() override;
extern void Update();
extern void Render();
static Tab instance;
};
}
}
+10 -16
View File
@@ -1,14 +1,13 @@
#include <Hotkey.h>
#include <imgui.h>
#include "camera.h"
#include "player.h"
#include "world.h"
#include "menu.h"
namespace Menu {
static const ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize;
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,25 +15,20 @@ 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();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Camera")) {
Menu::Camera::Render();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("World")) {
Menu::World::Render();
ImGui::EndTabItem();
for (auto& tab : *MenuTab::GetInstances()) {
if (ImGui::BeginTabItem(tab.second->tabName.data())) {
tab.second->Render();
ImGui::EndTabItem();
}
}
ImGui::EndTabBar();
}
ImGui::Separator();
ImGui::Hotkey("Menu Toggle Key", menuToggle);
ImGui::SliderFloat("Menu Transparency", &transparency, 0.0f, 100.0f, "%.1f%%", ImGuiSliderFlags_AlwaysClamp);
ImGui::End();
}
+16 -2
View File
@@ -1,8 +1,22 @@
#pragma once
#include "camera.h"
#include "..\core.h"
namespace Menu {
extern bool isOpen;
class MenuTab {
public:
MenuTab(std::string_view name, int tabIndex) : tabName(name), tabIndex(tabIndex) { GetInstances()->insert({ tabIndex, this}); };
~MenuTab() { GetInstances()->erase({ tabIndex, this }); }
static std::set<std::pair<int, MenuTab*>>* GetInstances() { static std::set<std::pair<int, MenuTab*>> instances{}; return &instances; };
virtual void Render() {};
virtual void Update() {};
std::string_view tabName{};
private:
int tabIndex{};
};
extern KeyBindOption menuToggle;
extern float transparency;
extern void Render();
@@ -0,0 +1,45 @@
#include <Hotkey.h>
#include <ImGuiEx.h>
#include <imgui.h>
#include "..\game_classes.h"
#include "misc.h"
namespace Menu {
namespace Misc {
KeyBindOption disableHUD{ VK_F8 };
static void UpdateDisabledOptions() {
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
disableHUD.SetChangesAreDisabled(!iLevel || !iLevel->IsLoaded());
}
Tab Tab::instance{};
void Tab::Update() {
UpdateDisabledOptions();
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
if (!iLevel)
return;
if (!iLevel->IsLoaded() && disableHUD.GetValue()) {
disableHUD.SetBothValues(false);
iLevel->ShowUIManager(true);
return;
}
if (disableHUD.HasChanged()) {
disableHUD.SetPrevValue(disableHUD.GetValue());
iLevel->ShowUIManager(!disableHUD.GetValue());
}
}
void Tab::Render() {
ImGui::SeparatorText("Misc##Misc");
ImGui::BeginDisabled(disableHUD.GetChangesAreDisabled()); {
ImGui::Checkbox("Disable HUD", &disableHUD);
ImGui::Hotkey("##DisableHUDToggleKey", disableHUD);
ImGui::EndDisabled();
}
}
}
}
+17
View File
@@ -0,0 +1,17 @@
#pragma once
#include "menu.h"
namespace Menu {
namespace Misc {
extern KeyBindOption disableHUD;
class Tab : MenuTab {
public:
Tab() : MenuTab("Misc", 2) {}
void Update() override;
void Render() override;
static Tab instance;
};
}
}
File diff suppressed because it is too large Load Diff
+15 -5
View File
@@ -1,17 +1,27 @@
#pragma once
#include <string>
#include "..\core.h"
#include "menu.h"
namespace Menu {
namespace Player {
extern SMART_BOOL godModeEnabled;
extern SMART_BOOL freezePlayerEnabled;
extern bool playerVariablesEnabled;
extern float playerHealth;
extern float playerMaxHealth;
extern KeyBindOption godMode;
extern KeyBindOption freezePlayer;
extern Option playerVariables;
extern Option disableOutOfBoundsTimer;
extern std::string saveSCRPath;
extern std::string loadSCRFilePath;
extern void Update();
extern void Render();
class Tab : MenuTab {
public:
Tab() : MenuTab("Player", 0) {}
void Update() override;
void Render() override;
static Tab instance;
};
}
}
+7 -3
View File
@@ -1,5 +1,6 @@
#include <imgui.h>
#include "..\game_classes.h"
#include "world.h"
namespace Menu {
namespace World {
@@ -16,10 +17,13 @@ namespace Menu {
"Stormy"
};
void Render() {
Tab Tab::instance{};
void Tab::Update() {}
void Tab::Render() {
GamePH::DayNightCycle* dayNightCycle = GamePH::DayNightCycle::Get();
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
ImGui::SeparatorText("Misc##World");
ImGui::BeginDisabled(!Engine::CBulletPhysicsCharacter::Get() || !dayNightCycle || dayNightCycle->time1 == 0.0f); {
ImGui::BeginDisabled(!iLevel || !iLevel->IsLoaded() || !dayNightCycle || dayNightCycle->time1 == 0.0f); {
if (ImGui::SliderFloat("Time", &time, 0.01f, 24.0f, "%.2f", ImGuiSliderFlags_AlwaysClamp) && dayNightCycle)
dayNightCycle->SetDaytime(time);
else if (dayNightCycle)
@@ -28,7 +32,7 @@ namespace Menu {
}
GamePH::TimeWeather::CSystem* timeWeatherSystem = GamePH::TimeWeather::CSystem::Get();
const bool weatherDisabledFlag = !Engine::CBulletPhysicsCharacter::Get() || !timeWeatherSystem;
const bool weatherDisabledFlag = !iLevel || !iLevel->IsLoaded() || !timeWeatherSystem;
ImGui::SeparatorText("Weather");
ImGui::BeginDisabled(weatherDisabledFlag); {
+10 -2
View File
@@ -1,12 +1,20 @@
#pragma once
#include "..\game_classes.h"
#include "menu.h"
namespace Menu {
namespace World {
extern float time;
extern EWeather::TYPE weather;
extern void Render();
class Tab : MenuTab {
public:
Tab() : MenuTab("World", 3) {}
void Update() override;
void Render() override;
static Tab instance;
};
}
}
+27 -14
View File
@@ -1,19 +1,25 @@
#pragma once
#include "sigscan.h"
#include "..\memory.h"
#include "sigscan.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,26 +44,33 @@ 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)
AddOffset(CameraFPPDI_VT, "gamedll_ph_x64_rwdi.dll", "48 8D 05 [?? ?? ?? ?? 48 89 07 48 8D 4F 60", PatternType::RelativePointer, DWORD64)
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
AddOffset(ReadVideoSettings, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 8D 4C 24 ?? FF 15 ?? ?? ?? ?? 48 C7 C2 ?? ?? ?? ??", PatternType::RelativePointer, LPVOID)
AddOffset(CalculateFreeCamCollision, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 8B 06 4C 8D 4C 24 ??", PatternType::RelativePointer, LPVOID)
AddOffset(GetViewCamera, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 85 C0 74 28 48 8B C8", PatternType::RelativePointer, LPVOID)
//AddOffset(GetViewCamera, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 85 C0 74 28 48 8B C8", PatternType::RelativePointer, LPVOID)
AddOffset(CreatePlayerHealthModule, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 4C 8B F1 E8 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ??", PatternType::Address, LPVOID)
AddOffset(LifeSetHealth, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 49 8D 4C 24 ?? 49 03 CE", PatternType::RelativePointer, LPVOID)
AddOffset(TogglePhotoMode, "gamedll_ph_x64_rwdi.dll", "48 83 EC 48 38 91 ?? ?? ?? ??", PatternType::Address, LPVOID)
AddOffset(OnUpdate_ChangeMap, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 88 44 24 20 48 8B 84 24 ?? ?? ?? ?? 48 83 78 ?? ??", PatternType::RelativePointer, LPVOID)
//AddOffset(OnUpdate_ChangeMap, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 88 44 24 20 48 8B 84 24 ?? ?? ?? ?? 48 83 78 ?? ??", PatternType::RelativePointer, LPVOID)
AddOffset(ShowTPPModelFunc2, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 45 8D 45 40", PatternType::RelativePointer, LPVOID)
AddOffset(ShowTPPModelFunc3, "gamedll_ph_x64_rwdi.dll", "E9 [?? ?? ?? ?? 48 85 D2 74 0A", PatternType::RelativePointer, 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)
//AddOffset(CalculateOutOfBoundsTimer, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 48 89 74 24 ?? 57 48 81 EC ?? ?? ?? ?? 0F B6 99", PatternType::Address, LPVOID)
AddOffset(IsNotOutOfBounds, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 41 56 41 57 48 83 EC ?? 4C 8B F9 48 85 D2", 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)
AddOffset(MoveCameraFromForwardUpPos, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 48 8B 03 48 8B CB F3 0F 10 9B ?? ?? ?? ??", PatternType::RelativePointer, LPVOID)
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(GetForwardVector, "engine_x64_rwdi.dll", "4C 8B 41 38 41 8B 40 48", PatternType::Address, LPVOID)
//AddOffset(IsLoading, "engine_x64_rwdi.dll", "48 8B 05 ?? ?? ?? ?? 48 8B 51 38", PatternType::Address, LPVOID)
//AddOffset(ShowUIManager, "engine_x64_rwdi.dll", "48 8B 0D ?? ?? ?? ?? E9 ?? ?? ?? ?? CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 40 53", 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
+28
View File
@@ -3,6 +3,26 @@
#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 < 0) {
start = std::chrono::time_point_cast<std::chrono::milliseconds>(clock::now());
return false;
}
if (timePassedMs >= timeToPass)
timePassed = true;
return timePassed;
}
bool are_same(float a, float b) {
return abs(a - b) < 0.0001f;
}
@@ -16,6 +36,14 @@ namespace Utils {
return true;
}
FARPROC GetProcAddr(std::string_view module, std::string_view funcName) {
HMODULE moduleHandle = GetModuleHandleA(module.data());
if (!moduleHandle)
return nullptr;
return GetProcAddress(moduleHandle, funcName.data());
}
std::string_view GetDesktopDir() {
char path[MAX_PATH + 1];
if (!SHGetSpecialFolderPathA(HWND_DESKTOP, path, CSIDL_DESKTOP, FALSE))
+16
View File
@@ -1,4 +1,5 @@
#pragma once
#include <chrono>
#include <string>
enum class WindowsVersion {
@@ -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);
@@ -19,6 +33,8 @@ namespace Utils {
return std::to_string(val);
}
extern FARPROC GetProcAddr(std::string_view module, std::string_view funcName);
extern std::string_view GetDesktopDir();
extern WindowsVersion GetWindowsVersion();
}
+10 -1
View File
@@ -8,12 +8,21 @@ DisableSafezoneFOVReduction=1
DistanceBehindPlayer=2
Enabled=0
HeightAbovePlayer=1.35
HorizontalDistanceFromPlayer=0
UseTPPModel=1
[Menu]
Transparency=99
[Menu:Keybinds]
ToggleKey=VK_F5
DisableHUDToggleKey=VK_F8
FreeCamToggleKey=VK_F3
FreezePlayerToggleKey=VK_F7
GodModeToggleKey=VK_F6
MenuToggleKey=VK_F5
TeleportPlayerToCameraToggleKey=VK_F4
ThirdPersonToggleKey=VK_F1
UseTPPModelToggleKey=VK_F2
[Player:Misc]
DisableOutOfBoundsTimer=1
GodMode=0
[Player:PlayerVariables]
Enabled=0
Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

+26 -1
View File
@@ -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.
+56 -71
View File
@@ -1,72 +1,57 @@
![EGameTools - an ASI mod for Dying Light 2](https://i.imgur.com/8b0smkU.jpeg)
# 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>
- Player Health slider<br>
- God Mode<br>
- Freeze Player<br>
- Disable Out of Bounds Timer<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>MISC</b><br>
- Disable HUD<br><br>
<b>WORLD</b><br>
- Time slider<br>
- Weather control<br><br>
<b>Check the mod's <a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">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>
To change the number of a slider value manually, press <b>Ctrl + Left Mouse Button</b> on the slider.<br><br>
A config file <b>EGameTools.ini</b> is stored in the same folder as the mod file which stores the mod menu's options.<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>
To change them 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 for each hotkey and save the config file.<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 the mod's <a href="https://trello.com/b/oRaJQEOi/egametools-dying-light-2">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>