2016-05-04 19:24:41 +02:00
|
|
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
2014-05-04 15:10:32 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
|
|
|
*
|
2016-05-04 19:24:41 +02:00
|
|
|
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
|
|
|
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
2014-05-04 15:10:32 +02:00
|
|
|
*
|
|
|
|
* OpenRCT2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
|
|
|
* A full copy of the GNU General Public License can be found in licence.txt
|
2014-05-04 15:10:32 +02:00
|
|
|
*****************************************************************************/
|
2016-05-04 19:24:41 +02:00
|
|
|
#pragma endregion
|
2014-05-04 15:10:32 +02:00
|
|
|
|
2014-10-06 18:36:58 +02:00
|
|
|
#include "../audio/audio.h"
|
|
|
|
#include "../management/news_item.h"
|
|
|
|
#include "../localisation/localisation.h"
|
|
|
|
#include "../world/sprite.h"
|
2015-02-17 21:39:35 +01:00
|
|
|
#include "../peep/staff.h"
|
2014-10-06 18:36:58 +02:00
|
|
|
#include "../sprites.h"
|
|
|
|
#include "../interface/widget.h"
|
|
|
|
#include "../interface/window.h"
|
2014-05-04 15:10:32 +02:00
|
|
|
|
2014-05-19 21:10:32 +02:00
|
|
|
enum WINDOW_NEWS_WIDGET_IDX {
|
2014-05-04 15:10:32 +02:00
|
|
|
WIDX_BACKGROUND,
|
|
|
|
WIDX_TITLE,
|
|
|
|
WIDX_CLOSE,
|
2015-12-24 14:16:39 +01:00
|
|
|
WIDX_SETTINGS,
|
2014-05-04 15:10:32 +02:00
|
|
|
WIDX_SCROLL
|
|
|
|
};
|
|
|
|
|
|
|
|
static rct_widget window_news_widgets[] = {
|
2016-07-14 14:07:49 +02:00
|
|
|
{ WWT_FRAME, 0, 0, 399, 0, 299, 0xFFFFFFFF, STR_NONE }, // panel / background
|
2014-05-04 15:10:32 +02:00
|
|
|
{ WWT_CAPTION, 0, 1, 398, 1, 14, STR_RECENT_MESSAGES, STR_WINDOW_TITLE_TIP }, // title bar
|
|
|
|
{ WWT_CLOSEBOX, 0, 387, 397, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP }, // close x button
|
2016-07-14 14:07:49 +02:00
|
|
|
{ WWT_FLATBTN, 0, 372, 395, 18, 41, SPR_TAB_GEARS_0, STR_NONE }, // settings
|
|
|
|
{ WWT_SCROLL, 0, 4, 395, 44, 295, SCROLL_VERTICAL, STR_NONE }, // scroll
|
2014-05-04 15:10:32 +02:00
|
|
|
{ WIDGETS_END },
|
|
|
|
};
|
|
|
|
|
2017-05-01 15:41:45 +02:00
|
|
|
static void window_news_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
2014-05-19 19:47:14 +02:00
|
|
|
static void window_news_update(rct_window *w);
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_news_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
|
|
|
static void window_news_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
2017-05-01 15:41:45 +02:00
|
|
|
static void window_news_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
2015-07-10 02:39:16 +02:00
|
|
|
static void window_news_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
2015-07-10 02:39:16 +02:00
|
|
|
|
|
|
|
static rct_window_event_list window_news_events = {
|
|
|
|
NULL,
|
2014-05-04 15:10:32 +02:00
|
|
|
window_news_mouseup,
|
2015-07-10 02:39:16 +02:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2014-05-04 15:10:32 +02:00
|
|
|
window_news_update,
|
2015-07-10 02:39:16 +02:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2014-05-04 15:10:32 +02:00
|
|
|
window_news_scrollgetsize,
|
|
|
|
window_news_scrollmousedown,
|
2015-07-10 02:39:16 +02:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2014-05-04 15:10:32 +02:00
|
|
|
window_news_tooltip,
|
2015-07-10 02:39:16 +02:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2017-05-17 13:19:42 +02:00
|
|
|
NULL,
|
2014-05-04 15:10:32 +02:00
|
|
|
window_news_paint,
|
|
|
|
window_news_scrollpaint
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2015-10-20 20:16:30 +02:00
|
|
|
*
|
2014-05-04 15:10:32 +02:00
|
|
|
* rct2: 0x0066E464
|
|
|
|
*/
|
|
|
|
void window_news_open()
|
|
|
|
{
|
|
|
|
rct_window* window;
|
|
|
|
|
|
|
|
// Check if window is already open
|
2014-10-16 03:02:43 +02:00
|
|
|
window = window_bring_to_front_by_class(WC_RECENT_NEWS);
|
2014-05-04 15:10:32 +02:00
|
|
|
if (window == NULL) {
|
|
|
|
window = window_create_auto_pos(
|
|
|
|
400,
|
|
|
|
300,
|
2015-07-10 02:39:16 +02:00
|
|
|
&window_news_events,
|
2014-05-04 17:32:10 +02:00
|
|
|
WC_RECENT_NEWS,
|
2014-05-04 15:10:32 +02:00
|
|
|
0
|
|
|
|
);
|
|
|
|
window->widgets = window_news_widgets;
|
2015-12-24 14:16:39 +01:00
|
|
|
window->enabled_widgets = (1 << WIDX_CLOSE) | (1 << WIDX_SETTINGS);
|
2014-05-04 15:10:32 +02:00
|
|
|
window_init_scroll_widgets(window);
|
2014-08-22 21:17:48 +02:00
|
|
|
window->news.var_480 = -1;
|
2014-05-04 15:10:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// sub_66E4BA:
|
|
|
|
rct_widget *widget;
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 width = 0;
|
|
|
|
sint32 height = 0;
|
2014-05-04 15:10:32 +02:00
|
|
|
window_get_scroll_size(window, 0, &width, &height);
|
|
|
|
widget = &window_news_widgets[WIDX_SCROLL];
|
|
|
|
window->scrolls[0].v_top = max(0, height - (widget->bottom - widget->top - 1));
|
|
|
|
widget_scroll_update_thumbs(window, WIDX_SCROLL);
|
2015-05-29 18:04:53 +02:00
|
|
|
|
2014-05-04 15:10:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-10-20 20:16:30 +02:00
|
|
|
*
|
2014-05-04 15:10:32 +02:00
|
|
|
* rct2: 0x0066D4D5
|
|
|
|
*/
|
2017-05-01 15:41:45 +02:00
|
|
|
static void window_news_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
2014-05-04 15:10:32 +02:00
|
|
|
{
|
2015-07-10 02:39:16 +02:00
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_CLOSE:
|
2014-05-04 15:10:32 +02:00
|
|
|
window_close(w);
|
2015-07-10 02:39:16 +02:00
|
|
|
break;
|
2015-12-24 14:16:39 +01:00
|
|
|
case WIDX_SETTINGS:
|
|
|
|
window_news_options_open();
|
|
|
|
break;
|
2015-07-10 02:39:16 +02:00
|
|
|
}
|
2014-05-04 15:10:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-10-20 20:16:30 +02:00
|
|
|
*
|
2014-05-04 15:10:32 +02:00
|
|
|
* rct2: 0x0066EAB8
|
|
|
|
*/
|
2014-05-19 19:47:14 +02:00
|
|
|
static void window_news_update(rct_window *w)
|
2014-05-04 15:10:32 +02:00
|
|
|
{
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 i, j, x, y, z;
|
2014-05-04 15:10:32 +02:00
|
|
|
|
2014-08-22 21:17:48 +02:00
|
|
|
if (w->news.var_480 == -1)
|
2014-05-04 15:10:32 +02:00
|
|
|
return;
|
2014-08-22 19:54:28 +02:00
|
|
|
if (--w->news.var_484 != 0)
|
2014-05-04 15:10:32 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
window_invalidate(w);
|
2017-03-29 19:44:19 +02:00
|
|
|
audio_play_sound(SOUND_CLICK_2, 0, w->x + (w->width / 2));
|
2014-05-04 15:10:32 +02:00
|
|
|
|
2014-08-22 21:17:48 +02:00
|
|
|
j = w->news.var_480;
|
|
|
|
w->news.var_480 = -1;
|
2014-05-04 15:10:32 +02:00
|
|
|
for (i = 11; i < 61; i++) {
|
2015-07-24 23:40:04 +02:00
|
|
|
if (news_item_is_empty(i))
|
2014-05-04 15:10:32 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (j == 0) {
|
2017-01-17 13:51:02 +01:00
|
|
|
NewsItem * const newsItem = news_item_get(i);
|
2017-01-17 18:23:03 +01:00
|
|
|
if (newsItem->Flags & NEWS_FLAG_HAS_BUTTON)
|
2014-05-04 15:10:32 +02:00
|
|
|
return;
|
2014-08-22 19:54:28 +02:00
|
|
|
if (w->news.var_482 == 1) {
|
2017-01-17 13:51:02 +01:00
|
|
|
news_item_open_subject(newsItem->Type, newsItem->Assoc);
|
2014-05-04 15:10:32 +02:00
|
|
|
return;
|
2014-08-22 19:54:28 +02:00
|
|
|
}
|
|
|
|
else if (w->news.var_482 > 1) {
|
2017-01-17 13:51:02 +01:00
|
|
|
news_item_get_subject_location(newsItem->Type, newsItem->Assoc, &x, &y, &z);
|
2014-05-04 15:10:32 +02:00
|
|
|
if (x != SPRITE_LOCATION_NULL)
|
|
|
|
if ((w = window_get_main()) != NULL)
|
|
|
|
window_scroll_to_location(w, x, y, z);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
j--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-10-20 20:16:30 +02:00
|
|
|
*
|
2014-05-04 15:10:32 +02:00
|
|
|
* rct2: 0x0066EA3C
|
|
|
|
*/
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_news_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
2014-05-04 15:10:32 +02:00
|
|
|
{
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 i;
|
2014-05-04 15:10:32 +02:00
|
|
|
|
2015-07-10 02:39:16 +02:00
|
|
|
*height = 0;
|
2014-05-04 15:10:32 +02:00
|
|
|
for (i = 11; i < 61; i++) {
|
2015-07-24 23:40:04 +02:00
|
|
|
if (news_item_is_empty(i))
|
2014-05-04 15:10:32 +02:00
|
|
|
break;
|
|
|
|
|
2015-07-10 02:39:16 +02:00
|
|
|
*height += 42;
|
2014-05-04 15:10:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-10-20 20:16:30 +02:00
|
|
|
*
|
2014-05-04 15:10:32 +02:00
|
|
|
* rct2: 0x0066EA5C
|
|
|
|
*/
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_news_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
2014-05-04 15:10:32 +02:00
|
|
|
{
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 i, buttonIndex;
|
2014-05-04 15:10:32 +02:00
|
|
|
|
|
|
|
buttonIndex = 0;
|
|
|
|
for (i = 11; i < 61; i++) {
|
2015-07-24 23:40:04 +02:00
|
|
|
if (news_item_is_empty(i))
|
2014-05-04 15:10:32 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
if (y < 42) {
|
2017-01-17 13:51:02 +01:00
|
|
|
NewsItem * const newsItem = news_item_get(i);
|
2017-01-17 18:23:03 +01:00
|
|
|
if (newsItem->Flags & NEWS_FLAG_HAS_BUTTON) {
|
2014-05-04 15:10:32 +02:00
|
|
|
buttonIndex = 0;
|
|
|
|
break;
|
|
|
|
} else if (y < 14) {
|
|
|
|
buttonIndex = 0;
|
|
|
|
break;
|
|
|
|
} else if (y >= 38) {
|
|
|
|
buttonIndex = 0;
|
|
|
|
break;
|
|
|
|
} else if (x < 328) {
|
|
|
|
buttonIndex = 0;
|
|
|
|
break;
|
|
|
|
} else if (x < 351) {
|
2017-01-17 13:51:02 +01:00
|
|
|
if (news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_SUBJECT) {
|
2014-05-04 15:10:32 +02:00
|
|
|
buttonIndex = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else if (x < 376) {
|
2017-01-17 13:51:02 +01:00
|
|
|
if (news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_LOCATION) {
|
2014-05-04 15:10:32 +02:00
|
|
|
buttonIndex = 2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
y -= 42;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (buttonIndex != 0) {
|
2014-08-22 21:17:48 +02:00
|
|
|
w->news.var_480 = i - 11;
|
2014-08-22 19:54:28 +02:00
|
|
|
w->news.var_482 = buttonIndex;
|
|
|
|
w->news.var_484 = 4;
|
2014-05-04 15:10:32 +02:00
|
|
|
window_invalidate(w);
|
2017-03-29 19:44:19 +02:00
|
|
|
audio_play_sound(SOUND_CLICK_1, 0, w->x + (w->width / 2));
|
2014-05-04 15:10:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-10-20 20:16:30 +02:00
|
|
|
*
|
2014-05-04 15:10:32 +02:00
|
|
|
* rct2: 0x0066EAAE
|
|
|
|
*/
|
2017-05-01 15:41:45 +02:00
|
|
|
static void window_news_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId)
|
2014-05-04 15:10:32 +02:00
|
|
|
{
|
2016-07-27 00:29:25 +02:00
|
|
|
set_format_arg(0, rct_string_id, STR_LIST);
|
2014-05-04 15:10:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-10-20 20:16:30 +02:00
|
|
|
*
|
2014-05-04 15:10:32 +02:00
|
|
|
* rct2: 0x0066E4E8
|
|
|
|
*/
|
2015-07-10 02:39:16 +02:00
|
|
|
static void window_news_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
2014-05-04 15:10:32 +02:00
|
|
|
{
|
|
|
|
window_draw_widgets(w, dpi);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-10-20 20:16:30 +02:00
|
|
|
*
|
2014-05-04 15:10:32 +02:00
|
|
|
* rct2: 0x0066E4EE
|
|
|
|
*/
|
2017-01-04 22:17:08 +01:00
|
|
|
static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
2014-05-04 15:10:32 +02:00
|
|
|
{
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 i, x, y, yy, press;
|
2014-05-04 15:10:32 +02:00
|
|
|
|
|
|
|
y = 0;
|
|
|
|
for (i = 11; i < 61; i++) {
|
2017-01-17 13:51:02 +01:00
|
|
|
NewsItem * const newsItem = news_item_get(i);
|
2015-07-24 23:40:04 +02:00
|
|
|
if (news_item_is_empty(i))
|
2014-05-04 15:10:32 +02:00
|
|
|
break;
|
|
|
|
if (y >= dpi->y + dpi->height)
|
|
|
|
break;
|
|
|
|
if (y + 42 < dpi->y) {
|
|
|
|
y += 42;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Background
|
2016-11-10 18:54:33 +01:00
|
|
|
gfx_fill_rect_inset(dpi, -1, y, 383, y + 41, w->colours[1], (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_GREY));
|
2014-05-04 15:10:32 +02:00
|
|
|
|
|
|
|
// Date text
|
2017-01-17 13:51:02 +01:00
|
|
|
set_format_arg(0, rct_string_id, DateDayNames[newsItem->Day - 1]);
|
|
|
|
set_format_arg(2, rct_string_id, DateGameMonthNames[(newsItem->MonthYear % 8)]);
|
2016-11-13 23:29:03 +01:00
|
|
|
gfx_draw_string_left(dpi, STR_NEWS_DATE_FORMAT, gCommonFormatArgs, COLOUR_WHITE, 4, y);
|
2014-05-04 15:10:32 +02:00
|
|
|
|
|
|
|
// Item text
|
2017-01-17 18:19:03 +01:00
|
|
|
utf8 *text = newsItem->Text;
|
|
|
|
gfx_draw_string_left_wrapped(dpi, &text, 2, y + 10, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, COLOUR_BRIGHT_GREEN);
|
2014-05-04 15:10:32 +02:00
|
|
|
|
|
|
|
// Subject button
|
2017-01-17 18:23:03 +01:00
|
|
|
if ((news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_SUBJECT) && !(newsItem->Flags & NEWS_FLAG_HAS_BUTTON)) {
|
2014-05-04 15:10:32 +02:00
|
|
|
x = 328;
|
|
|
|
yy = y + 14;
|
|
|
|
|
|
|
|
press = 0;
|
2014-08-22 21:17:48 +02:00
|
|
|
if (w->news.var_480 != -1) {
|
2015-07-24 23:40:04 +02:00
|
|
|
const uint8 idx = 11 + w->news.var_480;
|
|
|
|
news_item_is_valid_idx(idx);
|
|
|
|
if (i == idx && w->news.var_482 == 1)
|
2016-11-10 18:54:33 +01:00
|
|
|
press = INSET_RECT_FLAG_BORDER_INSET;
|
2014-05-04 15:10:32 +02:00
|
|
|
}
|
|
|
|
gfx_fill_rect_inset(dpi, x, yy, x + 23, yy + 23, w->colours[2], press);
|
|
|
|
|
2017-01-17 13:51:02 +01:00
|
|
|
switch (newsItem->Type) {
|
2014-05-04 15:10:32 +02:00
|
|
|
case NEWS_ITEM_RIDE:
|
2014-08-08 20:16:57 +02:00
|
|
|
gfx_draw_sprite(dpi, SPR_RIDE, x, yy, 0);
|
2014-05-04 15:10:32 +02:00
|
|
|
break;
|
|
|
|
case NEWS_ITEM_PEEP:
|
2015-02-17 21:39:35 +01:00
|
|
|
case NEWS_ITEM_PEEP_ON_RIDE:
|
|
|
|
{
|
2016-01-14 21:09:56 +01:00
|
|
|
rct_drawpixelinfo cliped_dpi;
|
|
|
|
if (!clip_drawpixelinfo(&cliped_dpi, dpi, x + 1, yy + 1, 22, 22)) {
|
|
|
|
break;
|
|
|
|
}
|
2015-02-17 21:39:35 +01:00
|
|
|
|
2017-01-17 13:51:02 +01:00
|
|
|
rct_peep* peep = GET_PEEP(newsItem->Assoc);
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 clip_x = 10, clip_y = 19;
|
2015-02-17 21:39:35 +01:00
|
|
|
|
|
|
|
// If normal peep set sprite to normal (no food)
|
|
|
|
// If staff set sprite to staff sprite
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 sprite_type = 0;
|
2015-02-17 21:39:35 +01:00
|
|
|
if (peep->type == PEEP_TYPE_STAFF){
|
|
|
|
sprite_type = peep->sprite_type;
|
|
|
|
if (peep->staff_type == STAFF_TYPE_ENTERTAINER){
|
|
|
|
clip_y += 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-08 19:29:07 +01:00
|
|
|
uint32 image_id = g_peep_animation_entries[sprite_type].sprite_animation->base_image;
|
2015-02-17 21:39:35 +01:00
|
|
|
image_id += 0xA0000001;
|
|
|
|
image_id |= (peep->tshirt_colour << 19) | (peep->trousers_colour << 24);
|
|
|
|
|
2016-01-14 21:09:56 +01:00
|
|
|
gfx_draw_sprite(&cliped_dpi, image_id, clip_x, clip_y, 0);
|
2015-10-20 20:16:30 +02:00
|
|
|
break;
|
2015-02-17 21:39:35 +01:00
|
|
|
}
|
2014-05-04 15:10:32 +02:00
|
|
|
case NEWS_ITEM_MONEY:
|
2014-08-08 20:16:57 +02:00
|
|
|
gfx_draw_sprite(dpi, SPR_FINANCE, x, yy, 0);
|
2014-05-04 15:10:32 +02:00
|
|
|
break;
|
2014-05-08 17:53:57 +02:00
|
|
|
case NEWS_ITEM_RESEARCH:
|
2017-01-17 13:51:02 +01:00
|
|
|
gfx_draw_sprite(dpi, newsItem->Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE, x, yy, 0);
|
2014-05-04 15:10:32 +02:00
|
|
|
break;
|
|
|
|
case NEWS_ITEM_PEEPS:
|
2014-08-08 20:16:57 +02:00
|
|
|
gfx_draw_sprite(dpi, SPR_GUESTS, x, yy, 0);
|
2014-05-04 15:10:32 +02:00
|
|
|
break;
|
|
|
|
case NEWS_ITEM_AWARD:
|
2014-08-08 20:16:57 +02:00
|
|
|
gfx_draw_sprite(dpi, SPR_AWARD, x, yy, 0);
|
2014-05-04 15:10:32 +02:00
|
|
|
break;
|
|
|
|
case NEWS_ITEM_GRAPH:
|
2014-08-08 20:16:57 +02:00
|
|
|
gfx_draw_sprite(dpi, SPR_GRAPH, x, yy, 0);
|
2014-05-04 15:10:32 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Location button
|
2017-01-17 18:23:03 +01:00
|
|
|
if ((news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_LOCATION) && !(newsItem->Flags & NEWS_FLAG_HAS_BUTTON)) {
|
2014-05-04 15:10:32 +02:00
|
|
|
x = 352;
|
|
|
|
yy = y + 14;
|
|
|
|
|
|
|
|
press = 0;
|
2014-08-22 21:17:48 +02:00
|
|
|
if (w->news.var_480 != -1) {
|
2015-07-24 23:40:04 +02:00
|
|
|
const uint8 idx = 11 + w->news.var_480;
|
|
|
|
news_item_is_valid_idx(idx);
|
|
|
|
if (i == idx && w->news.var_482 == 2)
|
2014-05-04 15:10:32 +02:00
|
|
|
press = 0x20;
|
|
|
|
}
|
|
|
|
gfx_fill_rect_inset(dpi, x, yy, x + 23, yy + 23, w->colours[2], press);
|
2014-08-08 20:16:57 +02:00
|
|
|
gfx_draw_sprite(dpi, SPR_LOCATE, x, yy, 0);
|
2014-05-04 15:10:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
y += 42;
|
|
|
|
}
|
2015-07-24 23:40:04 +02:00
|
|
|
}
|