Feat: SAM Radius arcs show when building cities (#2828)

## Description:

Simple PR, but adds the feature where using the hotkey to build a city
will show SAM radius layer to let user know safe areas to build.

<img width="2126" height="1398" alt="image"
src="https://github.com/user-attachments/assets/8aed5514-51c4-40f4-a446-e3c52346abc8"
/>

## 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:

bijx
This commit is contained in:
bijx
2026-01-08 20:10:22 -05:00
committed by GitHub
parent 2dada6f516
commit c769e4a99a
+5 -1
View File
@@ -40,7 +40,10 @@ export class SAMRadiusLayer implements Layer {
private handleToggleStructure(e: ToggleStructureEvent) {
const types = e.structureTypes;
this.hoveredShow = !!types && types.indexOf(UnitType.SAMLauncher) !== -1;
this.hoveredShow =
!!types &&
(types.indexOf(UnitType.SAMLauncher) !== -1 ||
types.indexOf(UnitType.City) !== -1);
this.updateVisibility();
}
@@ -83,6 +86,7 @@ export class SAMRadiusLayer implements Layer {
this.ghostShow =
this.uiState.ghostStructure === UnitType.MissileSilo ||
this.uiState.ghostStructure === UnitType.SAMLauncher ||
this.uiState.ghostStructure === UnitType.City ||
this.uiState.ghostStructure === UnitType.AtomBomb ||
this.uiState.ghostStructure === UnitType.HydrogenBomb;
this.updateVisibility();