Version 0.11.4: Mission auf der Karte zeigen, Wetter je Feld, Safari-Textumbruch

This commit is contained in:
db9979 committed 2026-11-26 23:19:13 +01:00
1 parent b756351ed9
commit cee34ccb5b
11 files changed
+148 -20

No files matched your search

+6
View File
@@ -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.
+2 -2
View File
@@ -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
<BaseScreen base={b} asOf={base.data.serverNow} sheet={sheet} setSheet={setSheet} onGuide={onGuide} onTroops={() => go("truppen")} onResearch={openResearch} />
</>
) : tab === "karte" ? (
<MapScreen base={b} focus={mapFocus} onPlan={openPlan} />
<MapScreen key={mapFocus?.missionId ?? "karte"} base={b} focus={mapFocus} onPlan={openPlan} />
) : tab === "truppen" ? (
<TroopsScreen base={b} onResearch={openResearch} onPlan={() => openPlan(null)} onShowOnMap={(t) => { setMapFocus(t); go("karte"); }} />
) : tab === "berichte" ? (
+11 -1
View File
@@ -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 }: {
<span className="text-ink2 font-normal"> · {fmtTime(ph.end)} Uhr</span>
</div>
</div>
<div className="grid grid-cols-[auto_1fr] gap-x-3 gap-y-1">
<div className="grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 items-center">
<span className="text-slate-400">Auftrag</span><span className="text-right">{kind}{m.spy?.building ? ` (${label(m.spy.building)})` : ""}</span>
<span className="text-slate-400">Ziel</span>
<span className="text-right">
+25 -2
View File
@@ -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 (
<div className="text-xs mt-1 flex items-start gap-2">
<Icon id={iconOf(w)} size={20} />
<span>
Wetter hier: {skyOf(w)}, Wind {beaufort(w.wind)} Bft{w.fog >= 0.3 ? `, Nebel ${Math.round(w.fog * 100)} %` : ""}
{effects.length > 0 && <span className={w.storm ? "text-siegel" : "text-ink2"}> – {effects.join(", ")}</span>}
</span>
</div>
);
}
type W = ReturnType<typeof weatherAt>;
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 (
<div className={`rounded-[3px] bg-card border px-2 py-1 flex items-center gap-2 ${w.storm ? "border-siegel border-l-4" : "border-rule"}`}>
<Icon id={icon} size={24} />
+82 -3
View File
@@ -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);
-2
View File
@@ -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 () => {
+4 -3
View File
@@ -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<Target | null>(focus);
const [missionId, setMissionId] = useState<number | null>(null);
const [sel, setSel] = useState<Target | null>(focus?.missionId ? null : focus);
const [missionId, setMissionId] = useState<number | null>(focus?.missionId ?? null);
const [recenter, setRecenter] = useState(0);
const [centerOn, setCenterOn] = useState<Target>(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 && (
<WorldEventCard e={info.event} onPlan={() => onPlan({ col: info.event!.col, row: info.event!.row, eventId: info.event!.id })} />
)}
{meta.data?.balance.weather && terrainAt(sel.col, sel.row) !== "land" && <WeatherLine at={sel} wb={meta.data.balance.weather} now={now} />}
{!info.base && !info.nest && !info.wreck && !info.event && (
<div className="text-slate-400 mt-1">Hier ist nichts. Ziele sind Piratennester (rote Raute) und fremde Stützpunkte.</div>
)}
+8 -4
View File
@@ -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:
</button>
</div>
<div className="text-xs text-slate-300"><UnitChips counts={m.status === "returning" ? m.returning : m.units} /></div>
<div className="text-sea-300">
{m.status === "outbound" ? `Ankunft in ${fmtDuration(m.arriveAtMs - now)}` : `Rückkehr in ${fmtDuration(m.returnAtMs - now)}`}
</div>
<button
type="button"
className="tap text-sea-300 text-left underline underline-offset-4 decoration-dotted"
onClick={() => onShowOnMap({ ...missionHex(m, { col: base.col, row: base.row }, now), missionId: m.id })}
>
{m.status === "outbound" ? `Ankunft in ${fmtDuration(m.arriveAtMs - now)}` : `Rückkehr in ${fmtDuration(m.returnAtMs - now)}`} · auf der Karte zeigen
</button>
{m.cargoHome && Object.values(m.cargoHome).some((v) => v > 0) && (
<div className="text-xs text-brass-400">Ladung: <UnitChips counts={m.cargoHome} /></div>
)}
+7
View File
@@ -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; }
+2 -2
View File
@@ -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/*"
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "tidefront",
"private": true,
"version": "0.11.3",
"version": "0.11.4",
"type": "module",
"engines": {
"node": ">=22.18"