예제 #1
0
/**
 *
 *  rct2: 0x006CFA31
 */
static void window_track_list_mouseup(rct_window *w, int widgetIndex)
{
	switch (widgetIndex) {
	case WIDX_CLOSE:
		window_close(w);
		if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER) {
			window_close_by_number(WC_MANAGE_TRACK_DESIGN, w->number);
			window_close_by_number(WC_TRACK_DELETE_PROMPT, w->number);
			trackmanager_load();
		}
		break;
	case WIDX_ROTATE:
		RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_ROTATION, uint8)++;
		RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_ROTATION, uint8) %= 4;
		window_invalidate(w);
		break;
	case WIDX_TOGGLE_SCENERY:
		RCT2_GLOBAL(RCT2_ADDRESS_TRACK_DESIGN_SCENERY_TOGGLE, uint8) ^= 1;
		reset_track_list_cache();
		window_invalidate(w);
		break;
	case WIDX_BACK:
		window_close(w);
		if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER) {
			window_close_by_number(WC_MANAGE_TRACK_DESIGN, w->number);
			window_close_by_number(WC_TRACK_DELETE_PROMPT, w->number);
			trackmanager_load();
		} else {
			window_new_ride_open();
		}
		break;
	}
}
예제 #2
0
/**
 *
 *  rct2: 0x006CFD76
 */
static void window_track_list_close(rct_window *w)
{
    // Dispose track design and preview
    track_design_dispose(_loadedTrackDesign);
    _loadedTrackDesign = NULL;
    SafeFree(_trackDesignPreviewPixels);

    // Dispose track list
    for (size_t i = 0; i < _trackDesignsCount; i++) {
        free(_trackDesigns[i].name);
        free(_trackDesigns[i].path);
    }
    SafeFree(_trackDesigns);
    _trackDesignsCount = 0;

    // If gScreenAge is zero, we're already in the process
    // of loading the track manager, so we shouldn't try
    // to do it again. Otherwise, this window will get
    // another close signal from the track manager load function,
    // try to load the track manager again, and an infinite loop will result.
    if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && gScreenAge != 0){
        window_close_by_number(WC_MANAGE_TRACK_DESIGN, w->number);
        window_close_by_number(WC_TRACK_DELETE_PROMPT, w->number);
        trackmanager_load();
    }
}
예제 #3
0
static void window_title_menu_dropdown(rct_window *w, sint32 widgetIndex, sint32 dropdownIndex)
{
	if (widgetIndex == WIDX_GAME_TOOLS) {
		switch (dropdownIndex) {
		case 0:
			editor_load();
			break;
		case 1:
			editor_convert_save_to_scenario();
			break;
		case 2:
			trackdesigner_load();
			break;
		case 3:
			trackmanager_load();
			break;
		}
	}
}
예제 #4
0
static void window_title_menu_dropdown(rct_window *w, int widgetIndex, int dropdownIndex)
{
	if (widgetIndex == WIDX_SHOW_TUTORIAL) {
		tutorial_start(dropdownIndex);
	} else if (widgetIndex == WIDX_GAME_TOOLS) {
		switch (dropdownIndex) {
		case 0:
			editor_load();
			break;
		case 1:
			editor_convert_save_to_scenario();
			break;
		case 2:
			trackdesigner_load();
			break;
		case 3:
			trackmanager_load();
			break;
		}
	}
}