Add move speed toggle to freecam

This commit is contained in:
Grinch_ 2022-07-07 13:32:37 +06:00
parent a9ca03253c
commit 44f1b2067e
3 changed files with 45 additions and 29 deletions

View File

@ -67,7 +67,7 @@ ForbiddenWantedLevel = "Forbidden area wl"
ForbiddenWantedLevelText = "Wanted levels that appears outside of LS without completing missions"
FPSLimit = "FPS limit"
Freecam = "Freecam"
FreecamTip = "Press Enter to teleport player to camera location"
FreecamTip = "Shortcuts:\n\nEnter : Teleport player to camera\nMouse wheel : Zoom\nCtrl+ mouse wheel : Movement speed"
FreePNS = "Free pay n spray"
FreezeGame = "Freeze game"
FreezeGameTime = "Freeze game time"

View File

@ -122,24 +122,40 @@ void Freecam::Process()
if (CPad::NewMouseControllerState.wheelUp)
{
if (m_fFOV > 10.0f)
if (KeyPressed(VK_LCONTROL) && m_nMul != 10)
{
m_fFOV -= 2.0f * speed;
++m_nMul;
SetHelpMessage(std::to_string(m_nMul).c_str());
}
else
{
if (m_fFOV > 10.0f)
{
m_fFOV -= 2.0f * speed;
}
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_fFOV, 250, true);
Command<Commands::CAMERA_PERSIST_FOV>(true);
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_fFOV, 250, true);
Command<Commands::CAMERA_PERSIST_FOV>(true);
}
}
if (CPad::NewMouseControllerState.wheelDown)
{
if (m_fFOV < 115.0f)
if (KeyPressed(VK_LCONTROL) && m_nMul != 1)
{
m_fFOV += 2.0f * speed;
--m_nMul;
SetHelpMessage(std::to_string(m_nMul).c_str());
}
else
{
if (m_fFOV < 115.0f)
{
m_fFOV += 2.0f * speed;
}
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_fFOV, 250, true);
Command<Commands::CAMERA_PERSIST_FOV>(true);
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_fFOV, 250, true);
Command<Commands::CAMERA_PERSIST_FOV>(true);
}
}
m_pPed->SetHeading(m_fTotalMouse.x);
@ -166,26 +182,26 @@ void Freecam::Clear()
void RandomCheats::Process()
{
static bool genCheats = false;
if (!genCheats)
{
// Generate enabled cheats vector
for (auto [k, v] : m_pData.Items())
{
/*
[
cheat_id = [ cheat_name, state (true/false) ]
]
*/
std::string key { k.str() };
m_EnabledCheats[std::stoi(key)][0] = v.value_or<std::string>("Unknown");
m_EnabledCheats[std::stoi(key)][1] = "true";
}
genCheats = true;
}
if (m_bEnabled)
{
static bool genCheats = false;
if (!genCheats)
{
// Generate enabled cheats vector
for (auto [k, v] : m_pData.Items())
{
/*
[
cheat_id = [ cheat_name, state (true/false) ]
]
*/
std::string key { k.str() };
m_EnabledCheats[std::stoi(key)][0] = v.value_or<std::string>("Unknown");
m_EnabledCheats[std::stoi(key)][1] = "true";
}
genCheats = true;
}
uint timer = CTimer::m_snTimeInMilliseconds;
if ((timer - m_nTimer) > (static_cast<uint>(m_nInterval) * 1000))
{
@ -596,7 +612,7 @@ void Game::ShowPage()
ImGui::Spacing();
ImGui::SliderFloat(TEXT("Game.FieldOfView"), &Freecam::m_fFOV, 5.0f, 120.0f);
ImGui::SliderInt(TEXT("Game.Movement Speed"), &Freecam::m_nMul, 1, 10);
ImGui::SliderInt(TEXT("Game.MovementSpeed"), &Freecam::m_nMul, 1, 10);
ImGui::Spacing();
ImGui::TextWrapped(TEXT("Game.FreecamTip"));
ImGui::Spacing();

View File

@ -321,7 +321,7 @@ void Teleport::ShowPage()
}
ImGui::SameLine();
#ifdef GTASA
if (ImGui::Button(TEXT("Teleport.TeleportMarker"), Widget::CalcSize(2)))
if (ImGui::Button((TEXT_S("Teleport.TeleportMarker") + "##Btn").c_str(), Widget::CalcSize(2)))
{
TeleportPlayer(true);
}