diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c7c378..8aef724 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ Änderungen an TIDEFRONT, neueste zuerst. Die Version steht im Handbuch unten und auf dem Anmeldebildschirm. +## 0.11.4 – 27.11.2026 +- **Mission auf der Karte zeigen**: In der Missionsliste (Truppen) springt „auf der Karte zeigen“ zur aktuellen Position des Verbands und öffnet das Missionsblatt. +- **Wetter je Feld**: Beim Hineinzoomen bekommt jedes Seefeld sein eigenes Wetterzeichen – Windpfeil mit Stärke-Fiedern, Wolkentönung, Regen, Nebel, Sturmfelder rot umrandet mit Blitz. Weit draußen bleibt die Wetterkarte mit Tiefs und Hochs. +- **Feld antippen zeigt das Wetter**: Himmel, Windstärke, Nebel und die Wirkung (Schiffe langsamer, Flugzeuge am Boden, Aufklärung ungenau, Luftschlag schwächer). +- iPhone/Safari: Texte vergrößern sich nicht mehr eigenmächtig und brechen sauber um; Silbentrennung im Fließtext. + ## 0.11.3 – 27.11.2026 - **Verband antippen**: Ein Tipp auf ein eigenes Schiff auf der Karte öffnet die Mission im Detail – Auftrag, Ziel, Fortschritt, Abfahrt, Ankunft, Rückkehr, Truppen, Verluste und Ladung; auf der Hinfahrt mit „Zurückrufen“. - **Wetter wie auf einer Wetterkarte**: Tiefs (T) und Hochs (H) mit Isobaren, Windpfeile mit Fiedern je nach Stärke, Wolkenfelder mit Regen, Sturmzellen mit Blitz und Nebelschleier. Neu: ein Wetterkärtchen „Am Hafen“ mit Himmel und Windstärke in Beaufort. diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 723cb79..a7b381d 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -34,7 +34,7 @@ const BugReportSheet = lazy(() => import("./components/BugReport.tsx").then((m) export type Tab = "basis" | "karte" | "truppen" | "berichte" | "boerse"; /** Missionsziel; eventId: Weltereignis (Schatzschiff, Großflotte, Belagerung). */ -export interface Target { col: number; row: number; eventId?: number } +export interface Target { col: number; row: number; eventId?: number; /** Karte: dieses Missionsblatt öffnen. */ missionId?: number } const TABS: { id: Tab; label: string; icon: string }[] = [ { id: "basis", label: "Basis", icon: "nav-basis" }, @@ -213,7 +213,7 @@ function Game({ playerId, playerName, onLoggedOut }: { playerId: number; playerN go("truppen")} onResearch={openResearch} /> ) : tab === "karte" ? ( - + ) : tab === "truppen" ? ( openPlan(null)} onShowOnMap={(t) => { setMapFocus(t); go("karte"); }} /> ) : tab === "berichte" ? ( diff --git a/apps/web/src/components/MissionSheet.tsx b/apps/web/src/components/MissionSheet.tsx index a7531f0..0a386b6 100644 --- a/apps/web/src/components/MissionSheet.tsx +++ b/apps/web/src/components/MissionSheet.tsx @@ -8,6 +8,7 @@ import { fmtDuration, fmtTime } from "../lib/time.ts"; import { Bar, Button, ErrorLine, Sheet, UnitChips } from "../ui.tsx"; import { Icon } from "../icons.tsx"; import { spyKindText } from "./SpyPlan.tsx"; +import { hexAtXY, hexCenterXY } from "@tidefront/world"; type MissionData = BaseData["missions"][number]; @@ -57,6 +58,15 @@ export function missionPhase(m: MissionData, now: number) { return { outbound, start, end, progress: Math.max(0, Math.min(1, (now - start) / Math.max(1, end - start))) }; } +/** Feld, auf dem der Verband gerade fährt (gerade Linie Heimathafen ↔ Ziel wie auf der Karte). */ +export function missionHex(m: MissionData, home: { col: number; row: number }, now: number): { col: number; row: number } { + const ph = missionPhase(m, now); + const a = hexCenterXY(home.col, home.row); + const b = hexCenterXY(m.target.col, m.target.row); + const t = ph.outbound ? ph.progress : 1 - ph.progress; + return hexAtXY(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); +} + /** Infoblatt eines Verbands: Auftrag, Ziel, Truppen, Zeiten, Fortschritt, Ladung, Rückruf. */ export function MissionSheet({ mission, now, home, onClose, onShowTarget }: { mission: MissionData; @@ -93,7 +103,7 @@ export function MissionSheet({ mission, now, home, onClose, onShowTarget }: { · {fmtTime(ph.end)} Uhr -
+
Auftrag{kind}{m.spy?.building ? ` (${label(m.spy.building)})` : ""} Ziel diff --git a/apps/web/src/map/WeatherChip.tsx b/apps/web/src/map/WeatherChip.tsx index cdf2fee..0bc7a3c 100644 --- a/apps/web/src/map/WeatherChip.tsx +++ b/apps/web/src/map/WeatherChip.tsx @@ -6,10 +6,33 @@ import { Icon } from "../icons.tsx"; /** Windstärke 0–1 grob in Beaufort (0–12). */ export const beaufort = (wind: number) => Math.max(0, Math.min(12, Math.round(wind * 12))); +/** Wetter an einem Feld als Text mit Wirkung (Feld-Infoblatt). */ +export function WeatherLine({ at, wb, now }: { at: { col: number; row: number }; wb: WeatherBalance; now: number }) { + const w = weatherAt(hexCenter(at.col, at.row), now, wb); + const effects: string[] = []; + if (w.wind >= wb.shipSlowFrom) effects.push("Schiffe langsamer"); + if (w.storm) effects.push("Flugzeuge bleiben am Boden"); + if (w.fog >= wb.fogScoutFrom) effects.push("Aufklärung ungenau, Radar kürzer"); + if (w.clouds >= 0.6) effects.push("Luftschlag schwächer"); + return ( +
+ + + Wetter hier: {skyOf(w)}, Wind {beaufort(w.wind)} Bft{w.fog >= 0.3 ? `, Nebel ${Math.round(w.fog * 100)} %` : ""} + {effects.length > 0 && – {effects.join(", ")}} + +
+ ); +} + +type W = ReturnType; +const iconOf = (w: W) => (w.storm ? "sturm" : w.fog >= 0.45 ? "nebel" : w.clouds >= 0.55 ? "wolke" : w.daylight > 0 ? "sonne" : "wind"); +const skyOf = (w: W) => (w.storm ? "Sturm" : w.fog >= 0.45 ? "Nebel" : w.clouds >= 0.8 ? "bedeckt" : w.clouds >= 0.55 ? "bewölkt" : w.clouds >= 0.3 ? "heiter" : w.daylight > 0 ? "sonnig" : "klar"); + export function WeatherChip({ at, wb, now }: { at: { col: number; row: number }; wb: WeatherBalance; now: number }) { const w = weatherAt(hexCenter(at.col, at.row), now, wb); - const icon = w.storm ? "sturm" : w.fog >= 0.45 ? "nebel" : w.clouds >= 0.55 ? "wolke" : w.daylight > 0 ? "sonne" : "wind"; - const sky = w.storm ? "Sturm" : w.fog >= 0.45 ? "Nebel" : w.clouds >= 0.8 ? "bedeckt" : w.clouds >= 0.55 ? "bewölkt" : w.clouds >= 0.3 ? "heiter" : w.daylight > 0 ? "sonnig" : "klar"; + const icon = iconOf(w); + const sky = skyOf(w); return (
diff --git a/apps/web/src/map/weather.ts b/apps/web/src/map/weather.ts index 23d75ff..c213be9 100644 --- a/apps/web/src/map/weather.ts +++ b/apps/web/src/map/weather.ts @@ -4,7 +4,8 @@ // oder bei deutlicher Zoomänderung; die T/H-Schilder behalten bei jedem Zoom ihre Bildschirmgröße. import { Container, Graphics, Text } from "pixi.js"; import { weatherAt, weatherSystemsAt, type WeatherBalance } from "@tidefront/game-core"; -import { COLS, KM_PER_DEG_LAT, KM_PER_DEG_LON, LAT1, LON0, ROWS, hexCenter, hexCenterXY } from "@tidefront/world"; +import { COLS, HEX_SIZE_KM, terrainAt, KM_PER_DEG_LAT, KM_PER_DEG_LON, LAT1, LON0, ROWS, hexCenter, hexCenterXY } from "@tidefront/world"; +import { weatherAlpha } from "./lod.ts"; import { INK, PAPER, SEE, SIEGEL } from "./symbols.ts"; /** Abtastung: jedes STEP-te Feld in beide Richtungen. */ @@ -13,6 +14,18 @@ const REDRAW_MS = 15 * 60000; const CLOUD = 0x8c96a3; const FOG = 0xdfe8ee; const SERIF = "Fraunces, Georgia, serif"; +/** Ab diesem Zoom werden betroffene Felder einzeln eingefärbt (Sturm, Nebel, dichte Wolken). */ +const HEX_FROM = 0.42; + +/** Sechseck (Spitze oben) um einen Feldmittelpunkt. */ +function hexPoly(x: number, y: number, r: number): number[] { + const pts: number[] = []; + for (let k = 0; k < 6; k++) { + const a = ((60 * k - 30) * Math.PI) / 180; + pts.push(x + r * Math.cos(a), y + r * Math.sin(a)); + } + return pts; +} export interface WeatherLayer { root: Container; @@ -70,10 +83,14 @@ function pressureLabel(low: boolean): Container { export function buildWeatherLayer(wb: WeatherBalance): WeatherLayer { const root = new Container(); + const atmos = new Container(); const wash = new Graphics(); const lines = new Graphics(); const labels = new Container(); - root.addChild(wash, lines, labels); + const fields = new Graphics(); + const fieldLines = new Graphics(); + atmos.addChild(wash, lines); + root.addChild(fields, fieldLines, atmos, labels); const cells: Cell[] = []; for (let row = 1; row < ROWS; row += STEP) { for (let col = 1; col < COLS; col += STEP) { @@ -166,6 +183,62 @@ export function buildWeatherLayer(wb: WeatherBalance): WeatherLayer { } lines.stroke({ color: SEE, width: 1.4 * px, alpha: 0.45 }); + // Nah dran: jedes Feld mit eigenem Wetterzeichen – genau dort wirkt das Wetter (Route, Radar, Kampfort). + fields.clear(); + fieldLines.clear(); + if (scale >= HEX_FROM) { + const r = HEX_SIZE_KM * 0.97; + const wind: number[][] = []; + const rain: number[][] = []; + const fog: number[][] = []; + const bolts: number[][] = []; + for (let row = 0; row < ROWS; row++) { + for (let col = 0; col < COLS; col++) { + if (terrainAt(col, row) === "land") continue; + const { lat, lon } = hexCenter(col, row); + const w = weatherAt({ lat, lon }, ms, wb); + const { x, y } = hexCenterXY(col, row); + const poly = hexPoly(x, y, r); + if (w.storm) fields.poly(poly).fill({ color: SIEGEL, alpha: 0.16 }).stroke({ color: SIEGEL, width: 1.6 * px, alpha: 0.7 }); + else if (w.fog >= 0.45) fields.poly(poly).fill({ color: SEE, alpha: 0.08 + 0.12 * w.fog }); + else if (w.clouds >= 0.5) fields.poly(poly).fill({ color: CLOUD, alpha: (w.clouds - 0.5) * 0.45 }); + if (w.storm) bolts.push([x, y]); + if (w.fog >= 0.45) fog.push([x, y]); + if (w.clouds >= 0.72 && !w.storm) rain.push([x, y]); + if (w.wind >= 0.15) wind.push([x, y, w.wind]); + } + } + const R = HEX_SIZE_KM; + for (const [x, y, v] of wind) { + const d = windDir(x, y, systems); + const len = R * 0.75; + const tx = x + (d.x * len) / 2, ty = y + (d.y * len) / 2; + const bx = x - (d.x * len) / 2, by = y - (d.y * len) / 2; + const h = R * 0.2; + fieldLines.moveTo(bx, by).lineTo(tx, ty); + fieldLines.moveTo(tx - d.x * h - d.y * h * 0.55, ty - d.y * h + d.x * h * 0.55).lineTo(tx, ty).lineTo(tx - d.x * h + d.y * h * 0.55, ty - d.y * h - d.x * h * 0.55); + const barbs = v >= 0.8 ? 3 : v >= 0.6 ? 2 : v >= 0.4 ? 1 : 0; + for (let b = 0; b < barbs; b++) { + const ox = bx + d.x * R * 0.13 * b, oy = by + d.y * R * 0.13 * b; + fieldLines.moveTo(ox, oy).lineTo(ox + d.y * R * 0.24 - d.x * R * 0.08, oy - d.x * R * 0.24 - d.y * R * 0.08); + } + } + fieldLines.stroke({ color: INK, width: 1.6 * px, alpha: 0.75 }); + for (const [x, y] of rain) { + for (let k = -1; k <= 1; k++) fieldLines.moveTo(x + k * R * 0.3 + R * 0.08, y + R * 0.3).lineTo(x + k * R * 0.3 - R * 0.04, y + R * 0.6); + } + fieldLines.stroke({ color: SEE, width: 1.6 * px, alpha: 0.8 }); + for (const [x, y] of fog) { + for (const yy of [-0.35, 0.45]) for (let k = -2; k <= 2; k++) fieldLines.moveTo(x + k * R * 0.22 - R * 0.06, y + yy * R).lineTo(x + k * R * 0.22 + R * 0.06, y + yy * R); + } + fieldLines.stroke({ color: SEE, width: 1.6 * px, alpha: 0.7 }); + for (const [x, y] of bolts) { + const b = R * 0.3; + fieldLines.moveTo(x + R * 0.45 + b * 0.3, y - R * 0.5 - b).lineTo(x + R * 0.45 - b * 0.25, y - R * 0.5 + b * 0.05).lineTo(x + R * 0.45 + b * 0.2, y - R * 0.5 + b * 0.05).lineTo(x + R * 0.45 - b * 0.3, y - R * 0.5 + b); + } + fieldLines.stroke({ color: SIEGEL, width: 2.2 * px, alpha: 0.95 }); + } + // Schilder T (Tief) und H (Hoch) in der Mitte der Systeme. for (const s of systems) { const l = pressureLabel(s.sign > 0); @@ -177,9 +250,15 @@ export function buildWeatherLayer(wb: WeatherBalance): WeatherLayer { return { root, update(nowMs: number, scale: number): void { + // Übersicht (Wetterkarte) blendet aus, Feldzeichen blenden ein; T/H bleiben immer. + const near = Math.max(0, Math.min(1, (scale - HEX_FROM) / 0.12)); + atmos.alpha = weatherAlpha(scale) * (1 - near); + fields.alpha = near; + fieldLines.alpha = near; for (const l of labels.children) l.scale.set(Math.max(0.6, Math.min(1.1, scale / 0.3 + 0.3)) / scale); const slot = Math.floor(nowMs / REDRAW_MS) * REDRAW_MS; - if (slot === drawnAt && drawnScale > 0 && Math.abs(Math.log(scale / drawnScale)) < 0.15) return; + const sameMode = (scale >= HEX_FROM) === (drawnScale >= HEX_FROM); + if (slot === drawnAt && drawnScale > 0 && sameMode && Math.abs(Math.log(scale / drawnScale)) < 0.15) return; drawnAt = slot; drawnScale = scale; draw(slot, scale); diff --git a/apps/web/src/screens/HexMap.tsx b/apps/web/src/screens/HexMap.tsx index 8fa6594..51ced2f 100644 --- a/apps/web/src/screens/HexMap.tsx +++ b/apps/web/src/screens/HexMap.tsx @@ -253,7 +253,6 @@ export function HexMap(props: HexMapProps) { drawMovers(s, live.current); const wl = weatherLayer.current; if (wl) { - wl.root.alpha = weatherAlpha(sc); wl.update(serverNow(), sc); } } @@ -390,7 +389,6 @@ export function HexMap(props: HexMapProps) { if (!ready || !s || !weather) return; const layer = buildWeatherLayer(weather); s.world.addChildAt(layer.root, s.world.getChildIndex(s.routes)); - layer.root.alpha = weatherAlpha(s.world.scale.x); layer.update(serverNow(), s.world.scale.x); weatherLayer.current = layer; return () => { diff --git a/apps/web/src/screens/MapScreen.tsx b/apps/web/src/screens/MapScreen.tsx index 6d16157..af0adbf 100644 --- a/apps/web/src/screens/MapScreen.tsx +++ b/apps/web/src/screens/MapScreen.tsx @@ -11,7 +11,7 @@ import { MapLegend } from "../map/Legend.tsx"; import { RELATION_HEX, TacticalIcon, relationKind } from "../map/TacticalIcon.tsx"; import { fmtPosition } from "../map/coords.ts"; import { MissionSheet } from "../components/MissionSheet.tsx"; -import { WeatherChip } from "../map/WeatherChip.tsx"; +import { WeatherChip, WeatherLine } from "../map/WeatherChip.tsx"; // Weltereignisse import { WorldEventCard, useWorldEvents } from "../components/WorldEvents.tsx"; @@ -29,8 +29,8 @@ export function MapScreen({ base, focus, onPlan }: { base: BaseData; focus: Targ const map = useQuery({ ...trpc.world.map.queryOptions(), refetchInterval: 60000 }); const meta = useQuery({ ...trpc.meta.queryOptions(), staleTime: Infinity }); const worldEvents = useWorldEvents(); - const [sel, setSel] = useState(focus); - const [missionId, setMissionId] = useState(null); + const [sel, setSel] = useState(focus?.missionId ? null : focus); + const [missionId, setMissionId] = useState(focus?.missionId ?? null); const [recenter, setRecenter] = useState(0); const [centerOn, setCenterOn] = useState(focus ?? { col: base.col, row: base.row }); // Wetterschicht (v1.6): abschaltbar, Wahl bleibt im Gerät. @@ -166,6 +166,7 @@ export function MapScreen({ base, focus, onPlan }: { base: BaseData; focus: Targ {info.event && ( onPlan({ col: info.event!.col, row: info.event!.row, eventId: info.event!.id })} /> )} + {meta.data?.balance.weather && terrainAt(sel.col, sel.row) !== "land" && } {!info.base && !info.nest && !info.wreck && !info.event && (
Hier ist nichts. Ziele sind Piratennester (rote Raute) und fremde Stützpunkte.
)} diff --git a/apps/web/src/screens/Troops.tsx b/apps/web/src/screens/Troops.tsx index 026f8d0..eef72cc 100644 --- a/apps/web/src/screens/Troops.tsx +++ b/apps/web/src/screens/Troops.tsx @@ -15,7 +15,7 @@ import { TECH, techName } from "../lib/research.ts"; import { unitBreakdown } from "../lib/breakdown.ts"; import { Breakdown, RankBadge, VeteranLine } from "../components/Breakdown.tsx"; import { spyKindText } from "../components/SpyPlan.tsx"; // Nachrichtendienst -import { RecallSheet, targetName } from "../components/MissionSheet.tsx"; +import { RecallSheet, missionHex, targetName } from "../components/MissionSheet.tsx"; export { targetName }; /** Werte, die die Aufschlüsselung zeigt (aus der festen Werte-Tabelle ausgeblendet). */ @@ -71,9 +71,13 @@ export function TroopsScreen({ base, onPlan, onShowOnMap, onResearch }: { base:
-
- {m.status === "outbound" ? `Ankunft in ${fmtDuration(m.arriveAtMs - now)}` : `Rückkehr in ${fmtDuration(m.returnAtMs - now)}`} -
+ {m.cargoHome && Object.values(m.cargoHome).some((v) => v > 0) && (
Ladung:
)} diff --git a/apps/web/src/styles.css b/apps/web/src/styles.css index a38a389..b460b2d 100644 --- a/apps/web/src/styles.css +++ b/apps/web/src/styles.css @@ -72,6 +72,8 @@ } html, body, #root { height: 100%; } +/* Safari (iPhone) vergrößert Schrift sonst eigenmächtig, etwa im Querformat – dann laufen Texte über den Rand. */ +html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; } body { margin: 0; color: var(--color-ink); @@ -79,11 +81,16 @@ body { font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; + /* Lange deutsche Wörter und Namen umbrechen statt über den Rahmen zu laufen; Silbentrennung nach lang="de". */ + overflow-wrap: break-word; background-color: var(--color-paper); /* Papierfaser: eine kleine Rauschkachel, einmal gerastert und gekachelt. */ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"); } input, select, button, textarea { font: inherit; } +/* Silbentrennung (lang="de") nur im Fließtext, nicht in Navigation, Knöpfen, Zahlen. */ +main :where(p, li) { hyphens: auto; -webkit-hyphens: auto; } +main :where(.mono, code, button) { hyphens: manual; -webkit-hyphens: manual; } input, select, textarea { color: var(--color-ink); } ::placeholder { color: #6b7380; } :focus-visible { outline: 2px solid var(--color-see); outline-offset: 2px; } diff --git a/package-lock.json b/package-lock.json index 6e0d810..2cf5dba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tidefront", - "version": "0.11.3", + "version": "0.11.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tidefront", - "version": "0.11.3", + "version": "0.11.4", "workspaces": [ "packages/*", "apps/*" diff --git a/package.json b/package.json index e95c3b1..27b7e7c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tidefront", "private": true, - "version": "0.11.3", + "version": "0.11.4", "type": "module", "engines": { "node": ">=22.18"