From a8fad43ad1cb275bc1af68ff30a3b8e4b9620fce Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Thu, 5 Oct 2023 14:22:57 +0600 Subject: [PATCH] Fix updater --- src/defines.h | 4 ++-- src/editor.cpp | 4 ---- src/utils/updater.cpp | 3 ++- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/defines.h b/src/defines.h index 7e8312f..97acc45 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,7 +1,7 @@ #pragma once #define EDITOR_NAME "Map Editor" -#define EDITOR_VERSION_NUMBER "0.10" -#define EDITOR_VERSION EDITOR_VERSION_NUMBER"-alpha" +#define EDITOR_VERSION_NUMBER "1.0" +#define EDITOR_VERSION EDITOR_VERSION_NUMBER"-beta" #define EDITOR_TITLE EDITOR_NAME " v" EDITOR_VERSION #define DISCORD_INVITE "https://discord.gg/ZzW7kmf" diff --git a/src/editor.cpp b/src/editor.cpp index 5abcfdb..8574fb8 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -68,10 +68,6 @@ EditorMgr::EditorMgr() { gConfig.Set("Menu.LastUpdateChecked", st.wDay); } - if (Updater::IsUpdateAvailable()) { - Log::Print("New update available: %s", Updater::GetUpdateVersion().c_str()); - } - if (!std::filesystem::exists(PLUGIN_PATH((char*)FILE_NAME))) { Log::Print("Failed to find MapEditor directory!"); return; diff --git a/src/utils/updater.cpp b/src/utils/updater.cpp index 52ea8fb..b987857 100644 --- a/src/utils/updater.cpp +++ b/src/utils/updater.cpp @@ -16,6 +16,7 @@ std::string Updater::GetUpdateVersion() { void Updater::CheckUpdate() { if (Updater::curState == States::IDLE) { Updater::curState = States::CHECKING; + CreateThread(nullptr, NULL, (LPTHREAD_START_ROUTINE)&Updater::Process, nullptr, NULL, nullptr); } } @@ -24,7 +25,7 @@ void Updater::Process() { return; } - const char* link = "https://api.github.com/repos/user-grinch/Cheat-Menu/tags"; + const char* link = "https://api.github.com/repos/user-grinch/Map-Editor/tags"; char* path = PLUGIN_PATH((char*)FILE_NAME "/data/versioninfo.json"); HRESULT res = URLDownloadToFile(NULL, link, path, 0, NULL);