Fix weird glitches with hud & radar flags
This commit is contained in:
parent
13c191d0dd
commit
a4c28025bc
@ -135,10 +135,16 @@ Game::Game()
|
|||||||
m_Freecam::m_bEnabled = false;
|
m_Freecam::m_bEnabled = false;
|
||||||
ClearFreecamStuff();
|
ClearFreecamStuff();
|
||||||
}
|
}
|
||||||
else m_Freecam::m_bEnabled = true;
|
else
|
||||||
|
{
|
||||||
|
m_Freecam::m_bEnabled = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_Freecam::m_bEnabled)
|
if (m_Freecam::m_bEnabled)
|
||||||
|
{
|
||||||
FreeCam();
|
FreeCam();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,10 +173,10 @@ void Game::FreeCam()
|
|||||||
{
|
{
|
||||||
CPlayerPed* player = FindPlayerPed(-1);
|
CPlayerPed* player = FindPlayerPed(-1);
|
||||||
Command<Commands::SET_EVERYONE_IGNORE_PLAYER>(0, true);
|
Command<Commands::SET_EVERYONE_IGNORE_PLAYER>(0, true);
|
||||||
m_Freecam::m_bHudState = CHud::m_Wants_To_Draw_Hud;
|
m_Freecam::m_bHudState = patch::Get<BYTE>(0xBA6769); // hud
|
||||||
m_Freecam::m_bRadarState = CHud::bScriptDontDisplayRadar;
|
m_Freecam::m_bRadarState = patch::Get<BYTE>(0xBA676C); // radar
|
||||||
CHud::bScriptDontDisplayRadar = true;
|
patch::Set<BYTE>(0xBA6769, 0); // hud
|
||||||
CHud::m_Wants_To_Draw_Hud = false;
|
patch::Set<BYTE>(0xBA676C, 2); // radar
|
||||||
CVector player_pos = player->GetPosition();
|
CVector player_pos = player->GetPosition();
|
||||||
CPad::GetPad(0)->DisablePlayerControls = true;
|
CPad::GetPad(0)->DisablePlayerControls = true;
|
||||||
|
|
||||||
@ -278,8 +284,8 @@ void Game::ClearFreecamStuff()
|
|||||||
{
|
{
|
||||||
m_Freecam::m_bInitDone = false;
|
m_Freecam::m_bInitDone = false;
|
||||||
Command<Commands::SET_EVERYONE_IGNORE_PLAYER>(0, false);
|
Command<Commands::SET_EVERYONE_IGNORE_PLAYER>(0, false);
|
||||||
CHud::bScriptDontDisplayRadar = m_Freecam::m_bRadarState;
|
patch::Set<BYTE>(0xBA6769, m_Freecam::m_bHudState); // hud
|
||||||
CHud::m_Wants_To_Draw_Hud = m_Freecam::m_bHudState;
|
patch::Set<BYTE>(0xBA676C, m_Freecam::m_bRadarState); // radar
|
||||||
CPad::GetPad(0)->DisablePlayerControls = false;
|
CPad::GetPad(0)->DisablePlayerControls = false;
|
||||||
|
|
||||||
Command<Commands::DELETE_CHAR>(m_Freecam::m_nPed);
|
Command<Commands::DELETE_CHAR>(m_Freecam::m_nPed);
|
||||||
|
@ -25,8 +25,8 @@ public:
|
|||||||
inline static int m_nPed = -1;
|
inline static int m_nPed = -1;
|
||||||
inline static CVector m_fMouse;
|
inline static CVector m_fMouse;
|
||||||
inline static CVector m_fTotalMouse;
|
inline static CVector m_fTotalMouse;
|
||||||
inline static bool m_bHudState;
|
inline static BYTE m_bHudState;
|
||||||
inline static bool m_bRadarState;
|
inline static BYTE m_bRadarState;
|
||||||
};
|
};
|
||||||
struct m_HardMode
|
struct m_HardMode
|
||||||
{
|
{
|
||||||
|
@ -213,15 +213,17 @@ void Visual::Draw()
|
|||||||
if (Ui::CheckboxWithHint("Hide veh names", &CHud::bScriptDontDisplayVehicleName))
|
if (Ui::CheckboxWithHint("Hide veh names", &CHud::bScriptDontDisplayVehicleName))
|
||||||
Command<Commands::DISPLAY_CAR_NAMES>(!CHud::bScriptDontDisplayVehicleName);
|
Command<Commands::DISPLAY_CAR_NAMES>(!CHud::bScriptDontDisplayVehicleName);
|
||||||
|
|
||||||
if (Ui::CheckboxWithHint("Hide radar", &CHud::bScriptDontDisplayRadar))
|
|
||||||
Command<Commands::DISPLAY_RADAR>(!CHud::bScriptDontDisplayRadar);
|
|
||||||
|
|
||||||
Ui::CheckboxAddressEx("Hide wanted level", 0x58DD1B, 0x90, 1);
|
Ui::CheckboxAddressEx("Hide wanted level", 0x58DD1B, 0x90, 1);
|
||||||
if (Ui::CheckboxWithHint("Lock weather", &m_bLockWeather))
|
if (Ui::CheckboxWithHint("Lock weather", &m_bLockWeather))
|
||||||
m_nBacWeatherType = CWeather::OldWeatherType;
|
m_nBacWeatherType = CWeather::OldWeatherType;
|
||||||
|
|
||||||
if (Ui::CheckboxWithHint("Show hud", &CHud::m_Wants_To_Draw_Hud))
|
bool radar_state = (patch::Get<BYTE>(0xBA676C) != 2);
|
||||||
Command<Commands::DISPLAY_HUD>(CHud::m_Wants_To_Draw_Hud);
|
if (Ui::CheckboxWithHint("Show radar", &radar_state))
|
||||||
|
{
|
||||||
|
patch::Set<BYTE>(0xBA676C, radar_state == true ? 0 : 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ui::CheckboxAddress("Show hud", 0xBA6769);
|
||||||
|
|
||||||
ImGui::Columns(1);
|
ImGui::Columns(1);
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
|
Loading…
Reference in New Issue
Block a user