From fd4b9d1f060843be2848095794aba3f83d6fafae Mon Sep 17 00:00:00 2001 From: Learath Lea Date: Thu, 5 Mar 2015 23:09:14 +0200 Subject: [PATCH] Add Perform Update to settings --- src/game/client/components/menus_settings.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index a5c377a25..15a648ccb 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -1790,6 +1791,24 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView) g_Config.m_ClHttpMapDownload ^= 1; } + { + Left.HSplitTop(20.0f, &Label, &Left); + bool NeedUpdate = str_comp(Client()->LatestVersion(), "0"); + char aBuf[256]; + if(NeedUpdate) + { + str_format(aBuf, sizeof(aBuf), "DDNet %s is available:", Client()->LatestVersion()); + Label.VSplitLeft(TextRender()->TextWidth(0, 14.0f, aBuf, -1) + 10.0f, &Label, &Button); + UI()->DoLabelScaled(&Label, aBuf, 14.0f, -1); + Button.VSplitLeft(150.0f, &Button, 0); + static int s_ButtonUpdate = 0; + if(DoButton_Menu(&s_ButtonUpdate, "Update Now", 0, &Button)) + AutoUpdate()->InitiateUpdate(); + } + else + UI()->DoLabelScaled(&Label, "No updates available", 14.0f, -1); + } + { Right.HSplitTop(20.0f, &Button, &Right); Button.VSplitLeft(190.0f, &Label, &Button);