mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
Move ride list window to UI module (#6412)
This commit is contained in:
committed by
Michał Janiszewski
parent
57a8bbac23
commit
ebb4bbe5d5
@@ -54,6 +54,7 @@
|
||||
C612A8991D64825300B634CA /* vehicle_data.c in Sources */ = {isa = PBXBuildFile; fileRef = C612A8971D64825300B634CA /* vehicle_data.c */; };
|
||||
C6136C551E21893500F3ED2B /* view_clipping.c in Sources */ = {isa = PBXBuildFile; fileRef = C6136C541E21893500F3ED2B /* view_clipping.c */; };
|
||||
C61FB7241CF86356004CE991 /* NetworkUser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61FB7221CF86356004CE991 /* NetworkUser.cpp */; };
|
||||
C632C81F1F8A445700781F6D /* RideList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C632C81E1F8A445700781F6D /* RideList.cpp */; };
|
||||
C6352B841F477022006CCEE3 /* DataSerialiser.h in Headers */ = {isa = PBXBuildFile; fileRef = C6352B811F477022006CCEE3 /* DataSerialiser.h */; };
|
||||
C6352B851F477022006CCEE3 /* DataSerialiserTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = C6352B821F477022006CCEE3 /* DataSerialiserTraits.h */; };
|
||||
C6352B861F477022006CCEE3 /* Endianness.h in Headers */ = {isa = PBXBuildFile; fileRef = C6352B831F477022006CCEE3 /* Endianness.h */; };
|
||||
@@ -124,7 +125,6 @@
|
||||
C666EE321F33E3800061AA04 /* ObjectLoadError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666ED9F1F33E3520061AA04 /* ObjectLoadError.cpp */; };
|
||||
C666EE381F33E3800061AA04 /* Ride.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EDA51F33E3520061AA04 /* Ride.cpp */; };
|
||||
C666EE391F33E3800061AA04 /* RideConstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EDA61F33E3520061AA04 /* RideConstruction.cpp */; };
|
||||
C666EE3A1F33E3800061AA04 /* RideList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EDA71F33E3520061AA04 /* RideList.cpp */; };
|
||||
C666EE3C1F33E3800061AA04 /* Scenery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EDA91F33E3520061AA04 /* Scenery.cpp */; };
|
||||
C666EE431F33E3800061AA04 /* TextInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EDB01F33E3520061AA04 /* TextInput.cpp */; };
|
||||
C666EE451F33E3800061AA04 /* TileInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EDB21F33E3520061AA04 /* TileInspector.cpp */; };
|
||||
@@ -664,6 +664,7 @@
|
||||
C612A8971D64825300B634CA /* vehicle_data.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vehicle_data.c; sourceTree = "<group>"; };
|
||||
C6136C541E21893500F3ED2B /* view_clipping.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = view_clipping.c; sourceTree = "<group>"; };
|
||||
C61FB7221CF86356004CE991 /* NetworkUser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkUser.cpp; sourceTree = "<group>"; usesTabs = 0; };
|
||||
C632C81E1F8A445700781F6D /* RideList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RideList.cpp; sourceTree = "<group>"; };
|
||||
C6352B811F477022006CCEE3 /* DataSerialiser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataSerialiser.h; sourceTree = "<group>"; };
|
||||
C6352B821F477022006CCEE3 /* DataSerialiserTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataSerialiserTraits.h; sourceTree = "<group>"; };
|
||||
C6352B831F477022006CCEE3 /* Endianness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Endianness.h; sourceTree = "<group>"; };
|
||||
@@ -722,7 +723,6 @@
|
||||
C666ED9F1F33E3520061AA04 /* ObjectLoadError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectLoadError.cpp; sourceTree = "<group>"; };
|
||||
C666EDA51F33E3520061AA04 /* Ride.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Ride.cpp; sourceTree = "<group>"; };
|
||||
C666EDA61F33E3520061AA04 /* RideConstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideConstruction.cpp; sourceTree = "<group>"; };
|
||||
C666EDA71F33E3520061AA04 /* RideList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideList.cpp; sourceTree = "<group>"; };
|
||||
C666EDA91F33E3520061AA04 /* Scenery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scenery.cpp; sourceTree = "<group>"; };
|
||||
C666EDB01F33E3520061AA04 /* TextInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextInput.cpp; sourceTree = "<group>"; };
|
||||
C666EDB21F33E3520061AA04 /* TileInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TileInspector.cpp; sourceTree = "<group>"; };
|
||||
@@ -2535,7 +2535,6 @@
|
||||
C666ED9F1F33E3520061AA04 /* ObjectLoadError.cpp */,
|
||||
C666EDA51F33E3520061AA04 /* Ride.cpp */,
|
||||
C666EDA61F33E3520061AA04 /* RideConstruction.cpp */,
|
||||
C666EDA71F33E3520061AA04 /* RideList.cpp */,
|
||||
C666EDA91F33E3520061AA04 /* Scenery.cpp */,
|
||||
C666EDB01F33E3520061AA04 /* TextInput.cpp */,
|
||||
F76C854A1EC4E7CD00FA49E2 /* tile_inspector.h */,
|
||||
@@ -2721,6 +2720,7 @@
|
||||
C654DF241F69C0430040F43D /* Park.cpp */,
|
||||
C654DF251F69C0430040F43D /* Player.cpp */,
|
||||
C685E5181F8907840090598F /* Research.cpp */,
|
||||
C632C81E1F8A445700781F6D /* RideList.cpp */,
|
||||
C666EE611F37ACB10061AA04 /* SavePrompt.cpp */,
|
||||
C666EE621F37ACB10061AA04 /* ServerList.cpp */,
|
||||
C666EE631F37ACB10061AA04 /* ServerStart.cpp */,
|
||||
@@ -3134,6 +3134,7 @@
|
||||
F76C88791EC5324E00FA49E2 /* AudioContext.cpp in Sources */,
|
||||
C666EE7A1F37ACB10061AA04 /* Themes.cpp in Sources */,
|
||||
C666EE7F1F37ACB10061AA04 /* Viewport.cpp in Sources */,
|
||||
C632C81F1F8A445700781F6D /* RideList.cpp in Sources */,
|
||||
4C93F1171F881F9C00A9330D /* Finance.cpp in Sources */,
|
||||
C654DF3C1F69C0430040F43D /* TrackDesignManage.cpp in Sources */,
|
||||
4CB832AC1EFFB8D100B88761 /* ttf.c in Sources */,
|
||||
@@ -3342,7 +3343,6 @@
|
||||
F76C86791EC4E88400FA49E2 /* SmallSceneryObject.cpp in Sources */,
|
||||
F76C867B1EC4E88400FA49E2 /* StexObject.cpp in Sources */,
|
||||
F76C867D1EC4E88400FA49E2 /* StringTable.cpp in Sources */,
|
||||
C666EE3A1F33E3800061AA04 /* RideList.cpp in Sources */,
|
||||
F76C867F1EC4E88400FA49E2 /* WallObject.cpp in Sources */,
|
||||
F76C86811EC4E88400FA49E2 /* WaterObject.cpp in Sources */,
|
||||
F76C86841EC4E88400FA49E2 /* object_list.c in Sources */,
|
||||
|
||||
@@ -83,6 +83,8 @@ public:
|
||||
return window_news_open();
|
||||
case WC_RESEARCH:
|
||||
return window_research_open();
|
||||
case WC_RIDE_LIST:
|
||||
return window_ride_list_open();
|
||||
case WC_NOTIFICATION_OPTIONS:
|
||||
return window_news_options_open();
|
||||
case WC_OPTIONS:
|
||||
@@ -234,6 +236,17 @@ public:
|
||||
case INTENT_ACTION_REFRESH_NEW_RIDES:
|
||||
window_new_ride_init_vars();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_REFRESH_RIDE_LIST:
|
||||
{
|
||||
auto window = window_find_by_class(WC_RIDE_LIST);
|
||||
if (window != nullptr)
|
||||
{
|
||||
window_ride_list_refresh_list(window);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ static void shortcut_show_rides_list()
|
||||
return;
|
||||
|
||||
if (!(gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
|
||||
window_ride_list_open();
|
||||
context_open_window(WC_RIDE_LIST);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include <openrct2/interface/widget.h>
|
||||
#include <openrct2/localisation/localisation.h>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
#include <openrct2/Context.h>
|
||||
|
||||
#define WW 200
|
||||
#define WH 100
|
||||
@@ -100,20 +102,17 @@ rct_window * window_ride_demolish_prompt_open(sint32 rideIndex)
|
||||
*/
|
||||
static void window_ride_demolish_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
rct_window* window;
|
||||
switch (widgetIndex) {
|
||||
case WIDX_DEMOLISH:
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_DEMOLISH_RIDE;
|
||||
ride_demolish(w->number, GAME_COMMAND_FLAG_APPLY);
|
||||
|
||||
// Prevents demolished rides sticking around in the ride list window
|
||||
window = window_find_by_class(WC_RIDE_LIST);
|
||||
if (window != nullptr)
|
||||
{
|
||||
window_ride_list_refresh_list(window);
|
||||
}
|
||||
|
||||
auto intent = Intent(INTENT_ACTION_REFRESH_RIDE_LIST);
|
||||
context_broadcast_intent(&intent);
|
||||
break;
|
||||
}
|
||||
case WIDX_CANCEL:
|
||||
case WIDX_CLOSE:
|
||||
window_close(w);
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../config/Config.h"
|
||||
#include "../network/network.h"
|
||||
#include "../core/Util.hpp"
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
|
||||
#include "../game.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../sprites.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "dropdown.h"
|
||||
#include "../interface/themes.h"
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/network/network.h>
|
||||
#include <openrct2/core/Util.hpp>
|
||||
#include <openrct2/game.h>
|
||||
#include <openrct2/localisation/localisation.h>
|
||||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/interface/widget.h>
|
||||
#include <openrct2/windows/dropdown.h>
|
||||
#include <openrct2/interface/themes.h>
|
||||
|
||||
enum {
|
||||
PAGE_RIDES,
|
||||
@@ -192,7 +193,7 @@ static void window_ride_list_open_all(rct_window *w);
|
||||
*
|
||||
* rct2: 0x006B30BC
|
||||
*/
|
||||
void window_ride_list_open()
|
||||
rct_window * window_ride_list_open()
|
||||
{
|
||||
rct_window* window;
|
||||
|
||||
@@ -229,6 +230,8 @@ void window_ride_list_open()
|
||||
_window_ride_list_information_type = INFORMATION_TYPE_STATUS;
|
||||
window->list_information_type = 0;
|
||||
_quickDemolishMode = false;
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,3 +104,6 @@ rct_window * window_new_ride_open();
|
||||
rct_window * window_new_ride_open_research();
|
||||
void window_new_ride_init_vars();
|
||||
void window_new_ride_focus(ride_list_item rideItem);
|
||||
|
||||
rct_window * window_ride_list_open();
|
||||
void window_ride_list_refresh_list(rct_window * w);
|
||||
|
||||
@@ -716,8 +716,6 @@ rct_window *window_ride_open_station(sint32 rideIndex, sint32 stationIndex);
|
||||
rct_window *window_ride_open_track(rct_map_element *mapElement);
|
||||
rct_window *window_ride_open_vehicle(rct_vehicle *vehicle);
|
||||
void window_ride_construct(rct_window *w);
|
||||
void window_ride_list_open();
|
||||
void window_ride_list_refresh_list(rct_window *w);
|
||||
rct_window *window_ride_construction_open();
|
||||
rct_window *window_maze_construction_open();
|
||||
void ride_construction_toolupdate_entrance_exit(sint32 screenX, sint32 screenY);
|
||||
|
||||
@@ -66,6 +66,7 @@ extern "C" {
|
||||
INTENT_ACTION_MAP,
|
||||
INTENT_ACTION_NEW_RIDE_OF_TYPE,
|
||||
INTENT_ACTION_REFRESH_NEW_RIDES,
|
||||
INTENT_ACTION_REFRESH_RIDE_LIST,
|
||||
};
|
||||
|
||||
Intent *intent_create(rct_windowclass clss);
|
||||
|
||||
@@ -346,7 +346,7 @@ static void window_top_toolbar_mouseup(rct_window *w, rct_widgetindex widgetInde
|
||||
context_open_window(WC_CONSTRUCT_RIDE);
|
||||
break;
|
||||
case WIDX_RIDES:
|
||||
window_ride_list_open();
|
||||
context_open_window(WC_RIDE_LIST);
|
||||
break;
|
||||
case WIDX_PARK:
|
||||
context_open_window(WC_PARK_INFORMATION);
|
||||
|
||||
Reference in New Issue
Block a user