mirror of
https://github.com/EricPlayZ/EGameTools.git
synced 2025-09-19 21:16:07 +08:00
- Fixed FOV slider not changing FOV while using FreeCam
This commit is contained in:
@ -178,7 +178,6 @@
|
|||||||
<ClInclude Include="source\utils\files.h" />
|
<ClInclude Include="source\utils\files.h" />
|
||||||
<ClInclude Include="source\utils\hook.h" />
|
<ClInclude Include="source\utils\hook.h" />
|
||||||
<ClInclude Include="source\utils\memory.h" />
|
<ClInclude Include="source\utils\memory.h" />
|
||||||
<ClInclude Include="source\utils\print.h" />
|
|
||||||
<ClInclude Include="source\utils\sigscan.h" />
|
<ClInclude Include="source\utils\sigscan.h" />
|
||||||
<ClInclude Include="source\utils\texture.h" />
|
<ClInclude Include="source\utils\texture.h" />
|
||||||
<ClInclude Include="source\utils\time.h" />
|
<ClInclude Include="source\utils\time.h" />
|
||||||
|
@ -261,9 +261,6 @@
|
|||||||
<ClInclude Include="source\utils\windows.h">
|
<ClInclude Include="source\utils\windows.h">
|
||||||
<Filter>utils</Filter>
|
<Filter>utils</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="source\utils\print.h">
|
|
||||||
<Filter>utils</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="source\utils\time.h">
|
<ClInclude Include="source\utils\time.h">
|
||||||
<Filter>utils</Filter>
|
<Filter>utils</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -71,7 +71,6 @@
|
|||||||
#include "..\source\utils\files.h"
|
#include "..\source\utils\files.h"
|
||||||
#include "..\source\utils\hook.h"
|
#include "..\source\utils\hook.h"
|
||||||
#include "..\source\utils\memory.h"
|
#include "..\source\utils\memory.h"
|
||||||
#include "..\source\utils\print.h"
|
|
||||||
#include "..\source\utils\sigscan.h"
|
#include "..\source\utils\sigscan.h"
|
||||||
#include "..\source\utils\texture.h"
|
#include "..\source\utils\texture.h"
|
||||||
#include "..\source\utils\time.h"
|
#include "..\source\utils\time.h"
|
||||||
|
@ -22,6 +22,7 @@ R"(- You can now load custom mod files from "EGameTools\UserModFiles"! Please re
|
|||||||
- Changed "Menu Transparency" to "Menu Opacity"
|
- Changed "Menu Transparency" to "Menu Opacity"
|
||||||
- Fixed having a weird offset of the entire map view when FreeCam is enabled
|
- Fixed having a weird offset of the entire map view when FreeCam is enabled
|
||||||
- Fixed player dying from switching FreeCam off after flying to high altitudes/through walls with "Teleport Player to Camera" option
|
- Fixed player dying from switching FreeCam off after flying to high altitudes/through walls with "Teleport Player to Camera" option
|
||||||
|
- Fixed FOV slider not changing FOV while using FreeCam
|
||||||
|
|
||||||
That's it for this update! The next few updates will include some more bug fixes rather than new, big features, so stay tuned!)" }
|
That's it for this update! The next few updates will include some more bug fixes rather than new, big features, so stay tuned!)" }
|
||||||
};
|
};
|
||||||
|
@ -4129,14 +4129,14 @@ namespace Config {
|
|||||||
inih::INIWriter writer{};
|
inih::INIWriter writer{};
|
||||||
writer.write(configFileName, reader);
|
writer.write(configFileName, reader);
|
||||||
} catch (const std::runtime_error& e) {
|
} catch (const std::runtime_error& e) {
|
||||||
Utils::PrintError("Error writing file {}: {}", configFileName, e.what());
|
spdlog::error("Error writing file {}: {}", configFileName, e.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static bool ConfigExists() {
|
static bool ConfigExists() {
|
||||||
return std::filesystem::exists(configFileName);
|
return std::filesystem::exists(configFileName);
|
||||||
}
|
}
|
||||||
static void CreateConfig() {
|
static void CreateConfig() {
|
||||||
Utils::PrintWarning("{} does not exist (will create now); using default config values", configFileName);
|
spdlog::warn("{} does not exist (will create now); using default config values", configFileName);
|
||||||
LoadAndWriteDefaultConfig();
|
LoadAndWriteDefaultConfig();
|
||||||
}
|
}
|
||||||
static void ReadConfig(const bool configUpdate = false) {
|
static void ReadConfig(const bool configUpdate = false) {
|
||||||
@ -4196,9 +4196,9 @@ namespace Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::PrintInfo(configUpdate ? "Successfully read updated config!" : "Successfully read config!");
|
spdlog::info(configUpdate ? "Successfully read updated config!" : "Successfully read config!");
|
||||||
} catch (const std::runtime_error& e) {
|
} catch (const std::runtime_error& e) {
|
||||||
Utils::PrintError("Error writing file {}; using default config values: {}", configFileName, e.what());
|
spdlog::error("Error writing file {}; using default config values: {}", configFileName, e.what());
|
||||||
LoadDefaultConfig();
|
LoadDefaultConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4234,7 +4234,7 @@ namespace Config {
|
|||||||
|
|
||||||
savedConfig = true;
|
savedConfig = true;
|
||||||
} catch (const std::runtime_error& e) {
|
} catch (const std::runtime_error& e) {
|
||||||
Utils::PrintError("Error saving to file {}: {}", configFileName, e.what());
|
spdlog::error("Error saving to file {}: {}", configFileName, e.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void InitConfig() {
|
void InitConfig() {
|
||||||
|
@ -76,9 +76,9 @@ namespace Core {
|
|||||||
std::filesystem::remove(entry.path());
|
std::filesystem::remove(entry.path());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Utils::PrintWarning("Creating game shortcut for \"EGameTools\"");
|
spdlog::warn("Creating game shortcut for \"EGameTools\"");
|
||||||
std::filesystem::create_directory_symlink(Utils::Files::GetCurrentProcDirectory() + "\\EGameTools", "..\\..\\data\\EGameTools");
|
std::filesystem::create_directory_symlink(Utils::Files::GetCurrentProcDirectory() + "\\EGameTools", "..\\..\\data\\EGameTools");
|
||||||
Utils::PrintInfo("Game shortcut created");
|
spdlog::info("Game shortcut created");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitLogger() {
|
static void InitLogger() {
|
||||||
@ -112,28 +112,28 @@ namespace Core {
|
|||||||
EnableConsole();
|
EnableConsole();
|
||||||
InitLogger();
|
InitLogger();
|
||||||
|
|
||||||
Utils::PrintWarning("Initializing config");
|
spdlog::warn("Initializing config");
|
||||||
Config::InitConfig();
|
Config::InitConfig();
|
||||||
CreateSymlinkForLoadingFiles();
|
CreateSymlinkForLoadingFiles();
|
||||||
Utils::PrintWarning("Sorting Player Variables");
|
spdlog::warn("Sorting Player Variables");
|
||||||
GamePH::PlayerVariables::SortPlayerVars();
|
GamePH::PlayerVariables::SortPlayerVars();
|
||||||
Utils::PrintInfo("Player Variables sorted");
|
spdlog::info("Player Variables sorted");
|
||||||
|
|
||||||
Utils::PrintWarning("Initializing MinHook");
|
spdlog::warn("Initializing MinHook");
|
||||||
MH_Initialize();
|
MH_Initialize();
|
||||||
Utils::PrintInfo("Initialized MinHook");
|
spdlog::info("Initialized MinHook");
|
||||||
|
|
||||||
Utils::PrintWarning("Hooking DX11/DX12 renderer");
|
spdlog::warn("Hooking DX11/DX12 renderer");
|
||||||
std::thread([]() {
|
std::thread([]() {
|
||||||
LoopHookRenderer();
|
LoopHookRenderer();
|
||||||
Utils::PrintInfo("Hooked \"DX11/DX12 renderer\"!");
|
spdlog::info("Hooked \"DX11/DX12 renderer\"!");
|
||||||
}).detach();
|
}).detach();
|
||||||
|
|
||||||
for (auto& hook : *Utils::Hook::HookBase::GetInstances()) {
|
for (auto& hook : *Utils::Hook::HookBase::GetInstances()) {
|
||||||
Utils::PrintWarning("Hooking \"{}\"", hook->name.data());
|
spdlog::warn("Hooking \"{}\"", hook->name.data());
|
||||||
std::thread([&hook]() {
|
std::thread([&hook]() {
|
||||||
hook->HookLoop();
|
hook->HookLoop();
|
||||||
Utils::PrintInfo("Hooked \"{}\"!", hook->name.data());
|
spdlog::info("Hooked \"{}\"!", hook->name.data());
|
||||||
}).detach();
|
}).detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,14 +146,14 @@ namespace Core {
|
|||||||
void Cleanup() {
|
void Cleanup() {
|
||||||
exiting = true;
|
exiting = true;
|
||||||
|
|
||||||
Utils::PrintWarning("Game requested exit, running cleanup");
|
spdlog::warn("Game requested exit, running cleanup");
|
||||||
Utils::PrintWarning("Saving config to file");
|
spdlog::warn("Saving config to file");
|
||||||
Config::SaveConfig();
|
Config::SaveConfig();
|
||||||
Utils::PrintInfo("Config saved to file");
|
spdlog::info("Config saved to file");
|
||||||
|
|
||||||
Utils::PrintWarning("Unhooking everything");
|
spdlog::warn("Unhooking everything");
|
||||||
MH_DisableHook(MH_ALL_HOOKS);
|
MH_DisableHook(MH_ALL_HOOKS);
|
||||||
MH_Uninitialize();
|
MH_Uninitialize();
|
||||||
Utils::PrintInfo("Unhooked everything");
|
spdlog::info("Unhooked everything");
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -75,7 +75,7 @@ namespace Engine {
|
|||||||
|
|
||||||
static std::vector<std::string> cachedUserModDirs{};
|
static std::vector<std::string> cachedUserModDirs{};
|
||||||
static void CacheUserModDirs() {
|
static void CacheUserModDirs() {
|
||||||
Utils::PrintWarning("Recaching user mod directories");
|
spdlog::warn("Recaching user mod directories");
|
||||||
|
|
||||||
if (!cachedUserModDirs.empty())
|
if (!cachedUserModDirs.empty())
|
||||||
cachedUserModDirs.clear();
|
cachedUserModDirs.clear();
|
||||||
@ -110,7 +110,7 @@ namespace Engine {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
const char* filePath2 = finalPath.c_str();
|
const char* filePath2 = finalPath.c_str();
|
||||||
Utils::PrintWarning("Loading user mod file \"{}\"", filePath2);
|
spdlog::warn("Loading user mod file \"{}\"", filePath2);
|
||||||
|
|
||||||
return FsOpenHook.pOriginal(firstByte != 0x0 ? (reinterpret_cast<DWORD64>(filePath2) | (firstByte << 56)) : reinterpret_cast<DWORD64>(filePath2), a2, a3); // restores first byte of addr if first byte was not 0
|
return FsOpenHook.pOriginal(firstByte != 0x0 ? (reinterpret_cast<DWORD64>(filePath2) | (firstByte << 56)) : reinterpret_cast<DWORD64>(filePath2), a2, a3); // restores first byte of addr if first byte was not 0
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,9 @@ namespace Menu {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
static bool prevFreeCam = freeCam.GetValue();
|
static bool prevFreeCam = freeCam.GetValue();
|
||||||
|
static bool prevEanbleSpeedMultiplier = pFreeCam->enableSpeedMultiplier1;
|
||||||
|
static float prevSpeedMultiplier = pFreeCam->speedMultiplier;
|
||||||
|
static float prevFOV = pFreeCam->FOV;
|
||||||
if (freeCam.GetValue() && !iLevel->IsTimerFrozen()) {
|
if (freeCam.GetValue() && !iLevel->IsTimerFrozen()) {
|
||||||
if (viewCam == pFreeCam) {
|
if (viewCam == pFreeCam) {
|
||||||
pFreeCam->enableSpeedMultiplier1 = true;
|
pFreeCam->enableSpeedMultiplier1 = true;
|
||||||
@ -79,6 +82,7 @@ namespace Menu {
|
|||||||
freeCamSpeed = 200.0f;
|
freeCamSpeed = 200.0f;
|
||||||
|
|
||||||
pFreeCam->speedMultiplier = freeCamSpeed;
|
pFreeCam->speedMultiplier = freeCamSpeed;
|
||||||
|
pFreeCam->FOV = static_cast<float>(FOV);
|
||||||
|
|
||||||
if (ImGui::IsKeyDown(ImGuiKey_LeftShift))
|
if (ImGui::IsKeyDown(ImGuiKey_LeftShift))
|
||||||
pFreeCam->speedMultiplier *= 2.0f;
|
pFreeCam->speedMultiplier *= 2.0f;
|
||||||
@ -90,14 +94,19 @@ namespace Menu {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prevEanbleSpeedMultiplier = pFreeCam->enableSpeedMultiplier1;
|
||||||
|
prevSpeedMultiplier = pFreeCam->speedMultiplier;
|
||||||
|
prevFOV = pFreeCam->FOV;
|
||||||
|
|
||||||
pGameDI_PH->TogglePhotoMode();
|
pGameDI_PH->TogglePhotoMode();
|
||||||
pFreeCam->AllowCameraMovement(2);
|
pFreeCam->AllowCameraMovement(2);
|
||||||
} else {
|
} else {
|
||||||
Engine::Hooks::switchedFreeCamByGamePause = freeCam.GetValue() && iLevel->IsTimerFrozen();
|
Engine::Hooks::switchedFreeCamByGamePause = freeCam.GetValue() && iLevel->IsTimerFrozen();
|
||||||
|
|
||||||
if (prevFreeCam) {
|
if (prevFreeCam) {
|
||||||
pFreeCam->enableSpeedMultiplier1 = false;
|
pFreeCam->enableSpeedMultiplier1 = prevEanbleSpeedMultiplier;
|
||||||
pFreeCam->speedMultiplier = 0.1f;
|
pFreeCam->speedMultiplier = prevSpeedMultiplier;
|
||||||
|
pFreeCam->FOV = prevFOV;
|
||||||
}
|
}
|
||||||
if (viewCam != pFreeCam)
|
if (viewCam != pFreeCam)
|
||||||
return;
|
return;
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <Windows.h>
|
|
||||||
#include <spdlog\logger.h>
|
|
||||||
|
|
||||||
namespace Utils {
|
|
||||||
enum ConsoleColors {
|
|
||||||
c_black,
|
|
||||||
c_blue,
|
|
||||||
c_green,
|
|
||||||
c_aqua,
|
|
||||||
c_red,
|
|
||||||
c_purple,
|
|
||||||
c_yellow,
|
|
||||||
c_white,
|
|
||||||
c_gray,
|
|
||||||
c_lightblue,
|
|
||||||
c_lightgreen,
|
|
||||||
c_lightaqua,
|
|
||||||
c_lightred,
|
|
||||||
c_lightpurple,
|
|
||||||
c_lightyellow,
|
|
||||||
c_brightwhite
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename... Args> void PrintError(const std::string f, Args... args) {
|
|
||||||
spdlog::error(fmt::runtime(f.c_str()), std::forward<Args>(args)...);
|
|
||||||
}
|
|
||||||
template<typename... Args> void PrintWarning(const std::string f, Args... args) {
|
|
||||||
spdlog::warn(fmt::runtime(f.c_str()), std::forward<Args>(args)...);
|
|
||||||
}
|
|
||||||
template<typename... Args> void PrintInfo(const std::string f, Args... args) {
|
|
||||||
spdlog::info(fmt::runtime(f.c_str()), std::forward<Args>(args)...);
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user