Skip to content

Commit dccd2af

Browse files
committed
Added XP/Vista end of support warning
1 parent f751618 commit dccd2af

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

Client/core/CMainMenu.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,24 @@ CMainMenu::CMainMenu(CGUI* pManager)
319319
m_pFeatureBranchAlertLabel->SetHorizontalAlign(CGUI_ALIGN_HORIZONTALCENTER);
320320
m_pFeatureBranchAlertLabel->SetVerticalAlign(CGUI_ALIGN_VERTICALCENTER);
321321
#endif
322+
323+
#if _WIN32_WINNT <= _WIN32_WINNT_WINXP
324+
// Add annonying alert
325+
m_pAlertTexture.reset(reinterpret_cast<CGUITexture*>(m_pManager->CreateTexture()));
326+
std::int32_t buffer = 0xFFFF0000;
327+
m_pAlertTexture->LoadFromMemory(&buffer, 1, 1); // HACK: Load red dot
328+
329+
m_pAlertImage.reset(reinterpret_cast<CGUIStaticImage*>(m_pManager->CreateStaticImage(m_pBackground)));
330+
m_pAlertImage->LoadFromTexture(m_pAlertTexture.get());
331+
m_pAlertImage->SetPosition({ 0.0f, 0.0f }, false);
332+
m_pAlertImage->SetSize({ ScreenSize.fX, 20.0f });
333+
334+
#define XP_VISTA_WARNING _("MTA will not receive updates on XP/Vista after July 2019.\n\nUpgrade Windows to play on the latest servers.")
335+
m_pAlertLabel.reset(reinterpret_cast<CGUILabel*>(m_pManager->CreateLabel(m_pAlertImage.get(), XP_VISTA_WARNING)));
336+
m_pAlertLabel->SetPosition({ 0.0f, 2.0f }, false);
337+
m_pAlertLabel->SetSize({ ScreenSize.fX, 20.0f });
338+
m_pAlertLabel->SetHorizontalAlign(CGUI_ALIGN_HORIZONTALCENTER);
339+
#endif
322340
}
323341

324342
CMainMenu::~CMainMenu()
@@ -623,6 +641,13 @@ void CMainMenu::Update()
623641
if (WaitForMenu == 275)
624642
GetVersionUpdater()->EnableChecking(true);
625643

644+
#if _WIN32_WINNT <= _WIN32_WINNT_WINXP
645+
if (WaitForMenu == 275)
646+
{
647+
CCore::GetSingletonPtr()->ShowErrorMessageBox("", XP_VISTA_WARNING, "au-revoir-xp-vista");
648+
}
649+
#endif
650+
626651
if (WaitForMenu < 300)
627652
WaitForMenu++;
628653
}

Client/core/CMainMenu.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ class CMainMenu
168168
std::unique_ptr<CGUILabel> m_pFeatureBranchAlertLabel;
169169
#endif
170170

171+
#if _WIN32_WINNT <= _WIN32_WINNT_WINXP
172+
std::unique_ptr<CGUITexture> m_pAlertTexture;
173+
std::unique_ptr<CGUIStaticImage> m_pAlertImage;
174+
std::unique_ptr<CGUILabel> m_pAlertLabel;
175+
#endif
176+
171177
// Fade states
172178
enum eFadeStates
173179
{

0 commit comments

Comments
 (0)