/** * * rct2: 0x006A7E92 */ static void window_footpath_mouseup() { short widgetIndex; rct_window *w; window_widget_get_registers(w, widgetIndex); switch (widgetIndex) { case WIDX_CLOSE: window_close(w); break; case WIDX_CONSTRUCT: window_footpath_construct(); break; case WIDX_REMOVE: window_footpath_remove(); break; case WIDX_CONSTRUCT_ON_LAND: if (RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) == PATH_CONSTRUCTION_MODE_LAND) break; _window_footpath_cost = 0x80000000; tool_cancel(); RCT2_CALLPROC_EBPSAFE(0x006A7831); RCT2_CALLPROC_EBPSAFE(0x0068AB1B); RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2; RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) = PATH_CONSTRUCTION_MODE_LAND; tool_set(w, WIDX_CONSTRUCT_ON_LAND, 17); RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6); RCT2_GLOBAL(RCT2_ADDRESS_PATH_ERROR_OCCURED, uint8) = 0; RCT2_CALLPROC_EBPSAFE(0x006A855C); break; case WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL: if (RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) break; _window_footpath_cost = 0x80000000; tool_cancel(); RCT2_CALLPROC_EBPSAFE(0x006A7831); RCT2_CALLPROC_EBPSAFE(0x0068AB1B); RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2; RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL; tool_set(w, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, 12); RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6); RCT2_GLOBAL(RCT2_ADDRESS_PATH_ERROR_OCCURED, uint8) = 0; RCT2_CALLPROC_EBPSAFE(0x006A855C); break; } }
/** * * rct2: 0x006CD811 */ static void window_maze_construction_close(rct_window *w) { ride_construction_invalidate_current_track(); viewport_set_visibility(0); map_invalidate_map_selection_tiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; // In order to cancel the yellow arrow correctly the // selection tool should be cancelled. tool_cancel(); hide_gridlines(); uint8 rideIndex = _currentRideIndex; rct_ride* ride = get_ride(rideIndex); if (ride->overall_view.xy == RCT_XY8_UNDEFINED) { sint32 savedPausedState = gGamePaused; gGamePaused = 0; game_do_command(0, GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED, 0, rideIndex, GAME_COMMAND_DEMOLISH_RIDE, 0, 0); gGamePaused = savedPausedState; } else { window_ride_main_open(rideIndex); } }
/** * * rct2: 0x006ACC28 */ void window_ride_main_open(int rideIndex) { rct_window *w; w = window_bring_to_front_by_id(WC_RIDE, rideIndex); if (w == NULL) { w = window_ride_open(rideIndex); w->ride.var_482 = -1; } 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) ) { tool_cancel(); } } w->page = 0; w->width = 316; w->height = 180; window_invalidate(w); w->widgets = window_ride_page_widgets[0]; w->enabled_widgets = 0x007DBFF4; w->var_020 = 0; w->event_handlers = window_ride_page_events[0]; w->pressed_widgets = 0; RCT2_CALLPROC_X(0x006AEB9F, 0, 0, 0, 0, (int)w, 0, 0); window_init_scroll_widgets(w); w->ride.var_480 = 0; RCT2_CALLPROC_X(0x006AF994, 0, 0, 0, 0, (int)w, 0, 0); }
void *action_exec(const action_t *action, const arg_t *args) { void *ret = NULL; int i, nb_args; long vals[4]; // So that we do not add undo snapshot when an action calls an other one. static int reentry = 0; // XXX: not sure this is actually legal in C. func will be called with // a variable number or arguments, that might be of any registered types! void *(*func)() = action->func; bool is_void; assert(action); nb_args = action->sig.nb_args; assert(nb_args <= ARRAY_SIZE(vals)); is_void = action->sig.ret == TYPE_VOID; // For the moment all action cancel the current tool, for simplicity. tool_cancel(goxel(), goxel()->tool, goxel()->tool_state); if (reentry == 0 && !(action->flags & ACTION_NO_CHANGE)) { image_history_push(goxel()->image); } reentry++; for (i = 0; i < nb_args; i++) vals[i] = get_arg_value(action->sig.args[i], args); if (is_void && nb_args == 0) func(); else if (is_void && nb_args == 1) func(vals[0]); else if (is_void && nb_args == 2) func(vals[0], vals[1]); else if (is_void && nb_args == 3) func(vals[0], vals[1], vals[2]); else if (is_void && nb_args == 4) func(vals[0], vals[1], vals[2], vals[3]); else if (!is_void && nb_args == 0) ret = func(); else if (!is_void && nb_args == 1) ret = func(vals[0]); else if (!is_void && nb_args == 2) ret = func(vals[0], vals[1]); else if (!is_void && nb_args == 3) ret = func(vals[0], vals[1], vals[2]); else if (!is_void && nb_args == 4) ret = func(vals[0], vals[1], vals[2], vals[3]); else LOG_E("Cannot handle signature for action %s", action->id); reentry--; if (reentry == 0 && !(action->flags & ACTION_NO_CHANGE)) { goxel_update_meshes(goxel(), -1); } return ret; }
/** * * rct2: 0x0066C9EA */ static void window_game_top_toolbar_dropdown() { short widgetIndex, dropdownIndex; __asm mov widgetIndex, dx __asm mov dropdownIndex, ax if (widgetIndex == WIDX_FILE_MENU) { switch (dropdownIndex) { case 0: // load game game_do_command(0, 1, 0, 0, 5, 0, 0); break; case 1: // save game tool_cancel(); { int eax, ebx, ecx, edx, esi, edi, ebp; RCT2_CALLFUNC_X(0x006750E9, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp); if (eax == 0) { gfx_invalidate_screen(); break; } char *src = (char*)0x0141EF67; do { src++; } while (*src != '.' && *src != '\0'); strcpy(src, ".SV6"); strcpy(RCT2_ADDRESS_SAVED_GAMES_PATH_2, 0x0141EF68); eax = 0; if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & 8) eax |= 1; RCT2_CALLPROC_X(0x006754F5, eax, 0, 0, 0, 0, 0, 0); // check success? game_do_command(0, 1047, 0, -1, 0, 0, 0); gfx_invalidate_screen(); } break; case 3: // about window_about_open(); break; case 4: // options window_options_open(); //RCT2_CALLPROC_EBPSAFE(0x006BAC5B); break; case 5: // screenshot RCT2_GLOBAL(RCT2_ADDRESS_SCREENSHOT_COUNTDOWN, sint8) = 10; break; case 7: // quit game game_do_command(0, 1, 0, 0, 5, 1, 0); break; } } else if (widgetIndex == WIDX_VIEW_MENU) { RCT2_CALLPROC_X(0x0066CF8A, dropdownIndex, 0, 0, 0, 0, 0, 0); } }
static void shortcut_cancel_construction_mode() { rct_window *window; window = window_find_by_class(WC_ERROR); if (window != NULL) window_close(window); else if (RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) & INPUT_FLAG_TOOL_ACTIVE) tool_cancel(); }
static void shortcut_quick_save_game() { // Do a quick save in playing mode and a regular save in Scenario Editor mode. In other cases, don't do anything. if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) == SCREEN_FLAGS_PLAYING) { tool_cancel(); save_game(); } else if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) { rct_s6_info *s6Info = (rct_s6_info*)0x0141F570; window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE, s6Info->name); } }
/** * * rct2: 0x006C825F */ static void window_maze_construction_entrance_tooldown(sint32 x, sint32 y, rct_window* w){ ride_construction_invalidate_current_track(); map_invalidate_selection_rect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; sint32 direction = 0; ride_get_entrance_or_exit_position_from_screen_position(x, y, &x, &y, &direction); if (gRideEntranceExitPlaceDirection == 0xFF) return; uint8 rideIndex = gRideEntranceExitPlaceRideIndex; uint8 entranceExitType = gRideEntranceExitPlaceType; if (entranceExitType == ENTRANCE_TYPE_RIDE_ENTRANCE) { gGameCommandErrorTitle = STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION; } else { gGameCommandErrorTitle = STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION; } money32 cost = game_do_command( x, GAME_COMMAND_FLAG_APPLY | ((direction ^ 2) << 8), y, rideIndex | (entranceExitType << 8), GAME_COMMAND_PLACE_RIDE_ENTRANCE_OR_EXIT, gRideEntranceExitPlaceStationIndex, 0); if (cost == MONEY32_UNDEFINED) return; audio_play_sound_at_location( SOUND_PLACE_ITEM, gCommandPosition.x, gCommandPosition.y, gCommandPosition.z); rct_ride* ride = get_ride(rideIndex); if (ride_are_all_possible_entrances_and_exits_built(ride)){ tool_cancel(); if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK)) window_close(w); } else{ gRideEntranceExitPlaceType = entranceExitType ^ 1; window_invalidate_by_class(WC_RIDE_CONSTRUCTION); gCurrentToolWidget.widget_index = entranceExitType ? WIDX_MAZE_ENTRANCE : WIDX_MAZE_EXIT; } }
/** * * rct2: 0x006A7C43 */ void window_footpath_open() { rct_window* window; // Check if window is already open window = window_bring_to_front_by_id(WC_FOOTPATH, 0); if (window != NULL) return; window = window_create( 0, 29, 106, 381, (uint32*)window_footpath_events, WC_FOOTPATH, 0 ); window->widgets = window_footpath_widgets; window->enabled_widgets = (1 << WIDX_CLOSE) | (1 << WIDX_FOOTPATH_TYPE) | (1 << WIDX_QUEUELINE_TYPE) | (1 << WIDX_DIRECTION_NW) | (1 << WIDX_DIRECTION_NE) | (1 << WIDX_DIRECTION_SW) | (1 << WIDX_DIRECTION_SE) | (1 << WIDX_SLOPEDOWN) | (1 << WIDX_LEVEL) | (1 << WIDX_SLOPEUP) | (1 << WIDX_CONSTRUCT) | (1 << WIDX_REMOVE) | (1 << WIDX_CONSTRUCT_ON_LAND) | (1 << WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL); window_init_scroll_widgets(window); window_push_others_right(window); show_gridlines(); window->colours[0] = 24; window->colours[1] = 24; window->colours[2] = 24; tool_cancel(); RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) = PATH_CONSTRUCTION_MODE_LAND; tool_set(window, WIDX_CONSTRUCT_ON_LAND, 17); RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6); RCT2_GLOBAL(RCT2_ADDRESS_PATH_ERROR_OCCURED, uint8) = 0; RCT2_CALLPROC_EBPSAFE(0x006A855C); }
/** * * rct2: 0x006ED801 */ void process_mouse_tool(int x, int y) { if (gInputFlags & INPUT_FLAG_TOOL_ACTIVE) { rct_window* w = window_find_by_number( RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass), RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWNUMBER, rct_windownumber) ); if (!w) tool_cancel(); else window_event_tool_update_call(w, RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16), x, y); } }
/** * * rct2: 0x006ED801 */ void process_mouse_tool(sint32 x, sint32 y) { if (_inputFlags & INPUT_FLAG_TOOL_ACTIVE) { rct_window* w = window_find_by_number( gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number ); if (!w) tool_cancel(); else window_event_tool_update_call(w, gCurrentToolWidget.widget_index, x, y); } }
/** * * rct2: 0x006CD767 */ static void window_maze_construction_update(rct_window *w) { rct_ride *ride = get_ride(_currentRideIndex); if (ride == NULL || ride->status != RIDE_STATUS_CLOSED) { window_close(w); return; } switch (_rideConstructionState) { case RIDE_CONSTRUCTION_STATE_PLACE: if (!widget_is_active_tool(w, WIDX_MAZE_DIRECTION_GROUPBOX)) { window_close(w); return; } break; case RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT: if (!widget_is_active_tool(w, WIDX_MAZE_ENTRANCE) && !widget_is_active_tool(w, WIDX_MAZE_EXIT)) { _rideConstructionState = gRideEntranceExitPlacePreviousRideConstructionState; window_maze_construction_update_pressed_widgets(); } break; } switch (_rideConstructionState) { case RIDE_CONSTRUCTION_STATE_FRONT: case RIDE_CONSTRUCTION_STATE_BACK: case RIDE_CONSTRUCTION_STATE_SELECTED: if ( (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WC_RIDE_CONSTRUCTION ) { tool_cancel(); } break; } sub_6C94D8(); }
static void window_tile_inspector_close() { tool_cancel(); }
/** * * rct2: 0x006E6B65 */ static void window_water_close(rct_window *w) { // If the tool wasn't changed, turn tool off if (water_tool_is_active()) tool_cancel(); }
void handle_shortcut_command(int shortcutIndex) { rct_window *window; switch (shortcutIndex) { case SHORTCUT_CLOSE_TOP_MOST_WINDOW: window_close_top(); break; case SHORTCUT_CLOSE_ALL_FLOATING_WINDOWS: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2)) window_close_all(); else if (RCT2_GLOBAL(0x0141F570, uint8) == 1) window_close_top(); break; case SHORTCUT_CANCEL_CONSTRUCTION_MODE: window = window_find_by_id(WC_ERROR, 0); if (window != NULL) window_close(window); else if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3)) tool_cancel(); break; case SHORTCUT_PAUSE_GAME: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 10)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 0, WE_MOUSE_UP); } } break; case SHORTCUT_ZOOM_VIEW_OUT: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) || RCT2_GLOBAL(0x0141F570, uint8) == 1) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 8)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 2, WE_MOUSE_UP); } } } break; case SHORTCUT_ZOOM_VIEW_IN: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) || RCT2_GLOBAL(0x0141F570, uint8) == 1) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 8)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 3, WE_MOUSE_UP); } } } break; case SHORTCUT_ROTATE_VIEW: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) || RCT2_GLOBAL(0x0141F570, uint8) == 1) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 8)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 4, WE_MOUSE_UP); } } } break; case SHORTCUT_ROTATE_CONSTRUCTION_OBJECT: RCT2_CALLPROC_EBPSAFE(0x006E4182); break; case SHORTCUT_UNDERGROUND_VIEW_TOGGLE: RCT2_CALLPROC_X(0x0066CF8A, 0, 0, 0, 0, 0, 0, 0); break; case SHORTCUT_REMOVE_BASE_LAND_TOGGLE: RCT2_CALLPROC_X(0x0066CF8A, 1, 0, 0, 0, 0, 0, 0); break; case SHORTCUT_REMOVE_VERTICAL_LAND_TOGGLE: RCT2_CALLPROC_X(0x0066CF8A, 2, 0, 0, 0, 0, 0, 0); break; case SHORTCUT_SEE_THROUGH_RIDES_TOGGLE: RCT2_CALLPROC_X(0x0066CF8A, 4, 0, 0, 0, 0, 0, 0); break; case SHORTCUT_SEE_THROUGH_SCENERY_TOGGLE: RCT2_CALLPROC_X(0x0066CF8A, 5, 0, 0, 0, 0, 0, 0); break; case SHORTCUT_INVISIBLE_SUPPORTS_TOGGLE: RCT2_CALLPROC_X(0x0066CF8A, 6, 0, 0, 0, 0, 0, 0); break; case SHORTCUT_INVISIBLE_PEOPLE_TOGGLE: RCT2_CALLPROC_X(0x0066CF8A, 7, 0, 0, 0, 0, 0, 0); break; case SHORTCUT_HEIGHT_MARKS_ON_LAND_TOGGLE: RCT2_CALLPROC_X(0x0066CF8A, 9, 0, 0, 0, 0, 0, 0); break; case SHORTCUT_HEIGHT_MARKS_ON_RIDE_TRACKS_TOGGLE: RCT2_CALLPROC_X(0x0066CF8A, 10, 0, 0, 0, 0, 0, 0); break; case SHORTCUT_HEIGHT_MARKS_ON_PATHS_TOGGLE: RCT2_CALLPROC_X(0x0066CF8A, 11, 0, 0, 0, 0, 0, 0); break; case SHORTCUT_ADJUST_LAND: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) || RCT2_GLOBAL(0x0141F570, uint8) == 1) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0C)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 7, WE_MOUSE_UP); } } } break; case SHORTCUT_ADJUST_WATER: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) || RCT2_GLOBAL(0x0141F570, uint8) == 1) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0C)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 8, WE_MOUSE_UP); } } } break; case SHORTCUT_BUILD_SCENERY: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) || RCT2_GLOBAL(0x0141F570, uint8) == 1) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0C)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 9, WE_MOUSE_UP); } } } break; case SHORTCUT_BUILD_PATHS: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) || RCT2_GLOBAL(0x0141F570, uint8) == 1) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0C)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 10, WE_MOUSE_UP); } } } break; case SHORTCUT_BUILD_NEW_RIDE: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) || RCT2_GLOBAL(0x0141F570, uint8) == 1) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0C)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 11, WE_MOUSE_UP); } } } break; case SHORTCUT_SHOW_FINANCIAL_INFORMATION: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0C)) if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800)) RCT2_CALLPROC_EBPSAFE(0x0069DDF1); break; case SHORTCUT_SHOW_RESEARCH_INFORMATION: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0E)) { // Open new ride window RCT2_CALLPROC_EBPSAFE(0x006B3CFF); window = window_find_by_id(WC_CONSTRUCT_RIDE, 0); if (window != NULL) window_event_helper(window, 10, WE_MOUSE_DOWN); } break; case SHORTCUT_SHOW_RIDES_LIST: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0E)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 12, WE_MOUSE_UP); } } break; case SHORTCUT_SHOW_PARK_INFORMATION: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0E)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 13, WE_MOUSE_UP); } } break; case SHORTCUT_SHOW_GUEST_LIST: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0E)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 15, WE_MOUSE_UP); } } break; case SHORTCUT_SHOW_STAFF_LIST: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0E)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 14, WE_MOUSE_UP); } } break; case SHORTCUT_SHOW_RECENT_MESSAGES: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0E)) window_news_open(); break; case SHORTCUT_SHOW_MAP: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) || RCT2_GLOBAL(0x0141F570, uint8) == 1) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0C)) { window = window_find_by_id(WC_TOP_TOOLBAR, 0); if (window != NULL) { window_invalidate(window); window_event_helper(window, 6, WE_MOUSE_UP); } } } break; case SHORTCUT_SCREENSHOT: RCT2_CALLPROC_EBPSAFE(0x006E4034); // set screenshot countdown to 2 break; } }
/** * * rct2: 0x006E6B65 */ static void window_clear_scenery_close(rct_window *w) { // If the tool wasn't changed, turn tool off if (clear_scenery_tool_is_active()) tool_cancel(); }
/** * * rct2: 0x0066C957 */ static void window_game_top_toolbar_mouseup() { short widgetIndex; rct_window *w, *mainWindow; __asm mov widgetIndex, dx __asm mov w, esi switch (widgetIndex) { case WIDX_PAUSE: game_do_command(0, 1, 0, 0, 2, 0, 0); break; case WIDX_FASTFORWARD: window_cheats_open(); break; case WIDX_ZOOM_OUT: if ((mainWindow = window_get_main()) != NULL) window_zoom_out(mainWindow); break; case WIDX_ZOOM_IN: if ((mainWindow = window_get_main()) != NULL) window_zoom_in(mainWindow); break; case WIDX_ROTATE: if ((mainWindow = window_get_main()) != NULL) window_rotate_camera(mainWindow); break; case WIDX_MAP: RCT2_CALLPROC_EBPSAFE(0x0068C88A); break; case WIDX_CLEAR_SCENERY: if ((RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3)) && RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, uint8) == 1 && RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16) == 16) { tool_cancel(); } else { show_gridlines(); tool_set(w, WIDX_CLEAR_SCENERY, 12); RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6); RCT2_GLOBAL(RCT2_ADDRESS_LAND_TOOL_SIZE, sint16) = 2; window_clear_scenery_open(); } break; case WIDX_LAND: if ((RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3)) && RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, uint8) == 1 && RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16) == 7) { tool_cancel(); } else { show_gridlines(); tool_set(w, WIDX_LAND, 18); RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6); RCT2_GLOBAL(RCT2_ADDRESS_LAND_TOOL_SIZE, sint16) = 1; window_land_open(); } break; case WIDX_WATER: if ((RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3)) && RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, uint8) == 1 && RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16) == 8) { tool_cancel(); } else { show_gridlines(); tool_set(w, WIDX_WATER, 19); RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6); RCT2_GLOBAL(RCT2_ADDRESS_LAND_TOOL_SIZE, sint16) = 1; window_water_open(); } break; case WIDX_SCENERY: tool_set(w, WIDX_SCENERY, 0); RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6); RCT2_CALLPROC_EBPSAFE(0x006E0FEF); break; case WIDX_PATH: if (window_find_by_id(WC_FOOTPATH, 0) == NULL) { window_footpath_open(); } else { tool_cancel(); window_close_by_id(0x80 | WC_FOOTPATH, 0); } break; case WIDX_CONSTRUCT_RIDE: RCT2_CALLPROC_EBPSAFE(0x006B3CFF); break; case WIDX_RIDES: window_ride_list_open(); break; case WIDX_PARK: window_park_entrance_open(); break; case WIDX_STAFF: RCT2_CALLPROC_EBPSAFE(0x006BD3CC); break; case WIDX_GUESTS: RCT2_CALLPROC_EBPSAFE(0x006992E3); break; } }
static void window_land_rights_close(rct_window *w) { // If the tool wasn't changed, turn tool off if (!window_land_rights_should_close()) tool_cancel(); }
/** * * rct2: 0x006E6B65 */ static void window_clear_scenery_close() { // If the tool wasn't changed, turn tool off if (!window_clear_scenery_should_close()) tool_cancel(); }