Feldblatt: erkannte Angriffe nur noch im Block „Bedrohung“ (doppelte Zeile „Angriff erkannt – Ankunft in …“ entfernt)

This commit is contained in:
db9979 committed 2026-11-29 21:17:30 +01:00
1 parent 2d7febcbc7
commit 81b22ee73f
2 files changed
+6 -9

No files matched your search

+3 -6
View File
@@ -4,7 +4,7 @@ import { useState } from "react";
import { trpc, trpcClient } from "../lib/trpc.ts";
import { useCommand } from "../lib/command.ts";
import { label } from "../lib/names.ts";
import { fmtDuration, fmtTime, useNow } from "../lib/time.ts";
import { fmtDuration, useNow } from "../lib/time.ts";
import { Button, ErrorLine, Stepper, UnitChips, SmallButton } from "../ui.tsx";
type Counts = Record<string, number>;
@@ -44,14 +44,11 @@ export function FieldEscortEditor({ fieldId, garrison, escort }: { fieldId: numb
);
}
/** Erkannte Angriffe (Radar des Heimathafens) und eigene Verstärkungen unterwegs. */
export function FieldIncomingLines({ incoming, reinforcements }: { incoming: { arriveAtMs: number }[]; reinforcements: { arriveAtMs: number; units: Counts }[] }) {
/** Eigene Verstärkungen unterwegs. Erkannte Angriffe stehen im Block „Bedrohung“ (FieldThreats.tsx). */
export function FieldReinforcementLines({ reinforcements }: { reinforcements: { arriveAtMs: number; units: Counts }[] }) {
const now = useNow();
return (
<>
{incoming.map((a, i) => (
<div key={`a${i}`} className="text-xs font-semibold text-siegel">Angriff erkannt – Ankunft in {fmtDuration(Math.max(0, a.arriveAtMs - now))} ({fmtTime(a.arriveAtMs)})</div>
))}
{reinforcements.map((r, i) => (
<div key={`r${i}`} className="text-xs text-moos">Verstärkung unterwegs, Ankunft in {fmtDuration(Math.max(0, r.arriveAtMs - now))}: <UnitChips counts={r.units} /></div>
))}
+3 -3
View File
@@ -8,7 +8,7 @@ import { fmtDuration, fmtTime, useNow } from "../lib/time.ts";
import { Button, Card, ErrorLine, SmallButton, UnitChips } from "../ui.tsx";
import { Icon } from "../icons.tsx";
import type { Target } from "../App.tsx";
import { FieldEscortEditor, FieldIncomingLines } from "./FieldEscort.tsx"; // Felder 2: Geleit, Vorwarnung, Verstärkung
import { FieldEscortEditor, FieldReinforcementLines } from "./FieldEscort.tsx"; // Felder 2: Geleit, Verstärkung
import { IntelStand } from "./IntelStand.tsx"; // Lagebild
import { FieldThreatBlock } from "./FieldThreats.tsx"; // Bedrohung eigener Felder (Kartell, erkannter Angriff)
@@ -73,7 +73,7 @@ export function FieldSheet({ data, sel, onPlan }: { data: FieldsData | null | un
{f.relation !== "own" && <Button kind="secondary" className="flex-1" onClick={() => onPlan({ col: f.col, row: f.row, fieldId: f.id, fieldMission: "aufklaerung" })}>Aufklären</Button>}
{canTake && <Button className="flex-1" onClick={() => onPlan({ col: f.col, row: f.row, fieldId: f.id, fieldMission: "besetzen" })}>{f.owner ? "Angreifen" : "Besetzen"}</Button>}
</div>
{mine && <FieldIncomingLines incoming={mine.incoming} reinforcements={mine.reinforcements} />}
{mine && <FieldReinforcementLines reinforcements={mine.reinforcements} />}
{mine && <Button kind="secondary" className="w-full mt-2" onClick={() => onPlan({ col: f.col, row: f.row, fieldId: f.id, fieldMission: "besetzen" })}>Verstärken (Schiffe zur Besatzung schicken)</Button>}
{mine?.admiral && <AdmiralRecall fieldId={f.id} name={mine.admiral.name} />}
{mine && <RecallButton fieldId={f.id} />}
@@ -137,7 +137,7 @@ export function MyFieldsPanel({ base, onShowOnMap }: { base: BaseData; onShowOnM
<strong>{KIND_TEXT[m.kind]} · Stufe {m.tier}</strong> <span className="text-xs text-ink2 mono">Feld {m.col}/{m.row}</span>
<div className="text-xs text-emerald-300">Ertrag {resLine(m.yieldPerHour)}/h ({Math.round(m.factor * 100)} %{m.zoneBonus ? ", Zonenbonus" : ""}) · Unterhalt {fmtNum(m.upkeepPerHour)} Proviant/h</div>
<FieldThreatBlock threats={m.threats} />
<FieldIncomingLines incoming={m.incoming} reinforcements={m.reinforcements} />
<FieldReinforcementLines reinforcements={m.reinforcements} />
<div className="text-xs">Besatzung: <UnitChips counts={m.garrison} />{Object.keys(m.escort).length > 0 && <span className="text-ink2"> – gegen Spieler verteidigt: <UnitChips counts={m.defenders} /> (gegen das Kartell alle)</span>}</div>
<FieldEscortEditor key={JSON.stringify(m.escort)} fieldId={m.id} garrison={m.garrison} escort={m.escort} />
<div className="text-xs text-ink2">Nächste Lieferung {d.nextDeliveryAtMs ? `in ${fmtDuration(d.nextDeliveryAtMs - now)}` : "bald"} per Konvoi nach {m.home ?? base.name}</div>