1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Name only flag for banner objects

This commit is contained in:
Ted John
2017-11-22 22:06:56 +00:00
parent ef65a5208b
commit 53493d0977
4 changed files with 24 additions and 19 deletions

View File

@@ -304,8 +304,10 @@ static void window_banner_invalidate(rct_window *w)
// Scenery item not sure why we use this instead of banner?
rct_scenery_entry* sceneryEntry = get_banner_entry(banner->type);
if (sceneryEntry->banner.flags & 1) colour_btn->type = WWT_COLOURBTN;
if (sceneryEntry->banner.flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR)
{
colour_btn->type = WWT_COLOURBTN;
}
w->pressed_widgets &= ~(1ULL<<WIDX_BANNER_NO_ENTRY);
w->disabled_widgets &= ~(

View File

@@ -965,9 +965,10 @@ void window_scenery_invalidate(rct_window *w)
if (tabSelectedSceneryId >= 0x400) {
sceneryEntry = get_banner_entry(tabSelectedSceneryId - 0x400);
if (sceneryEntry->banner.flags & 1)
if (sceneryEntry->banner.flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR)
{
window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WWT_COLOURBTN;
}
} else if (tabSelectedSceneryId >= 0x300) {
sceneryEntry = get_large_scenery_entry(tabSelectedSceneryId - 0x300);

View File

@@ -1011,21 +1011,18 @@ static void repaint_scenery_tool_down(sint16 x, sint16 y, rct_widgetindex widget
{
rct_banner* banner = &gBanners[tile_element->properties.banner.index];
rct_scenery_entry* scenery_entry = get_banner_entry(banner->type);
// If can't repaint
if (!(scenery_entry->banner.flags &
(1 << 0)))
return;
gGameCommandErrorTitle = STR_CANT_REPAINT_THIS;
game_do_command(
grid_x,
1,
grid_y,
tile_element->base_height | ((tile_element->properties.banner.position & 0x3) << 8),
GAME_COMMAND_SET_BANNER_COLOUR,
0,
gWindowSceneryPrimaryColour | (gWindowScenerySecondaryColour << 8));
if (scenery_entry->banner.flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR)
{
gGameCommandErrorTitle = STR_CANT_REPAINT_THIS;
game_do_command(
grid_x,
1,
grid_y,
tile_element->base_height | ((tile_element->properties.banner.position & 0x3) << 8),
GAME_COMMAND_SET_BANNER_COLOUR,
0,
gWindowSceneryPrimaryColour | (gWindowScenerySecondaryColour << 8));
}
break;
}
default:

View File

@@ -252,6 +252,11 @@ enum {
SCENERY_GHOST_FLAG_4 = (1 << SCENERY_TYPE_BANNER)
};
enum
{
BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR = (1 << 0),
};
#define SCENERY_ENTRIES_BY_TAB 256
#ifdef __cplusplus