summaryrefslogtreecommitdiff
path: root/src/news_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r--src/news_gui.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 183b27b90..b79418c89 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -33,6 +33,7 @@
#include "command_func.h"
#include "company_base.h"
#include "settings_internal.h"
+#include "guitimer_func.h"
#include "widgets/news_widget.h"
@@ -262,7 +263,7 @@ struct NewsWindow : Window {
const NewsItem *ni; ///< News item to display.
static int duration; ///< Remaining time for showing the current news message (may only be access while a news item is displayed).
- uint timer;
+ GUITimer timer;
NewsWindow(WindowDesc *desc, const NewsItem *ni) : Window(desc), ni(ni)
{
@@ -273,6 +274,8 @@ struct NewsWindow : Window {
this->flags |= WF_DISABLE_VP_SCROLL;
+ this->timer.SetInterval(15);
+
this->CreateNestedTree();
/* For company news with a face we have a separate headline in param[0] */
@@ -489,7 +492,7 @@ struct NewsWindow : Window {
virtual void OnRealtimeTick(uint delta_ms)
{
- int count = CountIntervalElapsed(this->timer, delta_ms, 15);
+ int count = this->timer.CountElapsed(delta_ms);
if (count > 0) {
/* Scroll up newsmessages from the bottom */
int newtop = max(this->top - 2 * count, _screen.height - this->height - this->status_height - this->chat_height);