fixed some issues with toggling hotkeys and third person logic

This commit is contained in:
EricPlayZ
2024-01-27 19:59:26 +02:00
parent cc244db9fd
commit e303f5e134
17 changed files with 354 additions and 227 deletions

View File

@ -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" />
@ -44,6 +45,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" />
@ -86,7 +88,7 @@
<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">
@ -144,7 +146,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 +175,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>

View File

@ -62,6 +62,9 @@
<ClCompile Include="source\ImGuiHotkeys\Hotkey.cpp">
<Filter>ImGuiHotkeys</Filter>
</ClCompile>
<ClCompile Include="source\ImGuiEx\ImGuiEx.cpp">
<Filter>ImGuiEx</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\memory.h" />
@ -155,6 +158,9 @@
<ClInclude Include="source\ImGuiHotkeys\Hotkey.h">
<Filter>ImGuiHotkeys</Filter>
</ClInclude>
<ClInclude Include="source\ImGuiEx\ImGuiEx.h">
<Filter>ImGuiEx</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="MinHook">
@ -193,5 +199,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>

View File

@ -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();

View File

@ -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();

View File

@ -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;
@ -23,6 +23,8 @@ LRESULT __stdcall hkWindowProc(_In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wPara
break;
for (auto& option : KeyBindOption::GetInstances()) {
if (option->GetImGuiDisabled())
continue;
if (wParam == option->GetKeyBind()) {
KeyBindOption::wasAnyKeyPressed = true;
option->Toggle();
@ -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();

View File

@ -0,0 +1,61 @@
#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;
}
void BeginDisabled(bool disabled, Option* v) {
BeginDisabled(disabled);
v->SetImGuiDisabled(disabled);
}
}

View File

@ -0,0 +1,7 @@
#pragma once
#include "..\core.h"
namespace ImGui {
bool Checkbox(const char* label, Option* v);
void BeginDisabled(bool disabled, Option* v);
}

View File

@ -4025,6 +4025,7 @@ namespace Config {
{ "Menu:Keybinds", "ThirdPersonToggleKey", std::string("VK_F1"), &Menu::Camera::thirdPersonCamera, String},
{ "Menu:Keybinds", "UseTPPModelToggleKey", std::string("VK_F2"), &Menu::Camera::tpUseTPPModel, 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 },
@ -4132,7 +4133,7 @@ namespace Config {
for (auto& entry : configVariablesDefault) {
switch (entry.type) {
case OPTION:
reinterpret_cast<Option*>(entry.optionPtr)->Set(reader.Get(entry.section.data(), entry.key.data(), std::any_cast<bool>(entry.value)));
reinterpret_cast<Option*>(entry.optionPtr)->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));
@ -4182,7 +4183,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);

View File

@ -1,15 +1,15 @@
#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"
#include "kiero.h"
#include "menu\menu.h"
#include "sigscan\offsets.h"
#pragma region Option
std::set<Option*> Option::instances{};
@ -152,6 +152,8 @@ namespace Core {
GamePH::LoopHookLifeSetHealth();
GamePH::LoopHookTogglePhotoMode();
GamePH::LoopHookMoveCameraFromForwardUpPos();
GamePH::LoopHookShowTPPModelFunc3();
GamePH::LoopHookIsNotOutOfBounds();
const HANDLE proc = GetCurrentProcess();
WaitForSingleObject(proc, INFINITE);

View File

@ -25,42 +25,22 @@ public:
~Option() { instances.erase(this); }
static std::set<Option*> GetInstances();
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 SetImGuiDisabled(bool newValue) { imGuiDisabled = newValue; }
bool GetImGuiDisabled() const { return imGuiDisabled; }
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 imGuiDisabled = false;
bool previousValue = false;
bool changed = false;
static std::set<Option*> instances;
};

View File

@ -2,13 +2,13 @@
#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\player.h"
#include "print.h"
#include "sigscan\offsets.h"
#include "utils.h"
namespace Core {
@ -17,8 +17,8 @@ namespace Core {
#pragma region GamePH
namespace GamePH {
#pragma region Hooks
#pragma region CreatePlayerHealthModule
#pragma region Hooks
#pragma region CreatePlayerHealthModule
static DWORD64(*pCreatePlayerHealthModule)(DWORD64 playerHealthModule) = nullptr;
static DWORD64(*oCreatePlayerHealthModule)(DWORD64 playerHealthModule) = nullptr;
DWORD64 detourCreatePlayerHealthModule(DWORD64 playerHealthModule) {
@ -37,9 +37,9 @@ namespace GamePH {
}
}
}
#pragma endregion
#pragma endregion
#pragma region OnPostUpdate
#pragma region OnPostUpdate
static void(*oOnPostUpdate)(LPVOID pGameDI_PH2) = nullptr;
void detourOnPostUpdate(LPVOID pGameDI_PH2) {
oOnPostUpdate(pGameDI_PH2);
@ -66,10 +66,10 @@ namespace GamePH {
static DWORD64(*pCalculateFreeCamCollision)(LPVOID pFreeCamera, float* finalPos) = nullptr;
static DWORD64(*oCalculateFreeCamCollision)(LPVOID pFreeCamera, float* finalPos) = nullptr;
DWORD64 detourCalculateFreeCamCollision(LPVOID pFreeCamera, float* finalPos) {
if (!Menu::Camera::freeCam.IsEnabled() && !Menu::Camera::disablePhotoModeLimits.IsEnabled())
return oCalculateFreeCamCollision(pFreeCamera, finalPos);
if (Menu::Camera::disablePhotoModeLimits.GetValue() || Menu::Camera::freeCam.GetValue())
return 0;
return 0;
return oCalculateFreeCamCollision(pFreeCamera, finalPos);
}
void LoopHookCalculateFreeCamCollision() {
while (true) {
@ -89,7 +89,7 @@ namespace GamePH {
static void(*pLifeSetHealth)(float* pLifeHealth, float health) = nullptr;
static void(*oLifeSetHealth)(float* pLifeHealth, float health) = nullptr;
void detourLifeSetHealth(float* pLifeHealth, float health) {
if (!Menu::Player::godMode.IsEnabled())
if (!Menu::Player::godMode.GetValue() && !Menu::Camera::freeCam.GetValue())
return oLifeSetHealth(pLifeHealth, health);
GamePH::PlayerHealthModule* playerHealthModule = GamePH::PlayerHealthModule::Get();
@ -124,7 +124,7 @@ namespace GamePH {
void detourTogglePhotoMode(LPVOID guiPhotoModeData, bool enabled) {
Menu::Camera::photoMode.Set(enabled);
if (!Menu::Camera::freeCam.IsEnabled())
if (!Menu::Camera::freeCam.GetValue())
return oTogglePhotoMode(guiPhotoModeData, enabled);
GamePH::GameDI_PH* pGameDI_PH = GamePH::GameDI_PH::Get();
if (!pGameDI_PH)
@ -133,9 +133,11 @@ namespace GamePH {
if (!pFreeCam)
return oTogglePhotoMode(guiPhotoModeData, enabled);
pGameDI_PH->TogglePhotoMode();
pFreeCam->AllowCameraMovement(0);
if (enabled) {
pGameDI_PH->TogglePhotoMode();
pFreeCam->AllowCameraMovement(0);
}
oTogglePhotoMode(guiPhotoModeData, enabled);
}
void LoopHookTogglePhotoMode() {
@ -152,7 +154,42 @@ namespace GamePH {
}
#pragma endregion
#pragma region ShowTPPModelFunc3
static Option wannaUseTPPModel{};
static void(*pShowTPPModelFunc3)(DWORD64 a1, bool showTPPModel) = nullptr;
static void(*oShowTPPModelFunc3)(DWORD64 a1, bool showTPPModel) = nullptr;
void detourShowTPPModelFunc3(DWORD64 a1, bool showTPPModel) {
wannaUseTPPModel.Set(showTPPModel);
gen_TPPModel* pgen_TPPModel = gen_TPPModel::Get();
if (!pgen_TPPModel) {
oShowTPPModelFunc3(a1, showTPPModel);
return;
}
if (wannaUseTPPModel.HasChangedTo(false)) {
wannaUseTPPModel.SetPrevValue(false);
pgen_TPPModel->enableTPPModel2 = true;
pgen_TPPModel->enableTPPModel1 = true;
}
oShowTPPModelFunc3(a1, showTPPModel);
}
void LoopHookShowTPPModelFunc3() {
while (true) {
Sleep(250);
if (!pShowTPPModelFunc3)
pShowTPPModelFunc3 = (decltype(pShowTPPModelFunc3))Offsets::Get_ShowTPPModelFunc3();
else if (!oShowTPPModelFunc3 && MH_CreateHook(pShowTPPModelFunc3, &detourShowTPPModelFunc3, reinterpret_cast<LPVOID*>(&oShowTPPModelFunc3)) == MH_OK) {
MH_EnableHook(pShowTPPModelFunc3);
break;
}
}
}
#pragma endregion
#pragma region MoveCameraFromForwardUpPos
static bool waitOneMoreFrame = false;
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) {
@ -162,37 +199,62 @@ namespace GamePH {
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)
if (!Menu::Camera::thirdPersonCamera.GetValue() || Menu::Camera::photoMode.GetValue() || Menu::Camera::freeCam.GetValue() || !pos)
return oMoveCameraFromForwardUpPos(pCBaseCamera, a3, a4, pos);
CameraFPPDI* viewCam = static_cast<CameraFPPDI*>(iLevel->GetViewCamera());
@ -222,10 +284,33 @@ namespace GamePH {
}
}
}
#pragma endregion
#pragma endregion
#pragma endregion
#pragma region OtherFuncs
#pragma region IsNotOutOfBounds
static bool(*pIsNotOutOfBounds)(LPVOID pInstance, DWORD64 a2) = nullptr;
static bool(*oIsNotOutOfBounds)(LPVOID pInstance, DWORD64 a2) = nullptr;
bool detourIsNotOutOfBounds(LPVOID pInstance, DWORD64 a2) {
if (Menu::Player::disableOutOfBoundsTimer.GetValue())
return true;
return oIsNotOutOfBounds(pInstance, a2);
}
void LoopHookIsNotOutOfBounds() {
while (true) {
Sleep(250);
if (!pIsNotOutOfBounds)
pIsNotOutOfBounds = (decltype(pIsNotOutOfBounds))Offsets::Get_IsNotOutOfBounds();
else if (!oIsNotOutOfBounds && MH_CreateHook(pIsNotOutOfBounds, &detourIsNotOutOfBounds, reinterpret_cast<LPVOID*>(&oIsNotOutOfBounds)) == MH_OK) {
MH_EnableHook(pIsNotOutOfBounds);
break;
}
}
}
#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 +318,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 +325,17 @@ namespace GamePH {
DWORD64 tppFunc2Addr = ShowTPPModelFunc2(pGameDI_PH);
if (!tppFunc2Addr)
return;
if (!pShowTPPModelFunc3)
return;
gen_TPPModel* pgen_TPPModel = gen_TPPModel::Get();
if (!pgen_TPPModel)
return;
ShowTPPModelFunc3(tppFunc2Addr, showTPPModel);
pShowTPPModelFunc3(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 +474,9 @@ namespace GamePH {
return nullptr;
}
}
#pragma endregion
#pragma endregion
#pragma region PlayerState
#pragma region PlayerState
PlayerState* PlayerState::Get() {
__try {
if (!Offsets::Get_PlayerState())
@ -411,9 +491,9 @@ namespace GamePH {
return nullptr;
}
}
#pragma endregion
#pragma endregion
#pragma region PlayerHealthModule
#pragma region PlayerHealthModule
PlayerHealthModule* PlayerHealthModule::pPlayerHealthModule = nullptr;
PlayerHealthModule* PlayerHealthModule::Get() {
__try {
@ -428,9 +508,9 @@ namespace GamePH {
return nullptr;
}
}
#pragma endregion
#pragma endregion
#pragma region TPPCameraDI
#pragma region TPPCameraDI
TPPCameraDI* TPPCameraDI::Get() {
__try {
FreeCamera* pFreeCam = FreeCamera::Get();
@ -450,9 +530,9 @@ namespace GamePH {
return nullptr;
}
}
#pragma endregion
#pragma endregion
#pragma region CameraFPPDI
#pragma region CameraFPPDI
Vector3* CameraFPPDI::GetForwardVector(Vector3* outForwardVec) {
Vector3* (*pGetForwardVector)(LPVOID pCameraFPPDI, Vector3 * outForwardVec) = (decltype(pGetForwardVector))Offsets::Get_GetForwardVector();
if (!pGetForwardVector)
@ -486,9 +566,9 @@ namespace GamePH {
return nullptr;
}
}*/
#pragma endregion
#pragma endregion
#pragma region FreeCamera
#pragma region FreeCamera
Vector3* FreeCamera::GetForwardVector(Vector3* outForwardVec) {
Vector3* (*pGetForwardVector)(LPVOID pFreeCamera, Vector3 * outForwardVec) = (decltype(pGetForwardVector))Offsets::Get_GetForwardVector();
if (!pGetForwardVector)
@ -525,9 +605,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,11 +629,11 @@ 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;
@ -590,11 +670,11 @@ 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;
@ -667,9 +747,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 +766,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 +785,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 +804,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,9 +822,9 @@ 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;
@ -755,8 +835,8 @@ namespace GamePH {
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 +857,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 +874,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 +892,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 +914,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 +932,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 +950,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 +967,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 +991,9 @@ namespace Engine {
return nullptr;
}
}
#pragma endregion
#pragma endregion
#pragma region CBulletPhysicsCharacter
#pragma region CBulletPhysicsCharacter
Vector3 CBulletPhysicsCharacter::posBeforeFreeze{};
void CBulletPhysicsCharacter::FreezeCharacter() {
@ -940,9 +1020,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 +1038,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 +1051,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 +1064,6 @@ namespace Engine {
return pCRTTI_FindField(this, name);
}
#pragma endregion
#pragma endregion
}
#pragma endregion

View File

@ -1,10 +1,10 @@
#pragma once
#include <Windows.h>
#include <map>
#include <vector>
#include <string>
#include <memory>
#include <any>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "hook.h"
#include "utils.h"
@ -99,6 +99,8 @@ namespace GamePH {
extern void LoopHookLifeSetHealth();
extern void LoopHookTogglePhotoMode();
extern void LoopHookMoveCameraFromForwardUpPos();
extern void LoopHookShowTPPModelFunc3();
extern void LoopHookIsNotOutOfBounds();
extern void ShowTPPModel(bool showTPPModel);
@ -291,7 +293,7 @@ namespace GamePH {
};
float GetGameTimeDelta();
INT64 GetCurrentGameVersion();
DWORD64 GetCurrentGameVersion();
void TogglePhotoMode(bool doNothing = false, bool setAsOptionalCamera = false);
static GameDI_PH* Get();
@ -301,6 +303,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();

View File

@ -1,8 +1,9 @@
#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 "menu.h"
namespace Menu {
@ -27,17 +28,17 @@ namespace Menu {
static const float baseSafezoneFOVReduction = -10.0f;
static void UpdateFOVWhileMenuClosed() {
if (Menu::menuToggle.IsEnabled())
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 +53,7 @@ namespace Menu {
if (!pFreeCam)
return;
if (freeCam.IsEnabled()) {
if (freeCam.GetValue()) {
if (viewCam == pFreeCam) {
pFreeCam->enableSpeedMultiplier1 = true;
pFreeCam->speedMultiplier = freeCamSpeed;
@ -67,9 +68,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,7 +80,7 @@ namespace Menu {
pGameDI_PH->TogglePhotoMode();
pFreeCam->AllowCameraMovement(0);
GamePH::ShowTPPModel(false);
freeCam.SetPrevValue(false);
}
}
@ -87,26 +88,16 @@ namespace Menu {
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();
@ -114,23 +105,23 @@ namespace Menu {
void Render() {
ImGui::SeparatorText("Free Camera");
ImGui::BeginDisabled(photoMode.IsEnabled()); {
ImGui::Checkbox("Enabled##FreeCam", &freeCam.value);
ImGui::BeginDisabled(photoMode.GetValue(), &freeCam); {
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::Checkbox("Teleport Player to Camera", &teleportPlayerToCamera);
ImGui::Hotkey("##TeleportPlayerToCamToggleKey", teleportPlayerToCamera);
ImGui::SeparatorText("Third Person Camera");
ImGui::BeginDisabled(freeCam.IsEnabled() || photoMode.IsEnabled()); {
ImGui::Checkbox("Enabled##ThirdPerson", &thirdPersonCamera.value);
ImGui::BeginDisabled(freeCam.GetValue() || photoMode.GetValue(), &thirdPersonCamera); {
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(freeCam.GetValue() || photoMode.GetValue(), &tpUseTPPModel); {
ImGui::Checkbox("Use Third Person Player (TPP) Model", &tpUseTPPModel);
ImGui::EndDisabled();
}
ImGui::Hotkey("##TPPModelToggleKey", tpUseTPPModel);
@ -143,14 +134,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);
}
}
}

View File

@ -1,7 +1,7 @@
#include <imgui.h>
#include <Hotkey.h>
#include "menu.h"
#include <imgui.h>
#include "camera.h"
#include "menu.h"
#include "player.h"
#include "world.h"
@ -21,15 +21,15 @@ namespace Menu {
ImGui::Begin("EGameTools", &menuToggle.value, windowFlags); {
if (ImGui::BeginTabBar("##MainTabBar")) {
if (ImGui::BeginTabItem("Player")) {
Menu::Player::Render();
Player::Render();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Camera")) {
Menu::Camera::Render();
Camera::Render();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("World")) {
Menu::World::Render();
World::Render();
ImGui::EndTabItem();
}
ImGui::EndTabBar();

View File

@ -1,4 +1,5 @@
#include <Hotkey.h>
#include <ImGuiEx.h>
#include <ImGuiFileDialog.h>
#include <algorithm>
#include <filesystem>
@ -5998,6 +5999,7 @@ namespace Menu {
KeyBindOption godMode{ VK_F6 };
KeyBindOption freezePlayer{ VK_F7 };
Option playerVariables{};
Option disableOutOfBoundsTimer{};
std::string saveSCRPath{};
std::string loadSCRFilePath{};
@ -6167,14 +6169,14 @@ namespace Menu {
if (!playerCharacter)
return;
if (freezePlayer.IsEnabled()) {
if (freezePlayer.GetValue() || (Camera::freeCam.GetValue() && !Camera::teleportPlayerToCamera.GetValue())) {
playerCharacter->FreezeCharacter();
return;
}
Engine::CBulletPhysicsCharacter::posBeforeFreeze = playerCharacter->playerPos;
if (!Menu::Camera::freeCam.IsEnabled() || !Menu::Camera::teleportPlayerToCamera.IsEnabled())
if (!Camera::freeCam.GetValue() || !Camera::teleportPlayerToCamera.GetValue())
return;
GamePH::FreeCamera* freeCam = GamePH::FreeCamera::Get();
@ -6190,7 +6192,7 @@ namespace Menu {
}
static void UpdatePlayerVars() {
if (!playerVariables.IsEnabled())
if (!playerVariables.GetValue())
return;
auto bgn = GamePH::PlayerVariables::playerVars.begin();
@ -6217,37 +6219,23 @@ namespace Menu {
}
void Update() {
if (Menu::Camera::freeCam.IsEnabled())
godMode.Change(true);
else
godMode.Restore();
if (Menu::Camera::freeCam.IsEnabled())
freezePlayer.Change(!Menu::Camera::teleportPlayerToCamera.IsEnabled());
else
freezePlayer.Restore();
PlayerPositionUpdate();
UpdatePlayerVars();
}
void Render() {
ImGui::SeparatorText("Misc");
ImGui::BeginDisabled(Menu::Camera::freeCam.IsEnabled()); {
ImGui::Checkbox("God Mode", &godMode.value);
ImGui::EndDisabled();
}
ImGui::Checkbox("God Mode", &godMode);
ImGui::Hotkey("##GodModeToggleKey", godMode);
ImGui::SameLine();
ImGui::BeginDisabled(!Engine::CBulletPhysicsCharacter::Get() || Menu::Camera::freeCam.IsEnabled()); {
ImGui::Checkbox("Freeze Player", &freezePlayer.value);
ImGui::EndDisabled();
}
ImGui::Checkbox("Freeze Player", &freezePlayer);
ImGui::Hotkey("##FreezePlayerToggleKey", freezePlayer);
ImGui::Checkbox("Disable Out of Bounds Timer", &disableOutOfBoundsTimer);
ImGui::SeparatorText("Player Variables");
ImGui::Checkbox("Enabled##PlayerVars", &playerVariables.value);
if (!playerVariables.IsEnabled())
ImGui::Checkbox("Enabled##PlayerVars", &playerVariables);
if (!playerVariables.GetValue())
return;
ImGui::BeginDisabled(!GamePH::PlayerVariables::gotPlayerVars); {

View File

@ -7,6 +7,7 @@ namespace Menu {
extern KeyBindOption godMode;
extern KeyBindOption freezePlayer;
extern Option playerVariables;
extern Option disableOutOfBoundsTimer;
extern std::string saveSCRPath;
extern std::string loadSCRFilePath;

View File

@ -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 () {\
@ -57,6 +57,8 @@ struct Offsets {
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(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)