diff --git a/src/interface/window.h b/src/interface/window.h index 7c8c3c07fa..a8f5320061 100644 --- a/src/interface/window.h +++ b/src/interface/window.h @@ -515,6 +515,7 @@ void window_land_open(); void window_water_open(); void window_staff_list_open(); void window_guest_list_open(); +void window_guest_list_open_with_filter(int type, int index); void window_map_open(); void window_options_open(); void window_shortcut_keys_open(); diff --git a/src/management/news_item.c b/src/management/news_item.c index 093d657ea1..f62b67c31e 100644 --- a/src/management/news_item.c +++ b/src/management/news_item.c @@ -333,7 +333,7 @@ void news_item_open_subject(int type, int subject) break; case NEWS_ITEM_PEEPS: // Open guest list to right tab - RCT2_CALLPROC_X(0x006993BA, 3, subject, 0, 0, 0, 0, 0); + window_guest_list_open_with_filter(3, subject);; break; case NEWS_ITEM_AWARD: window_park_awards_open(); diff --git a/src/windows/guest_list.c b/src/windows/guest_list.c index 7e4229bea5..856a8d59c4 100644 --- a/src/windows/guest_list.c +++ b/src/windows/guest_list.c @@ -115,13 +115,13 @@ static void* window_guest_list_events[] = { window_guest_list_scrollpaint }; -static int _window_guest_list_highlighted_index; -static int _window_guest_list_selected_tab; -static int _window_guest_list_selected_filter; -static int _window_guest_list_selected_page; -static int _window_guest_list_selected_view; -static int _window_guest_list_num_pages; -static int _window_guest_list_num_groups; +static int _window_guest_list_highlighted_index; // 0x00F1EE10 +static int _window_guest_list_selected_tab; // 0x00F1EE12 +static int _window_guest_list_selected_filter; // 0x00F1EE06 +static int _window_guest_list_selected_page; // 0x00F1EE07 +static int _window_guest_list_selected_view; // 0x00F1EE13 +static int _window_guest_list_num_pages; // 0x00F1EE08 +static int _window_guest_list_num_groups; // 0x00F1AF22 static uint16 _window_guest_list_groups_num_guests[240]; static uint32 _window_guest_list_groups_argument_1[240]; @@ -178,6 +178,93 @@ void window_guest_list_open() window->colours[2] = 15; } +/** +* type == 0 -> guests on ride +* type == 1 -> guests in queue +* type == 2 -> guests thinking about ride +* type == 3 -> guests thinking X, opened from news item +* index is number of the ride or index of the thought +* values of eax and edx probably determine the filter name string +* +* rct2: 0x006993BA +*/ +void window_guest_list_open_with_filter(int type, int index) +{ + //RCT2_CALLPROC_X(0x006993BA, type, ebx, 0, 0, 0, 0, 0); + + uint32 eax, edx; + + window_guest_list_open(); + + _window_guest_list_selected_page = 0; + _window_guest_list_num_pages = 1; + + RCT2_GLOBAL(0x009AC7E0, uint8) = 0; + RCT2_GLOBAL(0x009AC7F0, uint8) = 0; + + rct_ride *ride; + if (type != 3) { // common for cases 0, 1, 2 + ride = GET_RIDE(index & 0x000000FF); + eax = ride->name; + edx = ride->name_arguments; + } + + switch(type) + { + case 0: + _window_guest_list_selected_filter = 0; + + eax = (eax << 16) + 1435; + + if ((RCT2_GLOBAL(0x97CF40 + ride->type * 8, uint32) & 0x400000) != 0) + eax++; + + RCT2_GLOBAL(0x00F1EDF6, uint32) = eax; + RCT2_GLOBAL(0x00F1EDFA, uint32) = edx; + + _window_guest_list_highlighted_index = 0xFFFF; + _window_guest_list_selected_tab = 0; + _window_guest_list_selected_view = 0; + break; + case 1: + _window_guest_list_selected_filter = 0; + + eax = (eax << 16) + 1433; + + RCT2_GLOBAL(0x00F1EDF6, uint32) = eax; + RCT2_GLOBAL(0x00F1EDFA, uint32) = edx; + + _window_guest_list_highlighted_index = 0xFFFF; + _window_guest_list_selected_tab = 0; + _window_guest_list_selected_view = 0; + break; + case 2: + _window_guest_list_selected_filter = 1; + + eax = (eax << 16) + 0xFFFF; + + RCT2_GLOBAL(0x00F1EDF6, uint32) = eax; + RCT2_GLOBAL(0x00F1EDFA, uint32) = edx; + + _window_guest_list_highlighted_index = 0xFFFF; + _window_guest_list_selected_tab = 0; + _window_guest_list_selected_view = 1; + break; + case 3: + _window_guest_list_selected_filter = 1; + + index = (index & 0x000000FF) + 1480; + + RCT2_GLOBAL(0x00F1EDF6, uint32) = index; + RCT2_GLOBAL(0x00F1EDFA, uint32) = 0; + + _window_guest_list_highlighted_index = 0xFFFF; + _window_guest_list_selected_tab = 0; + _window_guest_list_selected_view = 1; + break; + } +} + /** * * rct2: 0x00699AAF @@ -719,7 +806,7 @@ static int window_guest_list_is_peep_in_filter(rct_peep* peep) _window_guest_list_selected_view = temp; - if (((RCT2_GLOBAL(0x00F1EDF6, uint32) >> 16) & 0xFFFF) == 0xFFFF && _window_guest_list_selected_filter == 1) + if (RCT2_GLOBAL(0x00F1EDF6, uint16) == 0xFFFF && _window_guest_list_selected_filter == 1) argument1 |= 0xFFFF; if (argument1 == RCT2_GLOBAL(0x00F1EDF6, uint32) && argument2 == RCT2_GLOBAL(0x00F1EDFA, uint32)) diff --git a/src/windows/ride.c b/src/windows/ride.c index b56c721930..26ab94276b 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -5649,13 +5649,13 @@ static void window_ride_customer_mouseup() window_ride_set_page(w, widgetIndex - WIDX_TAB_1); break; case WIDX_SHOW_GUESTS_THOUGHTS: - RCT2_CALLPROC_X(0x006993BA, 2, w->number, 0, 0, 0, 0, 0); + window_guest_list_open_with_filter(2, w->number); break; case WIDX_SHOW_GUESTS_ON_RIDE: - RCT2_CALLPROC_X(0x006993BA, 0, w->number, 0, 0, 0, 0, 0); + window_guest_list_open_with_filter(0, w->number); break; case WIDX_SHOW_GUESTS_QUEUING: - RCT2_CALLPROC_X(0x006993BA, 1, w->number, 0, 0, 0, 0, 0); + window_guest_list_open_with_filter(1, w->number); break; } }