Reimplement station building previews

This commit is contained in:
dP
2025-06-26 18:24:01 +05:00
parent c219bf3e4f
commit b2737fe293
20 changed files with 1587 additions and 1057 deletions
+4 -6
View File
@@ -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;
}