mirror of
https://github.com/EricPlayZ/EGameTools.git
synced 2026-10-10 12:53:04 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f1f6732cc | |||
| fb5ccd7ffe | |||
| 7469f1e9b7 | |||
| abc4a8a697 | |||
| 5b82f7512f | |||
| 154362f6a1 | |||
| 0db4be9b19 | |||
| 781e97bf77 | |||
| 2749d19fc9 | |||
| 6853aa0bee | |||
| 447291d036 | |||
| e303f5e134 | |||
| cc244db9fd |
@@ -16,6 +16,7 @@
|
||||
<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" />
|
||||
@@ -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,6 +46,7 @@
|
||||
<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" />
|
||||
@@ -66,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" />
|
||||
@@ -86,13 +90,13 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>ClangCL</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>ClangCL</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
@@ -144,7 +148,7 @@
|
||||
</Optimization>
|
||||
<IntrinsicFunctions>
|
||||
</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>source\ImGuiHotkeys;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>
|
||||
@@ -173,7 +177,7 @@
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>source\ImGuiHotkeys;source\ImGui;source\ImGuiFileDialog;source\MinHook\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>source\ImGuiEx;source\ImGuiHotkeys;source\ImGui;source\ImGuiFileDialog;source\MinHook\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
</ClCompile>
|
||||
@@ -186,7 +190,7 @@
|
||||
<AdditionalLibraryDirectories>source\MinHook\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libMinHook-x64-v141-mtd.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ImportLibrary />
|
||||
<AdditionalOptions>/NOIMPLIB %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/NOIMPLIB /NOEXP %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy /Y "$(SolutionDir)Extra Files\Default Config\EGameTools.ini" "$(SolutionDir)$(PlatformShortName)\$(Configuration)\EGameTools.ini"</Command>
|
||||
|
||||
@@ -62,6 +62,12 @@
|
||||
<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" />
|
||||
@@ -155,6 +161,12 @@
|
||||
<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">
|
||||
@@ -193,5 +205,8 @@
|
||||
<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::menuToggle.IsEnabled())
|
||||
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::menuToggle.IsEnabled())
|
||||
if (Menu::menuToggle.GetValue())
|
||||
Menu::Render();
|
||||
|
||||
ImGui::Render();
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include <Windows.h>
|
||||
#include <imgui.h>
|
||||
#include <Hotkey.h>
|
||||
#include <Windows.h>
|
||||
#include <backends\imgui_impl_win32.h>
|
||||
#include <Hotkey.h>
|
||||
#include <imgui.h>
|
||||
#include "..\..\core.h"
|
||||
#include "..\..\menu\menu.h"
|
||||
#include "..\config\config.h"
|
||||
#include "..\..\sigscan\offsets.h"
|
||||
#include "..\..\game_classes.h"
|
||||
#include "..\..\kiero.h"
|
||||
#include "..\..\menu\menu.h"
|
||||
#include "..\..\sigscan\offsets.h"
|
||||
#include "..\config\config.h"
|
||||
#include "win32_impl.h"
|
||||
|
||||
static WNDPROC oWndProc = NULL;
|
||||
@@ -22,7 +22,9 @@ LRESULT __stdcall hkWindowProc(_In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wPara
|
||||
if (ImGui::isAnyHotkeyBtnPressed || !ImGui::timeSinceHotkeyBtnPressed.GetTimePassed() || KeyBindOption::wasAnyKeyPressed)
|
||||
break;
|
||||
|
||||
for (auto& option : KeyBindOption::GetInstances()) {
|
||||
for (auto& option : *KeyBindOption::GetInstances()) {
|
||||
if (option->GetChangesAreDisabled())
|
||||
continue;
|
||||
if (wParam == option->GetKeyBind()) {
|
||||
KeyBindOption::wasAnyKeyPressed = true;
|
||||
option->Toggle();
|
||||
@@ -34,7 +36,7 @@ LRESULT __stdcall hkWindowProc(_In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wPara
|
||||
if (!KeyBindOption::wasAnyKeyPressed)
|
||||
break;
|
||||
|
||||
for (auto& option : KeyBindOption::GetInstances()) {
|
||||
for (auto& option : *KeyBindOption::GetInstances()) {
|
||||
if (wParam == option->GetKeyBind())
|
||||
KeyBindOption::wasAnyKeyPressed = false;
|
||||
}
|
||||
@@ -45,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::menuToggle.IsEnabled();
|
||||
ImGui::GetIO().MouseDrawCursor = Menu::menuToggle.GetValue();
|
||||
ImGui_ImplWin32_WndProcHandler(hwnd, uMsg, wParam, lParam);
|
||||
|
||||
if (Menu::menuToggle.IsEnabled()) {
|
||||
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);
|
||||
}
|
||||
@@ -1,11 +1,15 @@
|
||||
#include <filesystem>
|
||||
#include <any>
|
||||
#include <array>
|
||||
#include <filesystem>
|
||||
#include <functional>
|
||||
#include "config.h"
|
||||
#include "..\menu\camera.h"
|
||||
#include "..\menu\menu.h"
|
||||
#include "..\utils.h"
|
||||
#include "..\menu\misc.h"
|
||||
#include "..\menu\player.h"
|
||||
#include "..\menu\world.h"
|
||||
#include "..\print.h"
|
||||
#include "..\utils.h"
|
||||
#include "config.h"
|
||||
#include "ini.h"
|
||||
|
||||
namespace Config {
|
||||
@@ -4024,7 +4028,9 @@ namespace Config {
|
||||
{ "Menu:Keybinds", "TeleportPlayerToCameraToggleKey", std::string("VK_F4"), &Menu::Camera::teleportPlayerToCamera, String},
|
||||
{ "Menu:Keybinds", "ThirdPersonToggleKey", std::string("VK_F1"), &Menu::Camera::thirdPersonCamera, String},
|
||||
{ "Menu:Keybinds", "UseTPPModelToggleKey", std::string("VK_F2"), &Menu::Camera::tpUseTPPModel, String},
|
||||
{ "Menu:Keybinds", "DisableHUDToggleKey", std::string("VK_F8"), &Menu::Misc::disableHUD, String},
|
||||
{ "Player:Misc", "GodMode", false, &Menu::Player::godMode, OPTION },
|
||||
{ "Player:Misc", "DisableOutOfBoundsTimer", true, &Menu::Player::disableOutOfBoundsTimer, OPTION },
|
||||
{ "Player:PlayerVariables", "Enabled", false, &Menu::Player::playerVariables, OPTION },
|
||||
{ "Player:PlayerVariables", "LastSaveSCRPath", std::string(), &Menu::Player::saveSCRPath, String },
|
||||
{ "Player:PlayerVariables", "LastLoadSCRFilePath", std::string(), &Menu::Player::loadSCRFilePath, String },
|
||||
@@ -4034,6 +4040,7 @@ namespace Config {
|
||||
{ "Camera:ThirdPerson", "UseTPPModel", true, &Menu::Camera::tpUseTPPModel, OPTION },
|
||||
{ "Camera:ThirdPerson", "DistanceBehindPlayer", 2.0f, &Menu::Camera::tpDistanceBehindPlayer, Float },
|
||||
{ "Camera:ThirdPerson", "HeightAbovePlayer", 1.35f, &Menu::Camera::tpHeightAbovePlayer, Float },
|
||||
{ "Camera:ThirdPerson", "HorizontalDistanceFromPlayer", 0.0f, &Menu::Camera::tpHorizontalDistanceFromPlayer, Float },
|
||||
{ "Camera:Misc", "DisablePhotoModeLimits", true, &Menu::Camera::disablePhotoModeLimits, OPTION },
|
||||
{ "Camera:Misc", "DisableSafezoneFOVReduction", true, &Menu::Camera::disableSafezoneFOVReduction, OPTION }
|
||||
});
|
||||
@@ -4131,9 +4138,13 @@ namespace Config {
|
||||
std::string strValue{};
|
||||
for (auto& entry : configVariablesDefault) {
|
||||
switch (entry.type) {
|
||||
case OPTION:
|
||||
reinterpret_cast<Option*>(entry.optionPtr)->Change(reader.Get(entry.section.data(), entry.key.data(), std::any_cast<bool>(entry.value)));
|
||||
case OPTION: {
|
||||
Option* option = reinterpret_cast<Option*>(entry.optionPtr);
|
||||
if (option->GetChangesAreDisabled())
|
||||
break;
|
||||
option->SetBothValues(reader.Get(entry.section.data(), entry.key.data(), std::any_cast<bool>(entry.value)));
|
||||
break;
|
||||
}
|
||||
case Float:
|
||||
*reinterpret_cast<float*>(entry.optionPtr) = reader.Get(entry.section.data(), entry.key.data(), std::any_cast<float>(entry.value));
|
||||
break;
|
||||
@@ -4182,7 +4193,7 @@ namespace Config {
|
||||
for (auto& entry : configVariables) {
|
||||
switch (entry.type) {
|
||||
case OPTION:
|
||||
entry.value = reinterpret_cast<Option*>(entry.optionPtr)->IsEnabled();
|
||||
entry.value = reinterpret_cast<Option*>(entry.optionPtr)->GetValue();
|
||||
break;
|
||||
case Float:
|
||||
entry.value = *reinterpret_cast<float*>(entry.optionPtr);
|
||||
|
||||
@@ -1,26 +1,18 @@
|
||||
#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 "game_classes.h"
|
||||
#include "sigscan\offsets.h"
|
||||
#include "config\config.h"
|
||||
#include "game_classes.h"
|
||||
#include "hook.h"
|
||||
|
||||
#pragma region Option
|
||||
std::set<Option*> Option::instances{};
|
||||
std::set<Option*> Option::GetInstances() { return instances; };
|
||||
#pragma endregion
|
||||
#include "kiero.h"
|
||||
#include "menu\menu.h"
|
||||
#include "sigscan\offsets.h"
|
||||
|
||||
#pragma region KeyBindOption
|
||||
bool KeyBindOption::wasAnyKeyPressed = false;
|
||||
|
||||
std::set<KeyBindOption*> KeyBindOption::instances{};
|
||||
std::set<KeyBindOption*> KeyBindOption::GetInstances() { return instances; };
|
||||
#pragma endregion
|
||||
|
||||
namespace Core {
|
||||
@@ -121,8 +113,8 @@ 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)
|
||||
@@ -146,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);
|
||||
|
||||
@@ -21,56 +21,34 @@ struct Key {
|
||||
|
||||
class Option {
|
||||
public:
|
||||
Option() { instances.insert(this); };
|
||||
~Option() { instances.erase(this); }
|
||||
static std::set<Option*> GetInstances();
|
||||
Option() { GetInstances()->insert(this); };
|
||||
~Option() { GetInstances()->erase(this); }
|
||||
static std::set<Option*>* GetInstances() { static std::set<Option*> instances{}; return &instances; };
|
||||
|
||||
bool value = false;
|
||||
bool value = false;
|
||||
|
||||
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; }
|
||||
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; }
|
||||
|
||||
constexpr bool Change(bool newValue) {
|
||||
if (changed)
|
||||
return false;
|
||||
|
||||
previousValue = value;
|
||||
|
||||
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 changesAreDisabled = false;
|
||||
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();
|
||||
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())
|
||||
@@ -232,8 +210,6 @@ private:
|
||||
{ "]", VK_OEM_6, ImGuiKey_RightBracket },
|
||||
{ "`", VK_OEM_3, ImGuiKey_GraveAccent }
|
||||
});
|
||||
|
||||
static std::set<KeyBindOption*> instances;
|
||||
};
|
||||
|
||||
namespace Core {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include "MinHook\include\MinHook.h"
|
||||
#include "sigscan\offsets.h"
|
||||
#include "menu\player.h"
|
||||
#include "menu\camera.h"
|
||||
#include "config\config.h"
|
||||
#include "game_classes.h"
|
||||
#include "memory.h"
|
||||
#include "menu\camera.h"
|
||||
#include "menu\misc.h"
|
||||
#include "menu\player.h"
|
||||
#include "print.h"
|
||||
#include "sigscan\offsets.h"
|
||||
#include "utils.h"
|
||||
|
||||
namespace Core {
|
||||
@@ -17,215 +17,229 @@ namespace Core {
|
||||
|
||||
#pragma region GamePH
|
||||
namespace GamePH {
|
||||
#pragma region Hooks
|
||||
#pragma region CreatePlayerHealthModule
|
||||
static DWORD64(*pCreatePlayerHealthModule)(DWORD64 playerHealthModule) = nullptr;
|
||||
static DWORD64(*oCreatePlayerHealthModule)(DWORD64 playerHealthModule) = nullptr;
|
||||
DWORD64 detourCreatePlayerHealthModule(DWORD64 playerHealthModule) {
|
||||
#pragma region Hooks
|
||||
// Forward decl
|
||||
static DWORD64 detourCreatePlayerHealthModule(DWORD64 playerHealthModule);
|
||||
static void detourOnPostUpdate(LPVOID pGameDI_PH2);
|
||||
static DWORD64 detourCalculateFreeCamCollision(LPVOID pFreeCamera, float* finalPos);
|
||||
static void detourLifeSetHealth(float* pLifeHealth, float health);
|
||||
static void detourTogglePhotoMode(LPVOID guiPhotoModeData, bool enabled);
|
||||
static void detourShowTPPModelFunc3(DWORD64 a1, bool showTPPModel);
|
||||
static void detourMoveCameraFromForwardUpPos(LPVOID pCBaseCamera, float* a3, float* a4, Vector3* pos);
|
||||
static bool detourIsNotOutOfBounds(LPVOID pInstance, DWORD64 a2);
|
||||
static void detourShowUIManager(LPVOID pLevelDI, bool enabled);
|
||||
|
||||
#pragma region CreatePlayerHealthModule
|
||||
static Hook::MHook<LPVOID, DWORD64(*)(DWORD64)> CreatePlayerHealthModuleHook{ &Offsets::Get_CreatePlayerHealthModule, &detourCreatePlayerHealthModule };
|
||||
|
||||
static DWORD64 detourCreatePlayerHealthModule(DWORD64 playerHealthModule) {
|
||||
PlayerHealthModule::pPlayerHealthModule = reinterpret_cast<PlayerHealthModule*>(playerHealthModule);
|
||||
return oCreatePlayerHealthModule(playerHealthModule);
|
||||
return CreatePlayerHealthModuleHook.pOriginal(playerHealthModule);
|
||||
}
|
||||
void LoopHookCreatePlayerHealthModule() {
|
||||
while (true) {
|
||||
Sleep(250);
|
||||
#pragma endregion
|
||||
|
||||
if (!pCreatePlayerHealthModule)
|
||||
pCreatePlayerHealthModule = (decltype(pCreatePlayerHealthModule))Offsets::Get_CreatePlayerHealthModule();
|
||||
else if (!oCreatePlayerHealthModule && MH_CreateHook(pCreatePlayerHealthModule, &detourCreatePlayerHealthModule, reinterpret_cast<LPVOID*>(&oCreatePlayerHealthModule)) == MH_OK) {
|
||||
MH_EnableHook(pCreatePlayerHealthModule);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region OnPostUpdate
|
||||
static Hook::VTHook<GamePH::GameDI_PH2*, void(*)(LPVOID)> OnPostUpdateHook{ &GamePH::GameDI_PH2::Get, &detourOnPostUpdate, 0x3A8 };
|
||||
|
||||
#pragma region OnPostUpdate
|
||||
static void(*oOnPostUpdate)(LPVOID pGameDI_PH2) = nullptr;
|
||||
void detourOnPostUpdate(LPVOID pGameDI_PH2) {
|
||||
oOnPostUpdate(pGameDI_PH2);
|
||||
static void detourOnPostUpdate(LPVOID pGameDI_PH2) {
|
||||
OnPostUpdateHook.pOriginal(pGameDI_PH2);
|
||||
Core::OnPostUpdate();
|
||||
}
|
||||
void LoopHookOnUpdate() {
|
||||
GamePH::GameDI_PH2* pGameDI_PH2 = nullptr;
|
||||
|
||||
while (true) {
|
||||
Sleep(250);
|
||||
|
||||
pGameDI_PH2 = GamePH::GameDI_PH2::Get();
|
||||
if (!pGameDI_PH2)
|
||||
continue;
|
||||
|
||||
Hook::VTHook(pGameDI_PH2, &detourOnPostUpdate, reinterpret_cast<LPVOID*>(&oOnPostUpdate), 0x3a8);
|
||||
if (oOnPostUpdate)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CalculateFreeCamCollision
|
||||
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::freeCam.IsEnabled() && !Menu::Camera::disablePhotoModeLimits.IsEnabled())
|
||||
return oCalculateFreeCamCollision(pFreeCamera, finalPos);
|
||||
static Hook::MHook<LPVOID, DWORD64(*)(LPVOID, float*)> CalculateFreeCamCollisionHook{ &Offsets::Get_CalculateFreeCamCollision, &detourCalculateFreeCamCollision };
|
||||
|
||||
return 0;
|
||||
}
|
||||
void LoopHookCalculateFreeCamCollision() {
|
||||
while (true) {
|
||||
Sleep(250);
|
||||
static DWORD64 detourCalculateFreeCamCollision(LPVOID pFreeCamera, float* finalPos) {
|
||||
if (Menu::Camera::disablePhotoModeLimits.GetValue() || Menu::Camera::freeCam.GetValue())
|
||||
return 0;
|
||||
|
||||
if (!pCalculateFreeCamCollision)
|
||||
pCalculateFreeCamCollision = (decltype(pCalculateFreeCamCollision))Offsets::Get_CalculateFreeCamCollision();
|
||||
else if (!oCalculateFreeCamCollision && MH_CreateHook(pCalculateFreeCamCollision, &detourCalculateFreeCamCollision, reinterpret_cast<LPVOID*>(&oCalculateFreeCamCollision)) == MH_OK) {
|
||||
MH_EnableHook(pCalculateFreeCamCollision);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return CalculateFreeCamCollisionHook.pOriginal(pFreeCamera, finalPos);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region LifeSetHealth
|
||||
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::godMode.IsEnabled())
|
||||
return oLifeSetHealth(pLifeHealth, health);
|
||||
static Hook::MHook<LPVOID, void(*)(float*, float)> LifeSetHealthHook{ &Offsets::Get_LifeSetHealth, &detourLifeSetHealth };
|
||||
|
||||
static void detourLifeSetHealth(float* pLifeHealth, float health) {
|
||||
if (!Menu::Player::godMode.GetValue() && !Menu::Camera::freeCam.GetValue())
|
||||
return LifeSetHealthHook.pOriginal(pLifeHealth, health);
|
||||
|
||||
GamePH::PlayerHealthModule* playerHealthModule = GamePH::PlayerHealthModule::Get();
|
||||
if (!playerHealthModule)
|
||||
return oLifeSetHealth(pLifeHealth, health);
|
||||
return LifeSetHealthHook.pOriginal(pLifeHealth, health);
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel || !iLevel->IsLoaded())
|
||||
return oLifeSetHealth(pLifeHealth, health);
|
||||
return LifeSetHealthHook.pOriginal(pLifeHealth, health);
|
||||
|
||||
if (std::abs(reinterpret_cast<LONG64>(playerHealthModule) - reinterpret_cast<LONG64>(pLifeHealth)) < 0x100 && playerHealthModule->health > 0.0f)
|
||||
return;
|
||||
|
||||
oLifeSetHealth(pLifeHealth, health);
|
||||
}
|
||||
void LoopHookLifeSetHealth() {
|
||||
while (true) {
|
||||
Sleep(250);
|
||||
|
||||
if (!pLifeSetHealth)
|
||||
pLifeSetHealth = (decltype(pLifeSetHealth))Offsets::Get_LifeSetHealth();
|
||||
else if (!oLifeSetHealth && MH_CreateHook(pLifeSetHealth, &detourLifeSetHealth, reinterpret_cast<LPVOID*>(&oLifeSetHealth)) == MH_OK) {
|
||||
MH_EnableHook(pLifeSetHealth);
|
||||
break;
|
||||
}
|
||||
}
|
||||
LifeSetHealthHook.pOriginal(pLifeHealth, health);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region TogglePhotoMode
|
||||
static void(*pTogglePhotoMode)(LPVOID guiPhotoModeData, bool enabled) = nullptr;
|
||||
static void(*oTogglePhotoMode)(LPVOID guiPhotoModeData, bool enabled) = nullptr;
|
||||
void detourTogglePhotoMode(LPVOID guiPhotoModeData, bool enabled) {
|
||||
static Hook::MHook<LPVOID, void(*)(LPVOID, bool)> TogglePhotoModeHook{ &Offsets::Get_TogglePhotoMode, &detourTogglePhotoMode };
|
||||
|
||||
static void detourTogglePhotoMode(LPVOID guiPhotoModeData, bool enabled) {
|
||||
Menu::Camera::photoMode.Set(enabled);
|
||||
|
||||
if (!Menu::Camera::freeCam.IsEnabled())
|
||||
return oTogglePhotoMode(guiPhotoModeData, enabled);
|
||||
if (!Menu::Camera::freeCam.GetValue())
|
||||
return TogglePhotoModeHook.pOriginal(guiPhotoModeData, enabled);
|
||||
GamePH::GameDI_PH* pGameDI_PH = GamePH::GameDI_PH::Get();
|
||||
if (!pGameDI_PH)
|
||||
return oTogglePhotoMode(guiPhotoModeData, enabled);
|
||||
return TogglePhotoModeHook.pOriginal(guiPhotoModeData, enabled);
|
||||
GamePH::FreeCamera* pFreeCam = GamePH::FreeCamera::Get();
|
||||
if (!pFreeCam)
|
||||
return oTogglePhotoMode(guiPhotoModeData, enabled);
|
||||
return TogglePhotoModeHook.pOriginal(guiPhotoModeData, enabled);
|
||||
|
||||
pGameDI_PH->TogglePhotoMode();
|
||||
pFreeCam->AllowCameraMovement(0);
|
||||
|
||||
oTogglePhotoMode(guiPhotoModeData, enabled);
|
||||
}
|
||||
void LoopHookTogglePhotoMode() {
|
||||
while (true) {
|
||||
Sleep(250);
|
||||
|
||||
if (!pTogglePhotoMode)
|
||||
pTogglePhotoMode = (decltype(pTogglePhotoMode))Offsets::Get_TogglePhotoMode();
|
||||
else if (!oTogglePhotoMode && MH_CreateHook(pTogglePhotoMode, &detourTogglePhotoMode, reinterpret_cast<LPVOID*>(&oTogglePhotoMode)) == MH_OK) {
|
||||
MH_EnableHook(pTogglePhotoMode);
|
||||
break;
|
||||
}
|
||||
if (enabled) {
|
||||
pGameDI_PH->TogglePhotoMode();
|
||||
pFreeCam->AllowCameraMovement(0);
|
||||
}
|
||||
|
||||
TogglePhotoModeHook.pOriginal(guiPhotoModeData, enabled);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region ShowTPPModelFunc3
|
||||
static Option wannaUseTPPModel{};
|
||||
static Hook::MHook<LPVOID, void(*)(DWORD64, bool)> ShowTPPModelFunc3Hook{ &Offsets::Get_ShowTPPModelFunc3, &detourShowTPPModelFunc3 };
|
||||
|
||||
static void detourShowTPPModelFunc3(DWORD64 a1, bool showTPPModel) {
|
||||
wannaUseTPPModel.Set(showTPPModel);
|
||||
|
||||
gen_TPPModel* pgen_TPPModel = gen_TPPModel::Get();
|
||||
if (!pgen_TPPModel) {
|
||||
ShowTPPModelFunc3Hook.pOriginal(a1, showTPPModel);
|
||||
return;
|
||||
}
|
||||
if (wannaUseTPPModel.HasChangedTo(false)) {
|
||||
wannaUseTPPModel.SetPrevValue(false);
|
||||
pgen_TPPModel->enableTPPModel2 = true;
|
||||
pgen_TPPModel->enableTPPModel1 = true;
|
||||
}
|
||||
ShowTPPModelFunc3Hook.pOriginal(a1, showTPPModel);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region MoveCameraFromForwardUpPos
|
||||
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) {
|
||||
static Hook::MHook<LPVOID, void(*)(LPVOID, float*, float*, Vector3*)> MoveCameraFromForwardUpPosHook{ &Offsets::Get_MoveCameraFromForwardUpPos, &detourMoveCameraFromForwardUpPos };
|
||||
|
||||
static void detourMoveCameraFromForwardUpPos(LPVOID pCBaseCamera, float* a3, float* a4, Vector3* pos) {
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel || !iLevel->IsLoaded())
|
||||
return oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
|
||||
return MoveCameraFromForwardUpPosHook.pOriginal(pCBaseCamera, a3, a4, pos);
|
||||
|
||||
gen_TPPModel* pgen_TPPModel = gen_TPPModel::Get();
|
||||
if (pgen_TPPModel) {
|
||||
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::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.IsEnabled() && Menu::Camera::thirdPersonCamera.IsEnabled());
|
||||
if (!Menu::Camera::tpUseTPPModel.HasChanged() && !Menu::Camera::thirdPersonCamera.HasChanged() && (Menu::Camera::tpUseTPPModel.IsEnabled() && Menu::Camera::thirdPersonCamera.IsEnabled())) {
|
||||
if (wannaUseTPPModel.GetValue()) {
|
||||
wannaUseTPPModel.SetPrevValue(true);
|
||||
if (Menu::Camera::thirdPersonCamera.GetValue() && Menu::Camera::tpUseTPPModel.GetValue()) {
|
||||
pgen_TPPModel->enableTPPModel2 = false;
|
||||
pgen_TPPModel->enableTPPModel1 = false;
|
||||
}
|
||||
|
||||
Menu::Camera::tpUseTPPModel.SetPreviousVal(Menu::Camera::tpUseTPPModel.IsEnabled());
|
||||
Menu::Camera::thirdPersonCamera.SetPreviousVal(Menu::Camera::thirdPersonCamera.IsEnabled());
|
||||
}
|
||||
if (Menu::Camera::photoMode.HasChangedTo(true)) {
|
||||
pgen_TPPModel->enableTPPModel2 = false;
|
||||
pgen_TPPModel->enableTPPModel1 = false;
|
||||
}
|
||||
else if (!Menu::Camera::photoMode.HasChanged() && Menu::Camera::photoMode.IsEnabled()) {
|
||||
ShowTPPModel(Menu::Camera::photoMode.IsEnabled());
|
||||
}
|
||||
|
||||
Menu::Camera::photoMode.SetPreviousVal(Menu::Camera::photoMode.IsEnabled());
|
||||
if (Menu::Camera::photoMode.HasChangedTo(false) && !wannaUseTPPModel.GetValue()) {
|
||||
if (!Menu::Camera::freeCam.GetValue() && !Menu::Camera::tpUseTPPModel.GetValue()) {
|
||||
Menu::Camera::photoMode.SetPrevValue(false);
|
||||
ShowTPPModel(false);
|
||||
} else if (Menu::Camera::freeCam.GetValue() || (Menu::Camera::tpUseTPPModel.GetValue() && Menu::Camera::thirdPersonCamera.GetValue())) {
|
||||
Menu::Camera::photoMode.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
}
|
||||
} else if (Menu::Camera::photoMode.HasChangedTo(true)) {
|
||||
Menu::Camera::photoMode.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
} else if (Menu::Camera::freeCam.HasChangedTo(false)) {
|
||||
if (!Menu::Camera::photoMode.GetValue() && !Menu::Camera::thirdPersonCamera.GetValue()) {
|
||||
Menu::Camera::freeCam.SetPrevValue(false);
|
||||
ShowTPPModel(false);
|
||||
} else if (Menu::Camera::photoMode.GetValue() || (Menu::Camera::tpUseTPPModel.GetValue() && Menu::Camera::thirdPersonCamera.GetValue())) {
|
||||
Menu::Camera::freeCam.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
}
|
||||
} else if (Menu::Camera::freeCam.HasChangedTo(true)) {
|
||||
Menu::Camera::freeCam.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
} else if (Menu::Camera::thirdPersonCamera.HasChangedTo(false)) {
|
||||
if (!Menu::Camera::freeCam.GetValue() && !Menu::Camera::photoMode.GetValue()) {
|
||||
Menu::Camera::thirdPersonCamera.SetPrevValue(false);
|
||||
ShowTPPModel(false);
|
||||
} else if (Menu::Camera::freeCam.GetValue() || Menu::Camera::photoMode.GetValue()) {
|
||||
Menu::Camera::thirdPersonCamera.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
}
|
||||
} else if (Menu::Camera::thirdPersonCamera.HasChangedTo(true) && Menu::Camera::tpUseTPPModel.GetValue()) {
|
||||
Menu::Camera::thirdPersonCamera.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
} else if (Menu::Camera::tpUseTPPModel.HasChangedTo(false)) {
|
||||
if (!Menu::Camera::freeCam.GetValue() && !Menu::Camera::photoMode.GetValue()) {
|
||||
Menu::Camera::tpUseTPPModel.SetPrevValue(false);
|
||||
ShowTPPModel(false);
|
||||
} else if (Menu::Camera::freeCam.GetValue() || Menu::Camera::photoMode.GetValue()) {
|
||||
Menu::Camera::tpUseTPPModel.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
}
|
||||
} else if (Menu::Camera::tpUseTPPModel.HasChangedTo(true) && Menu::Camera::thirdPersonCamera.GetValue()) {
|
||||
Menu::Camera::tpUseTPPModel.SetPrevValue(true);
|
||||
ShowTPPModel(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!Menu::Camera::thirdPersonCamera.IsEnabled() || Menu::Camera::photoMode.IsEnabled() || Menu::Camera::freeCam.IsEnabled() || !pos)
|
||||
return oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
|
||||
if (!Menu::Camera::thirdPersonCamera.GetValue() || Menu::Camera::photoMode.GetValue() || Menu::Camera::freeCam.GetValue() || !pos)
|
||||
return MoveCameraFromForwardUpPosHook.pOriginal(pCBaseCamera, a3, a4, pos);
|
||||
|
||||
CameraFPPDI* viewCam = static_cast<CameraFPPDI*>(iLevel->GetViewCamera());
|
||||
if (!viewCam)
|
||||
return oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
|
||||
return MoveCameraFromForwardUpPosHook.pOriginal(pCBaseCamera, a3, a4, pos);
|
||||
|
||||
Vector3 forwardVec{};
|
||||
viewCam->GetForwardVector(&forwardVec);
|
||||
const Vector3 normForwardVec = forwardVec.normalize();
|
||||
Vector3 leftVec{};
|
||||
viewCam->GetLeftVector(&leftVec);
|
||||
const Vector3 normLeftVec = leftVec.normalize();
|
||||
|
||||
Vector3 newCamPos = *pos - normForwardVec * -Menu::Camera::tpDistanceBehindPlayer;
|
||||
newCamPos.Y += Menu::Camera::tpHeightAbovePlayer - 1.5f;
|
||||
newCamPos -= normLeftVec * Menu::Camera::tpHorizontalDistanceFromPlayer;
|
||||
|
||||
*pos = newCamPos;
|
||||
|
||||
oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
|
||||
MoveCameraFromForwardUpPosHook.pOriginal(pCBaseCamera, a3, a4, pos);
|
||||
}
|
||||
void LoopHookMoveCameraFromForwardUpPos() {
|
||||
while (true) {
|
||||
Sleep(250);
|
||||
#pragma endregion
|
||||
|
||||
if (!pMoveCameraFromForwardUpPos)
|
||||
pMoveCameraFromForwardUpPos = (decltype(pMoveCameraFromForwardUpPos))Offsets::Get_MoveCameraFromForwardUpPos();
|
||||
else if (!oMoveCameraFromForwardUpPos && MH_CreateHook(pMoveCameraFromForwardUpPos, &detourMoveCameraFromForwardUpPos, reinterpret_cast<LPVOID*>(&oMoveCameraFromForwardUpPos)) == MH_OK) {
|
||||
MH_EnableHook(pMoveCameraFromForwardUpPos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#pragma region IsNotOutOfBounds
|
||||
static Hook::MHook<LPVOID, bool(*)(LPVOID, DWORD64)> IsNotOutOfBoundsHook{ &Offsets::Get_IsNotOutOfBounds, &detourIsNotOutOfBounds };
|
||||
|
||||
static bool detourIsNotOutOfBounds(LPVOID pInstance, DWORD64 a2) {
|
||||
if (Menu::Player::disableOutOfBoundsTimer.GetValue())
|
||||
return true;
|
||||
|
||||
return IsNotOutOfBoundsHook.pOriginal(pInstance, a2);
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region OtherFuncs
|
||||
#pragma region ShowUIManager
|
||||
static LPVOID GetShowUIManager() {
|
||||
return Utils::GetProcAddr("engine_x64_rwdi.dll", "?ShowUIManager@ILevel@@QEAAX_N@Z");
|
||||
}
|
||||
static Hook::MHook<LPVOID, void(*)(LPVOID, bool)> ShowUIManagerHook{ &GetShowUIManager, &detourShowUIManager };
|
||||
|
||||
static void detourShowUIManager(LPVOID pLevelDI, bool enabled) {
|
||||
if (Menu::Misc::disableHUD.GetValue())
|
||||
enabled = false;
|
||||
|
||||
ShowUIManagerHook.pOriginal(pLevelDI, enabled);
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region OtherFuncs
|
||||
static DWORD64 ShowTPPModelFunc2(LPVOID a1) {
|
||||
DWORD64(*pShowTPPModelFunc2)(LPVOID a1) = (decltype(pShowTPPModelFunc2))Offsets::Get_ShowTPPModelFunc2();
|
||||
if (!pShowTPPModelFunc2)
|
||||
@@ -233,13 +247,6 @@ namespace GamePH {
|
||||
|
||||
return pShowTPPModelFunc2(a1);
|
||||
}
|
||||
static void ShowTPPModelFunc3(DWORD64 a1, bool showTPPModel) {
|
||||
void(*pShowTPPModelFunc3)(DWORD64 a1, bool showTPPModel) = (decltype(pShowTPPModelFunc3))Offsets::Get_ShowTPPModelFunc3();
|
||||
if (!pShowTPPModelFunc3)
|
||||
return;
|
||||
|
||||
pShowTPPModelFunc3(a1, showTPPModel);
|
||||
}
|
||||
void ShowTPPModel(bool showTPPModel) {
|
||||
GameDI_PH* pGameDI_PH = GameDI_PH::Get();
|
||||
if (!pGameDI_PH)
|
||||
@@ -247,15 +254,17 @@ namespace GamePH {
|
||||
DWORD64 tppFunc2Addr = ShowTPPModelFunc2(pGameDI_PH);
|
||||
if (!tppFunc2Addr)
|
||||
return;
|
||||
if (!ShowTPPModelFunc3Hook.pTarget)
|
||||
return;
|
||||
gen_TPPModel* pgen_TPPModel = gen_TPPModel::Get();
|
||||
if (!pgen_TPPModel)
|
||||
return;
|
||||
|
||||
ShowTPPModelFunc3(tppFunc2Addr, showTPPModel);
|
||||
ShowTPPModelFunc3Hook.pTarget(tppFunc2Addr, showTPPModel);
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region PlayerVariables
|
||||
#pragma region PlayerVariables
|
||||
static const int FLOAT_VAR_OFFSET = 3;
|
||||
static const int BOOL_VAR_OFFSET = 2;
|
||||
static const int VAR_LOC_OFFSET = 1;
|
||||
@@ -394,9 +403,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region PlayerState
|
||||
#pragma region PlayerState
|
||||
PlayerState* PlayerState::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_PlayerState())
|
||||
@@ -411,15 +420,15 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region PlayerHealthModule
|
||||
#pragma region PlayerHealthModule
|
||||
PlayerHealthModule* PlayerHealthModule::pPlayerHealthModule = nullptr;
|
||||
PlayerHealthModule* PlayerHealthModule::Get() {
|
||||
__try {
|
||||
if (!pPlayerHealthModule)
|
||||
return nullptr;
|
||||
if (!*reinterpret_cast<PDWORD64*>(pPlayerHealthModule))
|
||||
if (!*reinterpret_cast<LPVOID*>(pPlayerHealthModule))
|
||||
return nullptr;
|
||||
|
||||
return pPlayerHealthModule;
|
||||
@@ -428,9 +437,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region TPPCameraDI
|
||||
#pragma region TPPCameraDI
|
||||
TPPCameraDI* TPPCameraDI::Get() {
|
||||
__try {
|
||||
FreeCamera* pFreeCam = FreeCamera::Get();
|
||||
@@ -450,27 +459,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CameraFPPDI
|
||||
Vector3* CameraFPPDI::GetForwardVector(Vector3* outForwardVec) {
|
||||
Vector3* (*pGetForwardVector)(LPVOID pCameraFPPDI, Vector3 * outForwardVec) = (decltype(pGetForwardVector))Offsets::Get_GetForwardVector();
|
||||
if (!pGetForwardVector)
|
||||
return nullptr;
|
||||
|
||||
return pGetForwardVector(this, outForwardVec);
|
||||
}
|
||||
Vector3* CameraFPPDI::GetUpVector(Vector3* outUpVec) {
|
||||
Vector3* (*pGetUpVector)(LPVOID pCameraFPPDI, Vector3 * outUpVec) = (decltype(pGetUpVector))Offsets::Get_GetUpVector();
|
||||
if (!pGetUpVector)
|
||||
return nullptr;
|
||||
|
||||
return pGetUpVector(this, outUpVec);
|
||||
}
|
||||
Vector3* CameraFPPDI::GetPosition(Vector3* posIN) {
|
||||
return Memory::CallVT<181, Vector3*>(this, posIN);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CameraFPPDI
|
||||
/*CameraFPPDI* CameraFPPDI::Get() {
|
||||
__try {
|
||||
PDWORD64 pg_CameraFPPDI = Offsets::Get_g_CameraFPPDI();
|
||||
@@ -486,26 +477,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}*/
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region FreeCamera
|
||||
Vector3* FreeCamera::GetForwardVector(Vector3* outForwardVec) {
|
||||
Vector3* (*pGetForwardVector)(LPVOID pFreeCamera, Vector3 * outForwardVec) = (decltype(pGetForwardVector))Offsets::Get_GetForwardVector();
|
||||
if (!pGetForwardVector)
|
||||
return nullptr;
|
||||
|
||||
return pGetForwardVector(this, outForwardVec);
|
||||
}
|
||||
Vector3* FreeCamera::GetUpVector(Vector3* outUpVec) {
|
||||
Vector3* (*pGetUpVector)(LPVOID pFreeCamera, Vector3 * outUpVec) = (decltype(pGetUpVector))Offsets::Get_GetUpVector();
|
||||
if (!pGetUpVector)
|
||||
return nullptr;
|
||||
|
||||
return pGetUpVector(this, outUpVec);
|
||||
}
|
||||
Vector3* FreeCamera::GetPosition(Vector3* posIN) {
|
||||
return Memory::CallVT<181, Vector3*>(this, posIN);
|
||||
}
|
||||
#pragma region FreeCamera
|
||||
void FreeCamera::AllowCameraMovement(int mode) {
|
||||
Memory::CallVT<187>(this, mode);
|
||||
}
|
||||
@@ -525,9 +499,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region DayNightCycle
|
||||
#pragma region DayNightCycle
|
||||
void DayNightCycle::SetDaytime(float time) {
|
||||
time /= 24;
|
||||
time1 = time;
|
||||
@@ -549,30 +523,32 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region TimeWeather
|
||||
#pragma region TimeWeather
|
||||
namespace TimeWeather {
|
||||
#pragma region CSystem
|
||||
#pragma region CSystem
|
||||
void CSystem::SetForcedWeather(int weather) {
|
||||
if (!Offsets::Get_SetForcedWeather())
|
||||
return;
|
||||
__try {
|
||||
void(*pSetForcedWeather)(LPVOID timeWeatherSystem, int weather) = (decltype(pSetForcedWeather))Utils::GetProcAddr("engine_x64_rwdi.dll", "?SetForcedWeather@CSystem@TimeWeather@@QEAAXW4TYPE@EWeather@@VApiDebugAccess@2@@Z");
|
||||
if (!pSetForcedWeather)
|
||||
return;
|
||||
|
||||
void(*pSetForcedWeather)(LPVOID timeWeatherSystem, int weather) = (decltype(pSetForcedWeather))Offsets::Get_SetForcedWeather();
|
||||
if (!pSetForcedWeather)
|
||||
pSetForcedWeather(this, weather);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return;
|
||||
|
||||
pSetForcedWeather(this, weather);
|
||||
}
|
||||
}
|
||||
int CSystem::GetCurrentWeather() {
|
||||
if (!Offsets::Get_GetCurrentWeather())
|
||||
return EWeather::TYPE::Default;
|
||||
__try {
|
||||
int(*pGetCurrentWeather)(LPVOID timeWeatherSystem) = (decltype(pGetCurrentWeather))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetCurrentWeather@CSystem@TimeWeather@@QEBA?AW4TYPE@EWeather@@XZ");
|
||||
if (!pGetCurrentWeather)
|
||||
return EWeather::TYPE::Default;
|
||||
|
||||
int(*pGetCurrentWeather)(LPVOID timeWeatherSystem) = (decltype(pGetCurrentWeather))Offsets::Get_GetCurrentWeather();
|
||||
if (!pGetCurrentWeather)
|
||||
return pGetCurrentWeather(this);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return EWeather::TYPE::Default;
|
||||
|
||||
return pGetCurrentWeather(this);
|
||||
}
|
||||
}
|
||||
|
||||
CSystem* CSystem::Get() {
|
||||
@@ -590,20 +566,21 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region LevelDI
|
||||
#pragma region LevelDI
|
||||
bool LevelDI::IsLoading() {
|
||||
if (!Offsets::Get_IsLoading())
|
||||
return true;
|
||||
__try {
|
||||
bool(*pIsLoading)(LPVOID iLevel) = (decltype(pIsLoading))Utils::GetProcAddr("engine_x64_rwdi.dll", "?IsLoading@ILevel@@QEBA_NXZ");
|
||||
if (!pIsLoading)
|
||||
return true;
|
||||
|
||||
bool(*pIsLoading)(LPVOID iLevel) = (decltype(pIsLoading))Offsets::Get_IsLoading();
|
||||
if (!pIsLoading)
|
||||
return pIsLoading(this);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return true;
|
||||
|
||||
return pIsLoading(this);
|
||||
}
|
||||
}
|
||||
bool LevelDI::IsLoaded() {
|
||||
static float loadDeltaTime = 0.0f;
|
||||
@@ -619,14 +596,15 @@ namespace GamePH {
|
||||
return false;
|
||||
}
|
||||
LPVOID LevelDI::GetViewCamera() {
|
||||
if (!Offsets::Get_GetViewCamera())
|
||||
return nullptr;
|
||||
__try {
|
||||
LPVOID(*pGetViewCamera)(LPVOID iLevel) = (decltype(pGetViewCamera))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetViewCamera@ILevel@@QEBAPEAVIBaseCamera@@XZ");
|
||||
if (!pGetViewCamera)
|
||||
return nullptr;
|
||||
|
||||
LPVOID(*pGetViewCamera)(LPVOID iLevel) = (decltype(pGetViewCamera))Offsets::Get_GetViewCamera();
|
||||
if (!pGetViewCamera)
|
||||
return pGetViewCamera(this);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
|
||||
return pGetViewCamera(this);
|
||||
}
|
||||
}
|
||||
float LevelDI::GetTimeDelta() {
|
||||
return Memory::CallVT<176, float>(this);
|
||||
@@ -637,12 +615,20 @@ namespace GamePH {
|
||||
float LevelDI::GetTimePlayed() {
|
||||
return Memory::CallVT<317, float>(this);
|
||||
}
|
||||
void LevelDI::ShowUIManager(bool enabled) {
|
||||
__try {
|
||||
void(*pShowUIManager)(LPVOID iLevel, bool enabled) = (decltype(pShowUIManager))Utils::GetProcAddr("engine_x64_rwdi.dll", "?ShowUIManager@ILevel@@QEAAX_N@Z");
|
||||
if (!pShowUIManager)
|
||||
return;
|
||||
|
||||
pShowUIManager(this, enabled);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
TimeWeather::CSystem* LevelDI::GetTimeWeatherSystem() {
|
||||
__try {
|
||||
if (!Offsets::Get_GetTimeWeatherSystem())
|
||||
return nullptr;
|
||||
|
||||
TimeWeather::CSystem*(*pGetTimeWeatherSystem)(LevelDI* iLevel) = (decltype(pGetTimeWeatherSystem))Offsets::Get_GetTimeWeatherSystem();
|
||||
TimeWeather::CSystem*(*pGetTimeWeatherSystem)(LevelDI* iLevel) = (decltype(pGetTimeWeatherSystem))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetTimeWeatherSystem@ILevel@@QEBAPEAVCSystem@TimeWeather@@XZ");
|
||||
if (!pGetTimeWeatherSystem)
|
||||
return nullptr;
|
||||
|
||||
@@ -667,9 +653,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region gen_TPPModel
|
||||
#pragma region gen_TPPModel
|
||||
gen_TPPModel* gen_TPPModel::Get() {
|
||||
__try {
|
||||
LocalClientDI* pLocalClientDI = LocalClientDI::Get();
|
||||
@@ -686,9 +672,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region LocalClientDI
|
||||
#pragma region LocalClientDI
|
||||
LocalClientDI* LocalClientDI::Get() {
|
||||
__try {
|
||||
SessionCooperativeDI* pSessionCooperativeDI = SessionCooperativeDI::Get();
|
||||
@@ -705,9 +691,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region SessionCooperativeDI
|
||||
#pragma region SessionCooperativeDI
|
||||
SessionCooperativeDI* SessionCooperativeDI::Get() {
|
||||
__try {
|
||||
GameDI_PH* pGameDI_PH = GameDI_PH::Get();
|
||||
@@ -724,9 +710,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region GameDI_PH2
|
||||
#pragma region GameDI_PH2
|
||||
GameDI_PH2* GameDI_PH2::Get() {
|
||||
__try {
|
||||
GameDI_PH* pGameDI_PH = GameDI_PH::Get();
|
||||
@@ -742,21 +728,22 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region GameDI_PH
|
||||
#pragma region GameDI_PH
|
||||
float GameDI_PH::GetGameTimeDelta() {
|
||||
if (!Offsets::Get_GetGameTimeDelta())
|
||||
return -1.0f;
|
||||
__try {
|
||||
float(*pGetGameTimeDelta)(LPVOID pGameDI_PH) = (decltype(pGetGameTimeDelta))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetGameTimeDelta@IGame@@QEBAMXZ");
|
||||
if (!pGetGameTimeDelta)
|
||||
return -1.0f;
|
||||
|
||||
float(*pGetGameTimeDelta)(LPVOID pGameDI_PH) = (decltype(pGetGameTimeDelta))Offsets::Get_GetGameTimeDelta();
|
||||
if (!pGetGameTimeDelta)
|
||||
return pGetGameTimeDelta(this);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return -1.0f;
|
||||
|
||||
return pGetGameTimeDelta(this);
|
||||
}
|
||||
}
|
||||
INT64 GameDI_PH::GetCurrentGameVersion() {
|
||||
return Memory::CallVT<225, INT64>(this);
|
||||
DWORD64 GameDI_PH::GetCurrentGameVersion() {
|
||||
return Memory::CallVT<225, DWORD64>(this);
|
||||
}
|
||||
void GameDI_PH::TogglePhotoMode(bool doNothing, bool setAsOptionalCamera) {
|
||||
Memory::CallVT<258>(this, doNothing, setAsOptionalCamera);
|
||||
@@ -777,9 +764,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region PlayerObjProperties
|
||||
#pragma region PlayerObjProperties
|
||||
PlayerObjProperties* PlayerObjProperties::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_g_PlayerObjProperties())
|
||||
@@ -794,9 +781,9 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region BackgroundModuleScreenController
|
||||
#pragma region BackgroundModuleScreenController
|
||||
BackgroundModuleScreenController* BackgroundModuleScreenController::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_g_BackgroundModuleScreenController())
|
||||
@@ -812,13 +799,13 @@ namespace GamePH {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Engine
|
||||
namespace Engine {
|
||||
#pragma region CVideoSettings
|
||||
#pragma region CVideoSettings
|
||||
CVideoSettings* CVideoSettings::Get() {
|
||||
__try {
|
||||
CGame* pCGame = CGame::Get();
|
||||
@@ -834,9 +821,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CLevel
|
||||
#pragma region CLevel
|
||||
CLevel* CLevel::Get() {
|
||||
__try {
|
||||
CGame* pCGame = CGame::Get();
|
||||
@@ -852,9 +839,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CGame
|
||||
#pragma region CGame
|
||||
CGame* CGame::Get() {
|
||||
__try {
|
||||
CLobbySteam* pCLobbySteam = CLobbySteam::Get();
|
||||
@@ -870,9 +857,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CLobbySteam
|
||||
#pragma region CLobbySteam
|
||||
CLobbySteam* CLobbySteam::Get() {
|
||||
__try {
|
||||
if (!Offsets::Get_CLobbySteam())
|
||||
@@ -887,9 +874,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CInput
|
||||
#pragma region CInput
|
||||
DWORD64 CInput::BlockGameInput() {
|
||||
return Memory::CallVT<2, DWORD64>(this);
|
||||
}
|
||||
@@ -911,9 +898,56 @@ namespace Engine {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CBulletPhysicsCharacter
|
||||
#pragma region CBaseCamera
|
||||
Vector3* CBaseCamera::GetForwardVector(Vector3* outForwardVec) {
|
||||
__try {
|
||||
Vector3*(*pGetForwardVector)(LPVOID pCBaseCamera, Vector3* outForwardVec) = (decltype(pGetForwardVector))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetForwardVector@IBaseCamera@@QEBA?BVvec3@@XZ");
|
||||
if (!pGetForwardVector)
|
||||
return nullptr;
|
||||
|
||||
return pGetForwardVector(this, outForwardVec);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
Vector3* CBaseCamera::GetUpVector(Vector3* outUpVec) {
|
||||
__try {
|
||||
Vector3*(*pGetUpVector)(LPVOID pCBaseCamera, Vector3* outUpVec) = (decltype(pGetUpVector))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetUpVector@IBaseCamera@@QEBA?BVvec3@@XZ");
|
||||
if (!pGetUpVector)
|
||||
return nullptr;
|
||||
|
||||
return pGetUpVector(this, outUpVec);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
Vector3* CBaseCamera::GetLeftVector(Vector3* outLeftVec) {
|
||||
__try {
|
||||
Vector3*(*pGetLeftVector)(LPVOID pCBaseCamera, Vector3* outLeftVec) = (decltype(pGetLeftVector))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetLeftVector@IBaseCamera@@QEBA?BVvec3@@XZ");
|
||||
if (!pGetLeftVector)
|
||||
return nullptr;
|
||||
|
||||
return pGetLeftVector(this, outLeftVec);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
Vector3* CBaseCamera::GetPosition(Vector3* outPos) {
|
||||
__try {
|
||||
Vector3*(*pGetPosition)(LPVOID pCBaseCamera, Vector3* outPos) = (decltype(pGetPosition))Utils::GetProcAddr("engine_x64_rwdi.dll", "?GetPosition@IBaseCamera@@UEBA?BVvec3@@XZ");
|
||||
if (!pGetPosition)
|
||||
return nullptr;
|
||||
|
||||
return pGetPosition(this, outPos);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CBulletPhysicsCharacter
|
||||
Vector3 CBulletPhysicsCharacter::posBeforeFreeze{};
|
||||
|
||||
void CBulletPhysicsCharacter::FreezeCharacter() {
|
||||
@@ -940,9 +974,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CoPhysicsProperty
|
||||
#pragma region CoPhysicsProperty
|
||||
CoPhysicsProperty* CoPhysicsProperty::Get() {
|
||||
__try {
|
||||
GamePH::PlayerObjProperties* pPlayerObjProperties = GamePH::PlayerObjProperties::Get();
|
||||
@@ -958,9 +992,9 @@ namespace Engine {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CRTTIField
|
||||
#pragma region CRTTIField
|
||||
DWORD64 CRTTIField::Get_float(CRTTI* crtti, float& out) {
|
||||
if (!Offsets::Get_CRTTIFieldTypedNative_Get_float())
|
||||
return 0;
|
||||
@@ -971,9 +1005,9 @@ namespace Engine {
|
||||
|
||||
return pCRTTIFieldTypedNative_Get_float(this, crtti, out);
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CRTTI
|
||||
#pragma region CRTTI
|
||||
CRTTIField* CRTTI::FindField(const char* name) {
|
||||
if (!Offsets::Get_CRTTI_FindField())
|
||||
return nullptr;
|
||||
@@ -984,6 +1018,6 @@ namespace Engine {
|
||||
|
||||
return pCRTTI_FindField(this, name);
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
}
|
||||
#pragma endregion
|
||||
@@ -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,7 +76,21 @@ 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;
|
||||
|
||||
@@ -93,13 +107,6 @@ namespace Engine {
|
||||
}
|
||||
|
||||
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 {
|
||||
@@ -171,21 +178,17 @@ namespace GamePH {
|
||||
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();
|
||||
};
|
||||
|
||||
@@ -196,7 +199,7 @@ namespace GamePH {
|
||||
};
|
||||
};
|
||||
|
||||
class FreeCamera {
|
||||
class FreeCamera : public Engine::CBaseCamera {
|
||||
public:
|
||||
union {
|
||||
DEFINE_MEMBER_N(CoBaseCameraProxy*, pCoBaseCameraProxy, 0x18);
|
||||
@@ -206,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();
|
||||
@@ -245,6 +245,7 @@ namespace GamePH {
|
||||
float GetTimeDelta();
|
||||
void SetViewCamera(LPVOID viewCam);
|
||||
float GetTimePlayed();
|
||||
void ShowUIManager(bool enabled);
|
||||
TimeWeather::CSystem* GetTimeWeatherSystem();
|
||||
|
||||
static LevelDI* Get();
|
||||
@@ -291,7 +292,7 @@ namespace GamePH {
|
||||
};
|
||||
|
||||
float GetGameTimeDelta();
|
||||
INT64 GetCurrentGameVersion();
|
||||
DWORD64 GetCurrentGameVersion();
|
||||
void TogglePhotoMode(bool doNothing = false, bool setAsOptionalCamera = false);
|
||||
|
||||
static GameDI_PH* Get();
|
||||
@@ -301,6 +302,8 @@ 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();
|
||||
@@ -359,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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
#include <imgui.h>
|
||||
#include <Hotkey.h>
|
||||
#include "..\sigscan\offsets.h"
|
||||
#include "..\game_classes.h"
|
||||
#include <ImGuiEx.h>
|
||||
#include <imgui.h>
|
||||
#include "..\core.h"
|
||||
#include "..\game_classes.h"
|
||||
#include "..\sigscan\offsets.h"
|
||||
#include "camera.h"
|
||||
#include "menu.h"
|
||||
|
||||
namespace Menu {
|
||||
@@ -19,6 +21,7 @@ namespace Menu {
|
||||
KeyBindOption tpUseTPPModel{ VK_F2 };
|
||||
float tpDistanceBehindPlayer = 2.0f;
|
||||
float tpHeightAbovePlayer = 1.35f;
|
||||
float tpHorizontalDistanceFromPlayer = 0.0f;
|
||||
|
||||
Option disablePhotoModeLimits{};
|
||||
Option disableSafezoneFOVReduction{};
|
||||
@@ -26,18 +29,18 @@ namespace Menu {
|
||||
static const int baseFOV = 57;
|
||||
static const float baseSafezoneFOVReduction = -10.0f;
|
||||
|
||||
static void UpdateFOVWhileMenuClosed() {
|
||||
if (Menu::menuToggle.IsEnabled())
|
||||
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 (photoMode.IsEnabled())
|
||||
if (photoMode.GetValue())
|
||||
return;
|
||||
GamePH::LevelDI* iLevel = GamePH::LevelDI::Get();
|
||||
if (!iLevel || !iLevel->IsLoaded())
|
||||
@@ -52,7 +55,7 @@ namespace Menu {
|
||||
if (!pFreeCam)
|
||||
return;
|
||||
|
||||
if (freeCam.IsEnabled()) {
|
||||
if (freeCam.GetValue()) {
|
||||
if (viewCam == pFreeCam) {
|
||||
pFreeCam->enableSpeedMultiplier1 = true;
|
||||
pFreeCam->speedMultiplier = freeCamSpeed;
|
||||
@@ -67,9 +70,9 @@ namespace Menu {
|
||||
pGameDI_PH->TogglePhotoMode();
|
||||
pFreeCam->AllowCameraMovement(2);
|
||||
|
||||
GamePH::ShowTPPModel(true);
|
||||
freeCam.SetPrevValue(true);
|
||||
} else {
|
||||
if (freeCam.WasEnabled()) {
|
||||
if (freeCam.GetPrevValue()) {
|
||||
pFreeCam->enableSpeedMultiplier1 = false;
|
||||
pFreeCam->speedMultiplier = 0.1f;
|
||||
}
|
||||
@@ -79,63 +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 (disableSafezoneFOVReduction.IsEnabled()) {
|
||||
if (disableSafezoneFOVReduction.GetValue()) {
|
||||
GamePH::PlayerVariables::ChangePlayerVar("CameraDefaultFOVReduction", 0.0f);
|
||||
disableSafezoneFOVReduction.Change(true);
|
||||
} else if (disableSafezoneFOVReduction.WasEnabled()) {
|
||||
disableSafezoneFOVReduction.Restore(true);
|
||||
disableSafezoneFOVReduction.SetPrevValue(true);
|
||||
} else if (disableSafezoneFOVReduction.GetPrevValue()) {
|
||||
disableSafezoneFOVReduction.SetPrevValue(false);
|
||||
GamePH::PlayerVariables::ChangePlayerVar("CameraDefaultFOVReduction", baseSafezoneFOVReduction);
|
||||
}
|
||||
}
|
||||
|
||||
void Update() {
|
||||
if (photoMode.IsEnabled())
|
||||
freeCam.Change(false);
|
||||
else
|
||||
freeCam.Restore();
|
||||
|
||||
if (freeCam.IsEnabled())
|
||||
disablePhotoModeLimits.Change(true);
|
||||
else
|
||||
disablePhotoModeLimits.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(photoMode.IsEnabled()); {
|
||||
ImGui::Checkbox("Enabled##FreeCam", &freeCam.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", &teleportPlayerToCamera.value);
|
||||
ImGui::BeginDisabled(teleportPlayerToCamera.GetChangesAreDisabled()); {
|
||||
ImGui::Checkbox("Teleport Player to Camera", &teleportPlayerToCamera);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##TeleportPlayerToCamToggleKey", teleportPlayerToCamera);
|
||||
|
||||
ImGui::SeparatorText("Third Person Camera");
|
||||
ImGui::BeginDisabled(freeCam.IsEnabled() || photoMode.IsEnabled()); {
|
||||
ImGui::Checkbox("Enabled##ThirdPerson", &thirdPersonCamera.value);
|
||||
ImGui::BeginDisabled(thirdPersonCamera.GetChangesAreDisabled()); {
|
||||
ImGui::Checkbox("Enabled##ThirdPerson", &thirdPersonCamera);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Hotkey("##ThirdPersonToggleKey", thirdPersonCamera);
|
||||
ImGui::BeginDisabled(freeCam.IsEnabled() || photoMode.IsEnabled()); {
|
||||
ImGui::Checkbox("Use Third Person Player (TPP) Model", &tpUseTPPModel.value);
|
||||
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();
|
||||
@@ -143,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(freeCam.IsEnabled()); {
|
||||
ImGui::Checkbox("Disable Photo Mode Limits", &disablePhotoModeLimits.value);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::Checkbox("Disable Safezone FOV Reduction", &disableSafezoneFOVReduction.value);
|
||||
ImGui::Checkbox("Disable Photo Mode Limits", &disablePhotoModeLimits);
|
||||
ImGui::Checkbox("Disable Safezone FOV Reduction", &disableSafezoneFOVReduction);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "..\core.h"
|
||||
#include "menu.h"
|
||||
|
||||
namespace Menu {
|
||||
namespace Camera {
|
||||
@@ -15,11 +16,18 @@ namespace Menu {
|
||||
extern KeyBindOption tpUseTPPModel;
|
||||
extern float tpDistanceBehindPlayer;
|
||||
extern float tpHeightAbovePlayer;
|
||||
extern float tpHorizontalDistanceFromPlayer;
|
||||
|
||||
extern Option disablePhotoModeLimits;
|
||||
extern Option disableSafezoneFOVReduction;
|
||||
|
||||
extern void Update();
|
||||
extern void Render();
|
||||
class Tab : MenuTab {
|
||||
public:
|
||||
Tab() : MenuTab("Camera", 1) {}
|
||||
void Update() override;
|
||||
void Render() override;
|
||||
|
||||
static Tab instance;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
#include <imgui.h>
|
||||
#include <Hotkey.h>
|
||||
#include <imgui.h>
|
||||
#include "menu.h"
|
||||
#include "camera.h"
|
||||
#include "player.h"
|
||||
#include "world.h"
|
||||
|
||||
namespace Menu {
|
||||
static const ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize;
|
||||
@@ -20,17 +17,11 @@ namespace Menu {
|
||||
ImGui::SetNextWindowSizeConstraints(minWndSize, maxWndSize);
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
#pragma once
|
||||
#include "..\core.h"
|
||||
#include "camera.h"
|
||||
#include "player.h"
|
||||
#include "world.h"
|
||||
|
||||
namespace Menu {
|
||||
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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
@@ -1,17 +1,27 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "..\core.h"
|
||||
#include "menu.h"
|
||||
|
||||
namespace Menu {
|
||||
namespace Player {
|
||||
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;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -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); {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "..\game_classes.h"
|
||||
#include "menu.h"
|
||||
|
||||
namespace Menu {
|
||||
namespace World {
|
||||
@@ -7,6 +8,13 @@ namespace Menu {
|
||||
|
||||
extern EWeather::TYPE weather;
|
||||
|
||||
extern void Render();
|
||||
class Tab : MenuTab {
|
||||
public:
|
||||
Tab() : MenuTab("World", 3) {}
|
||||
void Update() override;
|
||||
void Render() override;
|
||||
|
||||
static Tab instance;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "sigscan.h"
|
||||
#include "..\memory.h"
|
||||
#include "sigscan.h"
|
||||
|
||||
#define AddOffset(name, moduleName, pattern, type, retType)\
|
||||
static retType Get_## name () {\
|
||||
@@ -45,26 +45,28 @@ struct Offsets {
|
||||
//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)
|
||||
//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(GetGameTimeDelta, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? F3 0F 59 05 ?? ?? ?? ?? F3 0F 58 03", PatternType::RelativePointer, 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)
|
||||
};
|
||||
|
||||
@@ -12,6 +12,11 @@ namespace Utils {
|
||||
|
||||
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;
|
||||
@@ -31,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))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <chrono>
|
||||
#include <string>
|
||||
|
||||
enum class WindowsVersion {
|
||||
Unknown,
|
||||
@@ -33,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();
|
||||
}
|
||||
@@ -8,10 +8,12 @@ DisableSafezoneFOVReduction=1
|
||||
DistanceBehindPlayer=2
|
||||
Enabled=0
|
||||
HeightAbovePlayer=1.35
|
||||
HorizontalDistanceFromPlayer=0
|
||||
UseTPPModel=1
|
||||
[Menu]
|
||||
Transparency=99
|
||||
[Menu:Keybinds]
|
||||
DisableHUDToggleKey=VK_F8
|
||||
FreeCamToggleKey=VK_F3
|
||||
FreezePlayerToggleKey=VK_F7
|
||||
GodModeToggleKey=VK_F6
|
||||
@@ -20,6 +22,7 @@ TeleportPlayerToCameraToggleKey=VK_F4
|
||||
ThirdPersonToggleKey=VK_F1
|
||||
UseTPPModelToggleKey=VK_F2
|
||||
[Player:Misc]
|
||||
DisableOutOfBoundsTimer=1
|
||||
GodMode=0
|
||||
[Player:PlayerVariables]
|
||||
Enabled=0
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
<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>
|
||||
@@ -13,10 +15,12 @@
|
||||
- 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 <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>
|
||||
<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>
|
||||
@@ -25,15 +29,15 @@ To uninstall, delete <b>winmm.dll</b>, <b>EGameTools.asi</b> and <b>EGameTools.i
|
||||
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>
|
||||
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 <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>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>
|
||||
|
||||
Reference in New Issue
Block a user