forked from rosebudai/OpenRCT2-Web
Rename window flags
This commit is contained in:
1 parent
75c964d68c
commit
ae82ffcd96
18 files changed
+26
-26
No files matched your search
+3
-3
@@ -434,7 +434,7 @@ static void input_viewport_drag_continue()
|
||||
platform_show_cursor();
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_STATE, uint8) = INPUT_STATE_RESET;
|
||||
} else if (dx != 0 || dy != 0) {
|
||||
if (!(w->flags & (1 << 2))) {
|
||||
if (!(w->flags & WF_NO_SCROLLING)) {
|
||||
RCT2_GLOBAL(0x009DE540, sint16) = 1000;
|
||||
dx <<= viewport->zoom + 1;
|
||||
dy <<= viewport->zoom + 1;
|
||||
@@ -1543,7 +1543,7 @@ void game_handle_edge_scroll()
|
||||
mainWindow = window_get_main();
|
||||
if (mainWindow == NULL)
|
||||
return;
|
||||
if ((mainWindow->flags & WF_2) || (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 9))
|
||||
if ((mainWindow->flags & WF_NO_SCROLLING) || (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 9))
|
||||
return;
|
||||
if (mainWindow->viewport == NULL)
|
||||
return;
|
||||
@@ -1586,7 +1586,7 @@ void game_handle_key_scroll()
|
||||
mainWindow = window_get_main();
|
||||
if (mainWindow == NULL)
|
||||
return;
|
||||
if ((mainWindow->flags & WF_2) || (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 9))
|
||||
if ((mainWindow->flags & WF_NO_SCROLLING) || (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 9))
|
||||
return;
|
||||
if (mainWindow->viewport == NULL)
|
||||
return;
|
||||
|
||||
@@ -361,7 +361,7 @@ rct_window *window_create(int x, int y, int width, int height, rct_window_event_
|
||||
if (RCT2_NEW_WINDOW >= &(g_window_list[MAX_NUMBER_WINDOWS])) {
|
||||
// Close least recently used window
|
||||
for (w = g_window_list; w < RCT2_NEW_WINDOW; w++)
|
||||
if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_9)))
|
||||
if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE)))
|
||||
break;
|
||||
|
||||
window_close(w);
|
||||
@@ -820,7 +820,7 @@ rct_window *window_find_from_point(int x, int y)
|
||||
if (x < w->x || x >= w->x + w->width || y < w->y || y >= w->y + w->height)
|
||||
continue;
|
||||
|
||||
if (w->flags & WF_5) {
|
||||
if (w->flags & WF_NO_BACKGROUND) {
|
||||
widget_index = window_find_widget_from_point(w, x, y);
|
||||
if (widget_index == -1)
|
||||
continue;
|
||||
@@ -1335,7 +1335,7 @@ void window_scroll_to_location(rct_window *w, int x, int y, int z)
|
||||
}
|
||||
// rct2: 0x006E7C76
|
||||
if (w->viewport_target_sprite == -1) {
|
||||
if (!(w->flags & WF_2)) {
|
||||
if (!(w->flags & WF_NO_SCROLLING)) {
|
||||
w->saved_view_x = map_coordinate.x - (sint16)(w->viewport->view_width * window_scroll_locations[i][0]);
|
||||
w->saved_view_y = map_coordinate.y - (sint16)(w->viewport->view_height * window_scroll_locations[i][1]);
|
||||
w->flags |= WF_SCROLLING_TO_LOCATION;
|
||||
@@ -1613,7 +1613,7 @@ void window_draw_widgets(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
rct_widget *widget;
|
||||
int widgetIndex;
|
||||
|
||||
if ((w->flags & WF_TRANSPARENT) && !(w->flags & WF_5))
|
||||
if ((w->flags & WF_TRANSPARENT) && !(w->flags & WF_NO_BACKGROUND))
|
||||
gfx_fill_rect(dpi, w->x, w->y, w->x + w->width - 1, w->y + w->height - 1, 0x2000000 | 51);
|
||||
|
||||
//todo: some code missing here? Between 006EB18C and 006EB260
|
||||
|
||||
@@ -329,13 +329,13 @@ typedef enum {
|
||||
|
||||
WF_STICK_TO_BACK = (1 << 0),
|
||||
WF_STICK_TO_FRONT = (1 << 1),
|
||||
WF_2 = (1 << 2),
|
||||
WF_NO_SCROLLING = (1 << 2), // User is unable to scroll this viewport
|
||||
WF_SCROLLING_TO_LOCATION = (1 << 3),
|
||||
WF_TRANSPARENT = (1 << 4),
|
||||
WF_5 = (1 << 5),
|
||||
WF_NO_BACKGROUND = (1 << 5), // Instead of half transparency, completely remove the window background
|
||||
WF_7 = (1 << 7),
|
||||
WF_RESIZABLE = (1 << 8),
|
||||
WF_9 = (1 << 9),
|
||||
WF_NO_AUTO_CLOSE = (1 << 9), // Don't auto close this window if too many windows are open
|
||||
WF_10 = (1 << 10),
|
||||
WF_WHITE_BORDER_ONE = (1 << 12),
|
||||
WF_WHITE_BORDER_MASK = (1 << 12) | (1 << 13),
|
||||
|
||||
@@ -117,7 +117,7 @@ void window_banner_open(rct_windownumber number)
|
||||
if (w != NULL)
|
||||
return;
|
||||
|
||||
w = window_create_auto_pos(WW, WH, &window_banner_events, WC_BANNER, WF_2);
|
||||
w = window_create_auto_pos(WW, WH, &window_banner_events, WC_BANNER, WF_NO_SCROLLING);
|
||||
w->widgets = window_banner_widgets;
|
||||
w->enabled_widgets =
|
||||
(1 << WIDX_CLOSE) |
|
||||
|
||||
@@ -130,7 +130,7 @@ void window_editor_bottom_toolbar_open()
|
||||
window = window_create(0, RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, uint16) - 32,
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16), 32,
|
||||
&window_editor_bottom_toolbar_events,
|
||||
WC_BOTTOM_TOOLBAR, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_5);
|
||||
WC_BOTTOM_TOOLBAR, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND);
|
||||
window->widgets = window_editor_bottom_toolbar_widgets;
|
||||
|
||||
window->enabled_widgets |=
|
||||
|
||||
@@ -532,7 +532,7 @@ void window_editor_inventions_list_open()
|
||||
400,
|
||||
&window_editor_inventions_list_events,
|
||||
WC_EDITOR_INVENTION_LIST,
|
||||
WF_2
|
||||
WF_NO_SCROLLING
|
||||
);
|
||||
w->widgets = window_editor_inventions_list_widgets;
|
||||
w->enabled_widgets =
|
||||
|
||||
@@ -343,7 +343,7 @@ void window_editor_scenario_options_open()
|
||||
148,
|
||||
window_editor_scenario_options_page_events[0],
|
||||
WC_EDITOR_SCENARIO_OPTIONS,
|
||||
WF_2
|
||||
WF_NO_SCROLLING
|
||||
);
|
||||
w->widgets = window_editor_scenario_options_widgets[0];
|
||||
w->enabled_widgets = window_editor_scenario_options_page_enabled_widgets[0];
|
||||
|
||||
@@ -134,7 +134,7 @@ void window_game_bottom_toolbar_open()
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16), 32,
|
||||
&window_game_bottom_toolbar_events,
|
||||
WC_BOTTOM_TOOLBAR,
|
||||
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_5
|
||||
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND
|
||||
);
|
||||
window->widgets = window_game_bottom_toolbar_widgets;
|
||||
window->enabled_widgets |=
|
||||
|
||||
+1
-1
@@ -774,7 +774,7 @@ void window_guest_viewport_init(rct_window* w){
|
||||
int height = view_widget->bottom - view_widget->top - 1;
|
||||
|
||||
viewport_create(w, x, y, width, height, 0, focus.coordinate.x, focus.coordinate.y, focus.coordinate.z, focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK, focus.sprite.sprite_id);
|
||||
w->flags |= WF_2;
|
||||
w->flags |= WF_NO_SCROLLING;
|
||||
window_invalidate(w);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ static void window_map_tooltip_open()
|
||||
w = window_find_by_class(WC_MAP_TOOLTIP);
|
||||
if (w == NULL) {
|
||||
w = window_create(
|
||||
x, y, width, height, &window_map_tooltip_events, WC_MAP_TOOLTIP, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_5
|
||||
x, y, width, height, &window_map_tooltip_events, WC_MAP_TOOLTIP, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND
|
||||
);
|
||||
w->widgets = window_map_tooltip_widgets;
|
||||
} else {
|
||||
|
||||
@@ -143,7 +143,7 @@ static void window_maze_construction_construct(int direction);
|
||||
*/
|
||||
rct_window *window_maze_construction_open()
|
||||
{
|
||||
rct_window *w = window_create(0, 29, 166, 200, &window_maze_construction_events, WC_RIDE_CONSTRUCTION, WF_9);
|
||||
rct_window *w = window_create(0, 29, 166, 200, &window_maze_construction_events, WC_RIDE_CONSTRUCTION, WF_NO_AUTO_CLOSE);
|
||||
w->widgets = window_maze_construction_widgets;
|
||||
w->enabled_widgets = 0x6F0001C4;
|
||||
|
||||
|
||||
+1
-1
@@ -1581,7 +1581,7 @@ static void window_ride_init_viewport(rct_window *w)
|
||||
focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK,
|
||||
focus.sprite.sprite_id);
|
||||
|
||||
w->flags |= WF_2;
|
||||
w->flags |= WF_NO_SCROLLING;
|
||||
window_invalidate(w);
|
||||
}
|
||||
if (w->viewport){
|
||||
|
||||
@@ -511,7 +511,7 @@ rct_window *window_ride_construction_open()
|
||||
if (ride->type == RIDE_TYPE_MAZE)
|
||||
return window_maze_construction_open();
|
||||
|
||||
w = window_create(0, 29, 166, 394, &window_ride_construction_events, WC_RIDE_CONSTRUCTION, WF_9);
|
||||
w = window_create(0, 29, 166, 394, &window_ride_construction_events, WC_RIDE_CONSTRUCTION, WF_NO_AUTO_CLOSE);
|
||||
|
||||
w->widgets = window_ride_construction_widgets;
|
||||
w->enabled_widgets = 0x67EFFFFFC4;
|
||||
|
||||
@@ -428,7 +428,7 @@ void window_scenery_open()
|
||||
WINDOW_SCENERY_HEIGHT,
|
||||
&window_scenery_events,
|
||||
WC_SCENERY,
|
||||
WF_2
|
||||
WF_NO_SCROLLING
|
||||
);
|
||||
window->widgets = window_scenery_widgets;
|
||||
|
||||
|
||||
+2
-2
@@ -153,7 +153,7 @@ void window_sign_open(rct_windownumber number)
|
||||
if (w != NULL)
|
||||
return;
|
||||
|
||||
w = window_create_auto_pos(WW, WH, &window_sign_events, WC_BANNER, WF_2);
|
||||
w = window_create_auto_pos(WW, WH, &window_sign_events, WC_BANNER, WF_NO_SCROLLING);
|
||||
w->widgets = window_sign_widgets;
|
||||
w->enabled_widgets =
|
||||
(1 << WIDX_CLOSE) |
|
||||
@@ -492,7 +492,7 @@ void window_sign_small_open(rct_windownumber number){
|
||||
);
|
||||
|
||||
w->viewport->flags = (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES) ? VIEWPORT_FLAG_GRIDLINES : 0;
|
||||
w->flags |= WF_2;
|
||||
w->flags |= WF_NO_SCROLLING;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1228,7 +1228,7 @@ void window_staff_viewport_init(rct_window* w){
|
||||
int height = view_widget->bottom - view_widget->top - 1;
|
||||
|
||||
viewport_create(w, x, y, width, height, 0, 0, 0, 0, focus.type & VIEWPORT_FOCUS_TYPE_MASK, focus.sprite_id);
|
||||
w->flags |= WF_2;
|
||||
w->flags |= WF_NO_SCROLLING;
|
||||
window_invalidate(w);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ void window_title_menu_open()
|
||||
328, 100,
|
||||
&window_title_menu_events,
|
||||
WC_TITLE_MENU,
|
||||
WF_STICK_TO_BACK | WF_TRANSPARENT | WF_5
|
||||
WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_BACKGROUND
|
||||
);
|
||||
window->widgets = window_title_menu_widgets;
|
||||
window->enabled_widgets = (
|
||||
|
||||
@@ -269,7 +269,7 @@ void window_top_toolbar_open()
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16), 28,
|
||||
&window_top_toolbar_events,
|
||||
WC_TOP_TOOLBAR,
|
||||
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_5
|
||||
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND
|
||||
);
|
||||
window->widgets = window_top_toolbar_widgets;
|
||||
|
||||
|
||||
Reference in new issue
Block a user