Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Client/core/CMainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,13 @@ void CMainMenu::Update()

if (m_bIsFullyVisible)
{
static bool versionUpdaterChecked = false;
if (!versionUpdaterChecked)
{
versionUpdaterChecked = true;
GetVersionUpdater()->OnMainMenuFullyVisible();
}

// Grab our cursor position
tagPOINT cursor;
GetCursorPos(&cursor);
Expand Down
23 changes: 23 additions & 0 deletions Client/core/CVersionUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class CVersionUpdater : public CVersionUpdaterInterface
int DoPollDownload();
int DoSendPostToNextServer();
int DoPollPost();
void OnMainMenuFullyVisible();

static void* StaticThreadProc(void* pContext);
void* ThreadProc();
Expand Down Expand Up @@ -3377,3 +3378,25 @@ int CVersionUpdater::DoPollPost()
}
return RES_OK;
}

// Issue: #1708
// Set the update settings to stable build if the user is on 1.5.8.
// We do this only once, this is why we need to write to registry.
void CVersionUpdater::OnMainMenuFullyVisible()
{
if (MTASA_VERSION_BUILD != 20670) // 20670 is the build number with PR #1712 merged.
return;
const std::string requiredValue = "discord-rich-presence";
const std::string lastSubKey = "version-revert-reason";
if (GetApplicationSetting(lastSubKey) != requiredValue)
{
SetApplicationSetting(lastSubKey, requiredValue);
// check if the MTA client version is 1.5.8
if (MTASA_VERSION_MAJOR == 1 && MTASA_VERSION_MINOR == 5 && MTASA_VERSION_MAINTENANCE == 8)
{
CVARS_SET("update_build_type", 0);
std::string message = _("We've reset your update preferences back to Default, please go change your settings again if you want Nightly updates.\n");
g_pCore->ShowMessageBox(_("VERSION UPDATE INFORMATION"), message.c_str(), MB_BUTTON_OK | MB_ICON_INFO);
}
}
}
1 change: 1 addition & 0 deletions Client/core/CVersionUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class CVersionUpdaterInterface
virtual void GetBrowseVersionMaps(std::map<SString, int>& outBlockedVersionMap, std::map<SString, int>& outAllowedVersionMap) = 0;
virtual void GetNewsSettings(SString& strOutOldestPost, uint& uiOutMaxHistoryLength) = 0;
virtual const SString& GetDebugFilterString() = 0;
virtual void OnMainMenuFullyVisible() = 0;
};

CVersionUpdaterInterface* GetVersionUpdater();