Log mod info, add option to disable updates #66
This commit is contained in:
parent
f3e0b10b6d
commit
4615338c9e
@ -2,6 +2,7 @@
|
||||
#include "cheatmenu.h"
|
||||
#include "updater.h"
|
||||
#include "rpc.h"
|
||||
#include "menu.h"
|
||||
|
||||
void MenuThread(void* param)
|
||||
{
|
||||
@ -49,6 +50,15 @@ void MenuThread(void* param)
|
||||
return;
|
||||
}
|
||||
|
||||
Log::Print<eLogLevel::None>("Starting " MENU_TITLE " (" BUILD_NUMBER ")\nAuthor: Grinch_\nDiscord: "
|
||||
DISCORD_INVITE "\nMore Info: " GITHUB_LINK);
|
||||
|
||||
// date time
|
||||
SYSTEMTIME st;
|
||||
GetSystemTime(&st);
|
||||
Log::Print<eLogLevel::None>("Date: {}-{}-{} Time: {}:{}\n", st.wYear, st.wMonth, st.wDay,
|
||||
st.wHour, st.wMinute);
|
||||
|
||||
/*
|
||||
TODO: Find a better way
|
||||
Since you could still name it something else
|
||||
@ -61,6 +71,7 @@ void MenuThread(void* param)
|
||||
return;
|
||||
}
|
||||
CFastman92limitAdjuster::Init();
|
||||
Log::Print<eLogLevel::None>("Game detected: GTA San Andreas 1.0 US");
|
||||
#elif GTAVC
|
||||
if (GetModuleHandle("vcmp-proxy.dll") || GetModuleHandle("vcmp-proxy.asi"))
|
||||
{
|
||||
@ -68,23 +79,29 @@ void MenuThread(void* param)
|
||||
MessageBox(NULL, "VCMP detected. Exiting " FILE_NAME, FILE_NAME, MB_ICONERROR);
|
||||
return;
|
||||
}
|
||||
Log::Print<eLogLevel::None>("Game detected: GTA Vice City 1.0 EN");
|
||||
#else
|
||||
Log::Print<eLogLevel::None>("Game detected: GTA III 1.0 EN");
|
||||
#endif
|
||||
|
||||
Log::Print<eLogLevel::None>("Starting " MENU_TITLE " (" BUILD_NUMBER ")\nAuthor: Grinch_\nDiscord: "
|
||||
DISCORD_INVITE "\nMore Info: " GITHUB_LINK);
|
||||
bool modloader = GetModuleHandle("modloader.asi");
|
||||
const char *path = PLUGIN_PATH((char*)"");
|
||||
Log::Print<eLogLevel::None>("Install location: {}", modloader && strstr(path, "modloader") ? "Modloader" : "Game directory");
|
||||
Log::Print<eLogLevel::None>("CLEO installed: {}", GetModuleHandle("cleo.asi") || GetModuleHandle("cleo_redux.asi") ? "True" : "False");
|
||||
Log::Print<eLogLevel::None>("FLA installed: {}", GetModuleHandle("$fastman92limitAdjuster.asi") ? "True" : "False");
|
||||
Log::Print<eLogLevel::None>("Mixsets installed: {}", GetModuleHandle("MixSets.asi") ? "True" : "False");
|
||||
Log::Print<eLogLevel::None>("Modloader installed: {}", modloader ? "True" : "False");
|
||||
Log::Print<eLogLevel::None>("OLA installed: {}", GetModuleHandle("III.VC.SA.LimitAdjuster.asi") ? "True" : "False");
|
||||
Log::Print<eLogLevel::None>("ProjectProps installed: {}", GetModuleHandle("ProjectProps.asi") ? "True" : "False");
|
||||
Log::Print<eLogLevel::None>("Renderhook installed: {}", GetModuleHandle("_gtaRenderHook.asi") ? "True" : "False");
|
||||
Log::Print<eLogLevel::None>("Widescreen Fix installed: {}\n", GetModuleHandle("GTASA.WidescreenFix.asi") ? "True" : "False");
|
||||
|
||||
// date time
|
||||
SYSTEMTIME st;
|
||||
GetSystemTime(&st);
|
||||
Log::Print<eLogLevel::None>("Date: {}-{}-{} Time: {}:{}\n", st.wYear, st.wMonth, st.wDay,
|
||||
st.wHour, st.wMinute);
|
||||
CheatMenu::Init();
|
||||
|
||||
// Checking for updates once a day
|
||||
if (gConfig.Get("Menu.LastUpdateChecked", 0) != st.wDay)
|
||||
if (Menu::m_bAutoCheckUpdate && gConfig.Get("Menu.LastUpdateChecked", 0) != st.wDay)
|
||||
{
|
||||
Updater::CheckUpdate();
|
||||
Updater::IncrementDailyUsageCounter();
|
||||
gConfig.Set("Menu.LastUpdateChecked", st.wDay);
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ void Menu::Init()
|
||||
Overlay::textColor[2] = gConfig.Get("Overlay.TextColor.Blue", 1.0f);
|
||||
Overlay::textColor[3] = gConfig.Get("Overlay.TextColor.Alpha", 1.0f);
|
||||
m_bDiscordRPC = gConfig.Get("Menu.DiscordRPC", false);
|
||||
m_bAutoCheckUpdate = gConfig.Get("Menu.AutoCheckUpdate", true);
|
||||
m_bTextOnlyMode = gConfig.Get("Menu.TextOnlyMode", false);
|
||||
|
||||
Util::GetCPUUsageInit();
|
||||
@ -352,6 +353,10 @@ void Menu::ShowPage()
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Columns(2, NULL, false);
|
||||
if (ImGui::Checkbox(TEXT("Menu.AutoCheckUpdate"), &m_bAutoCheckUpdate))
|
||||
{
|
||||
gConfig.Set("Menu.AutoCheckUpdate", m_bAutoCheckUpdate);
|
||||
}
|
||||
if (ImGui::Checkbox(TEXT("Menu.DiscordRPC"), &m_bDiscordRPC))
|
||||
{
|
||||
if (m_bDiscordRPC)
|
||||
|
@ -44,6 +44,7 @@ public:
|
||||
static inline bool m_bShowMenu;
|
||||
static inline char m_nInputBuffer[INPUT_BUFFER_SIZE] = "";
|
||||
};
|
||||
static inline bool m_bAutoCheckUpdate;
|
||||
static inline bool m_bDiscordRPC;
|
||||
static inline bool m_bTextOnlyMode;
|
||||
|
||||
|
@ -24,11 +24,6 @@ void Updater::CheckUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
void Updater::IncrementDailyUsageCounter()
|
||||
{
|
||||
URLDownloadToFile(NULL, "https://github.com/user-grinch/Cheat-Menu/releases/download/3.2/counter.info", "", 0, NULL);
|
||||
}
|
||||
|
||||
void Updater::Process()
|
||||
{
|
||||
if (Updater::curState != States::CHECKING)
|
||||
|
@ -31,15 +31,6 @@ public:
|
||||
// Is updated version available from GitHub
|
||||
static bool IsUpdateAvailable();
|
||||
|
||||
/*
|
||||
Just downloading counter.info file from GitHub repository
|
||||
Initial plan was to add google analytics but people will freak
|
||||
out about that (though every site has it in some form)
|
||||
|
||||
Pretty barebones but this shouldn't raise any concerns (i hope)
|
||||
*/
|
||||
static void IncrementDailyUsageCounter();
|
||||
|
||||
// Needs to run in it's own thread to prevent the game from freezing
|
||||
static void Process();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user