Add: station catchment area with ctrl+click
This commit is contained in:
@@ -678,4 +678,15 @@ std::string GetStationCoverageProductionText(TileIndex tile, int w, int h, int r
|
|||||||
return s.str();
|
return s.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* enable/disable catchment area with ctrl+click on a station */
|
||||||
|
void ShowCatchmentByClick(StationID station)
|
||||||
|
{
|
||||||
|
if (_viewport_highlight_station != nullptr) {
|
||||||
|
if (_viewport_highlight_station == Station::Get(station))
|
||||||
|
SetViewportCatchmentStation(Station::Get(station), false);
|
||||||
|
else SetViewportCatchmentStation(Station::Get(station), true);
|
||||||
|
}
|
||||||
|
else SetViewportCatchmentStation(Station::Get(station), true);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace citymania
|
} // namespace citymania
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ void SelectStationToJoin(const Station *station);
|
|||||||
void MarkCoverageHighlightDirty();
|
void MarkCoverageHighlightDirty();
|
||||||
bool CheckRedrawStationCoverage();
|
bool CheckRedrawStationCoverage();
|
||||||
void AbortStationPlacement();
|
void AbortStationPlacement();
|
||||||
|
void ShowCatchmentByClick(StationID station);
|
||||||
|
|
||||||
std::string GetStationCoverageProductionText(TileIndex tile, int w, int h, int rad, StationCoverageType sct);
|
std::string GetStationCoverageProductionText(TileIndex tile, int w, int h, int rad, StationCoverageType sct);
|
||||||
|
|
||||||
|
|||||||
@@ -2202,6 +2202,7 @@ static WindowDesc _station_view_desc(__FILE__, __LINE__,
|
|||||||
*/
|
*/
|
||||||
void ShowStationViewWindow(StationID station)
|
void ShowStationViewWindow(StationID station)
|
||||||
{
|
{
|
||||||
|
if (_ctrl_pressed) citymania::ShowCatchmentByClick(station); else
|
||||||
AllocateWindowDescFront<StationViewWindow>(&_station_view_desc, station);
|
AllocateWindowDescFront<StationViewWindow>(&_station_view_desc, station);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user