Reimplement station building previews
This commit is contained in:
+4
-6
@@ -37,6 +37,7 @@
|
||||
#include "widgets/airport_widget.h"
|
||||
|
||||
#include "citymania/cm_hotkeys.hpp"
|
||||
#include "citymania/cm_highlight.hpp"
|
||||
#include "citymania/cm_station_gui.hpp"
|
||||
|
||||
#include "safeguards.h"
|
||||
@@ -64,11 +65,7 @@ void CcBuildAirport(Commands, const CommandCost &result, TileIndex tile)
|
||||
*/
|
||||
static void PlaceAirport(TileIndex tile)
|
||||
{
|
||||
if (citymania::UseImprovedStationJoin()) {
|
||||
citymania::PlaceAirport(tile);
|
||||
return;
|
||||
}
|
||||
|
||||
NOT_REACHED(); // CityMania uses tools
|
||||
if (_selected_airport_index == -1) return;
|
||||
|
||||
byte airport_type = AirportClass::Get(_selected_airport_class)->GetSpec(_selected_airport_index)->GetIndex();
|
||||
@@ -130,7 +127,8 @@ struct BuildAirToolbarWindow : Window {
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_AT_AIRPORT:
|
||||
if (HandlePlacePushButton(this, WID_AT_AIRPORT, SPR_CURSOR_AIRPORT, HT_RECT, CM_DDSP_BUILD_AIRPORT)) {
|
||||
// if (HandlePlacePushButton(this, WID_AT_AIRPORT, SPR_CURSOR_AIRPORT, HT_RECT, CM_DDSP_BUILD_AIRPORT)) {
|
||||
if (citymania::HandlePlacePushButton(this, WID_AT_AIRPORT, std::make_unique<citymania::AirportBuildTool>())) {
|
||||
ShowBuildAirportPicker(this);
|
||||
this->last_user_action = widget;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user