Integrate and clean up rest of guest list window vars

This commit is contained in:
Ted John 2016-08-06 01:52:03 +01:00
parent c2db79919d
commit 1abc4a1915
3 changed files with 45 additions and 38 deletions

View File

@ -379,10 +379,6 @@
#define RCT2_ADDRESS_HINSTANCE 0x01423A08
#define RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_FILTER 0x00F1EE06
#define RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_TAB 0x00F1EE12
#define RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_VIEW 0x00F1EE13
#define RCT2_ADDRESS_WINDOW_RIDE_LIST_INFORMATION_TYPE 0x00F43833
#define RCT2_ADDRESS_WINDOW_RIDE_LIST_SELECTED_TAB 0x00F43824
#define RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM 0x00F43825
@ -544,6 +540,10 @@
#define RCT2_ADDRESS_PEEP_PATHFINDING_SINGLE_CHOICE_SECTION 0x00F1AEDE
#define RCT2_ADDRESS_PEEP_PATHFINDING_IS_STAFF 0x00F1AEDD
#define RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_FILTER 0x00F1EE06
#define RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_TAB 0x00F1EE12
#define RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_VIEW 0x00F1EE13
#define RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS 0x00F3EF92
#define RCT2_ADDRESS_PROVISIONAL_PATH_X 0x00F3EF94
#define RCT2_ADDRESS_PROVISIONAL_PATH_Y 0x00F3EF96

View File

@ -1875,32 +1875,6 @@ void tool_cancel()
}
}
/**
*
* rct2: 0x0068F083
*/
void window_guest_list_init_vars_a()
{
gNextGuestNumber = 1;
RCT2_GLOBAL(0x00F1AF1C, uint32) = 0xFFFFFFFF;
RCT2_GLOBAL(0x00F1EE02, uint32) = 0xFFFFFFFF;
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_FILTER, uint8) = 0xFF;
}
/**
*
* rct2: 0x0068F050
*/
void window_guest_list_init_vars_b()
{
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_TAB, uint8) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_VIEW, uint8) = 0;
RCT2_GLOBAL(0x00F1AF1C, uint32) = 0xFFFFFFFF;
RCT2_GLOBAL(0x00F1EE02, uint32) = 0xFFFFFFFF;
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_FILTER, uint8) = 0xFF;
RCT2_GLOBAL(0x00F1AF20, uint16) = 0;
}
void window_event_close_call(rct_window *w)
{
if (w->event_handlers->close != NULL)

View File

@ -134,6 +134,10 @@ static rct_window_event_list window_guest_list_events = {
window_guest_list_scrollpaint
};
static uint32 _window_guest_list_last_find_groups_tick;
static uint32 _window_guest_list_last_find_groups_selected_view;
static uint32 _window_guest_list_last_find_groups_wait;
static int _window_guest_list_highlighted_index; // 0x00F1EE10
static int _window_guest_list_selected_tab; // 0x00F1EE12
static int _window_guest_list_selected_filter; // 0x00F1EE06
@ -153,6 +157,30 @@ static void window_guest_list_find_groups();
static void get_arguments_from_peep(rct_peep *peep, uint32 *argument_1, uint32* argument_2);
/**
*
* rct2: 0x0068F083
*/
void window_guest_list_init_vars_a()
{
gNextGuestNumber = 1;
_window_guest_list_last_find_groups_tick = 0xFFFFFFFF;
_window_guest_list_selected_filter = 0xFF;
}
/**
*
* rct2: 0x0068F050
*/
void window_guest_list_init_vars_b()
{
_window_guest_list_selected_tab = 0;
_window_guest_list_selected_view = 0;
_window_guest_list_last_find_groups_tick = 0xFFFFFFFF;
_window_guest_list_selected_filter = 0xFF;
_window_guest_list_last_find_groups_wait = 0;
}
/**
*
* rct2: 0x006992E3
@ -421,8 +449,9 @@ static void window_guest_list_dropdown(rct_window *w, int widgetIndex, int dropd
*/
static void window_guest_list_update(rct_window *w)
{
if (RCT2_GLOBAL(0x00F1AF20, uint16) != 0)
RCT2_GLOBAL(0x00F1AF20, uint16)--;
if (_window_guest_list_last_find_groups_wait != 0) {
_window_guest_list_last_find_groups_wait--;
}
w->list_information_type++;
if (w->list_information_type >= (_window_guest_list_selected_tab == PAGE_INDIVIDUAL ? 24 : 32))
w->list_information_type = 0;
@ -860,14 +889,18 @@ static void window_guest_list_find_groups()
int spriteIndex, spriteIndex2, groupIndex, faceIndex;
rct_peep *peep, *peep2;
int eax = gScenarioTicks & 0xFFFFFF00;
if (_window_guest_list_selected_view == RCT2_GLOBAL(0x00F1EE02, uint32))
if (RCT2_GLOBAL(0x00F1AF20, uint16) != 0 || eax == RCT2_GLOBAL(0x00F1AF1C, uint32))
int tick256 = floor2(gScenarioTicks, 256);
if (_window_guest_list_selected_view == _window_guest_list_last_find_groups_selected_view) {
if (_window_guest_list_last_find_groups_wait != 0 ||
_window_guest_list_last_find_groups_tick == tick256
) {
return;
}
}
RCT2_GLOBAL(0x00F1AF1C, uint32) = eax;
RCT2_GLOBAL(0x00F1EE02, uint32) = _window_guest_list_selected_view;
RCT2_GLOBAL(0x00F1AF20, uint16) = 320;
_window_guest_list_last_find_groups_tick = tick256;
_window_guest_list_last_find_groups_selected_view = _window_guest_list_selected_view;
_window_guest_list_last_find_groups_wait = 320;
_window_guest_list_num_groups = 0;
// Set all guests to unassigned