1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Move maze construction window to UI module

This commit is contained in:
Marijn van der Werf
2017-10-21 18:12:15 +02:00
parent 1e335308cc
commit b85f9c3f68
7 changed files with 38 additions and 19 deletions

View File

@@ -144,6 +144,8 @@ public:
{
return window_new_ride_open_research();
}
case WV_MAZE_CONSTRUCTION:
return window_maze_construction_open();
default:
return nullptr;
}
@@ -260,6 +262,10 @@ public:
break;
}
case INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION:
window_maze_construction_update_pressed_widgets();
break;
}
}

View File

@@ -14,17 +14,19 @@
*****************************************************************************/
#pragma endregion
#include "../audio/audio.h"
#include "../drawing/drawing.h"
#include "../game.h"
#include "../input.h"
#include "../interface/viewport.h"
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../ride/Track.h"
#include "../sprites.h"
#include "Intent.h"
#include "../Context.h"
#include <openrct2-ui/windows/Window.h>
#include <openrct2/audio/audio.h>
#include <openrct2/Context.h>
#include <openrct2/drawing/drawing.h>
#include <openrct2/game.h>
#include <openrct2/input.h>
#include <openrct2/interface/viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/ride/Track.h>
#include <openrct2/sprites.h>
#include <openrct2/windows/Intent.h>
#pragma region Widgets

View File

@@ -118,3 +118,6 @@ extern ride_list_item _window_track_list_item;
rct_window * window_track_list_open(ride_list_item item);
void window_map_tooltip_update_visibility();
rct_window * window_maze_construction_open();
void window_maze_construction_update_pressed_widgets();

View File

@@ -507,7 +507,7 @@ enum {
WV_PARK_GUESTS,
WV_FINANCES_RESEARCH,
WV_RIDE_RESEARCH,
WV_MAZE_CONSTRUCTION,
};
enum {
@@ -718,13 +718,11 @@ void window_game_bottom_toolbar_open();
void window_game_bottom_toolbar_invalidate_news_item();
void window_ride_construct(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);
void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY);
void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY);
void window_maze_construction_update_pressed_widgets();
void window_network_status_open(const char* text, close_callback onClose);
void window_network_status_close();
void window_network_status_open_password();

View File

@@ -1801,7 +1801,11 @@ static sint32 ride_modify_maze(rct_tile_element *tileElement, sint32 x, sint32 y
_currentTrackBeginZ = tileElement->base_height * 8;
_currentTrackSelectionFlags = 0;
_rideConstructionArrowPulseTime = 0;
window_maze_construction_update_pressed_widgets();
Intent * intent = intent_create(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION);
context_broadcast_intent(intent);
intent_release(intent);
return 1;
}

View File

@@ -69,6 +69,7 @@ extern "C" {
INTENT_ACTION_NEW_RIDE_OF_TYPE,
INTENT_ACTION_REFRESH_NEW_RIDES,
INTENT_ACTION_REFRESH_RIDE_LIST,
INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION,
};
Intent *intent_create(rct_windowclass clss);

View File

@@ -549,7 +549,9 @@ rct_window *window_ride_construction_open()
_deferClose = false;
if (ride->type == RIDE_TYPE_MAZE)
return window_maze_construction_open();
{
return context_open_window_view(WV_MAZE_CONSTRUCTION);
}
w = window_create(0, 29, 166, 394, &window_ride_construction_events, WC_RIDE_CONSTRUCTION, WF_NO_AUTO_CLOSE);
@@ -3755,7 +3757,8 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY)
_currentTrackBeginZ += 16;
}
window_maze_construction_update_pressed_widgets();
auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION);
context_broadcast_intent(&intent);
map_invalidate_map_selection_tiles();
return;
}
@@ -3902,7 +3905,8 @@ void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY)
_currentTrackBeginZ = z;
_currentTrackSelectionFlags = 0;
_rideConstructionArrowPulseTime = 0;
window_maze_construction_update_pressed_widgets();
auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION);
context_broadcast_intent(&intent);
w = window_find_by_class(WC_RIDE_CONSTRUCTION);
if (w == nullptr)
break;
@@ -3942,7 +3946,8 @@ void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY)
_trackPlaceCtrlState = false;
_trackPlaceShiftState = false;
}
window_maze_construction_update_pressed_widgets();
auto intent2 = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION);
context_broadcast_intent(&intent2);
break;
}
else if (zAttempts >= 0) {