Allow railroad loops (#1274)

## Description:

This change enables loop formation in the station network, allowing for
enhanced connectivity. However, it can sometimes result in clustered
areas as a trade-off. To mitigate excessive clustering, loops are only
permitted when there are at least 5 intermediary stations between the
source and destination stations.


![image](https://github.com/user-attachments/assets/720fa4f9-a634-49e8-8027-fe4e244d5ae5)

Also a few fixes for `.dev` players.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors
This commit is contained in:
DevelopingTom
2025-06-27 22:00:11 +02:00
committed by GitHub
parent f905e29ec6
commit c1bf01d3ba
4 changed files with 54 additions and 6 deletions
+4 -1
View File
@@ -246,7 +246,10 @@ export class UnitInfoModal extends LitElement implements Layer {
class="upgrade-button"
title="${translateText("unit_info_modal.create_station")}"
style="width: 100px; height: 32px;
display: ${this.unit.hasTrainStation() ? "none" : "block"};"
display: ${this.unit.hasTrainStation() ||
!this.game.unitInfo(this.unit.type()).canBuildTrainStation
? "none"
: "block"};"
>
${translateText("unit_info_modal.create_station")}
</button>