Compare commits
7 commits
063fadd87d
...
84939cc839
| Author | SHA1 | Date | |
|---|---|---|---|
| 84939cc839 | |||
| 9865aa63b7 | |||
| d08ea8929c | |||
| ef7295c0d4 | |||
| 838c5035a4 | |||
| 1f230c0868 | |||
| 54e9a787cb |
11
AGENTS.md
|
|
@ -214,6 +214,17 @@ Leaflet world map at `/map` (top-level sidebar entry, whole unit views it). Full
|
|||
- **GameRules**: `proximityThreshold` now means meters (default 1000; migration backfilled rows still at the old default 10). Both call sites (shipments/actions.ts, structures/actions.ts transferResource) use meters.
|
||||
- **Tests**: `tests/int/map-system.int.spec.ts` (routing graph/snap/refusals, cross-map refusal, ground route + path snapshot, air straight-line, proximity, terrain/range validation, placeStructure happy/water/range cases, construction tick lifecycle, permission gating, label/styling helpers + save-action styling validation). Gotcha: Payload applies select `filterOptions` server-side, so test fixtures must use `approvalStatus: "in_progress"`.
|
||||
|
||||
## Mission Planning Map (Arma 3 markers)
|
||||
|
||||
Optional per-mission planning layer: the mission's own map (`classification.map`) rendered on the mission page with Arma 3 map markers that belong to that mission only (never on the shared world map).
|
||||
|
||||
- **Marker assets**: `bun run markers:arma` (`src/tools/arma/extractMarkers.ts`, needs the game install + `hemtt`; default game root `/mnt/LData/SteamLibrary/steamapps/common/Arma 3`, override `--game`). Scans `Dta`, `Addons` and every DLC `addons` dir (skips `@` mod folders), parses + merges `CfgMarkers` / `CfgMarkerColors` / `CfgMarkerBrushes` / `CfgMarkerClasses` with inheritance, resolves `$STR_` names via stringtables, converts icons to PNG in `public/arma/markers/` (committed, so prod needs no game files) and regenerates `src/lib/arma-markers/catalog.generated.ts` (never edit by hand). Side-color expressions resolve to Arma's default profile colors (BLUFOR 0,0.3,0.6 etc.).
|
||||
- **Catalog lib** (`src/lib/arma-markers/`, pure, client-safe): `index.ts` (case-insensitive `markerTypeOf`/`markerColorOf`/`markerBrushOf`, `resolveMarkerRgba` where color `Default` = the type's own config color, `markerTypesByCategory`), `missionMarkers.ts` (marker model mirroring Arma: shape icon/rectangle/ellipse/polyline + type/color/brush/text/size/direction/alpha/points; `normalizeMarkerInput` validation; `areaOutline` (direction = degrees clockwise from north, size = half-extents like `markerSize`); `hatchSegments` for pattern brushes; `armaGridRef`; `markersToSqf` export, y flipped against world height).
|
||||
- **Collection**: `mission-map-markers` (`src/collections/intelligence/MissionMapMarkers.ts`, permission group "Mission Map Markers", REST access permission-gated). Missions gained `classification.planningMapEnabled` (opt-in) and a `beforeDelete` hook that removes the mission's markers (the FK is NOT NULL, so Payload's default ON DELETE SET NULL would fail the delete). Migration `20261003_190000_add_mission_map_markers` (hand-written; matches the generated schema).
|
||||
- **Rules**: read = anyone who can read the mission (user-scoped `findByID`); edit = `missions:update` or the mission's `createdBy`. Service `src/lib/intelligence/missionMap.ts`; server actions `src/app/(frontend)/intelligence/missions/mapActions.ts` (`setMissionPlanningMap`, `getMissionMapMarkers`, `saveMissionMapMarker`, `deleteMissionMapMarker`, `clearMissionMapMarkers`; events `mission:planning-map-toggle` / `mission:map-marker-*` / `mission:map-markers-clear`, target `missions`). Max 1000 markers per mission.
|
||||
- **UI**: `src/components/frontend/intelligence/missionMap/` (tactical dossier section above the mission detail grid). `MissionPlanningMap` (state, debounced per-marker saves, 30s background refresh, Delete/Escape keys, SQF copy, Arma grid readout), `MissionMapCanvas` (Leaflet, basemap + roads/zones via `GET /api/map-features?mapId=&layers=base`, which skips structures/nodes/shipments), `MarkerToolPanel` (tools, type picker, colors, brush, text, scale/size, direction, opacity), `markerIcon.ts` + `iconStyle.ts` (icons render as texture MULTIPLIED by the marker color and masked by the texture alpha, exactly like Arma: white glyphs take the color, flags keep theirs). Editors see an "Enable planning map" card until it is on; non-editors see nothing until enabled.
|
||||
- **Gotchas**: leaflet click/dblclick/mousedown/mouseup fire faster than React re-renders, so draft line vertices and the area drag start live in refs (state only drives the preview). URLs inside divIcon HTML must use single quotes (`url('...')`): a double quote ends the `style` attribute and the glyph silently disappears. Radix Select keeps `pointer-events: none` on `<body>` briefly after closing (affects scripted drags right after choosing a brush). Tests: `tests/int/mission-map.int.spec.ts`, `tests/e2e/mission-planning-map.e2e.spec.ts`.
|
||||
|
||||
## Personnel (NPC directory)
|
||||
|
||||
- `/personnel/contacts` — NPC directory over `game-npcs` (`src/components/frontend/personnel/`: `NpcDirectory`, `NpcCard`); `/personnel/contacts/[id]` — NPC profile (faction, in-game vs generated badges, vendor listings, `NpcProfile`).
|
||||
|
|
|
|||
14
CHANGELOG.md
|
|
@ -1,5 +1,19 @@
|
|||
# Changelog
|
||||
|
||||
# v0.4.0
|
||||
|
||||
Mission pages get their own planning map, and the Intelligence section is back for everyone.
|
||||
|
||||
### Features
|
||||
|
||||
- **Mission planning maps**: a mission can now enable its own planning map, drawn on the mission's terrain with the same markers you know from in-game. Place icons, areas and lines, label and color them, then copy the whole plan as SQF to paste into your mission. Everyone who can see the mission can view the plan; the creator and intel staff can edit it.
|
||||
|
||||
### Fixes
|
||||
|
||||
- **Intelligence navigation**: the Intelligence section of the sidebar (Campaigns, Missions, Factions, Wiki) is visible to every member again, and the mission and campaign widgets are back on the dashboard.
|
||||
|
||||
---
|
||||
|
||||
# v0.3.1
|
||||
|
||||
### Fixes
|
||||
|
|
|
|||
|
|
@ -273,3 +273,20 @@ Per map, in the Payload admin panel (World: Maps):
|
|||
map's `minZoom` to the lowest level your pyramid actually serves).
|
||||
- `minZoom`/`maxZoom`/`defaultZoom` and `defaultCenterX`/`defaultCenterY`
|
||||
(meters) tune the initial view. `isActive` hides maps from the page.
|
||||
|
||||
## Mission planning maps
|
||||
|
||||
A mission can opt in to a planning map (`classification.planningMapEnabled`).
|
||||
The mission page then shows that mission's map (basemap, plus roads and zones
|
||||
as toggles) with a layer of Arma 3 markers stored in `mission-map-markers`.
|
||||
Those markers belong to the one mission and never appear on `/map`.
|
||||
|
||||
- Marker coordinates use the same meters as every other map feature (origin
|
||||
top-left, y south). The SQF export flips y against the world height, so
|
||||
`worldSizeWidth`/`worldSizeHeight` must match the terrain's real size for
|
||||
exported markers to land in the right place in-game.
|
||||
- The base layers come from `GET /api/map-features?mapId=<id>&layers=base`,
|
||||
which skips the structure, node and shipment queries.
|
||||
- Icons, colors and brushes come from the game config via
|
||||
`bun run markers:arma`. See the "Mission Planning Map" section in AGENTS.md
|
||||
for the full wiring.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "polaris-task-force",
|
||||
"version": "0.3.1",
|
||||
"version": "0.4.0",
|
||||
"description": "Web app for the Arma 3 unit Polaris Task Force. Uses Next.js for client- and server-side rendering, with a Postgres database and some other neat libraries.",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
"generate:version-info": "bun run src/scripts/generateVersionInfo.ts",
|
||||
"import:arma": "bun run src/tools/import/importArmaLibrary.ts",
|
||||
"icons:arma": "bun run src/tools/import/extractArmaIcons.ts",
|
||||
"markers:arma": "bun run src/tools/arma/extractMarkers.ts",
|
||||
"version:bump": "bun run src/scripts/bumpVersion.ts",
|
||||
"lint": "cross-env NODE_OPTIONS=--no-deprecation next lint",
|
||||
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/groupicons/waypoint.png
Normal file
|
After Width: | Height: | Size: 504 B |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/bunker_ca.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/bush_ca.png
Normal file
|
After Width: | Height: | Size: 542 B |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/busstop_ca.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/chapel_ca.png
Normal file
|
After Width: | Height: | Size: 751 B |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/church_ca.png
Normal file
|
After Width: | Height: | Size: 415 B |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/cross_ca.png
Normal file
|
After Width: | Height: | Size: 628 B |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/fountain_ca.png
Normal file
|
After Width: | Height: | Size: 990 B |
|
After Width: | Height: | Size: 1 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/hospital_ca.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/power_ca.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/powerwave_ca.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/powerwind_ca.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/quay_ca.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/rock_ca.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/ruin_ca.png
Normal file
|
After Width: | Height: | Size: 346 B |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/smalltree_ca.png
Normal file
|
After Width: | Height: | Size: 886 B |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/stack_ca.png
Normal file
|
After Width: | Height: | Size: 736 B |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/tourism_ca.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/tree_ca.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
public/arma/markers/a3/ui_f/data/map/mapcontrol/viewtower_ca.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
BIN
public/arma/markers/a3/ui_f_curator/data/cfgmarkers/kia_ca.png
Normal file
|
After Width: | Height: | Size: 3 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/arma/markers/a3/ui_f_enoch/data/cfgmarkers/astra_ca.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
public/arma/markers/a3/ui_f_enoch/data/cfgmarkers/ldf_ca.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
public/arma/markers/a3/ui_f_enoch/data/cfgmarkers/livonia_ca.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
BIN
public/arma/markers/a3/ui_f_enoch/data/cfgmarkers/russia_ca.png
Normal file
|
After Width: | Height: | Size: 725 B |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
BIN
public/arma/markers/a3/ui_f_orange/data/cfgmarkers/idap_ca.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
BIN
public/arma/markers/a3/ui_f_orange/data/cfgmarkers/white_ca.png
Normal file
|
After Width: | Height: | Size: 696 B |
BIN
public/arma/markers/flags/aaf_ca.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
public/arma/markers/flags/altis_ca.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
public/arma/markers/flags/altiscolonial_ca.png
Normal file
|
After Width: | Height: | Size: 6 KiB |
BIN
public/arma/markers/flags/belgium_ca.png
Normal file
|
After Width: | Height: | Size: 811 B |
BIN
public/arma/markers/flags/canada_ca.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/arma/markers/flags/croatia_ca.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
public/arma/markers/flags/csat_ca.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
public/arma/markers/flags/ctrg_ca.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
public/arma/markers/flags/czechrepublic_ca.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
public/arma/markers/flags/denmark_ca.png
Normal file
|
After Width: | Height: | Size: 862 B |
BIN
public/arma/markers/flags/eu_ca.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/arma/markers/flags/fia_ca.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
public/arma/markers/flags/france_ca.png
Normal file
|
After Width: | Height: | Size: 754 B |
BIN
public/arma/markers/flags/georgia_ca.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/arma/markers/flags/germany_ca.png
Normal file
|
After Width: | Height: | Size: 726 B |
BIN
public/arma/markers/flags/greece_ca.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/arma/markers/flags/hungary_ca.png
Normal file
|
After Width: | Height: | Size: 737 B |
BIN
public/arma/markers/flags/iceland_ca.png
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
public/arma/markers/flags/italy_ca.png
Normal file
|
After Width: | Height: | Size: 755 B |
BIN
public/arma/markers/flags/luxembourg_ca.png
Normal file
|
After Width: | Height: | Size: 739 B |
BIN
public/arma/markers/flags/nato_ca.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
public/arma/markers/flags/netherlands_ca.png
Normal file
|
After Width: | Height: | Size: 739 B |
BIN
public/arma/markers/flags/norway_ca.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/arma/markers/flags/poland_ca.png
Normal file
|
After Width: | Height: | Size: 740 B |
BIN
public/arma/markers/flags/portugal_ca.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/arma/markers/flags/slovakia_ca.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
public/arma/markers/flags/slovenia_ca.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/arma/markers/flags/spain_ca.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
public/arma/markers/flags/syndicat_ca.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/arma/markers/flags/tanoa_ca.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
public/arma/markers/flags/tanoagendarmerie_ca.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
public/arma/markers/flags/uk_ca.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
public/arma/markers/flags/un_ca.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
public/arma/markers/flags/usa_ca.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
public/arma/markers/flags/viper_ca.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
public/arma/markers/handdrawn/ambush_ca.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
public/arma/markers/handdrawn/arrow_ca.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/arma/markers/handdrawn/destroy_ca.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/arma/markers/handdrawn/dot_ca.png
Normal file
|
After Width: | Height: | Size: 669 B |
BIN
public/arma/markers/handdrawn/end_ca.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
public/arma/markers/handdrawn/flag_ca.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
public/arma/markers/handdrawn/join_ca.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
public/arma/markers/handdrawn/objective_ca.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
public/arma/markers/handdrawn/pickup_ca.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
public/arma/markers/handdrawn/start_ca.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
public/arma/markers/handdrawn/unknown_ca.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/arma/markers/handdrawn/warning_ca.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |