Fix #451
- Also added toggle damage overlay & hp overlay from @portra400nc 's CameraTools
This commit is contained in:
parent
582f5e31fa
commit
c058035677
@ -11,6 +11,8 @@ namespace cheat::feature
|
|||||||
app::GameObject* mainCam = nullptr;
|
app::GameObject* mainCam = nullptr;
|
||||||
app::Object_1* freeCamObj = nullptr;
|
app::Object_1* freeCamObj = nullptr;
|
||||||
app::Object_1* mainCamObj = nullptr;
|
app::Object_1* mainCamObj = nullptr;
|
||||||
|
app::GameObject* damageOverlay = nullptr;
|
||||||
|
app::GameObject* hpOverlay = nullptr;
|
||||||
app::Transform* freeCam_Transform;
|
app::Transform* freeCam_Transform;
|
||||||
app::Component_1* freeCam_Camera;
|
app::Component_1* freeCam_Camera;
|
||||||
app::Component_1* mainCam_Camera;
|
app::Component_1* mainCam_Camera;
|
||||||
@ -22,6 +24,8 @@ namespace cheat::feature
|
|||||||
FreeCamera::FreeCamera() : Feature(),
|
FreeCamera::FreeCamera() : Feature(),
|
||||||
NF(f_Enabled, "Free Camera", "Visuals::FreeCamera", false),
|
NF(f_Enabled, "Free Camera", "Visuals::FreeCamera", false),
|
||||||
NF(f_FreezeAnimation, "Freeze Character Animation", "Visuals::FreeCamera", false),
|
NF(f_FreezeAnimation, "Freeze Character Animation", "Visuals::FreeCamera", false),
|
||||||
|
NF(f_DamageOverlay, "Damage Overlay", "Visuals::FreeCamera", false),
|
||||||
|
NF(f_HpOverlay, "Enemy HP Overlay", "Visuals::FreeCamera", false),
|
||||||
NF(f_Speed, "Speed", "Visuals::FreeCamera", 1.0f),
|
NF(f_Speed, "Speed", "Visuals::FreeCamera", 1.0f),
|
||||||
NF(f_LookSens, "Look Sensitivity", "Visuals::FreeCamera", 1.0f),
|
NF(f_LookSens, "Look Sensitivity", "Visuals::FreeCamera", 1.0f),
|
||||||
NF(f_RollSpeed, "Roll Speed", "Visuals::FreeCamera", 1.0f),
|
NF(f_RollSpeed, "Roll Speed", "Visuals::FreeCamera", 1.0f),
|
||||||
@ -52,7 +56,13 @@ namespace cheat::feature
|
|||||||
void FreeCamera::DrawMain()
|
void FreeCamera::DrawMain()
|
||||||
{
|
{
|
||||||
ConfigWidget("Enable", f_Enabled);
|
ConfigWidget("Enable", f_Enabled);
|
||||||
ConfigWidget("Freeze Character Animation", f_FreezeAnimation, "Freezes the active character's animation.\nAfter disabling, jump to un-freeze your character.");
|
ConfigWidget("Freeze Character Animation", f_FreezeAnimation, "Freezes the active character's animation.");
|
||||||
|
if (f_Enabled)
|
||||||
|
{
|
||||||
|
ConfigWidget("Toggle Damage Overlay", f_DamageOverlay, "Remove damage output overlay");
|
||||||
|
ConfigWidget("Toggle Enemy HP Overlay", f_HpOverlay, "Remove enemy HP overlay");
|
||||||
|
}
|
||||||
|
|
||||||
if (ImGui::BeginTable("FreeCameraDrawTable", 1, ImGuiTableFlags_NoBordersInBody))
|
if (ImGui::BeginTable("FreeCameraDrawTable", 1, ImGuiTableFlags_NoBordersInBody))
|
||||||
{
|
{
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
@ -245,9 +255,23 @@ namespace cheat::feature
|
|||||||
}
|
}
|
||||||
if (freeCamObj)
|
if (freeCamObj)
|
||||||
EnableFreeCam();
|
EnableFreeCam();
|
||||||
|
|
||||||
|
if (damageOverlay == nullptr)
|
||||||
|
damageOverlay = app::GameObject_Find(string_to_il2cppi("/Canvas/Pages/InLevelMainPage/GrpMainPage/ParticleDamageTextContainer"), nullptr);
|
||||||
|
else
|
||||||
|
app::GameObject_SetActive(damageOverlay, !f_DamageOverlay, nullptr);
|
||||||
|
|
||||||
|
if (hpOverlay == nullptr)
|
||||||
|
hpOverlay = app::GameObject_Find(string_to_il2cppi("AvatarBoardCanvasV2(Clone)"), nullptr);
|
||||||
|
else
|
||||||
|
app::GameObject_SetActive(hpOverlay, !f_DamageOverlay, nullptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
DisableFreeCam();
|
DisableFreeCam();
|
||||||
|
damageOverlay = nullptr;
|
||||||
|
hpOverlay = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
// Taiga#5555: There's probably be a better way of implementing this. But for now, this is just what I came up with.
|
// Taiga#5555: There's probably be a better way of implementing this. But for now, this is just what I came up with.
|
||||||
auto& manager = game::EntityManager::instance();
|
auto& manager = game::EntityManager::instance();
|
||||||
@ -256,17 +280,24 @@ namespace cheat::feature
|
|||||||
if (animator == nullptr && rigidBody == nullptr)
|
if (animator == nullptr && rigidBody == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
static bool changed = false;
|
||||||
|
|
||||||
if (f_FreezeAnimation)
|
if (f_FreezeAnimation)
|
||||||
{
|
{
|
||||||
//auto constraints = app::Rigidbody_get_constraints(rigidBody, nullptr);
|
//auto constraints = app::Rigidbody_get_constraints(rigidBody, nullptr);
|
||||||
//LOG_DEBUG("%s", magic_enum::enum_name(constraints).data());
|
//LOG_DEBUG("%s", magic_enum::enum_name(constraints).data());
|
||||||
app::Rigidbody_set_constraints(rigidBody, app::RigidbodyConstraints__Enum::FreezePosition, nullptr);
|
app::Rigidbody_set_constraints(rigidBody, app::RigidbodyConstraints__Enum::FreezePosition, nullptr);
|
||||||
app::Animator_set_speed(animator, 0.f, nullptr);
|
app::Animator_set_speed(animator, 0.f, nullptr);
|
||||||
|
changed = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
app::Rigidbody_set_constraints(rigidBody, app::RigidbodyConstraints__Enum::FreezeRotation, nullptr);
|
app::Rigidbody_set_constraints(rigidBody, app::RigidbodyConstraints__Enum::FreezeRotation, nullptr);
|
||||||
app::Animator_set_speed(animator, 1.f, nullptr);
|
if (!changed)
|
||||||
|
{
|
||||||
|
app::Animator_set_speed(animator, 1.f, nullptr);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,6 +9,8 @@ namespace cheat::feature
|
|||||||
public:
|
public:
|
||||||
config::Field<config::Toggle<Hotkey>> f_Enabled;
|
config::Field<config::Toggle<Hotkey>> f_Enabled;
|
||||||
config::Field<config::Toggle<Hotkey>> f_FreezeAnimation;
|
config::Field<config::Toggle<Hotkey>> f_FreezeAnimation;
|
||||||
|
config::Field<bool> f_DamageOverlay;
|
||||||
|
config::Field<bool> f_HpOverlay;
|
||||||
config::Field<float> f_Speed;
|
config::Field<float> f_Speed;
|
||||||
config::Field<float> f_LookSens;
|
config::Field<float> f_LookSens;
|
||||||
config::Field<float> f_RollSpeed;
|
config::Field<float> f_RollSpeed;
|
||||||
|
Loading…
Reference in New Issue
Block a user