1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Add helper function for calling widget events

Add window_event_helper
This commit is contained in:
ZedThree
2014-05-09 18:27:59 +02:00
parent b2d1f0dfd6
commit bc413fede9
2 changed files with 11 additions and 0 deletions

View File

@@ -1245,3 +1245,12 @@ void window_guest_list_init_vars_b() {
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_GUEST_LIST_SELECTED_FILTER, uint8) = 0xFF;
RCT2_GLOBAL(0x00F1AF20, uint16) = 0;
}
/**
* Wrapper for window events so C functions can call them
*/
void window_event_helper(rct_window* w, short widgetIndex, WINDOW_EVENTS event) {
RCT2_CALLPROC_X(w->event_handlers[event], 0, 0, 0, widgetIndex, w, 0, 0);
}

View File

@@ -360,4 +360,6 @@ void window_ride_construction_init_vars();
void window_staff_init_vars();
void window_event_helper(rct_window* w, short widgetIndex, WINDOW_EVENTS event);
#endif