diff options
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/GameController.cpp | 17 | ||||
| -rw-r--r-- | src/game/GameController.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index 154d99b..188a233 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -1257,6 +1257,23 @@ void GameController::NotifyAuthUserChanged(Client * sender) gameModel->SetUser(newUser); } +void GameController::NotifyNewNotification(Client * sender, std::pair<std::string, std::string> notification) +{ + class LinkNotification : public Notification + { + std::string link; + public: + LinkNotification(std::string link_, std::string message) : link(link_), Notification(message) {} + virtual ~LinkNotification() {} + + virtual void Action() + { + OpenURI(link); + } + }; + gameModel->AddNotification(new LinkNotification(notification.second, notification.first)); +} + void GameController::NotifyUpdateAvailable(Client * sender) { class UpdateConfirmation: public ConfirmDialogueCallback { diff --git a/src/game/GameController.h b/src/game/GameController.h index 984cfd6..d44a295 100644 --- a/src/game/GameController.h +++ b/src/game/GameController.h @@ -142,6 +142,7 @@ public: virtual void NotifyUpdateAvailable(Client * sender); virtual void NotifyAuthUserChanged(Client * sender); + virtual void NotifyNewNotification(Client * sender, std::pair<std::string, std::string> notification); void RunUpdater(); }; |
