mirror of https://github.com/OpenRCT2/OpenRCT2.git
Move Ride window to UI module
This commit is contained in:
parent
427d639e69
commit
61255e25a7
|
@ -201,10 +201,16 @@ public:
|
|||
}
|
||||
case WC_MANAGE_TRACK_DESIGN:
|
||||
return window_track_manage_open((track_design_file_ref *) intent->GetPointerExtra(INTENT_EXTRA_TRACK_DESIGN));
|
||||
case WC_RIDE:
|
||||
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_SCENARIO_SELECT:
|
||||
return window_scenarioselect_open((scenarioselect_callback) intent->GetPointerExtra(INTENT_EXTRA_CALLBACK));
|
||||
case WD_VEHICLE:
|
||||
return window_ride_open_vehicle((rct_vehicle *) intent->GetPointerExtra(INTENT_EXTRA_VEHICLE));
|
||||
case WD_TRACK:
|
||||
return window_ride_open_track((rct_tile_element *) intent->GetPointerExtra(INTENT_EXTRA_TILE_ELEMENT));
|
||||
case INTENT_ACTION_NEW_RIDE_OF_TYPE:
|
||||
{
|
||||
// Open ride list window
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include <openrct2/interface/widget.h>
|
||||
#include <openrct2/util/util.h>
|
||||
#include <openrct2/world/footpath.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
|
||||
enum WINDOW_GUEST_PAGE {
|
||||
WINDOW_GUEST_OVERVIEW,
|
||||
|
@ -1578,7 +1580,9 @@ void window_guest_rides_scroll_mouse_down(rct_window *w, sint32 scrollIndex, sin
|
|||
index = y / 10;
|
||||
if (index >= w->no_list_items) return;
|
||||
|
||||
window_ride_main_open(w->list_item_positions[index]);
|
||||
auto intent = Intent(WC_RIDE);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_ID, w->list_item_positions[index]);
|
||||
context_open_intent(&intent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,33 +14,34 @@
|
|||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../config/Config.h"
|
||||
#include "../network/network.h"
|
||||
#include "../object/ObjectManager.h"
|
||||
#include "../object/ObjectRepository.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../ride/RideGroupManager.h"
|
||||
#include "../core/Math.hpp"
|
||||
#include "../core/Util.hpp"
|
||||
#include "../Context.h"
|
||||
#include "Intent.h"
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
|
||||
#include "../audio/audio.h"
|
||||
#include "../cheats.h"
|
||||
#include "../game.h"
|
||||
#include "../input.h"
|
||||
#include "../interface/themes.h"
|
||||
#include "../interface/viewport.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../localisation/date.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../peep/Staff.h"
|
||||
#include "../rct1.h"
|
||||
#include "../ride/ride_data.h"
|
||||
#include "../ride/Track.h"
|
||||
#include "../ride/TrackData.h"
|
||||
#include "../sprites.h"
|
||||
#include "dropdown.h"
|
||||
#include <openrct2/audio/audio.h>
|
||||
#include <openrct2/cheats.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/core/Math.hpp>
|
||||
#include <openrct2/core/Util.hpp>
|
||||
#include <openrct2/game.h>
|
||||
#include <openrct2/input.h>
|
||||
#include <openrct2/interface/themes.h>
|
||||
#include <openrct2/interface/viewport.h>
|
||||
#include <openrct2/interface/widget.h>
|
||||
#include <openrct2/localisation/date.h>
|
||||
#include <openrct2/localisation/localisation.h>
|
||||
#include <openrct2/network/network.h>
|
||||
#include <openrct2/object/ObjectManager.h>
|
||||
#include <openrct2/object/ObjectRepository.h>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
#include <openrct2/peep/Staff.h>
|
||||
#include <openrct2/rct1.h>
|
||||
#include <openrct2/ride/RideGroupManager.h>
|
||||
#include <openrct2/ride/ride_data.h>
|
||||
#include <openrct2/ride/Track.h>
|
||||
#include <openrct2/ride/TrackData.h>
|
||||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/windows/dropdown.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
|
||||
enum {
|
||||
WINDOW_RIDE_PAGE_MAIN,
|
||||
|
@ -1556,7 +1557,7 @@ rct_window *window_ride_main_open(sint32 rideIndex)
|
|||
*
|
||||
* rct2: 0x006ACCCE
|
||||
*/
|
||||
rct_window *window_ride_open_station(sint32 rideIndex, sint32 stationIndex)
|
||||
static rct_window * window_ride_open_station(sint32 rideIndex, sint32 stationIndex)
|
||||
{
|
||||
sint32 i;
|
||||
Ride *ride;
|
|
@ -25,6 +25,8 @@
|
|||
#include <openrct2/interface/widget.h>
|
||||
#include <openrct2/windows/dropdown.h>
|
||||
#include <openrct2/interface/themes.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
#include <openrct2/Context.h>
|
||||
|
||||
enum {
|
||||
PAGE_RIDES,
|
||||
|
@ -442,7 +444,9 @@ static void window_ride_list_scrollmousedown(rct_window *w, sint32 scrollIndex,
|
|||
window_ride_list_refresh_list(w);
|
||||
}
|
||||
else {
|
||||
window_ride_main_open(rideIndex);
|
||||
auto intent = Intent(WC_RIDE);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_ID, rideIndex);
|
||||
context_open_intent(&intent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#include <openrct2/ride/Track.h>
|
||||
#include <openrct2/ride/TrackData.h>
|
||||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
|
||||
#define TRACK_MINI_PREVIEW_WIDTH 168
|
||||
#define TRACK_MINI_PREVIEW_HEIGHT 78
|
||||
|
@ -336,7 +338,9 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd
|
|||
|
||||
_currentRideIndex = rideIndex;
|
||||
if (track_design_are_entrance_and_exit_placed()) {
|
||||
window_ride_main_open(rideIndex);
|
||||
auto intent = Intent(WC_RIDE);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_ID, rideIndex);
|
||||
context_open_intent(&intent);
|
||||
window_close(w);
|
||||
} else {
|
||||
ride_initialise_construction_window(rideIndex);
|
||||
|
|
|
@ -107,3 +107,8 @@ void window_new_ride_focus(ride_list_item rideItem);
|
|||
|
||||
rct_window * window_ride_list_open();
|
||||
void window_ride_list_refresh_list(rct_window * w);
|
||||
|
||||
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();
|
||||
|
|
|
@ -129,8 +129,13 @@ sint32 viewport_interaction_left_click(sint32 x, sint32 y)
|
|||
case VIEWPORT_INTERACTION_ITEM_SPRITE:
|
||||
switch (info.sprite->unknown.sprite_identifier) {
|
||||
case SPRITE_IDENTIFIER_VEHICLE:
|
||||
window_ride_open_vehicle(info.vehicle);
|
||||
{
|
||||
Intent * intent = intent_create(WD_VEHICLE);
|
||||
intent_set_pointer(intent, INTENT_EXTRA_VEHICLE, info.vehicle);
|
||||
context_open_intent(intent);
|
||||
intent_release(intent);
|
||||
break;
|
||||
}
|
||||
case SPRITE_IDENTIFIER_PEEP:
|
||||
{
|
||||
Intent * intent = intent_create(WC_PEEP);
|
||||
|
@ -154,8 +159,13 @@ sint32 viewport_interaction_left_click(sint32 x, sint32 y)
|
|||
}
|
||||
return 1;
|
||||
case VIEWPORT_INTERACTION_ITEM_RIDE:
|
||||
window_ride_open_track(info.tileElement);
|
||||
return 1;
|
||||
{
|
||||
Intent * intent = intent_create(WD_TRACK);
|
||||
intent_set_pointer(intent, INTENT_EXTRA_TILE_ELEMENT, info.tileElement);
|
||||
context_open_intent(intent);
|
||||
intent_release(intent);
|
||||
return true;
|
||||
}
|
||||
case VIEWPORT_INTERACTION_ITEM_PARK:
|
||||
context_open_window(WC_PARK_INFORMATION);
|
||||
return 1;
|
||||
|
|
|
@ -518,6 +518,9 @@ enum {
|
|||
WD_SIGN_SMALL,
|
||||
|
||||
WD_PLAYER,
|
||||
|
||||
WD_VEHICLE,
|
||||
WD_TRACK,
|
||||
};
|
||||
|
||||
#define validate_global_widx(wc, widx) \
|
||||
|
@ -717,10 +720,6 @@ 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);
|
||||
rct_window *window_ride_main_open(sint32 rideIndex);
|
||||
rct_window *window_ride_open_station(sint32 rideIndex, sint32 stationIndex);
|
||||
rct_window *window_ride_open_track(rct_tile_element *tileElement);
|
||||
rct_window *window_ride_open_vehicle(rct_vehicle *vehicle);
|
||||
void window_ride_construct(rct_window *w);
|
||||
rct_window *window_ride_construction_open();
|
||||
rct_window *window_maze_construction_open();
|
||||
|
|
|
@ -349,8 +349,12 @@ void news_item_open_subject(sint32 type, sint32 subject)
|
|||
switch (type)
|
||||
{
|
||||
case NEWS_ITEM_RIDE:
|
||||
window_ride_main_open(subject);
|
||||
{
|
||||
auto intent = Intent(WC_RIDE);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_ID, subject);
|
||||
context_open_intent(&intent);
|
||||
break;
|
||||
}
|
||||
case NEWS_ITEM_PEEP_ON_RIDE:
|
||||
case NEWS_ITEM_PEEP:
|
||||
{
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "../rct2/addresses.h"
|
||||
#include "../scenario/scenario.h"
|
||||
#include "../util/util.h"
|
||||
#include "../windows/Intent.h"
|
||||
#include "../world/banner.h"
|
||||
#include "../world/Climate.h"
|
||||
#include "../world/footpath.h"
|
||||
|
@ -7656,7 +7657,11 @@ void ride_crash(uint8 rideIndex, uint8 vehicleIndex)
|
|||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) {
|
||||
// Open ride window for crashed vehicle
|
||||
rct_window *w = window_ride_open_vehicle(vehicle);
|
||||
Intent * intent = intent_create(WD_VEHICLE);
|
||||
intent_set_pointer(intent, INTENT_EXTRA_VEHICLE, vehicle);
|
||||
rct_window * w = context_open_intent(intent);
|
||||
intent_release(intent);
|
||||
|
||||
if (w->viewport != NULL) {
|
||||
w->viewport->flags |= VIEWPORT_FLAG_SOUND_ON;
|
||||
}
|
||||
|
|
|
@ -1230,7 +1230,6 @@ bool shop_item_is_souvenir(sint32 shopItem);
|
|||
void ride_reset_all_names();
|
||||
const uint8* ride_seek_available_modes(Ride *ride);
|
||||
|
||||
void window_ride_measurements_design_cancel();
|
||||
void window_ride_construction_mouseup_demolish_next_piece(sint32 x, sint32 y, sint32 z, sint32 direction, sint32 type);
|
||||
|
||||
uint32 ride_customers_per_hour(const Ride *ride);
|
||||
|
|
|
@ -60,6 +60,8 @@ extern "C" {
|
|||
INTENT_EXTRA_TRACK_DESIGN,
|
||||
INTENT_EXTRA_RIDE_TYPE,
|
||||
INTENT_EXTRA_RIDE_ENTRY_INDEX,
|
||||
INTENT_EXTRA_TILE_ELEMENT,
|
||||
INTENT_EXTRA_VEHICLE,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../ride/Track.h"
|
||||
#include "../sprites.h"
|
||||
#include "Intent.h"
|
||||
#include "../Context.h"
|
||||
|
||||
#pragma region Widgets
|
||||
|
||||
|
@ -184,7 +186,9 @@ static void window_maze_construction_close(rct_window *w)
|
|||
ride_demolish(rideIndex, GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
|
||||
gGamePaused = savedPausedState;
|
||||
} else {
|
||||
window_ride_main_open(rideIndex);
|
||||
auto intent = Intent(WC_RIDE);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_ID, rideIndex);
|
||||
context_open_intent(&intent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "dropdown.h"
|
||||
#include "../sprites.h"
|
||||
#include "../world/entrance.h"
|
||||
#include "Intent.h"
|
||||
|
||||
#pragma region Widgets
|
||||
|
||||
|
@ -669,7 +670,9 @@ static void window_ride_construction_close(rct_window *w)
|
|||
}
|
||||
|
||||
ride_set_to_default_inspection_interval(rideIndex);
|
||||
window_ride_main_open(rideIndex);
|
||||
auto intent = Intent(WC_RIDE);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_ID, rideIndex);
|
||||
context_open_intent(&intent);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue