From 234dc32c8645ec2bf84acbea58f2aa792a0d0b9f Mon Sep 17 00:00:00 2001 From: Lucio Chen Date: Sun, 9 Aug 2026 17:04:36 -0700 Subject: [PATCH] Add editable export workflow and new map sources --- .gitattributes | 4 + .gitignore | 18 +- DOCUMENTATION.md | 15 +- PLAN.md | 12 +- README.md | 52 +- docs/adding-a-map.md | 7 +- maps.json | 310 +++++++- re3mrTransits/re3mrTransits.psd | 3 + server/Caddyfile | 4 +- server/run.ps1 | 63 +- server/serve.py | 140 +++- sources/customs/customs-dorms.psd | 3 + sources/customs/customs-reference.png | 3 + sources/customs/customs.psd | 3 + sources/customs/re3mrCustoms2.7z | 3 + sources/factory/re3mrFactory.psd | 3 + sources/ground-zero/GroundZeroByRe3mr.psd | 3 + sources/interchange/interchange.psd | 3 + sources/labyrinth/re3mrLabyrinth.psd | 3 + sources/lighthouse/lighthouse.psd | 3 + sources/reserve/reserve.psd | 3 + sources/shoreline-resort/shoreline-resort.psd | 3 + sources/shoreline/shoreline.psd | 3 + sources/streets/streets.psd | 3 + sources/woods/woods.psd | 3 + tools/extract_markers.py | 46 +- web/app.js | 274 ++++++- web/data/capabilities.json | 6 + web/data/marker-defaults/factory.json | 141 ++++ web/data/marker-defaults/ground-zero.json | 186 +++++ web/data/marker-defaults/labyrinth.json | 744 ++++++++++++++++++ web/index.html | 7 +- web/style.css | 14 +- 33 files changed, 1976 insertions(+), 112 deletions(-) create mode 100644 .gitattributes create mode 100644 re3mrTransits/re3mrTransits.psd create mode 100644 sources/customs/customs-dorms.psd create mode 100644 sources/customs/customs-reference.png create mode 100644 sources/customs/customs.psd create mode 100644 sources/customs/re3mrCustoms2.7z create mode 100644 sources/factory/re3mrFactory.psd create mode 100644 sources/ground-zero/GroundZeroByRe3mr.psd create mode 100644 sources/interchange/interchange.psd create mode 100644 sources/labyrinth/re3mrLabyrinth.psd create mode 100644 sources/lighthouse/lighthouse.psd create mode 100644 sources/reserve/reserve.psd create mode 100644 sources/shoreline-resort/shoreline-resort.psd create mode 100644 sources/shoreline/shoreline.psd create mode 100644 sources/streets/streets.psd create mode 100644 sources/woods/woods.psd create mode 100644 web/data/capabilities.json create mode 100644 web/data/marker-defaults/factory.json create mode 100644 web/data/marker-defaults/ground-zero.json create mode 100644 web/data/marker-defaults/labyrinth.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0b0f112 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +*.psd filter=lfs diff=lfs merge=lfs -text +*.psb filter=lfs diff=lfs merge=lfs -text +*.7z filter=lfs diff=lfs merge=lfs -text +sources/**/*.png filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index 3115260..721bc41 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,4 @@ -# Source art: hundreds of MB to >1 GB per map. Keep these on the shared -# drive, never in git. See docs/adding-a-map.md. -# ...except the overall base map: 1.3 MB, and every placement in maps.json is -# expressed relative to it, so the repo cannot build without it. Git will not -# descend into an excluded directory, so the path has to be re-included one -# level at a time. -sources/* -!sources/overall/ -sources/overall/* -!sources/overall/*.jpeg - -*.psd -*.psb -*.7z +# Source artwork is committed through Git LFS. See .gitattributes. # Generated by tools/build.py -- rebuildable from sources/, so not tracked. build/ @@ -20,6 +7,9 @@ web/tiles-trimmed/ web/data/world.json web/data/markers/ +# Deployable static-site bundles created by the editable server. +exports/ + # Fetched by server/get-caddy.ps1 -- a 47 MB binary, not source. server/caddy.exe server/caddy.out diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index ce36456..2e51c2c 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -48,7 +48,7 @@ Two deliberate scope choices: ## 2. How it fits together ``` -sources//*.psd layered source art (gitignored, 0.2-1.1 GB each) +sources//*.psd layered source art (Git LFS, 0.2-1.1 GB each) │ │ tools/export_base.py keep only baseLayers, drop everything else ▼ @@ -754,9 +754,11 @@ focused map is topmost in all seven tested cases. proper touch targets, but this is unproven — the browser pane used during development would not composite frames, so verification was DOM- and network-level, never pixels. -- **Ground Zero, Factory and Labs** are on the base map but have no detail map. -- **Source PSDs have no agreed home.** They are gitignored; the team needs a - shared drive or NAS path recorded in the README. +- **Labs** is on the base map but has no detail map. Ground Zero, Factory, and + Labyrinth have been imported; Transit is intentionally reserved for a later + route-visualization style. +- **Source PSDs are Git LFS objects.** A full clone requires Git LFS and several + gigabytes of storage. --- @@ -772,5 +774,6 @@ confirmed in every PSD. Local and LAN hosting is unambiguously fine. **Get sign-off before hosting publicly** — ShareAlike would apply to the tiles as adapted works. -The `sources/` directory is gitignored except `overall.jpeg`, which is 1.3 MB -and is the anchor every placement is expressed against. +The `sources/` directory is versioned through Git LFS for large source assets. +`overall.jpeg` remains a normal Git object and is the anchor every placement is +expressed against. diff --git a/PLAN.md b/PLAN.md index 5c160e6..f91386c 100644 --- a/PLAN.md +++ b/PLAN.md @@ -65,7 +65,8 @@ Licence in both files: **CC BY-NC-SA 4.0**, "Made by re3mr.com". ## 3. Constraints - **CC BY-NC-SA 4.0.** Attribution stays visible in the viewer; non-commercial only; derived map images inherit the licence. LAN use is fine. **Sign-off required before public hosting.** -- **Source art never enters git.** 1.09 GB + 198 MB + a 608 MB archive for one map. `.gitignore` covers `sources/`, `*.psd`, `*.7z`, `build/`, `web/tiles/`. +- **Source art uses Git LFS.** Multi-gigabyte PSDs and archives are LFS objects; + generated `build/` and `web/tiles/` output remains gitignored. - Tooling on the build machine: Python 3.13, Pillow 12, psd-tools 1.18 + scikit-image, Node 22. No ImageMagick / libvips / GDAL needed. --- @@ -133,7 +134,8 @@ server/serve.py static server, LAN-reachable, cache headers web/ index.html, app.js, style.css, vendored Leaflet 1.9.4 DOCUMENTATION.md full technical reference docs/adding-a-map.md -sources/ build/ web/tiles/ gitignored (except sources/overall/) +sources/ source artwork tracked through Git LFS +build/ web/tiles/ reproducible output, gitignored ``` --- @@ -159,12 +161,12 @@ sources/ build/ web/tiles/ gitignored (except sources/overall/) ### Phase 1 — pipeline and viewer ✅ **complete** #### Stage 0 — Repo foundations `[x]` -- [x] `git init`, `.gitignore` covering sources, build output and tiles +- [x] `git init`, Git LFS for sources, `.gitignore` covering build output and tiles - [x] Directory skeleton, `tools/requirements.txt` - [x] `README.md` with quickstart - [x] Sources moved to `sources/customs/` -- [x] Verified nothing large is tracked — 0.43 MB staged -- [ ] **Decide where master PSDs live for the team** (shared drive / NAS / Syncthing) and record the path in the README +- [x] Large source artwork stored as Git LFS objects +- [x] Master PSDs live in the repository through Git LFS #### Stage 1 — Source audit `[x]` - [x] Dimensions, layer trees, blend modes, masks for both PSDs diff --git a/README.md b/README.md index 6b92039..f5024b4 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,11 @@ titles are dropped during the render. ## Quickstart +```bash +git lfs install +git lfs pull +``` + ```bash python -m pip install -r tools/requirements.txt ``` @@ -29,12 +34,14 @@ pwsh server/run.ps1 ``` Open the printed URL. The LAN address works from a phone on the same network. +The default launcher is the editable authoring server. -`run.ps1` uses Caddy when `server/caddy.exe` is present and falls back to -`serve.py` otherwise, so the first step is optional — see [Serving](#serving). +Pass `-ReadOnly` for a deployment-style preview. In read-only mode `run.ps1` +uses Caddy when `server/caddy.exe` is present and falls back to `serve.py`, so +the Caddy download is optional — see [Serving](#serving). -Source PSDs are not in the repo (see `.gitignore`) — get them from the shared -drive and put them under `sources/`. +Source PSDs and archives are stored through Git LFS. Run `git lfs install` +before cloning and `git lfs pull` if a checkout contains pointer files. ## Documentation @@ -65,7 +72,7 @@ tools/ common.py config loading + world placement maths server/serve.py dependency-free static server with sane cache headers web/ the site: index.html, app.js, style.css, vendored Leaflet -sources/ gitignored — source PSDs +sources/ Git LFS — layered source artwork build/ gitignored — intermediate PNGs web/tiles/ gitignored — generated original tiles web/tiles-trimmed/ gitignored — generated permanently trimmed tiles @@ -101,13 +108,36 @@ Select a detail map, choose **Edit placement**, then drag its yellow center anchor or enter exact X/Y values. Width and Height can be changed independently to stretch the map horizontally or vertically around that anchor. All changes preview live without rebuilding. **Save & rebuild** writes the new geometry to -`maps.json`, rebuilds only that map, and reloads its versioned tiles. Start the -writable local server with: +`maps.json`, rebuilds only that map, and reloads its versioned tiles. The normal +project launcher starts the writable local server: ```bash -pwsh server/run.ps1 -Port 8081 -Editable +pwsh server/run.ps1 -Port 8081 ``` +Use `-ReadOnly` for a deployment-style preview. In that mode the authoring +controls are hidden and every write API returns `403`. The editable server is +intended only for a trusted local machine or private admin access; exported +static viewers remain read-only and use the separate local-marker mode below. + +### Static-site export + +On the editable server, choose **Export site ZIP** to create and download +`exports/tarkov-map-static.zip`. The archive contains only the finished `web/` +document root plus a small export manifest; it does not include Python, PSDs, +build tooling, editable APIs or marker backup snapshots. Extract the ZIP into a +static host's document root and put that host behind Cloudflare. The bundled +capability file keeps map geometry and all published files read-only. + +The exported viewer still allows visitors to edit markers. Published marker +files (including the canonical marker edits made through the editable Python +server) are cached per map in the browser. Visitor additions, moves, renames, +category changes and deletions are stored only in that site's `localStorage`; +the static host receives no write request. **Reset this map** discards the +selected map's browser-local changes and refetches the latest published marker +files. Local marker changes survive refreshes and browser relaunches, but remain +specific to that browser, device and site origin. + Placement mode renders the selected map at 50% opacity so landmarks on the overall map remain visible underneath it. @@ -258,7 +288,7 @@ upscales — unavoidable, and `ZOOM_HEADROOM` deliberately allows one level of i ## Serving -Two options, both driven by `server/run.ps1`: +Two read-only options, both selected with `server/run.ps1 -ReadOnly`: | | `serve.py` | Caddy | | --- | --- | --- | @@ -269,6 +299,10 @@ Two options, both driven by `server/run.ps1`: Measured on loopback, 480 tile requests over reused connections. +Tile responses are cached for one year and marked `immutable`. Versioned tile +URLs make that safe after rebuilds and let a CDN serve repeat requests without +returning to the origin VPS. + The number that matters is the second row. `serve.py` is thread-per-connection behind the GIL, so under load it doesn't just slow down — throughput *falls* and tail latency goes past a second. Caddy stays flat. Use Caddy for anything real; diff --git a/docs/adding-a-map.md b/docs/adding-a-map.md index 4f4039b..1bba4c4 100644 --- a/docs/adding-a-map.md +++ b/docs/adding-a-map.md @@ -10,11 +10,12 @@ Budget ~10 minutes plus render time (roughly 3 minutes per GB of PSD). ## 0. Once per machine ```bash +git lfs install python -m pip install -r tools/requirements.txt ``` -Put the PSD under `sources//`. That directory is gitignored — source art -lives on the shared drive, never in the repo. +Put the PSD under `sources//`. PSD, PSB, archive, and source-reference PNG +files are stored through Git LFS according to `.gitattributes`. --- @@ -221,7 +222,7 @@ which looks the same as upscaling during the build but without storing tiles. explicitly for a nested detail view that should stay out of the main view until the user zooms closer; the configured value can only raise the automatic threshold. -For visual placement, run `pwsh server/run.ps1 -Editable`, select the map in +For visual placement, run `pwsh server/run.ps1`, select the map in the viewer, and use **Edit placement**. Dragging the center anchor previews the move immediately. Width and Height stretch it independently around that anchor; **Save & rebuild** updates `maps.json` and retiles that map. diff --git a/maps.json b/maps.json index 0cd04d5..9e5af59 100644 --- a/maps.json +++ b/maps.json @@ -986,10 +986,312 @@ ], "crop": null, "place": { - "cx": 1021.9, - "cy": 433.27, - "w": 220.0, - "h": 140.02 + "cx": 1066.32, + "cy": 536.69, + "w": 330.0, + "h": 210.02 + }, + "trim": { + "points": [ + [ + 0.578224, + 0.005056 + ], + [ + 0.578224, + 0.085862 + ], + [ + 0.573939, + 0.130474 + ], + [ + 0.566439, + 0.191079 + ], + [ + 0.513406, + 0.197812 + ], + [ + 0.4893, + 0.33754 + ], + [ + 0.455552, + 0.329123 + ], + [ + 0.429303, + 0.53703 + ], + [ + 0.388055, + 0.782816 + ], + [ + 0.350021, + 0.771873 + ], + [ + 0.347879, + 0.832478 + ], + [ + 0.236456, + 0.886349 + ], + [ + 0.246098, + 0.936852 + ], + [ + 0.358057, + 0.886349 + ], + [ + 0.357521, + 0.956212 + ], + [ + 0.472158, + 0.903183 + ], + [ + 0.486086, + 0.940219 + ], + [ + 0.587866, + 0.893082 + ], + [ + 0.58251, + 0.94527 + ], + [ + 0.612508, + 0.952004 + ], + [ + 0.615186, + 0.921701 + ], + [ + 0.637685, + 0.930119 + ], + [ + 0.628579, + 0.991565 + ], + [ + 0.670362, + 0.99409 + ], + [ + 0.677862, + 0.94527 + ], + [ + 0.749644, + 0.962104 + ], + [ + 0.745894, + 0.991565 + ], + [ + 0.798391, + 0.996615 + ], + [ + 0.80482, + 0.973047 + ], + [ + 0.839639, + 0.981464 + ], + [ + 0.84821, + 0.937694 + ], + [ + 0.891601, + 0.949478 + ], + [ + 0.897493, + 0.895608 + ], + [ + 0.946777, + 0.915809 + ], + [ + 0.96499, + 0.84342 + ], + [ + 0.906064, + 0.81901 + ], + [ + 0.924813, + 0.627937 + ], + [ + 0.975168, + 0.671707 + ], + [ + 0.99981, + 0.618678 + ], + [ + 0.944634, + 0.567332 + ], + [ + 0.956419, + 0.506728 + ], + [ + 0.894279, + 0.472217 + ], + [ + 0.90285, + 0.44444 + ], + [ + 0.960169, + 0.471375 + ], + [ + 0.985882, + 0.382152 + ], + [ + 0.939277, + 0.354374 + ], + [ + 0.93392, + 0.302187 + ], + [ + 0.904993, + 0.267676 + ], + [ + 0.868031, + 0.246633 + ], + [ + 0.834282, + 0.307238 + ], + [ + 0.846603, + 0.236532 + ], + [ + 0.821426, + 0.197812 + ], + [ + 0.748572, + 0.189395 + ], + [ + 0.736787, + 0.210438 + ], + [ + 0.71536, + 0.205388 + ], + [ + 0.722859, + 0.1431 + ], + [ + 0.73518, + 0.101013 + ], + [ + 0.738394, + 0.043776 + ], + [ + 0.730359, + 0.015157 + ] + ], + "outsideTransparency": 1.0 + } + }, + { + "id": "factory", + "name": "Factory", + "psd": "sources/factory/re3mrFactory.psd", + "baseLayers": [ + "3DlayerFloors" + ], + "crop": [ + 55, + 131, + 13401, + 4410 + ], + "place": { + "cx": 904.39, + "cy": 916.76, + "w": 120.0, + "h": 38.48 + } + }, + { + "id": "ground-zero", + "name": "Ground Zero", + "psd": "sources/ground-zero/GroundZeroByRe3mr.psd", + "baseLayers": [ + "3D Map Layer" + ], + "crop": [ + 1280, + 50, + 2481, + 2082 + ], + "place": { + "cx": 1028.07, + "cy": 316.33, + "w": 95.0, + "h": 160.73 + } + }, + { + "id": "labyrinth", + "name": "Labyrinth", + "psd": "sources/labyrinth/re3mrLabyrinth.psd", + "baseLayers": [ + "All/BaseLayer", + "All/re3mrupperfloor" + ], + "crop": [ + 945, + 309, + 4753, + 3778 + ], + "place": { + "cx": 1239.5, + "cy": 1276.0, + "w": 200.0, + "h": 182.2 } } ] diff --git a/re3mrTransits/re3mrTransits.psd b/re3mrTransits/re3mrTransits.psd new file mode 100644 index 0000000..de755da --- /dev/null +++ b/re3mrTransits/re3mrTransits.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c2231f410fa6baba7b9e74c5e589f1bdead981d16607ad58c163c37a3a0aa02 +size 13911804 diff --git a/server/Caddyfile b/server/Caddyfile index 73f058e..a06c2e6 100644 --- a/server/Caddyfile +++ b/server/Caddyfile @@ -25,8 +25,8 @@ # Tiles are rewritten wholesale by tools/build.py and never edited in # place, so a long lifetime is safe. `immutable` stops the browser # revalidating them on every pan. - @tiles path /tiles/* - header @tiles Cache-Control "public, max-age=604800, immutable" + @tiles path /tiles/* /tiles-trimmed/* + header @tiles Cache-Control "public, max-age=31536000, immutable" # The shell and the manifest must never be stale, or the app can end up # pointing at tiles that no longer exist. diff --git a/server/run.ps1 b/server/run.ps1 index 54aea67..072ff27 100644 --- a/server/run.ps1 +++ b/server/run.ps1 @@ -1,34 +1,46 @@ # Serve the built site. # -# pwsh server/run.ps1 # port 8080 +# pwsh server/run.ps1 # editable server, port 8080 # pwsh server/run.ps1 -Port 9000 -# pwsh server/run.ps1 -Port 9000 -Editable # enable placement, trim and marker saves +# pwsh server/run.ps1 -Port 9000 -ReadOnly # deployment-style preview # -# Uses Caddy when server/caddy.exe is present (get it with get-caddy.ps1) and -# falls back to the dependency-free serve.py otherwise. Caddy is roughly 3x -# faster at low concurrency and does not fall over at high concurrency -- see -# the table in the README. +# Editable mode uses serve.py. Read-only mode uses Caddy when server/caddy.exe +# is present (get it with get-caddy.ps1) and falls back to serve.py otherwise. +# Caddy is roughly 3x faster at low concurrency and does not fall over at high +# concurrency -- see the table in the README. param( [int]$Port = 8080, - [switch]$Editable + [switch]$Editable, + [switch]$ReadOnly ) $ErrorActionPreference = 'Stop' $here = Split-Path -Parent $MyInvocation.MyCommand.Path Set-Location $here # Caddyfile's `root * ../web` resolves against the cwd +if ($Editable -and $ReadOnly) { + throw '-Editable and -ReadOnly cannot be used together.' +} +$editMode = -not $ReadOnly + if (-not (Test-Path (Join-Path $here '..\web\data\world.json'))) { Write-Warning "web/data/world.json missing -- run 'python tools/build.py' first" } -$ip = (Get-NetIPConfiguration | - Where-Object { $_.IPv4DefaultGateway -and $_.NetAdapter.Status -eq 'Up' } | - Select-Object -First 1).IPv4Address.IPAddress -if (-not $ip) { $ip = '127.0.0.1' } +$ip = '127.0.0.1' +try { + $lanIp = (Get-NetIPConfiguration -ErrorAction Stop | + Where-Object { $_.IPv4DefaultGateway -and $_.NetAdapter.Status -eq 'Up' } | + Select-Object -First 1).IPv4Address.IPAddress + if ($lanIp) { $ip = $lanIp } +} +catch { + # Restricted shells may block the CIM query. Localhost still works. +} $caddy = Join-Path $here 'caddy.exe' -$engine = if ($Editable) { 'serve.py (map editing enabled)' } +$engine = if ($editMode) { 'serve.py (map editing enabled)' } elseif (Test-Path $caddy) { 'caddy' } else { 'serve.py (slower)' } @@ -40,11 +52,32 @@ Write-Host "" Write-Host " Ctrl+C to stop" Write-Host "" -if (-not $Editable -and (Test-Path $caddy)) { +if (-not $editMode -and (Test-Path $caddy)) { $env:TARKOVMAP_PORT = "$Port" & $caddy run --config (Join-Path $here 'Caddyfile') } else { - if (-not $Editable) { Write-Host " (run get-caddy.ps1 for the faster server)" } - python (Join-Path $here 'serve.py') $Port + $python = Join-Path $here '..\.venv\Scripts\python.exe' + $pythonArgs = @() + if (-not (Test-Path $python)) { + $pythonCommand = Get-Command python -ErrorAction SilentlyContinue + if ($pythonCommand) { + $python = $pythonCommand.Source + } + else { + $pyCommand = Get-Command py -ErrorAction SilentlyContinue + if (-not $pyCommand) { + throw 'Python was not found. Create .venv or install Python.' + } + $python = $pyCommand.Source + $pythonArgs = @('-3') + } + } + if ($editMode) { + & $python @pythonArgs (Join-Path $here 'serve.py') $Port --editable + } + else { + Write-Host " (run get-caddy.ps1 for the faster server)" + & $python @pythonArgs (Join-Path $here 'serve.py') $Port + } } diff --git a/server/serve.py b/server/serve.py index 2bbae52..2c64421 100644 --- a/server/serve.py +++ b/server/serve.py @@ -1,6 +1,7 @@ -"""Static server plus local placement, trim and marker editing API. +"""Static server plus local map editing and read-only site export API. - python server/serve.py [port] # default 8080 + python server/serve.py [port] # read-only, default 8080 + python server/serve.py [port] --editable # trusted local editing Deliberately dependency-free. Tiles are immutable once built, so they get a long cache lifetime while the app shell stays uncached -- that is the whole @@ -24,6 +25,7 @@ import subprocess import sys import threading import uuid +import zipfile from pathlib import Path from urllib.parse import urlsplit @@ -33,12 +35,15 @@ CONFIG = ROOT / "maps.json" BUILD_TOOL = ROOT / "tools" / "build.py" MARKER_DIR = WEB / "data" / "markers" MARKER_EDIT_DIR = WEB / "data" / "marker-edits" +EXPORT_DIR = ROOT / "exports" +EXPORT_ZIP = EXPORT_DIR / "tarkov-map-static.zip" CONFIG_LOCK = threading.Lock() class Handler(http.server.SimpleHTTPRequestHandler): extensions_map = {**http.server.SimpleHTTPRequestHandler.extensions_map, ".webp": "image/webp"} + editable = False # SimpleHTTPRequestHandler defaults to HTTP/1.0, which closes the socket # after every response -- one TCP handshake per tile. A map view pulls ~30 @@ -56,12 +61,65 @@ class Handler(http.server.SimpleHTTPRequestHandler): self.end_headers() self.wfile.write(body) - def do_POST(self) -> None: # noqa: N802 - stdlib handler API + def send_export(self, include_body: bool) -> None: + if not self.editable: + self.send_json(403, {"error": "This server is read-only"}) + return + if not EXPORT_ZIP.exists(): + self.send_json(404, {"error": "No static export has been created yet"}) + return + self.send_response(200) + self.send_header("Content-Type", "application/zip") + self.send_header( + "Content-Disposition", f'attachment; filename="{EXPORT_ZIP.name}"' + ) + self.send_header("Content-Length", str(EXPORT_ZIP.stat().st_size)) + self.send_header("Cache-Control", "no-store") + self.end_headers() + if include_body: + with EXPORT_ZIP.open("rb") as source: + self.copyfile(source, self.wfile) + + def do_GET(self) -> None: # noqa: N802 - stdlib handler API path = urlsplit(self.path).path - if path not in {"/api/placement", "/api/trim", "/api/marker"}: + if path == "/data/capabilities.json": + self.send_json(200, { + "mapEditing": self.editable, + "markerEditing": self.editable, + "markerPersistence": "server" if self.editable else "none", + "exporting": self.editable, + }) + return + if path == "/api/export/download": + self.send_export(include_body=True) + return + super().do_GET() + + def do_HEAD(self) -> None: # noqa: N802 - stdlib handler API + if urlsplit(self.path).path == "/api/export/download": + self.send_export(include_body=False) + return + super().do_HEAD() + + def do_POST(self) -> None: # noqa: N802 - stdlib handler API + if not self.editable: + self.send_json(403, {"error": "This server is read-only"}) + return + + path = urlsplit(self.path).path + if path not in {"/api/placement", "/api/trim", "/api/marker", "/api/export"}: self.send_json(404, {"error": "unknown API endpoint"}) return + if path == "/api/export": + try: + result = export_static_site() + except PlacementError as exc: + self.send_json(exc.status, {"error": str(exc)}) + return + self.send_json(200, result) + return + try: length = int(self.headers.get("Content-Length", "0")) if not 0 < length <= 16_384: @@ -125,7 +183,7 @@ class Handler(http.server.SimpleHTTPRequestHandler): def end_headers(self): if "/tiles/" in self.path or "/tiles-trimmed/" in self.path: - self.send_header("Cache-Control", "public, max-age=604800, immutable") + self.send_header("Cache-Control", "public, max-age=31536000, immutable") else: self.send_header("Cache-Control", "no-cache") super().end_headers() @@ -140,6 +198,72 @@ class PlacementError(Exception): self.status = status +def export_static_site() -> dict: + """Create an atomic, read-only ZIP containing only the deployable web root.""" + required = [ + WEB / "index.html", + WEB / "app.js", + WEB / "style.css", + WEB / "data" / "world.json", + WEB / "data" / "capabilities.json", + WEB / "tiles", + ] + missing = [str(path.relative_to(ROOT)) for path in required if not path.exists()] + if missing: + raise PlacementError( + "static export is incomplete; missing " + ", ".join(missing), 409 + ) + + stored_suffixes = { + ".webp", ".png", ".jpg", ".jpeg", ".gif", ".ico", + ".woff", ".woff2", ".zip", + } + excluded_prefixes = ("data/marker-defaults/",) + with CONFIG_LOCK: + EXPORT_DIR.mkdir(parents=True, exist_ok=True) + temporary = EXPORT_DIR / f".{EXPORT_ZIP.name}.{os.getpid()}.tmp" + file_count = 0 + source_bytes = 0 + try: + with zipfile.ZipFile(temporary, "w", allowZip64=True) as archive: + for path in sorted(item for item in WEB.rglob("*") if item.is_file()): + relative = path.relative_to(WEB).as_posix() + if relative.startswith(excluded_prefixes): + continue + compression = ( + zipfile.ZIP_STORED + if path.suffix.lower() in stored_suffixes + else zipfile.ZIP_DEFLATED + ) + archive.write(path, relative, compress_type=compression) + file_count += 1 + source_bytes += path.stat().st_size + manifest = { + "format": 1, + "readOnly": True, + "fileCount": file_count, + "sourceBytes": source_bytes, + } + archive.writestr( + "export-manifest.json", + json.dumps(manifest, indent=2) + "\n", + compress_type=zipfile.ZIP_DEFLATED, + ) + temporary.replace(EXPORT_ZIP) + except (OSError, zipfile.BadZipFile) as exc: + temporary.unlink(missing_ok=True) + raise PlacementError(f"static export failed: {exc}") from exc + + return { + "ok": True, + "fileName": EXPORT_ZIP.name, + "download": "/api/export/download", + "fileCount": file_count + 1, + "sourceBytes": source_bytes, + "zipBytes": EXPORT_ZIP.stat().st_size, + } + + def normalize_trim_points(value) -> list[list[float]]: if not isinstance(value, list) or len(value) > 500: raise ValueError("points must be a list containing at most 500 vertices") @@ -447,10 +571,14 @@ def main() -> None: if not (WEB / "data" / "world.json").exists(): print("warning: web/data/world.json missing -- run tools/build.py first\n") - port = int(sys.argv[1]) if len(sys.argv) > 1 else 8080 + args = sys.argv[1:] + Handler.editable = "--editable" in args + positional = [arg for arg in args if not arg.startswith("--")] + port = int(positional[0]) if positional else 8080 handler = functools.partial(Handler, directory=str(WEB)) with Server(("0.0.0.0", port), handler) as httpd: print(f"serving {WEB}") + print(f" mode {'editable' if Handler.editable else 'read-only'}") print(f" local http://localhost:{port}/") print(f" LAN http://{lan_ip()}:{port}/") print("\nCtrl+C to stop") diff --git a/sources/customs/customs-dorms.psd b/sources/customs/customs-dorms.psd new file mode 100644 index 0000000..5752b5f --- /dev/null +++ b/sources/customs/customs-dorms.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d63cdfd4d7d3458dff2278e0a764f3a82b35886df12f4c30db9f4b739ac997e +size 207215095 diff --git a/sources/customs/customs-reference.png b/sources/customs/customs-reference.png new file mode 100644 index 0000000..bde5687 --- /dev/null +++ b/sources/customs/customs-reference.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae142108844d12f2dacd394965fb664cefd9a52c03bfca151066200aae33abad +size 15109648 diff --git a/sources/customs/customs.psd b/sources/customs/customs.psd new file mode 100644 index 0000000..f352f55 --- /dev/null +++ b/sources/customs/customs.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:582e8e6064e6f592366da6f8f74dc8e07abab7247106900cc57dec87155dce86 +size 1142534761 diff --git a/sources/customs/re3mrCustoms2.7z b/sources/customs/re3mrCustoms2.7z new file mode 100644 index 0000000..c6ab282 --- /dev/null +++ b/sources/customs/re3mrCustoms2.7z @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4945255ece0add32c7e6551587a3a28c76d127f0b2cb2738abd1eda26080773b +size 637376467 diff --git a/sources/factory/re3mrFactory.psd b/sources/factory/re3mrFactory.psd new file mode 100644 index 0000000..3eb0a50 --- /dev/null +++ b/sources/factory/re3mrFactory.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:440550fd7bee5e56fd114e3669d3d8d23064f00fb0a1dd1f87fcaca5b6257cdd +size 517242825 diff --git a/sources/ground-zero/GroundZeroByRe3mr.psd b/sources/ground-zero/GroundZeroByRe3mr.psd new file mode 100644 index 0000000..7df55f0 --- /dev/null +++ b/sources/ground-zero/GroundZeroByRe3mr.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f65643b4160c9d8ebc0c642d79c00af7f4a79606cda49d0946ea011bd6a4c591 +size 43909743 diff --git a/sources/interchange/interchange.psd b/sources/interchange/interchange.psd new file mode 100644 index 0000000..ea1fc64 --- /dev/null +++ b/sources/interchange/interchange.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65111f728d8c31c4891169769605dc3c65153ed7bdfe8379f257328c41732f11 +size 1064461599 diff --git a/sources/labyrinth/re3mrLabyrinth.psd b/sources/labyrinth/re3mrLabyrinth.psd new file mode 100644 index 0000000..78c2cd7 --- /dev/null +++ b/sources/labyrinth/re3mrLabyrinth.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d79ce746c7cd4b50682dc47ee4ae202842ef22b0f557fbef825b4cd6ef08abc8 +size 151696290 diff --git a/sources/lighthouse/lighthouse.psd b/sources/lighthouse/lighthouse.psd new file mode 100644 index 0000000..20d7093 --- /dev/null +++ b/sources/lighthouse/lighthouse.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95de67bf3b2e055e62cd98db9ead19fb11926ff3d54e15a6f2415c268e132def +size 485527305 diff --git a/sources/reserve/reserve.psd b/sources/reserve/reserve.psd new file mode 100644 index 0000000..c613531 --- /dev/null +++ b/sources/reserve/reserve.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d7e57b46cf2d13f8359f65bab512a6e90205aae51acf6a1a92a85fc08816a64 +size 299230680 diff --git a/sources/shoreline-resort/shoreline-resort.psd b/sources/shoreline-resort/shoreline-resort.psd new file mode 100644 index 0000000..c46c489 --- /dev/null +++ b/sources/shoreline-resort/shoreline-resort.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d73796372581be6429bacfc89b73a9b1d8363d31a988f7238ab046ac28e64823 +size 526828266 diff --git a/sources/shoreline/shoreline.psd b/sources/shoreline/shoreline.psd new file mode 100644 index 0000000..5a3e7ce --- /dev/null +++ b/sources/shoreline/shoreline.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b181a8b0d42e0cd40086492b9b7de9c6c2a89173461a0264e3caa7c85254ff8 +size 202566846 diff --git a/sources/streets/streets.psd b/sources/streets/streets.psd new file mode 100644 index 0000000..c580484 --- /dev/null +++ b/sources/streets/streets.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38b6019fe23c0fcd7134e370b16825127ba5cb0506e81fbeb689688361c4d9b0 +size 811040886 diff --git a/sources/woods/woods.psd b/sources/woods/woods.psd new file mode 100644 index 0000000..57e7745 --- /dev/null +++ b/sources/woods/woods.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ede7a1ac01f7eb6dfa08db28bd1c7ee954d457251605e24f9568d2f164625d80 +size 530230770 diff --git a/tools/extract_markers.py b/tools/extract_markers.py index 0990f77..eea44cf 100644 --- a/tools/extract_markers.py +++ b/tools/extract_markers.py @@ -53,6 +53,7 @@ LABEL_CORRECTIONS = { } MAP_CATEGORY_OVERRIDES = { ("reserve", "sewer manhole"): "extract-pmc", + ("ground-zero", "emercom checkpoint"): "extract-pmc", } EXTRACT_CATEGORIES = { "extract-pmc", "extract-scav", "extract-neutral", "extract-hidden", "transit", @@ -71,6 +72,8 @@ EXTRACT_LABEL_PATHS = ( "overlay captions", "extract name text / extract text pmc", "extract name text / extract text scav", "extract name text / extract text neutral", "extract name text / transit text", "onmap exfil names / text", + "onmap exfil names", "on map exfil names", "on-map extract names", "on map extract names", + "extract names smaller", "new onmap / exfil names", "on map extract text", "extract names / pmc", "extract names / scav", "extract names / neutral", "extract names / transit", "on map overlay / extracts / text", @@ -82,6 +85,9 @@ EXTRACT_LABEL_NOISE = ( EXTRACT_ANCHOR_PATHS = ( "overlay pmc extracts", "overlay scav extracts", "overlay neutral", "overlay transit", "overlay hidden", "extract dots", "onmap exfil icons", + "onmap extracts", "on map extracts", "pmc extract icons", "scav extract icons", + "transit / on map icons", "transit / on map letters", + "hidden / on map", "hidden / onmap", "map markers / pmc extracts", "map markers / scav extracts", "map markers / neutral extracts", "running man markers", "hidden exfil onmap", "transit onmap", "on map overlay / extracts / pmc", @@ -122,7 +128,9 @@ def display_label(category: str, value: str) -> str: def category_for(path: tuple[str, ...]) -> str | None: - text = " / ".join(path).lower().replace("_", " ") + # Normalize camel-case PSD group names (OnMapLetters, ExfilNames, etc.) + # before matching. Newer re3mr files use these spellings extensively. + text = normalized_path(path) excluded = [term for term in EXCLUDED if term != "legend" and not ( term in {"only for bw", "onlyforbw"} and "extractmarkersforbw" in text.replace(" ", "") )] @@ -200,7 +208,9 @@ def is_extract_label_path(path: tuple[str, ...], label: str) -> bool: def explicit_extract_category(path: tuple[str, ...], label: str) -> str | None: lower_label = label.lower() if ("smuggler" in lower_label and "basement" in lower_label) \ - or "passage by the lake" in lower_label: + or "passage by the lake" in lower_label \ + or "ariadne’s path" in lower_label \ + or "ariadne's path" in lower_label: return "extract-hidden" label_category = None if any(term in lower_label for term in ("co-op", "coop")) \ @@ -236,10 +246,12 @@ def explicit_extract_category(path: tuple[str, ...], label: str) -> str | None: def semantic_path_label(path: tuple[str, ...], category: str) -> str: ignored = { - "icons", "main", "letters", "text", "pmc", "scav", "neutral", "hidden", + "all", "icons", "main", "letters", "text", "pmc", "scav", "neutral", "hidden", "transit", "extracts", "extract dots", "extract dot pmc", "extract dots scav", "extract dots neutral", "transit dots", "onmap", "overlay", "overlays", - "markers", "running man markers", "on map extract information", + "markers", "map overlay", "running man markers", "on map extracts", + "on map extract information", + "pmc small markers", "scav small markers", "pmc extract icons", "scav extract icons", "neutral extracts", "pmc extracts", "scav extracts", "transit letters", "transit onmap", "hidden+transit", "re3mr.com", } @@ -374,7 +386,10 @@ def extract_map(m: dict, source_root: Path | None) -> list[dict]: if not (left <= cx <= right and top <= cy <= bottom): continue # Very large leaves are region overlays or artwork, not point data. - if x1 - x0 > width * 0.16 or y1 - y0 > height * 0.16: + # Text labels can legitimately be wider on tightly cropped maps + # (Ground Zero's extract names take up roughly a quarter-width). + max_width = width * (0.32 if layer.kind == "type" else 0.16) + if x1 - x0 > max_width or y1 - y0 > height * 0.16: continue label = layer_text(layer) if label in {"☠", "☢"}: @@ -468,9 +483,30 @@ def extract_map(m: dict, source_root: Path | None) -> list[dict]: for label_index in sorted(unmatched_labels): extracts.append(extract_labels[label_index]) + + # A shared gate can carry overlapping PMC and Scav icons. Once its label + # is paired, fold any nearly coincident unused icon into that record and + # apply the configured extract priority instead of emitting a duplicate. + # Explicit co-op extracts remain neutral/yellow by design. + for anchor_index, anchor in enumerate(anchors): + if anchor_index in used_anchors: + continue + nearby = next((record for record in extracts + if record["category"] != "extract-neutral" + and (record["x"] - anchor["x"]) ** 2 + + (record["y"] - anchor["y"]) ** 2 < 0.02 ** 2), None) + if nearby is None: + continue + nearby["category"] = highest_priority_extract_category( + nearby["category"], anchor["category"], + ) or nearby["category"] + used_anchors.add(anchor_index) + unmatched = [anchor for index, anchor in enumerate(anchors) if index not in used_anchors] unmatched_by_name: dict[tuple[str, str], dict] = {} for anchor in unmatched: + if m["id"] == "factory" and anchor["category"] == "extract-hidden": + anchor["label"] = "SMUGGLER’S PASSAGE" if anchor["label"] == CATEGORY_LABELS[anchor["category"]]: continue if any(anchor_matches_label(anchor["label"], label["label"]) diff --git a/web/app.js b/web/app.js index 5949ebd..48a5b4e 100644 --- a/web/app.js +++ b/web/app.js @@ -95,7 +95,7 @@ function readHash() { } async function main() { - const [world, markerConfig] = await Promise.all([ + const [world, markerConfig, capabilities] = await Promise.all([ fetch('data/world.json', { cache: 'no-cache' }).then((r) => { if (!r.ok) throw new Error(`world.json: ${r.status}`); return r.json(); @@ -103,8 +103,15 @@ async function main() { fetch('data/marker-config.json', { cache: 'no-cache' }) .then((r) => (r.ok ? r.json() : { defaults: {}, groups: [], categories: {} })) .catch(() => ({ defaults: {}, groups: [], categories: {} })), + fetch('data/capabilities.json', { cache: 'no-store' }) + .then((r) => (r.ok ? r.json() : { editable: false })) + .catch(() => ({ editable: false })), ]); if (!world.maps.length) throw new Error('world.json contains no maps'); + const mapEditingEnabled = capabilities.mapEditing === true; + const markerEditingEnabled = capabilities.markerEditing === true; + const markerPersistence = capabilities.markerPersistence === 'server' ? 'server' : 'local'; + const exportingEnabled = capabilities.exporting === true; const ZMAX = world.maxZoom; const base = world.maps.find((m) => m.base) ?? world.maps[0]; @@ -374,6 +381,48 @@ async function main() { }; let selectEditableMarker = () => {}; let saveDraggedMarker = () => {}; + const localMarkerVersion = 1; + const localMarkerEditKey = (mapId) => `tarkov-local-markers-v${localMarkerVersion}-${mapId}`; + const publishedMarkerCacheKey = (mapId) => ( + `tarkov-published-markers-v${localMarkerVersion}-${mapId}` + ); + const readStoredJSON = (key, fallback) => { + try { + const value = localStorage.getItem(key); + return value ? JSON.parse(value) : fallback; + } catch { + return fallback; + } + }; + const writeStoredJSON = (key, value, required = false) => { + try { + localStorage.setItem(key, JSON.stringify(value)); + } catch (error) { + if (required) throw new Error(`Browser storage failed: ${error.message}`); + } + }; + const readLocalMarkerEdits = (mapId) => { + const value = readStoredJSON(localMarkerEditKey(mapId), {}); + return { + overrides: value?.overrides && typeof value.overrides === 'object' ? value.overrides : {}, + added: Array.isArray(value?.added) ? value.added : [], + deleted: Array.isArray(value?.deleted) ? value.deleted : [], + }; + }; + const writeLocalMarkerEdits = (mapId, edits) => { + writeStoredJSON(localMarkerEditKey(mapId), { version: 1, ...edits }, true); + }; + const applyLocalMarkerEdits = (mapId, published) => { + if (markerPersistence !== 'local') return published; + const edits = readLocalMarkerEdits(mapId); + const deleted = new Set(edits.deleted); + const markers = published + .filter((marker) => !deleted.has(marker.id)) + .map((marker) => ({ ...marker, ...(edits.overrides[marker.id] ?? {}) })); + const ids = new Set(markers.map((marker) => marker.id)); + markers.push(...edits.added.filter((marker) => !ids.has(marker.id))); + return markers; + }; // World-space grid index: panning queries only intersecting cells rather // than scanning or instantiating all PSD records. @@ -419,16 +468,20 @@ async function main() { const loadedMarkerMaps = new Map(); const markerMapRequests = new Map(); let activeMarkerMapIds = new Set(); - const fetchMarkerMap = (mapId) => { - if (markerMapRequests.has(mapId)) return markerMapRequests.get(mapId); + const fetchMarkerMap = (mapId, { force = false, publishedOnly = false } = {}) => { + if (!force && !publishedOnly && markerMapRequests.has(mapId)) { + return markerMapRequests.get(mapId); + } + const suffix = force ? `?refresh=${Date.now()}` : ''; + const requestCache = force ? 'reload' : 'no-cache'; const request = Promise.all([ - fetch(`data/markers/${encodeURIComponent(mapId)}.json`, { cache: 'no-cache' }) + fetch(`data/markers/${encodeURIComponent(mapId)}.json${suffix}`, { cache: requestCache }) .then((response) => { if (response.status === 404) return { markers: [] }; if (!response.ok) throw new Error(`${mapId} markers: ${response.status}`); return response.json(); }), - fetch(`data/marker-edits/${encodeURIComponent(mapId)}.json`, { cache: 'no-cache' }) + fetch(`data/marker-edits/${encodeURIComponent(mapId)}.json${suffix}`, { cache: requestCache }) .then((response) => { if (response.status === 404) return { overrides: {}, added: [] }; if (!response.ok) throw new Error(`${mapId} marker edits: ${response.status}`); @@ -442,12 +495,22 @@ async function main() { .map((marker) => ({ ...marker, ...(overrides[marker.id] ?? {}), - })); + })); const ids = new Set(markers.map((marker) => marker.id)); markers.push(...(edits.added ?? []).filter((marker) => !ids.has(marker.id))); - return markers; - }).finally(() => markerMapRequests.delete(mapId)); - markerMapRequests.set(mapId, request); + if (markerPersistence === 'local') { + writeStoredJSON(publishedMarkerCacheKey(mapId), { markers }); + } + return publishedOnly ? markers : applyLocalMarkerEdits(mapId, markers); + }).catch((error) => { + if (force || markerPersistence !== 'local') throw error; + const cached = readStoredJSON(publishedMarkerCacheKey(mapId), null); + if (!Array.isArray(cached?.markers)) throw error; + return publishedOnly ? cached.markers : applyLocalMarkerEdits(mapId, cached.markers); + }).finally(() => { + if (markerMapRequests.get(mapId) === request) markerMapRequests.delete(mapId); + }); + if (!force && !publishedOnly) markerMapRequests.set(mapId, request); return request; }; @@ -485,7 +548,7 @@ async function main() { const label = record.label || settings.label || record.category.replaceAll('-', ' '); const leafletMarker = L.marker([record.worldY, record.worldX], { icon: createMarkerIcon(record), pane: 'semantic-markers', interactive: true, - keyboard: false, draggable: true, + keyboard: false, draggable: markerEditingEnabled, zIndexOffset: extractCategories.has(record.category) ? 5000 : 0, }); leafletMarker.bindTooltip( @@ -720,6 +783,17 @@ async function main() { scheduleMarkerRefresh(); return indexed; }; + const replaceLoadedMarkerMap = (mapId, markers) => { + for (const markerId of loadedMarkerMaps.get(mapId) ?? []) removeIndexedMarker(markerId); + const markerIds = new Set(); + for (const marker of markers) { + const indexed = indexMarker(marker); + if (indexed) markerIds.add(indexed.id); + } + loadedMarkerMaps.set(mapId, markerIds); + refreshMarkerCounts(); + scheduleMarkerRefresh(); + }; let markersVisible = localStorage.getItem('tarkov-markers-visible') !== 'false'; const refreshMarkers = () => { markerRefreshFrame = null; @@ -881,6 +955,19 @@ async function main() { const overviewButton = document.getElementById('overview-map'); const editButton = document.getElementById('edit-placement'); const trimButton = document.getElementById('edit-trim'); + const editorActions = editButton.closest('.editor-mode-actions'); + const exportButton = document.getElementById('export-static'); + const exportStatus = document.getElementById('export-status'); + editButton.hidden = !mapEditingEnabled; + trimButton.hidden = !mapEditingEnabled; + exportButton.hidden = !exportingEnabled; + document.getElementById('edit-markers').hidden = !markerEditingEnabled; + if (editorActions) { + editorActions.hidden = !(mapEditingEnabled || markerEditingEnabled || exportingEnabled); + editorActions.dataset.markerOnly = String( + markerEditingEnabled && !mapEditingEnabled && !exportingEnabled, + ); + } const editorPanel = document.getElementById('placement-editor'); const editorName = document.getElementById('placement-name'); const xInput = document.getElementById('placement-x'); @@ -904,6 +991,7 @@ async function main() { const markerEditorPanel = document.getElementById('marker-editor'); const markerEditorName = document.getElementById('marker-editor-name'); const markerDropButton = document.getElementById('marker-drop'); + const markerResetButton = document.getElementById('marker-reset'); const markerFields = document.getElementById('marker-fields'); const markerLabelInput = document.getElementById('marker-label'); const markerCategoryInput = document.getElementById('marker-category'); @@ -912,6 +1000,7 @@ async function main() { const markerCancelButton = document.getElementById('marker-cancel'); const markerSaveButton = document.getElementById('marker-save'); const markerEditStatus = document.getElementById('marker-edit-status'); + markerResetButton.hidden = markerPersistence !== 'local'; const byId = new Map(world.maps.map((m) => [m.id, m])); const editor = { selectedId: null, @@ -979,7 +1068,55 @@ async function main() { markerSaveButton.textContent = isNew ? 'Add marker' : 'Save marker'; }; + const localMarkerValues = (record, id = record.id) => ({ + id, + mapId: record.mapId, + x: Number(record.x), + y: Number(record.y), + label: String(record.label).trim(), + category: String(record.category), + source: id.startsWith('local-') ? 'Local marker' : record.source, + }); + + const persistLocalMarker = (record) => { + const edits = readLocalMarkerEdits(record.mapId); + let id = record.id; + if (!id || id.startsWith('draft-')) { + const random = globalThis.crypto?.randomUUID?.() + ?? `${Date.now()}-${Math.random().toString(16).slice(2)}`; + id = `local-${random}`; + } + const saved = localMarkerValues(record, id); + const addedIndex = edits.added.findIndex((marker) => marker.id === id); + if (id.startsWith('local-') || addedIndex >= 0) { + if (addedIndex >= 0) edits.added[addedIndex] = saved; + else edits.added.push(saved); + } else { + edits.overrides[id] = { + x: saved.x, + y: saved.y, + label: saved.label, + category: saved.category, + }; + } + edits.deleted = edits.deleted.filter((deletedId) => deletedId !== id); + writeLocalMarkerEdits(record.mapId, edits); + return { ...record, ...saved }; + }; + + const deleteLocalMarker = (record) => { + const edits = readLocalMarkerEdits(record.mapId); + const addedLength = edits.added.length; + edits.added = edits.added.filter((marker) => marker.id !== record.id); + if (edits.added.length === addedLength) { + if (!edits.deleted.includes(record.id)) edits.deleted.push(record.id); + delete edits.overrides[record.id]; + } + writeLocalMarkerEdits(record.mapId, edits); + }; + const persistMarker = async (record) => { + if (markerPersistence === 'local') return persistLocalMarker(record); const response = await fetch('api/marker', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -1022,12 +1159,15 @@ async function main() { return; } leafletMarker.dragging.disable(); - showMarkerStatus('Saving the new marker position…'); + showMarkerStatus(markerPersistence === 'local' + ? 'Saving the new marker position in this browser…' + : 'Saving the new marker position…'); try { const saved = await persistMarker({ ...record, x: point[0], y: point[1] }); replaceMarkerRecord(saved); selectEditableMarker(saved.id); - showMarkerStatus('Marker position saved.'); + showMarkerStatus(markerPersistence === 'local' + ? 'Marker position saved locally.' : 'Marker position saved.'); } catch (error) { leafletMarker.setLatLng([record.worldY, record.worldX]); leafletMarker.dragging.enable(); @@ -1046,7 +1186,7 @@ async function main() { } function openMarkerEditor(m) { - if (!m || m.base) return; + if (!markerEditingEnabled || !m || m.base) return; if (editor.active) closeEditor(); if (trimEditor.active) closeTrimEditor(); markerEditing.selectedMapId = m.id; @@ -1065,7 +1205,9 @@ async function main() { requestAnimationFrame(() => { for (const leafletMarker of renderedMarkers.values()) leafletMarker.dragging?.enable(); }); - showMarkerStatus('Click a marker to edit it, or drop a new one.'); + showMarkerStatus(markerPersistence === 'local' + ? 'Changes are saved only in this browser.' + : 'Click a marker to edit it, or drop a new one.'); focus(m.id); } @@ -1085,32 +1227,62 @@ async function main() { showMarkerStatus('Selection cleared.'); }); - markerDeleteButton.addEventListener('click', async () => { - const record = markerRecords.get(markerEditing.selectedMarkerId); - if (!record || !window.confirm(`Delete “${record.label}”? The default backup is unchanged.`)) { + markerResetButton.addEventListener('click', async () => { + const mapId = markerEditing.selectedMapId; + const m = byId.get(mapId); + if (markerPersistence !== 'local' || !m) return; + if (!window.confirm(`Discard all local marker changes for ${m.name} and reload the published markers?`)) { return; } + markerResetButton.disabled = true; + showMarkerStatus('Fetching the latest published markers…'); + try { + const published = await fetchMarkerMap(mapId, { force: true, publishedOnly: true }); + localStorage.removeItem(localMarkerEditKey(mapId)); + clearMarkerSelection(); + replaceLoadedMarkerMap(mapId, published); + showMarkerStatus('Local changes cleared. Latest published markers loaded.'); + } catch (error) { + showMarkerStatus(`Reset failed: ${error.message}`, true); + } finally { + markerResetButton.disabled = false; + } + }); + + markerDeleteButton.addEventListener('click', async () => { + const record = markerRecords.get(markerEditing.selectedMarkerId); + if (!record) return; + const confirmation = markerPersistence === 'local' + ? `Delete “${record.label}” from this browser?` + : `Delete “${record.label}”? The default backup is unchanged.`; + if (!window.confirm(confirmation)) return; markerDeleteButton.disabled = true; markerSaveButton.disabled = true; showMarkerStatus('Deleting marker…'); try { - const response = await fetch('api/marker', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ action: 'delete', id: record.id, mapId: record.mapId }), - }); - const responseText = await response.text(); - let result; - try { result = JSON.parse(responseText); } catch { result = {}; } - if (!response.ok) throw new Error( - result.error || 'This server is read-only; start it with server/run.ps1 -Editable', - ); + if (markerPersistence === 'local') { + deleteLocalMarker(record); + } else { + const response = await fetch('api/marker', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ action: 'delete', id: record.id, mapId: record.mapId }), + }); + const responseText = await response.text(); + let result; + try { result = JSON.parse(responseText); } catch { result = {}; } + if (!response.ok) throw new Error( + result.error || 'This server is read-only; start it with server/run.ps1 -Editable', + ); + } removeIndexedMarker(record.id); loadedMarkerMaps.get(record.mapId)?.delete(record.id); refreshMarkerCounts(); scheduleMarkerRefresh(); clearMarkerSelection(); - showMarkerStatus('Marker deleted. The read-only default remains available for restoration.'); + showMarkerStatus(markerPersistence === 'local' + ? 'Marker deleted locally. Reset this map to restore published markers.' + : 'Marker deleted. The read-only default remains available for restoration.'); } catch (error) { showMarkerStatus(`Delete failed: ${error.message}`, true); } finally { @@ -1135,7 +1307,8 @@ async function main() { return; } markerSaveButton.disabled = true; - showMarkerStatus('Saving marker…'); + showMarkerStatus(markerPersistence === 'local' + ? 'Saving marker in this browser…' : 'Saving marker…'); try { const saved = await persistMarker({ ...current, @@ -1145,7 +1318,7 @@ async function main() { clearMarkerDraft(); replaceMarkerRecord(saved); selectEditableMarker(saved.id); - showMarkerStatus('Marker saved.'); + showMarkerStatus(markerPersistence === 'local' ? 'Marker saved locally.' : 'Marker saved.'); } catch (error) { showMarkerStatus(`Save failed: ${error.message}`, true); } finally { @@ -1200,7 +1373,7 @@ async function main() { }; const openEditor = (m) => { - if (!m || m.base) return; + if (!mapEditingEnabled || !m || m.base) return; if (trimEditor.active) closeTrimEditor(); if (markerEditing.active) closeMarkerEditor(); const previous = byId.get(editor.selectedId); @@ -1252,14 +1425,14 @@ async function main() { editor.selectedId = m.base ? null : m.id; trimEditor.selectedId = m.base ? null : m.id; markerEditing.selectedMapId = m.base ? null : m.id; - editButton.disabled = !!m.base; - trimButton.disabled = !!m.base; - markerEditButton.disabled = !!m.base; + editButton.disabled = !mapEditingEnabled || !!m.base; + trimButton.disabled = !mapEditingEnabled || !!m.base; + markerEditButton.disabled = !markerEditingEnabled || !!m.base; buttons.forEach((b) => { b.dataset.selected = String(b.dataset.id === m.id); }); overviewButton.dataset.selected = String(!!m.base); - if (!m.base && mode === 'placement') openEditor(m); - if (!m.base && mode === 'trim') openTrimEditor(m); - if (!m.base && mode === 'markers') openMarkerEditor(m); + if (mapEditingEnabled && !m.base && mode === 'placement') openEditor(m); + if (mapEditingEnabled && !m.base && mode === 'trim') openTrimEditor(m); + if (markerEditingEnabled && !m.base && mode === 'markers') openMarkerEditor(m); }; const roots = detail.filter((m) => !m.parent); @@ -1294,6 +1467,29 @@ async function main() { editButton.setAttribute('aria-pressed', 'false'); trimButton.setAttribute('aria-pressed', 'false'); markerEditButton.setAttribute('aria-pressed', 'false'); + exportButton.addEventListener('click', async () => { + exportButton.disabled = true; + exportStatus.dataset.error = 'false'; + exportStatus.textContent = 'Building static ZIP…'; + try { + const response = await fetch('api/export', { method: 'POST' }); + const result = await response.json().catch(() => ({})); + if (!response.ok) throw new Error(result.error || `Export failed (${response.status})`); + const sizeMiB = (Number(result.zipBytes) / 1024 / 1024).toFixed(1); + exportStatus.textContent = `Created ${result.fileName} (${sizeMiB} MiB, ${result.fileCount} files).`; + const download = document.createElement('a'); + download.href = `${result.download}?v=${Date.now()}`; + download.download = result.fileName; + document.body.appendChild(download); + download.click(); + download.remove(); + } catch (error) { + exportStatus.dataset.error = 'true'; + exportStatus.textContent = error.message; + } finally { + exportButton.disabled = false; + } + }); editButton.addEventListener('click', () => { if (editor.active) closeEditor(); else openEditor(byId.get(editor.selectedId)); @@ -1458,7 +1654,7 @@ async function main() { } function openTrimEditor(m) { - if (!m || m.base) return; + if (!mapEditingEnabled || !m || m.base) return; if (editor.active) closeEditor(); if (markerEditing.active) closeMarkerEditor(); clearTrimEditorLayers(); diff --git a/web/data/capabilities.json b/web/data/capabilities.json new file mode 100644 index 0000000..680f2aa --- /dev/null +++ b/web/data/capabilities.json @@ -0,0 +1,6 @@ +{ + "mapEditing": false, + "markerEditing": true, + "markerPersistence": "local", + "exporting": false +} diff --git a/web/data/marker-defaults/factory.json b/web/data/marker-defaults/factory.json new file mode 100644 index 0000000..29be5c9 --- /dev/null +++ b/web/data/marker-defaults/factory.json @@ -0,0 +1,141 @@ +{ + "version": 2, + "mapId": "factory", + "markers": [ + { + "x": 0.9318147759628354, + "y": 0.29516242112643143, + "category": "extract-hidden", + "label": "SMUGGLER\u2019S PASSAGE", + "source": "ExtractLegend/HIDDEN/Onmap/R", + "id": "factory-76a0d09fdeb9", + "mapId": "factory" + }, + { + "x": 0.48726210100404616, + "y": 0.4788501986445431, + "category": "extract-pmc", + "label": "COURTYARD GATE", + "source": "OnMapExtracts/ExtractNamesSmaller/COURTYARD GATE", + "id": "factory-0da9b29af46c", + "mapId": "factory" + }, + { + "x": 0.9118087816574254, + "y": 0.1868427202617434, + "category": "extract-pmc", + "label": "CELLARS", + "source": "OnMapExtracts/ExtractNamesSmaller/CELLARS", + "id": "factory-44d6b9feb851", + "mapId": "factory" + }, + { + "x": 0.7208152255357411, + "y": 0.7223650385604113, + "category": "extract-pmc", + "label": "MED TENT GATE", + "source": "OnMapExtracts/ExtractNamesSmaller/MED TENT GATE", + "id": "factory-bc21dda44298", + "mapId": "factory" + }, + { + "x": 0.5009366102202907, + "y": 0.2834774480018696, + "category": "extract-pmc", + "label": "GATE 3", + "source": "OnMapExtracts/ExtractNamesSmaller/GATE 3", + "id": "factory-c0ab06ab14fa", + "mapId": "factory" + }, + { + "x": 0.5101153903791398, + "y": 0.986211731713017, + "category": "extract-pmc", + "label": "GATE 0", + "source": "OnMapExtracts/ExtractNamesSmaller/GATE 0", + "id": "factory-ea2d17496842", + "mapId": "factory" + }, + { + "x": 0.7755881912183425, + "y": 0.6849731245618135, + "category": "extract-scav", + "label": "CAMERA BUNKER DOOR", + "source": "OnMapExtracts/ExtractNamesSmaller/CAMERA BUNKER DOOR ", + "id": "factory-5ae9bee65c8a", + "mapId": "factory" + }, + { + "x": 0.04589390079424547, + "y": 0.5010516475812106, + "category": "extract-scav", + "label": "OFFICE WINDOW", + "source": "OnMapExtracts/ExtractNamesSmaller/OFFICE WINDOW", + "id": "factory-b53e2ab073f5", + "mapId": "factory" + }, + { + "x": 0.8991083470702832, + "y": 0.23253096517878008, + "category": "key", + "label": "Factory emergency exit key", + "source": "OnMapMarkers/OnMapKeytext/Factory emergency exit key copy", + "id": "factory-1cc8bd224a77", + "mapId": "factory" + }, + { + "x": 0.03810130376142665, + "y": 0.42813741528394483, + "category": "key", + "label": "Factory emergency exit key", + "source": "OnMapMarkers/OnMapKeytext/Factory emergency exit key", + "id": "factory-370de048aadb", + "mapId": "factory" + }, + { + "x": 0.7722913232429193, + "y": 0.7618602477214302, + "category": "key", + "label": "Terra Group storage room keycard", + "source": "OnMapMarkers/OnMapKeytext/ TerraGroup storage room keycard", + "id": "factory-9377d27ef4ed", + "mapId": "factory" + }, + { + "x": 0.6917803087067286, + "y": 0.7282075251226923, + "category": "key", + "label": "Factory emergency exit key", + "source": "OnMapMarkers/OnMapKeytext/Factory emergency exit key copy 2", + "id": "factory-eeda2592fc3c", + "mapId": "factory" + }, + { + "x": 0.4872246365952345, + "y": 0.5085300303809301, + "category": "transit", + "label": "WOODS", + "source": "OnMapExtracts/ExtractNamesSmaller/WOODS", + "id": "factory-2830071855ae", + "mapId": "factory" + }, + { + "x": 0.9385958339577402, + "y": 0.7515774713718159, + "category": "transit", + "label": "THE LABS", + "source": "OnMapExtracts/ExtractNamesSmaller/THE LABS", + "id": "factory-7065703fa1b6", + "mapId": "factory" + }, + { + "x": 0.7090888655777012, + "y": 0.4973124561813508, + "category": "transit", + "label": "CUSTOMS", + "source": "OnMapExtracts/ExtractNamesSmaller/CUSTOMS", + "id": "factory-fb6b76cde606", + "mapId": "factory" + } + ] +} diff --git a/web/data/marker-defaults/ground-zero.json b/web/data/marker-defaults/ground-zero.json new file mode 100644 index 0000000..142c2c6 --- /dev/null +++ b/web/data/marker-defaults/ground-zero.json @@ -0,0 +1,186 @@ +{ + "version": 2, + "mapId": "ground-zero", + "markers": [ + { + "x": 0.6261448792672772, + "y": 0.14025590551181102, + "category": "extract-neutral", + "label": "SCAV CHECKPOINT (CO-OP)", + "source": "Map Overlay/On-map Extract Names/SCAV CHECKPOINt (CO-OP)", + "id": "ground-zero-d09a5c127856", + "mapId": "ground-zero" + }, + { + "x": 0.7052456286427977, + "y": 0.8513779527559056, + "category": "extract-pmc", + "label": "NAKATANI BASEMENT STAIRS", + "source": "Map Overlay/On-map Extract Names/nakatani basement stairs", + "id": "ground-zero-0465c74f6394", + "mapId": "ground-zero" + }, + { + "x": 0.24313072439633637, + "y": 0.11663385826771654, + "category": "extract-pmc", + "label": "EMERCOM CHECKPOINT", + "source": "Map Overlay/On-map Extract Names/EMERCOM CHECKPOINT", + "id": "ground-zero-51367f29c31a", + "mapId": "ground-zero" + }, + { + "x": 0.7385512073272273, + "y": 0.48326771653543305, + "category": "extract-pmc", + "label": "POLICE CORDON V-EX", + "source": "Map Overlay/On-map Extract Names/police cordon v-ex", + "id": "ground-zero-514f769e0370", + "mapId": "ground-zero" + }, + { + "x": 0.05412156536219817, + "y": 0.3612204724409449, + "category": "extract-pmc", + "label": "MIRA AVE", + "source": "Map Overlay/On-map Extract Names/MIRA AVE", + "id": "ground-zero-f2a5ba104f9f", + "mapId": "ground-zero" + }, + { + "x": 0.9991673605328892, + "y": 0.5492125984251969, + "category": "poi", + "label": "LABYRINTH", + "source": "Map Overlay/POI Text/LABYRINTH", + "id": "ground-zero-072402ef83f1", + "mapId": "ground-zero" + }, + { + "x": 0.607826810990841, + "y": 0.8821358267716536, + "category": "poi", + "label": "NAKATANI", + "source": "Map Overlay/POI Text/NAKATANI", + "id": "ground-zero-0a1f9f41d213", + "mapId": "ground-zero" + }, + { + "x": 0.5308076602830974, + "y": 0.5642224409448819, + "category": "poi", + "label": "EMPIRE", + "source": "Map Overlay/POI Text/EMPIRE", + "id": "ground-zero-175cc4746abc", + "mapId": "ground-zero" + }, + { + "x": 0.2343880099916736, + "y": 0.25664370078740156, + "category": "poi", + "label": "BUSINESS CENTER", + "source": "Map Overlay/POI Text/BUSINESS CENTER", + "id": "ground-zero-3bf16906fd15", + "mapId": "ground-zero" + }, + { + "x": 0.39217318900915904, + "y": 0.6958661417322834, + "category": "poi", + "label": "M", + "source": "Map Overlay/POI Text/M", + "id": "ground-zero-3eef8c2c2e3f", + "mapId": "ground-zero" + }, + { + "x": 0.23189009159034138, + "y": 0.23991141732283464, + "category": "poi", + "label": "SKYSIDE", + "source": "Map Overlay/POI Text/SKYSIDE", + "id": "ground-zero-4019518d7d5a", + "mapId": "ground-zero" + }, + { + "x": 0.517901748542881, + "y": 0.5123031496062992, + "category": "poi", + "label": "TARBANK", + "source": "Map Overlay/POI Text/TARBANK", + "id": "ground-zero-42ca7b78426a", + "mapId": "ground-zero" + }, + { + "x": 0.5915903413821815, + "y": 0.2266240157480315, + "category": "poi", + "label": "Rectangle 2", + "source": "Map Overlay/POI Text/Rectangle 2", + "id": "ground-zero-56ffd764e5d4", + "mapId": "ground-zero" + }, + { + "x": 0.31099084096586177, + "y": 0.3407972440944882, + "category": "poi", + "label": "ASAP", + "source": "Map Overlay/POI Text/ASAP", + "id": "ground-zero-79ce7616175f", + "mapId": "ground-zero" + }, + { + "x": 0.2935054121565362, + "y": 0.8206200787401575, + "category": "poi", + "label": "CAPITAL INSIGHT", + "source": "Map Overlay/POI Text/CAPITAL INSIGHT", + "id": "ground-zero-84f1441a75bc", + "mapId": "ground-zero" + }, + { + "x": 0.3430474604496253, + "y": 0.4702263779527559, + "category": "poi", + "label": "OASIS", + "source": "Map Overlay/POI Text/OASIS", + "id": "ground-zero-9c5a88b4c86e", + "mapId": "ground-zero" + }, + { + "x": 0.548293089092423, + "y": 0.7044783464566929, + "category": "poi", + "label": "GAGARIN HOTEL", + "source": "Map Overlay/POI Text/GAGARIN HOTEL", + "id": "ground-zero-a72e532ed70f", + "mapId": "ground-zero" + }, + { + "x": 0.12614487926727727, + "y": 0.5659448818897638, + "category": "poi", + "label": "Point of interest", + "source": "Map Overlay/POI Text/Ellipse 1", + "id": "ground-zero-b5d3f8aa2bd0", + "mapId": "ground-zero" + }, + { + "x": 0.8288925895087427, + "y": 0.3762303149606299, + "category": "poi", + "label": "TERRAGROUP", + "source": "Map Overlay/POI Text/TERRAGROUP", + "id": "ground-zero-f6576cf57c93", + "mapId": "ground-zero" + }, + { + "x": 0.23980016652789343, + "y": 0.5243602362204725, + "category": "poi", + "label": "FUSION", + "source": "Map Overlay/POI Text/FUSION", + "id": "ground-zero-f6fa1dc62053", + "mapId": "ground-zero" + } + ] +} diff --git a/web/data/marker-defaults/labyrinth.json b/web/data/marker-defaults/labyrinth.json new file mode 100644 index 0000000..a478638 --- /dev/null +++ b/web/data/marker-defaults/labyrinth.json @@ -0,0 +1,744 @@ +{ + "version": 2, + "mapId": "labyrinth", + "markers": [ + { + "x": 0.3084296218487395, + "y": 0.7113000864802537, + "category": "extract-hidden", + "label": "ARIADNE\u2019S PATH", + "source": "All/ONMAP/ONMAP ExfilNames/ARIADNE\u2019S PATH", + "id": "labyrinth-9e598d81edb9", + "mapId": "labyrinth" + }, + { + "x": 0.6846113445378151, + "y": 0.43124819832804845, + "category": "extract-pmc", + "label": "THE WAY UP", + "source": "All/ONMAP/ONMAP ExfilNames/THE WAY UP", + "id": "labyrinth-34bac18ea070", + "mapId": "labyrinth" + }, + { + "x": 0.8609506302521008, + "y": 0.1677716921302969, + "category": "key", + "label": "\u278f", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 46", + "id": "labyrinth-0f62b15a834e", + "mapId": "labyrinth" + }, + { + "x": 0.20627626050420167, + "y": 0.06082444508503892, + "category": "key", + "label": "\u278b", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 17", + "id": "labyrinth-113d098b0d58", + "mapId": "labyrinth" + }, + { + "x": 0.29818802521008403, + "y": 0.15739406168924763, + "category": "key", + "label": "key03", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/key03", + "id": "labyrinth-140b4c8f9302", + "mapId": "labyrinth" + }, + { + "x": 0.9038865546218487, + "y": 0.86105505909484, + "category": "key", + "label": "key5", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/key5", + "id": "labyrinth-1ad363e6f893", + "mapId": "labyrinth" + }, + { + "x": 0.9003413865546218, + "y": 0.2626117036609974, + "category": "key", + "label": "\u277a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 40", + "id": "labyrinth-1ae141379925", + "mapId": "labyrinth" + }, + { + "x": 0.9536502100840336, + "y": 0.6081003170942635, + "category": "key", + "label": "key4", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/key4", + "id": "labyrinth-247cf8cfa3d5", + "mapId": "labyrinth" + }, + { + "x": 0.9097951680672269, + "y": 0.08273277601614298, + "category": "key", + "label": "\u278a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 36", + "id": "labyrinth-28073ce3e250", + "mapId": "labyrinth" + }, + { + "x": 0.22465861344537816, + "y": 0.005477082732776016, + "category": "key", + "label": "\u278a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 16", + "id": "labyrinth-293401a1f01c", + "mapId": "labyrinth" + }, + { + "x": 0.17345063025210083, + "y": 0.09599308157970597, + "category": "key", + "label": "\u277a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 24", + "id": "labyrinth-2d4485b36668", + "mapId": "labyrinth" + }, + { + "x": 0.8882615546218487, + "y": 0.7206687806284232, + "category": "key", + "label": "\u278d", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 28", + "id": "labyrinth-2d8ef327a471", + "mapId": "labyrinth" + }, + { + "x": 0.9252888655462185, + "y": 0.32026520611127124, + "category": "key", + "label": "key1", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/key1", + "id": "labyrinth-2fc05838029f", + "mapId": "labyrinth" + }, + { + "x": 0.27468487394957986, + "y": 0.6754107812049582, + "category": "key", + "label": "Ariadne Key Icon", + "source": "All/ONMAP/AriadneKey/AriadneKeyIcon", + "id": "labyrinth-30f8800e1ac4", + "mapId": "labyrinth" + }, + { + "x": 0.06315651260504201, + "y": 0.7503603343903142, + "category": "key", + "label": "\u278c", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 33", + "id": "labyrinth-4e159a46d5c0", + "mapId": "labyrinth" + }, + { + "x": 0.8535976890756303, + "y": 0.7316229460939752, + "category": "key", + "label": "\u278c", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 27", + "id": "labyrinth-55a97712729c", + "mapId": "labyrinth" + }, + { + "x": 0.17345063025210083, + "y": 0.18132026520611128, + "category": "key", + "label": "\u278c", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 22", + "id": "labyrinth-597fd6cb0145", + "mapId": "labyrinth" + }, + { + "x": 0.20942752100840337, + "y": 0.2017872585759585, + "category": "key", + "label": "\u278d", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 19", + "id": "labyrinth-6321d1266323", + "mapId": "labyrinth" + }, + { + "x": 0.16846113445378152, + "y": 0.5978668204093399, + "category": "key", + "label": "CORPSE ROOM KEY", + "source": "All/ONMAP/OnMap CorpseKeyIconDots/CORPSE ROOM KEY", + "id": "labyrinth-6b75e62762cd", + "mapId": "labyrinth" + }, + { + "x": 0.04923844537815126, + "y": 0.8137791870856155, + "category": "key", + "label": "\u277a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 35", + "id": "labyrinth-7c687d07008b", + "mapId": "labyrinth" + }, + { + "x": 0.06289390756302521, + "y": 0.5869126549437879, + "category": "key", + "label": "\u278a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 12", + "id": "labyrinth-7ee9c84f0c05", + "mapId": "labyrinth" + }, + { + "x": 0.7488182773109243, + "y": 0.8697030844623811, + "category": "key", + "label": "\u278b", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 42", + "id": "labyrinth-8192cd9463f3", + "mapId": "labyrinth" + }, + { + "x": 0.18500525210084034, + "y": 0.16805995964254827, + "category": "key", + "label": "\u278d", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 23", + "id": "labyrinth-83ad3bda6f35", + "mapId": "labyrinth" + }, + { + "x": 0.16832983193277312, + "y": 0.5748054194292304, + "category": "key", + "label": "Corpse Key Icon", + "source": "All/ONMAP/OnMap CorpseKeyIconDots/CorpseKeyIcon", + "id": "labyrinth-90aa7ad37af1", + "mapId": "labyrinth" + }, + { + "x": 0.05422794117647059, + "y": 0.6154511386566734, + "category": "key", + "label": "\u278a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 31", + "id": "labyrinth-9194038251ea", + "mapId": "labyrinth" + }, + { + "x": 0.9628413865546218, + "y": 0.6519169789564716, + "category": "key", + "label": "FIND KEY 04 FOR THE DOOR", + "source": "All/ONMAP/OnMap Chamber5Labels/FIND KEY 04 FOR THE DOOR", + "id": "labyrinth-9736308e6206", + "mapId": "labyrinth" + }, + { + "x": 0.021664915966386554, + "y": 0.5422311905448256, + "category": "key", + "label": "\u278b", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 13", + "id": "labyrinth-984b5a7dca73", + "mapId": "labyrinth" + }, + { + "x": 0.850577731092437, + "y": 0.22585759584894782, + "category": "key", + "label": "FIND KEY 1 FOR THE DOOR", + "source": "All/ONMAP/OnMap Chamber5Labels/Group 1/FIND KEY 1 FOR THE DOOR", + "id": "labyrinth-a17da5f7e9f6", + "mapId": "labyrinth" + }, + { + "x": 0.16163340336134455, + "y": 0.21331795906601325, + "category": "key", + "label": "\u278b", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 21", + "id": "labyrinth-a40f48bd716f", + "mapId": "labyrinth" + }, + { + "x": 0.8491334033613446, + "y": 0.714326895358893, + "category": "key", + "label": "\u278b", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 26", + "id": "labyrinth-a95584c2d703", + "mapId": "labyrinth" + }, + { + "x": 0.021664915966386554, + "y": 0.47765926780051887, + "category": "key", + "label": "\u278d", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 15", + "id": "labyrinth-aa545e09fa83", + "mapId": "labyrinth" + }, + { + "x": 0.20181197478991597, + "y": 0.2017872585759585, + "category": "key", + "label": "\u278c", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 18", + "id": "labyrinth-ab9362835461", + "mapId": "labyrinth" + }, + { + "x": 0.8719800420168067, + "y": 0.6906889593542808, + "category": "key", + "label": "\u277a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 29", + "id": "labyrinth-b051ce7eca1b", + "mapId": "labyrinth" + }, + { + "x": 0.06368172268907563, + "y": 0.6976073796483137, + "category": "key", + "label": "\u278b", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 32", + "id": "labyrinth-b1ca70e35377", + "mapId": "labyrinth" + }, + { + "x": 0.034926470588235295, + "y": 0.4550302680887864, + "category": "key", + "label": "FIND KEY 02 FOR THE DOOR", + "source": "All/ONMAP/OnMap Chamber5Labels/FIND KEY 02 FOR THE DOOR", + "id": "labyrinth-b29acbd29be3", + "mapId": "labyrinth" + }, + { + "x": 0.02035189075630252, + "y": 0.7506486019025655, + "category": "key", + "label": "\u278d", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 34", + "id": "labyrinth-b45fdc116451", + "mapId": "labyrinth" + }, + { + "x": 0.7606355042016807, + "y": 0.7852407033727299, + "category": "key", + "label": "\u278d", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 44", + "id": "labyrinth-b58cceb2ca94", + "mapId": "labyrinth" + }, + { + "x": 0.7461922268907563, + "y": 0.8019602190833093, + "category": "key", + "label": "\u278c", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 43", + "id": "labyrinth-b788cadcbfcb", + "mapId": "labyrinth" + }, + { + "x": 0.7301733193277311, + "y": 0.8630729316805996, + "category": "key", + "label": "\u278a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 41", + "id": "labyrinth-bb85f0974b96", + "mapId": "labyrinth" + }, + { + "x": 0.8848476890756303, + "y": 0.682329201498991, + "category": "key", + "label": "\u278f", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 30", + "id": "labyrinth-c3ab341618b8", + "mapId": "labyrinth" + }, + { + "x": 0.06289390756302521, + "y": 0.489478235802825, + "category": "key", + "label": "\u278c", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 14", + "id": "labyrinth-c5363e0468da", + "mapId": "labyrinth" + }, + { + "x": 0.26404936974789917, + "y": 0.21504756413952147, + "category": "key", + "label": "FIND KEY 3 FOR THE DOOR", + "source": "All/ONMAP/OnMap Chamber5Labels/FIND KEY 3 FOR THE DOOR", + "id": "labyrinth-cacbf41dba3e", + "mapId": "labyrinth" + }, + { + "x": 0.9570640756302521, + "y": 0.17555491496108389, + "category": "key", + "label": "\u278c", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 38", + "id": "labyrinth-cf2d56c52fc6", + "mapId": "labyrinth" + }, + { + "x": 0.20732668067226892, + "y": 0.22542519458057078, + "category": "key", + "label": "\u278a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 20", + "id": "labyrinth-dfb47cf1052f", + "mapId": "labyrinth" + }, + { + "x": 0.8556985294117647, + "y": 0.7097146151628712, + "category": "key", + "label": "\u278a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 25", + "id": "labyrinth-e234481dd232", + "mapId": "labyrinth" + }, + { + "x": 0.11922268907563026, + "y": 0.6644566157394062, + "category": "key", + "label": "Key02", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/Key02", + "id": "labyrinth-e4bc1a23df36", + "mapId": "labyrinth" + }, + { + "x": 0.8360031512605042, + "y": 0.8224272124531565, + "category": "key", + "label": "\u277a", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 45", + "id": "labyrinth-ea271456100e", + "mapId": "labyrinth" + }, + { + "x": 0.9118960084033614, + "y": 0.2752954742000577, + "category": "key", + "label": "\u278d", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 39", + "id": "labyrinth-ea30ac72c665", + "mapId": "labyrinth" + }, + { + "x": 0.27494747899159666, + "y": 0.6987604496973191, + "category": "key", + "label": "ARIADNE SYMBOL KEY", + "source": "All/ONMAP/AriadneKey/ARIADNE SYMBOL KEY", + "id": "labyrinth-eb0039a6301a", + "mapId": "labyrinth" + }, + { + "x": 0.8683035714285714, + "y": 0.06514845776880945, + "category": "key", + "label": "\u278b", + "source": "All/ONMAP/ONMAP KEYLOCATIONS/onmapnumbers/JumpSymbol copy 37", + "id": "labyrinth-fb075b207c5e", + "mapId": "labyrinth" + }, + { + "x": 0.6221113445378151, + "y": 0.4567598731622946, + "category": "location", + "label": "ASSEMBLY ROOM", + "source": "All/ONMAP/OnMap TextLabels/ASSEMBLY ROOM", + "id": "labyrinth-00f646845968", + "mapId": "labyrinth" + }, + { + "x": 0.3941701680672269, + "y": 0.6696454309599308, + "category": "location", + "label": "Blocked Path Torture Room", + "source": "All/ONMAP/BlockedPathTortureRoom", + "id": "labyrinth-3147ef844bdf", + "mapId": "labyrinth" + }, + { + "x": 0.37683823529411764, + "y": 0.5944076102623235, + "category": "location", + "label": "OBSERVATION ROOM", + "source": "All/ONMAP/OnMap TextLabels/OBSERVATION ROOM", + "id": "labyrinth-39a2d8bf18be", + "mapId": "labyrinth" + }, + { + "x": 0.3953518907563025, + "y": 0.702507927356587, + "category": "location", + "label": "TORTURE ROOM", + "source": "All/ONMAP/OnMap TextLabels/TORTURE ROOM", + "id": "labyrinth-978d5e8a4cfd", + "mapId": "labyrinth" + }, + { + "x": 0.4426207983193277, + "y": 0.6236667627558374, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP Corpse/JumpSymbol copy 8", + "id": "labyrinth-000acb9ea206", + "mapId": "labyrinth" + }, + { + "x": 0.6020220588235294, + "y": 0.4334102046699337, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP_Scientist_Corpses/\u2777 copy 4", + "id": "labyrinth-077e24cf989f", + "mapId": "labyrinth" + }, + { + "x": 0.7939863445378151, + "y": 0.36047852407033726, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP_Scientist_Corpses/\u2779 copy 4", + "id": "labyrinth-117c597bf54b", + "mapId": "labyrinth" + }, + { + "x": 0.8275997899159664, + "y": 0.5121072355145575, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP CorpseRoomSpawns/OnMapCorpseRoom/\u277b copy", + "id": "labyrinth-2707c1d3c1e3", + "mapId": "labyrinth" + }, + { + "x": 0.8163077731092437, + "y": 0.754107812049582, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/OnMap Chamber5Labels/USE THE SWITCH TO DISABLE THE SHOTGUN TRAP", + "id": "labyrinth-3cd787d23f18", + "mapId": "labyrinth" + }, + { + "x": 0.7175682773109243, + "y": 0.23335255116748344, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP Corpse/JumpSymbol copy 7", + "id": "labyrinth-41a519e805ad", + "mapId": "labyrinth" + }, + { + "x": 0.6219800420168067, + "y": 0.6132891323147881, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP_Scientist_Corpses/\u2778 copy 4", + "id": "labyrinth-428eff9e795f", + "mapId": "labyrinth" + }, + { + "x": 0.3862920168067227, + "y": 0.5863361199192851, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP_Scientist_Corpses/\u277b", + "id": "labyrinth-4ab82c13b45e", + "mapId": "labyrinth" + }, + { + "x": 0.756171218487395, + "y": 0.3319400403574517, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP CorpseRoomSpawns/OnMapCorpseRoom/\u2779 copy", + "id": "labyrinth-50e0a33c437d", + "mapId": "labyrinth" + }, + { + "x": 0.43001575630252103, + "y": 0.4455174401844912, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/Story corpse/\ud83d\udf89", + "id": "labyrinth-519da2675e46", + "mapId": "labyrinth" + }, + { + "x": 0.6989233193277311, + "y": 0.5490054770827327, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP CorpseRoomSpawns/OnMapCorpseRoom/\u277a copy", + "id": "labyrinth-59339d304b31", + "mapId": "labyrinth" + }, + { + "x": 0.33075105042016806, + "y": 0.49769385990198906, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP_Scientist_Corpses/\u277a copy 4", + "id": "labyrinth-5b142ab91ebc", + "mapId": "labyrinth" + }, + { + "x": 0.3806460084033613, + "y": 0.48183914672816375, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP CorpseRoomSpawns/OnMapCorpseRoom/\u2778 copy", + "id": "labyrinth-5b8402f6b736", + "mapId": "labyrinth" + }, + { + "x": 0.21271008403361344, + "y": 0.5874891899682906, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/OnMap TextLabels/CORPSE ROOM", + "id": "labyrinth-692e080d765b", + "mapId": "labyrinth" + }, + { + "x": 0.46704306722689076, + "y": 0.4342750072066878, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP CorpseRoomSpawns/OnMapCorpseRoom/\u2776 copy", + "id": "labyrinth-7762084a99dc", + "mapId": "labyrinth" + }, + { + "x": 0.5938813025210085, + "y": 0.5345921014701643, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP CorpseRoomSpawns/OnMapCorpseRoom/\u2777 copy", + "id": "labyrinth-893514d9db10", + "mapId": "labyrinth" + }, + { + "x": 0.4263392857142857, + "y": 0.4504179878927645, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP_Scientist_Corpses/\u2776 copy 8", + "id": "labyrinth-a708a25d036f", + "mapId": "labyrinth" + }, + { + "x": 0.058429621848739496, + "y": 0.4605073508215624, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP Corpse/JumpSymbol copy 11", + "id": "labyrinth-b61a0d7b00a9", + "mapId": "labyrinth" + }, + { + "x": 0.6054359243697479, + "y": 0.4282213894494091, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/Story corpse/\ud83d\udf89", + "id": "labyrinth-be294dffbce3", + "mapId": "labyrinth" + }, + { + "x": 0.21599264705882354, + "y": 0.003603343903142116, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP Corpse/JumpSymbol copy 9", + "id": "labyrinth-be759335a7f3", + "mapId": "labyrinth" + }, + { + "x": 0.5815388655462185, + "y": 0.21144422023637935, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/ONMAP Corpse/JumpSymbol copy 10", + "id": "labyrinth-dadaf6c05e02", + "mapId": "labyrinth" + }, + { + "x": 0.6253939075630253, + "y": 0.6078120495820121, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/Story corpse/\ud83d\udf89", + "id": "labyrinth-f0ff11eb9db7", + "mapId": "labyrinth" + }, + { + "x": 0.8016018907563025, + "y": 0.700634188526953, + "category": "loot", + "label": "Loot", + "source": "All/ONMAP/Chambers/Chamber5/SHOTGUN TRAP", + "id": "labyrinth-fdc1cac858fb", + "mapId": "labyrinth" + }, + { + "x": 0.2036502100840336, + "y": 0.021043528394349958, + "category": "spawn", + "label": "PMC spawn", + "source": "All/ONMAP/PMC Spawns/PMCSpawn", + "id": "labyrinth-1c58883c860d", + "mapId": "labyrinth" + }, + { + "x": 0.7924107142857143, + "y": 0.7218218506774287, + "category": "spawn", + "label": "PMC spawn", + "source": "All/ONMAP/PMC Spawns/PMCSpawn", + "id": "labyrinth-670b01ccfdce", + "mapId": "labyrinth" + }, + { + "x": 0.04214810924369748, + "y": 0.5673104641106947, + "category": "spawn", + "label": "PMC spawn", + "source": "All/ONMAP/PMC Spawns/PMCSpawn", + "id": "labyrinth-9406f26c8c88", + "mapId": "labyrinth" + }, + { + "x": 0.6051733193277311, + "y": 0.9256269818391467, + "category": "spawn", + "label": "PMC spawn", + "source": "All/ONMAP/PMC Spawns/PMCSpawn", + "id": "labyrinth-c56e20152d03", + "mapId": "labyrinth" + }, + { + "x": 0.983061974789916, + "y": 0.13721533583165177, + "category": "spawn", + "label": "PMC spawn", + "source": "All/ONMAP/PMC Spawns/PMCSpawn", + "id": "labyrinth-e84b37cdc2f0", + "mapId": "labyrinth" + } + ] +} diff --git a/web/index.html b/web/index.html index e95f38c..5d5db24 100644 --- a/web/index.html +++ b/web/index.html @@ -27,6 +27,8 @@ + +