mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-14 21:26:21 +00:00
Feat: Display ghost railways when building cities and ports (#3202)
## Description: Based on [this suggestion on Discord](https://discord.com/channels/1284581928254701718/1447110257196138577) and feedback gathered in [this thread](https://discord.com/channels/1359946986937258015/1469598906173227184). Supersedes #3143 This PR introduces "ghost railways": when you are going to place a city or port, previews railway connections that will be made when actually building the structure. Ghost railways are skipped if the structure is going to be snapped to existing railways (as in railway snapping functionality introduced in #3156 ). ### Video https://github.com/user-attachments/assets/ff8cf325-6501-4df8-801d-c8ae3ced3d0e ### Ghost rails color revisited black with 40% opacity <img width="695" height="430" alt="image" src="https://github.com/user-attachments/assets/272efbcc-4185-426a-921c-7fae61f6c462" /> ## 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 ## Please put your Discord username so you can be contacted if a bug or regression is found: deshack_82603
This commit is contained in:
@@ -54,11 +54,13 @@ export function createRenderer(
|
||||
const transformHandler = new TransformHandler(game, eventBus, canvas);
|
||||
const userSettings = new UserSettings();
|
||||
|
||||
const uiState = {
|
||||
const uiState: UIState = {
|
||||
attackRatio: 20,
|
||||
ghostStructure: null,
|
||||
overlappingRailroads: [],
|
||||
ghostRailPaths: [],
|
||||
rocketDirectionUp: true,
|
||||
} as UIState;
|
||||
};
|
||||
|
||||
//hide when the game renders
|
||||
const startingModal = document.querySelector(
|
||||
|
||||
Reference in New Issue
Block a user