From e222b88581b6a5cce62983dee19b4347e99cc19d Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sun, 17 Aug 2014 23:57:41 +0100 Subject: [PATCH] start work on new ride window --- src/window.h | 1 + src/window_game_top_toolbar.c | 17 ++------- src/window_new_ride.c | 68 +++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 15 deletions(-) diff --git a/src/window.h b/src/window.h index c8d90fc870..9629975068 100644 --- a/src/window.h +++ b/src/window.h @@ -375,6 +375,7 @@ void window_park_rating_open(); void window_finances_open(); void window_new_campaign_open(int campaignType); void window_ride_list_open(); +void window_new_ride_open(); void window_banner_open(); void window_cheats_open(); void window_research_open(); diff --git a/src/window_game_top_toolbar.c b/src/window_game_top_toolbar.c index bc7e406ee2..e5fe50057d 100644 --- a/src/window_game_top_toolbar.c +++ b/src/window_game_top_toolbar.c @@ -190,18 +190,7 @@ static void window_game_top_toolbar_mouseup() short widgetIndex; rct_window *w, *mainWindow; - #ifdef _MSC_VER - __asm mov widgetIndex, dx - #else - __asm__ ( "mov %[widgetIndex], dx " : [widgetIndex] "+m" (widgetIndex) ); - #endif - - #ifdef _MSC_VER - __asm mov w, esi - #else - __asm__ ( "mov %[w], esi " : [w] "+m" (w) ); - #endif - + window_mouse_up_get_registers(w, widgetIndex); switch (widgetIndex) { case WIDX_PAUSE: @@ -231,7 +220,6 @@ static void window_game_top_toolbar_mouseup() window_rotate_camera(mainWindow); break; case WIDX_MAP: - //RCT2_CALLPROC_EBPSAFE(0x0068C88A); window_map_open(); break; case WIDX_CLEAR_SCENERY: @@ -282,7 +270,7 @@ static void window_game_top_toolbar_mouseup() } break; case WIDX_CONSTRUCT_RIDE: - RCT2_CALLPROC_EBPSAFE(0x006B3CFF); + window_new_ride_open(); break; case WIDX_RIDES: window_ride_list_open(); @@ -292,7 +280,6 @@ static void window_game_top_toolbar_mouseup() break; case WIDX_STAFF: window_staff_open(); - //RCT2_CALLPROC_EBPSAFE(0x006BD3CC); break; case WIDX_GUESTS: window_guest_list_open(); diff --git a/src/window_new_ride.c b/src/window_new_ride.c index edbb45d96e..79137b0b29 100644 --- a/src/window_new_ride.c +++ b/src/window_new_ride.c @@ -33,6 +33,24 @@ enum { WINDOW_NEW_RIDE_TAB_RESEARCH } WINDOW_RIDE_CONSTRUCTION_TAB; +enum { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_PAGE_BACKGROUND, + WIDX_TAB_1, + WIDX_TAB_2, + WIDX_TAB_3, + WIDX_TAB_4, + WIDX_TAB_5, + WIDX_TAB_6, + WIDX_TAB_7, + + WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP, + WIDX_LAST_DEVELOPMENT_GROUP, + WIDX_LAST_DEVELOPMENT_BUTTON +}; + /** * * rct2: 0x006ACA58 @@ -55,4 +73,54 @@ void window_new_ride_init_vars() { } RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_RIDE_LIST_INFORMATION_TYPE, uint8) = 0; +} + +/** + * + * rct2: 0x006B3CFF + */ +void window_new_ride_open() +{ + rct_window *w; + + w = window_bring_to_front_by_id(WC_CONSTRUCT_RIDE, 0); + if (w != NULL) + return; + + // Not sure what these windows are + window_close_by_id(161, 0); + window_close_by_id(162, 0); + + w = window_create_auto_pos(601, 370, (uint32*)0x0098E354, WC_CONSTRUCT_RIDE, 0x400); + w->widgets = (rct_widget*)0x009AEBF4; + w->enabled_widgets = + (1 << WIDX_CLOSE) | + (1 << WIDX_TAB_1) | + (1 << WIDX_TAB_2) | + (1 << WIDX_TAB_3) | + (1 << WIDX_TAB_4) | + (1 << WIDX_TAB_5) | + (1 << WIDX_TAB_6) | + (1 << WIDX_TAB_7) | + (1 << 14) | + (1 << 15); + window_init_scroll_widgets(w); + + w->frame_no = 0; + w->colours[0] = 24; + w->colours[1] = 26; + w->colours[2] = 26; + w->var_480 = -1; + w->var_482 = -1; + RCT2_GLOBAL(0x00F43866, sint16) = -1; + + RCT2_CALLPROC_EBPSAFE(0x006B6F3E); + + w->var_482 = RCT2_ADDRESS(0x00F43825, sint16)[RCT2_GLOBAL(0x00F43824, uint8)]; + if (w->var_482 == -1) + w->var_482 = RCT2_GLOBAL(0x00F43523, sint16); + + w->width = 1; + RCT2_CALLPROC_EBPSAFE(0x006B3DF1); // initialise window size and widgets + RCT2_CALLPROC_EBPSAFE(0x006B7220); } \ No newline at end of file