forked from mirror/OpenTTD
Change: Use GUITimer class instead of bare int/uints.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user