Save radar & hud state for freecam, fix overlay pos bug

This commit is contained in:
Grinch_ 2021-07-10 17:30:05 +06:00
parent ea83dc8c09
commit d75d1aa00e
3 changed files with 8 additions and 4 deletions

View File

@ -167,6 +167,8 @@ void Game::FreeCam()
{
CPlayerPed* player = FindPlayerPed(-1);
Command<Commands::SET_EVERYONE_IGNORE_PLAYER>(0, true);
m_Freecam::m_bHudState = CHud::m_Wants_To_Draw_Hud;
m_Freecam::m_bRadarState = CHud::bScriptDontDisplayRadar;
CHud::bScriptDontDisplayRadar = true;
CHud::m_Wants_To_Draw_Hud = false;
CVector player_pos = player->GetPosition();
@ -276,8 +278,8 @@ void Game::ClearFreecamStuff()
{
m_Freecam::m_bInitDone = false;
Command<Commands::SET_EVERYONE_IGNORE_PLAYER>(0, false);
CHud::bScriptDontDisplayRadar = false;
CHud::m_Wants_To_Draw_Hud = true;
CHud::bScriptDontDisplayRadar = m_Freecam::m_bRadarState;
CHud::m_Wants_To_Draw_Hud = m_Freecam::m_bHudState;
CPad::GetPad(0)->DisablePlayerControls = false;
Command<Commands::DELETE_CHAR>(m_Freecam::m_nPed);

View File

@ -25,6 +25,8 @@ public:
inline static int m_nPed = -1;
inline static CVector m_fMouse;
inline static CVector m_fTotalMouse;
inline static bool m_bHudState;
inline static bool m_bRadarState;
};
struct m_HardMode
{

View File

@ -84,8 +84,8 @@ void Menu::DrawOverlay()
{
if (m_Overlay::fPosX != NULL && m_Overlay::fPosY != NULL)
{
config.SetValue("overlay.fPosX", m_Overlay::fPosX);
config.SetValue("overlay.fPosY", m_Overlay::fPosY);
config.SetValue("overlay.posx", m_Overlay::fPosX);
config.SetValue("overlay.posy", m_Overlay::fPosY);
ImGui::SetNextWindowPos(ImVec2(m_Overlay::fPosX, m_Overlay::fPosY), ImGuiCond_Once);
}
}