Fall back to regular(non-improved)) station joining if distant join is not allowed
This commit is contained in:
@@ -57,7 +57,7 @@ void CcBuildAirport(const CommandCost &result, TileIndex tile, uint32 p1, uint32
|
||||
*/
|
||||
static void PlaceAirport(TileIndex tile)
|
||||
{
|
||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
||||
if (citymania::UseImprovedStationJoin()) {
|
||||
citymania::PlaceAirport(tile);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,10 @@ TileArea _highlight_join_area;
|
||||
// _station_select.catchment = catchment;
|
||||
// }
|
||||
|
||||
bool UseImprovedStationJoin() {
|
||||
return _settings_client.gui.cm_use_improved_station_join && _settings_game.station.distant_join_stations;
|
||||
}
|
||||
|
||||
void SetStationBiildingStatus(StationBuildingStatus status) {
|
||||
_station_building_status = status;
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ enum class StationBuildingStatus {
|
||||
|
||||
// void SetStationBiildingStatus(StationBuildingStatus status);
|
||||
// void SetStationTileSelectSize(int w, int h, int catchment);
|
||||
|
||||
bool UseImprovedStationJoin();
|
||||
void OnStationTileSetChange(const Station *station, bool adding, StationType type);
|
||||
void OnStationPartBuilt(const Station *station, TileIndex tile, uint32 p1, uint32 p2);
|
||||
void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, uint32 cmd);
|
||||
|
||||
@@ -198,7 +198,7 @@ struct BuildDocksToolbarWindow : Window {
|
||||
|
||||
case WID_DT_STATION: { // Build station button
|
||||
|
||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
||||
if (citymania::UseImprovedStationJoin()) {
|
||||
citymania::PlaceDock(tile);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1449,7 +1449,7 @@ STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT :Keep the buildi
|
||||
STR_CONFIG_SETTING_PERSISTENT_DEPOTTOOLS :Keep depot building tools active after usage: {STRING2}
|
||||
STR_CONFIG_SETTING_PERSISTENT_DEPOTTOOLS_HELPTEXT :Keep the building tools for road, train and ship depots (reversible by placing with Ctrl).
|
||||
STR_CM_CONFIG_SETTING_IMPROVED_STATION_JOIN :Use improved station joining controls: {STRING2}
|
||||
STR_CM_CONFIG_SETTING_IMPROVED_STATION_JOIN_HELPTEXT :Use Ctrl-click on station tile to select or deselect station to join. If station has no tiles Ctrl-click its sign. Ctrl-click empty tile for a new station. Also recently built station is automatically selected as a station to join.
|
||||
STR_CM_CONFIG_SETTING_IMPROVED_STATION_JOIN_HELPTEXT :Use Ctrl-click on station tile to select or deselect station to join. If station has no tiles Ctrl-click its sign. Ctrl-click empty tile for a new station. Also recently built station is automatically selected as a station to join. {RED}Does't work if joining stations not directly adjacent(distant join) is not allowed in settings.
|
||||
STR_CONFIG_SETTING_EXPENSES_LAYOUT :Group expenses in company finance window: {STRING2}
|
||||
STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :Define the layout for the company expenses window
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ static void PlaceRail_Station(TileIndex tile)
|
||||
VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED, DDSP_BUILD_STATION);
|
||||
VpSetPlaceSizingLimit(_settings_game.station.station_spread);
|
||||
} else {
|
||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
||||
if (citymania::UseImprovedStationJoin()) {
|
||||
citymania::PlaceRail_Station(tile);
|
||||
return;
|
||||
}
|
||||
@@ -1077,7 +1077,7 @@ Window *ShowBuildRailToolbar(RailType railtype)
|
||||
|
||||
static void HandleStationPlacement(TileIndex start, TileIndex end)
|
||||
{
|
||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
||||
if (citymania::UseImprovedStationJoin()) {
|
||||
citymania::HandleStationPlacement(start, end);
|
||||
return;
|
||||
}
|
||||
@@ -1223,7 +1223,7 @@ public:
|
||||
|
||||
int rad = (_settings_game.station.modified_catchment) ? CA_TRAIN : CA_UNMODIFIED;
|
||||
|
||||
if (_settings_client.gui.cm_use_improved_station_join || _settings_client.gui.station_show_coverage)
|
||||
if (citymania::UseImprovedStationJoin() || _settings_client.gui.station_show_coverage)
|
||||
SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
|
||||
|
||||
for (uint bits = 0; bits < 7; bits++) {
|
||||
|
||||
@@ -289,7 +289,7 @@ DiagDirection AutodetectDriveThroughRoadStopDirection(TileArea area) {
|
||||
*/
|
||||
static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, uint32 cmd)
|
||||
{
|
||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
||||
if (citymania::UseImprovedStationJoin()) {
|
||||
citymania::PlaceRoadStop(start_tile, end_tile, p2, cmd);
|
||||
return;
|
||||
}
|
||||
@@ -1270,7 +1270,7 @@ struct BuildRoadStationWindow : public PickerWindowBase {
|
||||
|
||||
int rad = _settings_game.station.modified_catchment ? ((this->window_class == WC_BUS_STATION) ? CA_BUS : CA_TRUCK) : CA_UNMODIFIED;
|
||||
SetTileSelectSize(1, 1);
|
||||
if (_settings_client.gui.cm_use_improved_station_join || _settings_client.gui.station_show_coverage)
|
||||
if (citymania::UseImprovedStationJoin() || _settings_client.gui.station_show_coverage)
|
||||
SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
|
||||
|
||||
/* 'Accepts' and 'Supplies' texts. */
|
||||
|
||||
@@ -154,7 +154,7 @@ static void FindStationsAroundSelection()
|
||||
void CheckRedrawStationCoverage(const Window *w)
|
||||
{
|
||||
/* CityMania code begin */
|
||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
||||
if (citymania::UseImprovedStationJoin()) {
|
||||
if (citymania::CheckRedrawStationCoverage()) w->SetDirty();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user