From 2b7e4ab277e3455d2759b0f7468b7625852f5ff3 Mon Sep 17 00:00:00 2001 From: Chris Vickery Date: Mon, 4 Mar 2024 15:54:23 -0800 Subject: [PATCH] expose settlement razing better --- .../locations/settlement/building-details.tsx | 21 ++++++++++++++++++- src/game/locations/settlement/index.tsx | 12 +++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/game/locations/settlement/building-details.tsx b/src/game/locations/settlement/building-details.tsx index 076b166..4a235ce 100644 --- a/src/game/locations/settlement/building-details.tsx +++ b/src/game/locations/settlement/building-details.tsx @@ -6,6 +6,7 @@ import FormControl from "@mui/material/FormControl"; import InputLabel from "@mui/material/InputLabel"; import TextField from "@mui/material/TextField"; import Tooltip from "@mui/material/Tooltip"; +import Typography from "@mui/material/Typography"; import LoadingButton from "@mui/lab/LoadingButton"; @@ -24,9 +25,11 @@ import { CampUpgrades } from "../camp"; export function BuildingDetails({ location, hero, + onDestroy, }: { location: PlayerLocation; hero: Hero; + onDestroy: (location: PlayerLocation) => void; }): JSX.Element | null { const [recruitAction, { loading: recruitLoading }] = useRecruitMutation(); const [purchaseBondsAction, { loading: bondsLoading }] = @@ -66,9 +69,25 @@ export function BuildingDetails({ )} - {location.type === PlayerLocationType.Settlement && ( + {location.id === hero.home?.id && ( )} + {location.type === PlayerLocationType.Settlement && + location.id !== hero.home?.id && ( + <> + + This settlement is a former capital that has fallen. You can + destroy this location and reclaim most of the resources. + + + + )} {location.type === PlayerLocationType.Barracks && ( )} {selectedBuilding && ( - + )} {!selectedBuilding && ( - + )}