mirror of
https://github.com/EricPlayZ/EGameTools.git
synced 2025-07-19 01:47:50 +08:00
- Fixed Slow Motion not changing back to the original game speed when deactivated
- Fixed certain features like Use TPP Model or Player Variables not working at all for some users
This commit is contained in:
@ -3,8 +3,9 @@
|
|||||||
namespace ImGui {
|
namespace ImGui {
|
||||||
std::unordered_map<std::string_view, float> AnimValueStack{};
|
std::unordered_map<std::string_view, float> AnimValueStack{};
|
||||||
|
|
||||||
const float AnimEaseInSine(const float blendPoint) { return 1 - std::cos((blendPoint * static_cast<float>(M_PI)) / 2); }
|
const float AnimEaseInSine(const float blendPoint) { return 1.0f - std::cos((blendPoint * static_cast<float>(M_PI)) / 2.0f); }
|
||||||
const float AnimEaseOutSine(const float blendPoint) { return std::sin((blendPoint * static_cast<float>(M_PI)) / 2.0f); }
|
const float AnimEaseOutSine(const float blendPoint) { return std::sin((blendPoint * static_cast<float>(M_PI)) / 2.0f); }
|
||||||
|
const float AnimEaseInOutSine(const float blendPoint) { return -(std::cos(static_cast<float>(M_PI) * blendPoint) - 1.0f) / 2.0f; }
|
||||||
|
|
||||||
static const float SetAnimTime(const std::string_view& valueName, const float animSpeed, const bool resetBlendPoint = false, const float (*easingFunction)(float) = nullptr) {
|
static const float SetAnimTime(const std::string_view& valueName, const float animSpeed, const bool resetBlendPoint = false, const float (*easingFunction)(float) = nullptr) {
|
||||||
const ImGuiContext& g = *GImGui;
|
const ImGuiContext& g = *GImGui;
|
||||||
|
@ -8,6 +8,7 @@ namespace ImGui {
|
|||||||
|
|
||||||
const float AnimEaseInSine(const float blendPoint);
|
const float AnimEaseInSine(const float blendPoint);
|
||||||
const float AnimEaseOutSine(const float blendPoint);
|
const float AnimEaseOutSine(const float blendPoint);
|
||||||
|
const float AnimEaseInOutSine(const float blendPoint);
|
||||||
|
|
||||||
extern const float AnimateLerp(const std::string_view& valueName, const float a, const float b, const float animSpeed, const bool resetBlendPoint = false, const float (*easingFunction)(float) = nullptr);
|
extern const float AnimateLerp(const std::string_view& valueName, const float a, const float b, const float animSpeed, const bool resetBlendPoint = false, const float (*easingFunction)(float) = nullptr);
|
||||||
}
|
}
|
@ -24,6 +24,12 @@ R"(- You can now load custom mod files from "EGameTools\UserModFiles"! Please re
|
|||||||
- 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
|
- 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!)" },
|
||||||
|
{ "v1.1.1",
|
||||||
|
R"(- Fixed frequent crashes when using DX12, sometimes DX11 too.
|
||||||
|
- Fixed frequent crashing at game startup
|
||||||
|
- Fixed crashing when trying to use ".model" mods with the custom file loading system; PLEASE keep in mind that I haven't found a fix for this yet! Custom ".model" files will not get loaded from "UserModFiles"
|
||||||
|
- Fixed Slow Motion not changing back to the original game speed when deactivated
|
||||||
|
- Fixed certain features like Use TPP Model or Player Variables not working at all for some users)" }
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -16,8 +16,8 @@
|
|||||||
#define VK_MWHEELUP 0x101
|
#define VK_MWHEELUP 0x101
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
constexpr auto MOD_VERSION_STR = "v1.1.0";
|
constexpr auto MOD_VERSION_STR = "v1.1.1";
|
||||||
constexpr auto MOD_VERSION = 10100;
|
constexpr auto MOD_VERSION = 10101;
|
||||||
constexpr auto GAME_VER_COMPAT_STR = ">= v1.14.0";
|
constexpr auto GAME_VER_COMPAT_STR = ">= v1.14.0";
|
||||||
constexpr auto GAME_VER_COMPAT = 11400;
|
constexpr auto GAME_VER_COMPAT = 11400;
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#pragma pack(1)
|
||||||
|
|
||||||
template<size_t size, typename T> class buffer {
|
template<size_t size, typename T> class buffer {
|
||||||
char buffer[size];
|
char buffer[size];
|
||||||
T data;
|
T data;
|
||||||
@ -15,3 +17,5 @@ public:
|
|||||||
T& operator-=(const T& other) { data -= other; return data; }
|
T& operator-=(const T& other) { data -= other; return data; }
|
||||||
T operator-(const T& other) const { return data - other; }
|
T operator-(const T& other) const { return data - other; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#pragma pack()
|
@ -52,9 +52,13 @@ namespace Menu {
|
|||||||
freezeTime.SetPrevValue(false);
|
freezeTime.SetPrevValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slowMotion.HasChangedTo(false)) {
|
|
||||||
static bool slowMoHasChanged = true;
|
static bool slowMoHasChanged = true;
|
||||||
slowMotionSpeedLerp = ImGui::AnimateLerp("slowMotionSpeedLerp", slowMotionSpeed, gameSpeedBeforeSlowMo, slowMotionTransitionTime, slowMoHasChanged, &ImGui::AnimEaseOutSine);
|
if (slowMotion.HasChangedTo(false)) {
|
||||||
|
static float gameSpeedAfterChange = 0.0f;
|
||||||
|
if (slowMoHasChanged)
|
||||||
|
gameSpeedAfterChange = gameSpeed;
|
||||||
|
|
||||||
|
slowMotionSpeedLerp = ImGui::AnimateLerp("slowMotionSpeedLerp", gameSpeedAfterChange, gameSpeedBeforeSlowMo, slowMotionTransitionTime, slowMoHasChanged, &ImGui::AnimEaseInOutSine);
|
||||||
iLevel->TimerSetSpeedUp(slowMotionSpeedLerp);
|
iLevel->TimerSetSpeedUp(slowMotionSpeedLerp);
|
||||||
slowMoHasChanged = false;
|
slowMoHasChanged = false;
|
||||||
|
|
||||||
@ -63,15 +67,21 @@ namespace Menu {
|
|||||||
slowMotion.SetPrevValue(false);
|
slowMotion.SetPrevValue(false);
|
||||||
}
|
}
|
||||||
} else if (slowMotion.GetValue()) {
|
} else if (slowMotion.GetValue()) {
|
||||||
|
static float gameSpeedAfterChange = 0.0f;
|
||||||
if (slowMotion.HasChanged()) {
|
if (slowMotion.HasChanged()) {
|
||||||
|
if (slowMoHasChanged)
|
||||||
gameSpeedBeforeSlowMo = gameSpeed;
|
gameSpeedBeforeSlowMo = gameSpeed;
|
||||||
slowMotionSpeedLerp = gameSpeed;
|
gameSpeedAfterChange = gameSpeed;
|
||||||
}
|
}
|
||||||
slowMotionSpeedLerp = ImGui::AnimateLerp("slowMotionSpeedLerp", gameSpeedBeforeSlowMo, slowMotionSpeed, slowMotionTransitionTime, slowMotion.HasChanged(), &ImGui::AnimEaseOutSine);
|
|
||||||
|
slowMotionSpeedLerp = ImGui::AnimateLerp("slowMotionSpeedLerp", gameSpeedAfterChange, slowMotionSpeed, slowMotionTransitionTime, slowMotion.HasChanged(), &ImGui::AnimEaseInOutSine);
|
||||||
iLevel->TimerSetSpeedUp(slowMotionSpeedLerp);
|
iLevel->TimerSetSpeedUp(slowMotionSpeedLerp);
|
||||||
if (slowMotion.HasChanged())
|
|
||||||
|
if (slowMotion.HasChanged()) {
|
||||||
|
slowMoHasChanged = true;
|
||||||
slowMotion.SetPrevValue(slowMotion.GetValue());
|
slowMotion.SetPrevValue(slowMotion.GetValue());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!menuToggle.GetValue()) {
|
if (!menuToggle.GetValue()) {
|
||||||
time = dayNightCycle->time1 * 24.0f;
|
time = dayNightCycle->time1 * 24.0f;
|
||||||
@ -80,7 +90,6 @@ namespace Menu {
|
|||||||
|
|
||||||
if (!slowMotion.GetValue() && !slowMotion.HasChanged())
|
if (!slowMotion.GetValue() && !slowMotion.HasChanged())
|
||||||
iLevel->TimerSetSpeedUp(gameSpeed);
|
iLevel->TimerSetSpeedUp(gameSpeed);
|
||||||
if (!Utils::Values::are_samef(iLevel->TimerGetSpeedUp(), 1.0f))
|
|
||||||
gameSpeed = iLevel->TimerGetSpeedUp();
|
gameSpeed = iLevel->TimerGetSpeedUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -109,7 +118,6 @@ namespace Menu {
|
|||||||
else if (iLevel && iLevel->IsLoaded()) {
|
else if (iLevel && iLevel->IsLoaded()) {
|
||||||
if (!slowMotion.GetValue() && !slowMotion.HasChanged())
|
if (!slowMotion.GetValue() && !slowMotion.HasChanged())
|
||||||
iLevel->TimerSetSpeedUp(gameSpeed);
|
iLevel->TimerSetSpeedUp(gameSpeed);
|
||||||
if (!Utils::Values::are_samef(iLevel->TimerGetSpeedUp(), 1.0f))
|
|
||||||
gameSpeed = iLevel->TimerGetSpeedUp();
|
gameSpeed = iLevel->TimerGetSpeedUp();
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
Reference in New Issue
Block a user