Check updates once a day, fix config save issue
This commit is contained in:
parent
d75d1aa00e
commit
13c191d0dd
@ -7,11 +7,20 @@
|
|||||||
void CheatMenu::DrawWindow()
|
void CheatMenu::DrawWindow()
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
static bool game_running = true;
|
||||||
|
|
||||||
if (FrontEndMenuManager.m_bMenuActive)
|
if (FrontEndMenuManager.m_bMenuActive)
|
||||||
|
{
|
||||||
|
if (game_running)
|
||||||
|
{
|
||||||
|
config.WriteToDisk();
|
||||||
|
game_running = false;
|
||||||
m_bShowMouse = false;
|
m_bShowMouse = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
game_running = true;
|
||||||
if (Globals::m_bShowMenu || m_Commands::m_bShowMenu)
|
if (Globals::m_bShowMenu || m_Commands::m_bShowMenu)
|
||||||
{
|
{
|
||||||
if (Globals::m_bShowMenu)
|
if (Globals::m_bShowMenu)
|
||||||
@ -75,7 +84,9 @@ CheatMenu::CheatMenu()
|
|||||||
if (m_bShowMouse != Globals::m_bShowMenu)
|
if (m_bShowMouse != Globals::m_bShowMenu)
|
||||||
{
|
{
|
||||||
if (m_bShowMouse) // Only write when the menu closes
|
if (m_bShowMouse) // Only write when the menu closes
|
||||||
|
{
|
||||||
config.WriteToDisk();
|
config.WriteToDisk();
|
||||||
|
}
|
||||||
|
|
||||||
m_bShowMouse = Globals::m_bShowMenu;
|
m_bShowMouse = Globals::m_bShowMenu;
|
||||||
}
|
}
|
||||||
@ -187,7 +198,16 @@ void MenuThread(void* param)
|
|||||||
GITHUB_LINK "\n" << std::endl;
|
GITHUB_LINK "\n" << std::endl;
|
||||||
CFastman92limitAdjuster::Init();
|
CFastman92limitAdjuster::Init();
|
||||||
CheatMenu menu;
|
CheatMenu menu;
|
||||||
|
|
||||||
|
time_t now = time(0);
|
||||||
|
struct tm tstruct = *localtime(&now);
|
||||||
|
int last_check_date = config.GetValue("config.last_update_checked", 0);
|
||||||
|
|
||||||
|
if (last_check_date != tstruct.tm_mday)
|
||||||
|
{
|
||||||
Updater::CheckForUpdate();
|
Updater::CheckForUpdate();
|
||||||
|
config.SetValue("config.last_update_checked", tstruct.tm_mday);
|
||||||
|
}
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,7 @@ class CJson
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::string m_FilePath;
|
std::string m_FilePath;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
nlohmann::json m_Data;
|
nlohmann::json m_Data;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "Updater.h"
|
#include "Updater.h"
|
||||||
#include "Ui.h"
|
#include "Ui.h"
|
||||||
#include "MenuInfo.h"
|
#include "MenuInfo.h"
|
||||||
|
#include "Util.h"
|
||||||
|
|
||||||
void Updater::CheckForUpdate()
|
void Updater::CheckForUpdate()
|
||||||
{
|
{
|
||||||
|
@ -300,7 +300,7 @@ void Visual::Draw()
|
|||||||
ImGui::TextWrapped(
|
ImGui::TextWrapped(
|
||||||
"These options won't work if you got any mods that drastically changes the game hud. i.e. Mobile Hud, GTA 5 Hud etc.");
|
"These options won't work if you got any mods that drastically changes the game hud. i.e. Mobile Hud, GTA 5 Hud etc.");
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
Ui::ColorPickerAddress("Armourbar color", *(int*)0x5890FC, ImVec4(180, 25, 29, 255));
|
Ui::ColorPickerAddress("Armourbar color", *(int*)0x5890FC, ImVec4(225, 225, 225, 255));
|
||||||
Ui::EditAddress<float>("Armourbar posX", 0x866B78, -999, 94, 999);
|
Ui::EditAddress<float>("Armourbar posX", 0x866B78, -999, 94, 999);
|
||||||
Ui::EditAddress<float>("Armourbar posY", 0x862D38, -999, 48, 999);
|
Ui::EditAddress<float>("Armourbar posY", 0x862D38, -999, 48, 999);
|
||||||
Ui::ColorPickerAddress("Breathbar color", *(int*)0x5891EB, ImVec4(172, 203, 241, 255));
|
Ui::ColorPickerAddress("Breathbar color", *(int*)0x5891EB, ImVec4(172, 203, 241, 255));
|
||||||
|
Loading…
Reference in New Issue
Block a user