diff --git a/src/Game.cpp b/src/Game.cpp index 2285e04..295d4cf 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -31,6 +31,7 @@ float Game::freecam::tmouseY = 0; float Game::freecam::mouseX = 0; float Game::freecam::mouseY = 0; int Game::freecam::hped = -1; +float Game::freecam::fov = -1; CPed *Game::freecam::ped = nullptr; bool Game::hard_mode::state = false; @@ -83,6 +84,7 @@ Game::Game() { json.LoadData(search_categories, selected_item); stat::json.LoadData(stat::search_categories, stat::selected_item); + freecam::fov = TheCamera.FindCamFOV(); // Generate enabled cheats vector for (auto element : random_cheats::name_json.data.items()) @@ -243,7 +245,11 @@ void Game::FreeCam() freecam::init_done = true; player_pos.z -= 20; freecam::ped->SetPosn(player_pos); + + TheCamera.LerpFOV(TheCamera.FindCamFOV(),freecam::fov,1000,true); + Command(true); } + CVector pos = freecam::ped->GetPosition(); Command(&freecam::mouseX, &freecam::mouseY); @@ -301,6 +307,24 @@ void Game::FreeCam() pos.y += delta_speed * sin(angle * 3.14159f/180.0f); } + if ( CPad::NewMouseControllerState.wheelUp) + { + if (freecam::fov > 10.0f) + freecam::fov -= 2.0f * delta_speed; + + TheCamera.LerpFOV(TheCamera.FindCamFOV(),freecam::fov,250,true); + Command(true); + } + + if ( CPad::NewMouseControllerState.wheelDown) + { + if (freecam::fov < 115.0f) + freecam::fov += 2.0f * delta_speed; + + TheCamera.LerpFOV(TheCamera.FindCamFOV(),freecam::fov,250,true); + Command(true); + } + freecam::ped->SetHeading(freecam::tmouseX); Command(freecam::hped,0.0,0.0,20.0,90.0,180,freecam::tmouseY,0.0,2); freecam::ped->SetPosn(pos); @@ -317,7 +341,7 @@ void Game::ClearFreecamStuff() Command(freecam::hped); freecam::ped = nullptr; - + Command(false); Command(); } @@ -438,15 +462,19 @@ of LS without completing missions")) if (ImGui::CollapsingHeader("Free cam")) { if (Ui::CheckboxWithHint("Enable", &freecam::enable, "Forward: I\tBackward: K\ -\nLeft: J\t\t Right: L\n\nSlower: RCtrl\tFaster: RShift")) +\nLeft: J\t\t Right: L\n\nSlower: RCtrl\tFaster: RShift\n\nZoom: Mouse wheel")) { if (!freecam::enable) ClearFreecamStuff(); } ImGui::Spacing(); - - ImGui::SliderFloat("Movement Speed", &freecam::speed, 0.0, 0.5); - + + if (ImGui::SliderFloat("Field of view", &freecam::fov, 5.0f, 120.0f)) + { + TheCamera.LerpFOV(TheCamera.FindCamFOV(),freecam::fov,250.0f,true); + Command(true); + } + ImGui::SliderFloat("Movement Speed", &freecam::speed, 0.0f, 0.5f); ImGui::Spacing(); ImGui::TextWrapped("Press Enter to teleport player to camera location"); ImGui::Spacing(); diff --git a/src/Game.h b/src/Game.h index 86e5ad9..0fe6e15 100644 --- a/src/Game.h +++ b/src/Game.h @@ -23,6 +23,7 @@ public: { static bool enable; static float speed; + static float fov; static bool init_done; static CPed *ped; static int hped; diff --git a/src/Player.cpp b/src/Player.cpp index 156ce11..f0cb6a3 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -422,13 +422,14 @@ void Player::Main() if (ImGui::BeginTabItem("Custom skins")) { ImGui::Spacing(); - Ui::FilterWithHint("Search", filter, std::string("Total skins: " + std::to_string(custom_skins::store_vec.size())).c_str()); - Ui::ShowTooltip("Place your dff & txd files inside 'modloader/Custom Skins'"); - ImGui::Spacing(); - ImGui::TextWrapped("Note: Your txd & dff names can't exceed 8 characters. Don't change names while the game is running."); - ImGui::Spacing(); + if (modloader_installed) - { + { + Ui::FilterWithHint("Search", filter, std::string("Total skins: " + std::to_string(custom_skins::store_vec.size())).c_str()); + Ui::ShowTooltip("Place your dff & txd files inside 'modloader/Custom Skins'"); + ImGui::Spacing(); + ImGui::TextWrapped("Note: Your txd & dff names can't exceed 8 characters. Don't change names while the game is running."); + ImGui::Spacing(); for (std::string name : custom_skins::store_vec) { if (custom_skins::filter.PassFilter(name.c_str()))