mirror of https://github.com/OpenRCT2/OpenRCT2.git
Add functions to open park window to awards/rating
Also update replace some address that have constants/functions
This commit is contained in:
parent
d5927e415f
commit
a35289fc9f
|
@ -359,8 +359,10 @@ void window_clear_scenery_open();
|
|||
void window_land_open();
|
||||
void window_water_open();
|
||||
void window_guest_list_open();
|
||||
void window_park_awards_open();
|
||||
void window_park_entrance_open();
|
||||
void window_park_objective_open();
|
||||
void window_park_rating_open();
|
||||
void window_ride_list_open();
|
||||
void window_cheats_open();
|
||||
|
||||
|
|
|
@ -270,7 +270,7 @@ static void window_footpath_mouseup()
|
|||
break;
|
||||
|
||||
_window_footpath_cost = 0x80000000;
|
||||
RCT2_CALLPROC_EBPSAFE(0x006EE281);
|
||||
tool_cancel();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A7831);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068AB1B);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2;
|
||||
|
|
|
@ -166,7 +166,7 @@ static void window_game_bottom_toolbar_mouseup()
|
|||
RCT2_CALLPROC_EBPSAFE(0x00667D35);
|
||||
break;
|
||||
case WIDX_PARK_RATING:
|
||||
RCT2_CALLPROC_EBPSAFE(0x00667CA4);
|
||||
window_park_rating_open();
|
||||
break;
|
||||
case WIDX_MIDDLE_INSET:
|
||||
news_item_close_current();
|
||||
|
|
|
@ -646,7 +646,7 @@ static void window_park_entrance_close()
|
|||
|
||||
if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))
|
||||
if (w->classification == RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass) && w->number == RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWNUMBER, rct_windownumber))
|
||||
RCT2_CALLPROC_EBPSAFE(0x006EE281);
|
||||
tool_cancel();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1083,6 +1083,35 @@ static void window_park_scroll_to_viewport(rct_window *w)
|
|||
|
||||
#pragma region Rating page
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00667CA4
|
||||
*/
|
||||
void window_park_rating_open()
|
||||
{
|
||||
rct_window* window;
|
||||
|
||||
window = window_bring_to_front_by_id(WC_PARK_INFORMATION, 0);
|
||||
if (window == NULL) {
|
||||
window = window_park_open();
|
||||
window->var_482 = -1;
|
||||
window->var_484 = -1;
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))
|
||||
if (window->classification == RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass) && window->number == RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWNUMBER, rct_windownumber))
|
||||
tool_cancel();
|
||||
|
||||
window->viewport = NULL;
|
||||
window->page = WINDOW_PARK_PAGE_RATING;
|
||||
window_invalidate(window);
|
||||
window->widgets = window_park_rating_widgets;
|
||||
window->enabled_widgets = window_park_page_enabled_widgets[WINDOW_PARK_PAGE_RATING];
|
||||
window->var_020 = 0;
|
||||
window->event_handlers = window_park_rating_events;
|
||||
window_init_scroll_widgets(window);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00668A06
|
||||
|
@ -1570,7 +1599,7 @@ static void window_park_stats_paint()
|
|||
y = w->y + window_park_awards_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
|
||||
// Draw park size
|
||||
parkSize = RCT2_GLOBAL(0x013580EA, sint16) * 10;
|
||||
parkSize = RCT2_GLOBAL(RCT2_ADDRESS_PARK_SIZE, sint16) * 10;
|
||||
stringIndex = STR_PARK_SIZE_METRIC_LABEL;
|
||||
if (!RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, uint8)) {
|
||||
stringIndex = STR_PARK_SIZE_IMPERIAL_LABEL;
|
||||
|
@ -1619,7 +1648,7 @@ void window_park_objective_open()
|
|||
|
||||
if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))
|
||||
if (window->classification == RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass) && window->number == RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWNUMBER, rct_windownumber))
|
||||
RCT2_CALLPROC_EBPSAFE(0x006EE281);
|
||||
tool_cancel();
|
||||
|
||||
window->viewport = NULL;
|
||||
window->page = WINDOW_PARK_PAGE_OBJECTIVE;
|
||||
|
@ -1773,6 +1802,35 @@ static void window_park_objective_paint()
|
|||
|
||||
#pragma region Awards page
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00667DC6
|
||||
*/
|
||||
void window_park_awards_open()
|
||||
{
|
||||
rct_window* window;
|
||||
|
||||
window = window_bring_to_front_by_id(WC_PARK_INFORMATION, 0);
|
||||
if (window == NULL) {
|
||||
window = window_park_open();
|
||||
window->var_482 = -1;
|
||||
window->var_484 = -1;
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))
|
||||
if (window->classification == RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass) && window->number == RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWNUMBER, rct_windownumber))
|
||||
tool_cancel();
|
||||
|
||||
window->viewport = NULL;
|
||||
window->page = WINDOW_PARK_PAGE_AWARDS;
|
||||
window_invalidate(window);
|
||||
window->widgets = window_park_awards_widgets;
|
||||
window->enabled_widgets = window_park_page_enabled_widgets[WINDOW_PARK_PAGE_AWARDS];
|
||||
window->var_020 = 0;
|
||||
window->event_handlers = window_park_awards_events;
|
||||
window_init_scroll_widgets(window);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00669851
|
||||
|
@ -1896,7 +1954,7 @@ static void window_park_set_page(rct_window *w, int page)
|
|||
|
||||
if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))
|
||||
if (w->classification == RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass) && w->number == RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWNUMBER, rct_windownumber))
|
||||
RCT2_CALLPROC_EBPSAFE(0x006EE281);
|
||||
tool_cancel();
|
||||
|
||||
// Set listen only to viewport
|
||||
listen = 0;
|
||||
|
|
Loading…
Reference in New Issue