diff --git a/src/citymania/cm_highlight.cpp b/src/citymania/cm_highlight.cpp index c607bdb1a0..67e3cea3f4 100644 --- a/src/citymania/cm_highlight.cpp +++ b/src/citymania/cm_highlight.cpp @@ -62,7 +62,6 @@ extern AirportClassID _selected_airport_class; ///< the currently visible airpor extern int _selected_airport_index; extern byte _selected_airport_layout; extern DiagDirection _build_depot_direction; ///< Currently selected depot direction -extern DiagDirection _road_station_picker_orientation; extern DiagDirection _road_depot_orientation; extern uint32 _realtime_tick; extern uint32 _cm_funding_layout; @@ -1853,7 +1852,7 @@ HighLightStyle UpdateTileSelection(HighLightStyle new_drawstyle) { if (_thd.select_proc == DDSP_BUILD_STATION) _thd.cm_new = ObjectHighlight::make_rail_station(start_tile, end_tile, _railstation.orientation); else if (_thd.select_proc == DDSP_BUILD_BUSSTOP || _thd.select_proc == DDSP_BUILD_TRUCKSTOP) { - auto ddir = _road_station_picker_orientation; + auto ddir = _roadstop_gui_settings.orientation; auto ta = TileArea(start_tile, end_tile); if (pt.x != -1) { if (ddir >= DIAGDIR_END && ddir < STATIONDIR_AUTO) { diff --git a/src/citymania/cm_main.cpp b/src/citymania/cm_main.cpp index 662c924247..0d8cb15a5e 100644 --- a/src/citymania/cm_main.cpp +++ b/src/citymania/cm_main.cpp @@ -1,6 +1,7 @@ #include "../stdafx.h" #include "cm_main.hpp" +#include "cm_command_type.hpp" #include "cm_hotkeys.hpp" #include "cm_minimap.hpp" diff --git a/src/citymania/cm_station_gui.cpp b/src/citymania/cm_station_gui.cpp index 0e33dd4fff..a2b3d6a056 100644 --- a/src/citymania/cm_station_gui.cpp +++ b/src/citymania/cm_station_gui.cpp @@ -34,7 +34,6 @@ extern const Station *_viewport_highlight_station; extern TileHighlightData _thd; -extern DiagDirection _road_station_picker_orientation; extern bool CheckClickOnViewportSign(const Viewport *vp, int x, int y, const ViewportSign *sign); extern Rect ExpandRectWithViewportSignMargins(Rect r, ZoomLevel zoom); extern RoadBits FindRailsToConnect(TileIndex tile); diff --git a/src/citymania/extensions/cmext_commandcost.hpp b/src/citymania/extensions/cmext_commandcost.hpp index 5ca4b9c307..af5e45f447 100644 --- a/src/citymania/extensions/cmext_commandcost.hpp +++ b/src/citymania/extensions/cmext_commandcost.hpp @@ -1,13 +1,21 @@ #ifndef CMEXT_COMMANDCOST_HPP #define CMEXT_COMMANDCOST_HPP +#include "../cm_type.hpp" + namespace citymania { +class ObjectTileHighlight; + namespace ext { class CommandCost { public: size_t industry_layout; + // std::list> highlight; + // void add_highlight(const ObjectTileHighlight &hl) { + + // } }; } // namespace ext diff --git a/src/road_gui.cpp b/src/road_gui.cpp index d67abc0e39..0383299e14 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -67,7 +67,6 @@ static bool _place_road_end_half; /* CM static */ RoadType _cur_roadtype; /* CM static */ DiagDirection _road_depot_orientation; -DiagDirection _road_station_picker_orientation; struct RoadStopGUISettings { DiagDirection orientation; @@ -1259,9 +1258,11 @@ public: if (RoadTypeIsTram(_cur_roadtype) && _roadstop_gui_settings.orientation < DIAGDIR_END) { _roadstop_gui_settings.orientation = DIAGDIR_END; } - if (RoadTypeIsTram(_cur_roadtype) && _road_station_picker_orientation == (DiagDirection)(DIAGDIR_END + 2)) { - _road_station_picker_orientation = (DiagDirection)(DIAGDIR_END + 3); + + if (RoadTypeIsTram(_cur_roadtype) && _roadstop_gui_settings.orientation == citymania::STATIONDIR_AUTO) { + _roadstop_gui_settings.orientation = citymania::STATIONDIR_AUTO_XY; } + const RoadTypeInfo *rti = GetRoadTypeInfo(_cur_roadtype); this->GetWidget(WID_BROS_CAPTION)->widget_data = rti->strings.picker_title[rs]; @@ -1394,16 +1395,16 @@ public: } if (hotkey == CM_BROSHK_ROTATE) { - if (_road_station_picker_orientation < citymania::STATIONDIR_AUTO) { - this->RaiseWidget(_road_station_picker_orientation + WID_BROS_STATION_NE); - if (_road_station_picker_orientation < DIAGDIR_END) { - _road_station_picker_orientation = ChangeDiagDir(_road_station_picker_orientation, DIAGDIRDIFF_90RIGHT); - } else if (_road_station_picker_orientation == citymania::STATIONDIR_X) { - _road_station_picker_orientation = citymania::STATIONDIR_Y; - } else if (_road_station_picker_orientation == citymania::STATIONDIR_Y) { - _road_station_picker_orientation = citymania::STATIONDIR_X; + if (_roadstop_gui_settings.orientation < citymania::STATIONDIR_AUTO) { + this->RaiseWidget(_roadstop_gui_settings.orientation + WID_BROS_STATION_NE); + if (_roadstop_gui_settings.orientation < DIAGDIR_END) { + _roadstop_gui_settings.orientation = ChangeDiagDir(_roadstop_gui_settings.orientation, DIAGDIRDIFF_90RIGHT); + } else if (_roadstop_gui_settings.orientation == citymania::STATIONDIR_X) { + _roadstop_gui_settings.orientation = citymania::STATIONDIR_Y; + } else if (_roadstop_gui_settings.orientation == citymania::STATIONDIR_Y) { + _roadstop_gui_settings.orientation = citymania::STATIONDIR_X; } - this->LowerWidget(_road_station_picker_orientation + WID_BROS_STATION_NE); + this->LowerWidget(_roadstop_gui_settings.orientation + WID_BROS_STATION_NE); } else { citymania::RotateAutodetection(); }