mirror of https://github.com/OpenRCT2/OpenRCT2.git
Move track design list window to UI module
This commit is contained in:
parent
61255e25a7
commit
ee6c3cfc56
|
@ -205,6 +205,13 @@ public:
|
|||
return window_ride_main_open(intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID));
|
||||
case WC_TRACK_DESIGN_PLACE:
|
||||
return window_track_place_open((track_design_file_ref *) intent->GetPointerExtra(INTENT_EXTRA_TRACK_DESIGN));
|
||||
case WC_TRACK_DESIGN_LIST:
|
||||
{
|
||||
ride_list_item rideItem;
|
||||
rideItem.type = intent->GetUIntExtra(INTENT_EXTRA_RIDE_TYPE);
|
||||
rideItem.entry_index = intent->GetUIntExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX);
|
||||
return window_track_list_open(rideItem);
|
||||
}
|
||||
case WC_SCENARIO_SELECT:
|
||||
return window_scenarioselect_open((scenarioselect_callback) intent->GetPointerExtra(INTENT_EXTRA_CALLBACK));
|
||||
case WD_VEHICLE:
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <openrct2/ride/TrackData.h>
|
||||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/util/util.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
|
||||
static uint8 _windowNewRideCurrentTab;
|
||||
static ride_list_item _windowNewRideHighlightedItem[6];
|
||||
|
@ -1013,7 +1014,10 @@ static void window_new_ride_select(rct_window *w)
|
|||
|
||||
if (allowTrackDesigns && ride_type_has_flag(item.type, RIDE_TYPE_FLAG_HAS_TRACK)) {
|
||||
if (_lastTrackDesignCount > 0) {
|
||||
window_track_list_open(item);
|
||||
auto intent = Intent(WC_TRACK_DESIGN_LIST);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_TYPE, item.type);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, item.entry_index);
|
||||
context_open_intent(&intent);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,7 +229,11 @@ static void window_track_place_mouseup(rct_window *w, rct_widgetindex widgetInde
|
|||
break;
|
||||
case WIDX_SELECT_DIFFERENT_DESIGN:
|
||||
window_close(w);
|
||||
window_track_list_open(_window_track_list_item);
|
||||
|
||||
auto intent = Intent(WC_TRACK_DESIGN_LIST);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_TYPE, _window_track_list_item.type);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, _window_track_list_item.entry_index);
|
||||
context_open_intent(&intent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,20 +14,21 @@
|
|||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../Context.h"
|
||||
#include "../drawing/IDrawingEngine.h"
|
||||
#include "../ride/TrackDesignRepository.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../core/Math.hpp"
|
||||
#include "../core/Memory.hpp"
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
|
||||
#include "../audio/audio.h"
|
||||
#include "../Editor.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct1.h"
|
||||
#include "../sprites.h"
|
||||
#include "../windows/Intent.h"
|
||||
#include <openrct2/audio/audio.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/core/Math.hpp>
|
||||
#include <openrct2/core/Memory.hpp>
|
||||
#include <openrct2/drawing/IDrawingEngine.h>
|
||||
#include <openrct2/Editor.h>
|
||||
#include <openrct2/interface/widget.h>
|
||||
#include <openrct2/localisation/localisation.h>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
#include <openrct2/rct1.h>
|
||||
#include <openrct2/ride/TrackDesignRepository.h>
|
||||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
|
||||
enum {
|
||||
WIDX_BACKGROUND,
|
||||
|
@ -113,7 +114,7 @@ static bool track_list_load_design_for_preview(utf8 *path);
|
|||
*
|
||||
* rct2: 0x006CF1A2
|
||||
*/
|
||||
static void _window_track_list_open(ride_list_item item)
|
||||
rct_window * window_track_list_open(ride_list_item item)
|
||||
{
|
||||
window_close_construction_windows();
|
||||
_window_track_list_item = item;
|
||||
|
@ -155,6 +156,8 @@ static void _window_track_list_open(ride_list_item item)
|
|||
|
||||
_loadedTrackDesign = nullptr;
|
||||
_loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED;
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -644,11 +647,3 @@ static bool track_list_load_design_for_preview(utf8 *path)
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void window_track_list_open(ride_list_item item)
|
||||
{
|
||||
_window_track_list_open(item);
|
||||
}
|
||||
}
|
|
@ -112,3 +112,7 @@ rct_window * window_ride_main_open(sint32 rideIndex);
|
|||
rct_window * window_ride_open_track(rct_tile_element * tileElement);
|
||||
rct_window * window_ride_open_vehicle(rct_vehicle * vehicle);
|
||||
void window_ride_measurements_design_cancel();
|
||||
|
||||
// rct2: 0x00F635EE
|
||||
extern ride_list_item _window_track_list_item;
|
||||
rct_window * window_track_list_open(ride_list_item item);
|
||||
|
|
|
@ -630,9 +630,6 @@ extern rct_window * gWindowFirst;
|
|||
extern rct_window * gWindowNextSlot;
|
||||
extern rct_window * gWindowAudioExclusive;
|
||||
|
||||
// rct2: 0x00F635EE
|
||||
extern ride_list_item _window_track_list_item;
|
||||
|
||||
extern uint16 gWindowUpdateTicks;
|
||||
extern uint8 gToolbarDirtyFlags;
|
||||
extern uint16 gWindowMapFlashingFlags;
|
||||
|
@ -719,7 +716,6 @@ void window_resize_gui_scenario_editor(sint32 width, sint32 height);
|
|||
void window_top_toolbar_open();
|
||||
void window_game_bottom_toolbar_open();
|
||||
void window_game_bottom_toolbar_invalidate_news_item();
|
||||
void window_track_list_open(ride_list_item item);
|
||||
void window_ride_construct(rct_window *w);
|
||||
rct_window *window_ride_construction_open();
|
||||
rct_window *window_maze_construction_open();
|
||||
|
|
|
@ -1659,9 +1659,10 @@ static void window_editor_object_selection_manage_tracks()
|
|||
rct_ride_entry* ride_entry = get_ride_entry(entry_index);
|
||||
uint8 ride_type = ride_entry_get_first_non_null_ride_type(ride_entry);
|
||||
|
||||
ride_list_item item = { ride_type, (uint8) entry_index };
|
||||
// track_load_list(item);
|
||||
window_track_list_open(item);
|
||||
auto intent = Intent(WC_TRACK_DESIGN_LIST);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_TYPE, ride_type);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, entry_index);
|
||||
context_open_intent(&intent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue