mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 11:33:03 +01:00
Name news flags
This commit is contained in:
@@ -390,7 +390,7 @@ void news_item_disable_news(uint8 type, uint32 assoc)
|
||||
if (!news_item_is_empty(i)) {
|
||||
NewsItem * const newsItem = news_item_get(i);
|
||||
if (type == newsItem->Type && assoc == newsItem->Assoc) {
|
||||
newsItem->Flags |= 0x1;
|
||||
newsItem->Flags |= NEWS_FLAG_HAS_BUTTON;
|
||||
if (i == 0) {
|
||||
window_game_bottom_toolbar_invalidate_news_item();
|
||||
}
|
||||
@@ -404,7 +404,7 @@ void news_item_disable_news(uint8 type, uint32 assoc)
|
||||
if (!news_item_is_empty(i)) {
|
||||
NewsItem * const newsItem = news_item_get(i);
|
||||
if (type == newsItem->Type && assoc == newsItem->Assoc) {
|
||||
newsItem->Flags |= 0x1;
|
||||
newsItem->Flags |= NEWS_FLAG_HAS_BUTTON;
|
||||
window_invalidate_by_class(WC_RECENT_NEWS);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -37,6 +37,10 @@ enum {
|
||||
NEWS_TYPE_HAS_SUBJECT = 2,
|
||||
};
|
||||
|
||||
enum {
|
||||
NEWS_FLAG_HAS_BUTTON = 1 << 0,
|
||||
};
|
||||
|
||||
extern const uint8 news_type_properties[10];
|
||||
|
||||
/**
|
||||
|
||||
@@ -296,7 +296,7 @@ static void window_game_bottom_toolbar_invalidate(rct_window *w)
|
||||
window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WWT_EMPTY;
|
||||
}
|
||||
|
||||
if (newsItem->Flags & 1) {
|
||||
if (newsItem->Flags & NEWS_FLAG_HAS_BUTTON) {
|
||||
w->disabled_widgets |= (1 << WIDX_NEWS_SUBJECT);
|
||||
w->disabled_widgets |= (1 << WIDX_NEWS_LOCATE);
|
||||
}
|
||||
@@ -540,7 +540,7 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rc
|
||||
break;
|
||||
case NEWS_ITEM_PEEP_ON_RIDE:
|
||||
case NEWS_ITEM_PEEP:
|
||||
if (newsItem->Flags & 1)
|
||||
if (newsItem->Flags & NEWS_FLAG_HAS_BUTTON)
|
||||
break;
|
||||
|
||||
rct_drawpixelinfo cliped_dpi;
|
||||
|
||||
@@ -157,7 +157,7 @@ static void window_news_update(rct_window *w)
|
||||
|
||||
if (j == 0) {
|
||||
NewsItem * const newsItem = news_item_get(i);
|
||||
if (newsItem->Flags & 1)
|
||||
if (newsItem->Flags & NEWS_FLAG_HAS_BUTTON)
|
||||
return;
|
||||
if (w->news.var_482 == 1) {
|
||||
news_item_open_subject(newsItem->Type, newsItem->Assoc);
|
||||
@@ -207,7 +207,7 @@ static void window_news_scrollmousedown(rct_window *w, sint32 scrollIndex, sint3
|
||||
|
||||
if (y < 42) {
|
||||
NewsItem * const newsItem = news_item_get(i);
|
||||
if (newsItem->Flags & 1) {
|
||||
if (newsItem->Flags & NEWS_FLAG_HAS_BUTTON) {
|
||||
buttonIndex = 0;
|
||||
break;
|
||||
} else if (y < 14) {
|
||||
@@ -299,7 +299,7 @@ static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint3
|
||||
gfx_draw_string_left_wrapped(dpi, &text, 2, y + 10, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, COLOUR_BRIGHT_GREEN);
|
||||
|
||||
// Subject button
|
||||
if ((news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_SUBJECT) && !(newsItem->Flags & 1)) {
|
||||
if ((news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_SUBJECT) && !(newsItem->Flags & NEWS_FLAG_HAS_BUTTON)) {
|
||||
x = 328;
|
||||
yy = y + 14;
|
||||
|
||||
@@ -363,7 +363,7 @@ static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint3
|
||||
}
|
||||
|
||||
// Location button
|
||||
if ((news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_LOCATION) && !(newsItem->Flags & 1)) {
|
||||
if ((news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_LOCATION) && !(newsItem->Flags & NEWS_FLAG_HAS_BUTTON)) {
|
||||
x = 352;
|
||||
yy = y + 14;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user