From 9167a47fcf703262c76862bbeef951b3933bf293 Mon Sep 17 00:00:00 2001 From: TheApadayo Date: Wed, 7 Jun 2017 16:04:02 -0400 Subject: [PATCH] [News] Add toast if an update is available when the game starts --- src/Components/Modules/News.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Components/Modules/News.cpp b/src/Components/Modules/News.cpp index 76e8ff7d..44af50d8 100644 --- a/src/Components/Modules/News.cpp +++ b/src/Components/Modules/News.cpp @@ -133,6 +133,14 @@ namespace Components Dvar::Var("cl_updateversion").get()->current.integer = revisionNumber; Dvar::Var("cl_updateavailable").get()->current.boolean = (revisionNumber > REVISION); + + // if there is an update then show the toast, but only once + static bool showToast = true; + if (revisionNumber > REVISION && showToast) + { + Toast::Show("cardicon_gears", "^4Update Available", "There is an update available for your client!", 5000); + showToast = false; + } } }