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)
|
static void PlaceAirport(TileIndex tile)
|
||||||
{
|
{
|
||||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
if (citymania::UseImprovedStationJoin()) {
|
||||||
citymania::PlaceAirport(tile);
|
citymania::PlaceAirport(tile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ TileArea _highlight_join_area;
|
|||||||
// _station_select.catchment = catchment;
|
// _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) {
|
void SetStationBiildingStatus(StationBuildingStatus status) {
|
||||||
_station_building_status = status;
|
_station_building_status = status;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ enum class StationBuildingStatus {
|
|||||||
|
|
||||||
// void SetStationBiildingStatus(StationBuildingStatus status);
|
// void SetStationBiildingStatus(StationBuildingStatus status);
|
||||||
// void SetStationTileSelectSize(int w, int h, int catchment);
|
// void SetStationTileSelectSize(int w, int h, int catchment);
|
||||||
|
bool UseImprovedStationJoin();
|
||||||
void OnStationTileSetChange(const Station *station, bool adding, StationType type);
|
void OnStationTileSetChange(const Station *station, bool adding, StationType type);
|
||||||
void OnStationPartBuilt(const Station *station, TileIndex tile, uint32 p1, uint32 p2);
|
void OnStationPartBuilt(const Station *station, TileIndex tile, uint32 p1, uint32 p2);
|
||||||
void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, uint32 cmd);
|
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
|
case WID_DT_STATION: { // Build station button
|
||||||
|
|
||||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
if (citymania::UseImprovedStationJoin()) {
|
||||||
citymania::PlaceDock(tile);
|
citymania::PlaceDock(tile);
|
||||||
break;
|
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 :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_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 :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 :Group expenses in company finance window: {STRING2}
|
||||||
STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :Define the layout for the company expenses window
|
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);
|
VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED, DDSP_BUILD_STATION);
|
||||||
VpSetPlaceSizingLimit(_settings_game.station.station_spread);
|
VpSetPlaceSizingLimit(_settings_game.station.station_spread);
|
||||||
} else {
|
} else {
|
||||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
if (citymania::UseImprovedStationJoin()) {
|
||||||
citymania::PlaceRail_Station(tile);
|
citymania::PlaceRail_Station(tile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1077,7 +1077,7 @@ Window *ShowBuildRailToolbar(RailType railtype)
|
|||||||
|
|
||||||
static void HandleStationPlacement(TileIndex start, TileIndex end)
|
static void HandleStationPlacement(TileIndex start, TileIndex end)
|
||||||
{
|
{
|
||||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
if (citymania::UseImprovedStationJoin()) {
|
||||||
citymania::HandleStationPlacement(start, end);
|
citymania::HandleStationPlacement(start, end);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1223,7 +1223,7 @@ public:
|
|||||||
|
|
||||||
int rad = (_settings_game.station.modified_catchment) ? CA_TRAIN : CA_UNMODIFIED;
|
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);
|
SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
|
||||||
|
|
||||||
for (uint bits = 0; bits < 7; bits++) {
|
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)
|
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);
|
citymania::PlaceRoadStop(start_tile, end_tile, p2, cmd);
|
||||||
return;
|
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;
|
int rad = _settings_game.station.modified_catchment ? ((this->window_class == WC_BUS_STATION) ? CA_BUS : CA_TRUCK) : CA_UNMODIFIED;
|
||||||
SetTileSelectSize(1, 1);
|
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);
|
SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
|
||||||
|
|
||||||
/* 'Accepts' and 'Supplies' texts. */
|
/* 'Accepts' and 'Supplies' texts. */
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ static void FindStationsAroundSelection()
|
|||||||
void CheckRedrawStationCoverage(const Window *w)
|
void CheckRedrawStationCoverage(const Window *w)
|
||||||
{
|
{
|
||||||
/* CityMania code begin */
|
/* CityMania code begin */
|
||||||
if (_settings_client.gui.cm_use_improved_station_join) {
|
if (citymania::UseImprovedStationJoin()) {
|
||||||
if (citymania::CheckRedrawStationCoverage()) w->SetDirty();
|
if (citymania::CheckRedrawStationCoverage()) w->SetDirty();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user