forked from phenom/healer-man
Update Healer Man server
This commit is contained in:
1 parent
9c5fb4c614
commit
bd073fb00f
113 files changed
+4902
-273
No files matched your search
+10
-9
@@ -8,7 +8,7 @@ import { DungeonMapGraphic, type MapArtworkStatus } from "./DungeonMapGraphic";
|
||||
import { requireDungeonDefinition } from "../game/dungeonRegistry";
|
||||
import { resolveStagePresentation } from "../game/manastormStagePresentation";
|
||||
import { useManastormStore } from "../game/manastormStore";
|
||||
import { wowDungeonMapFor, wowMapContains, wowMapFloorFor, wowMapPoint } from "../game/wowDungeonMap";
|
||||
import { dungeonArtworkContains, dungeonArtworkFloorFor, dungeonArtworkMapFor, dungeonArtworkPoint } from "../game/dungeonArtworkMap";
|
||||
|
||||
export function closeMapForKey(event: Pick<KeyboardEvent, "code" | "ctrlKey" | "altKey" | "shiftKey" | "metaKey" | "repeat" | "defaultPrevented" | "preventDefault" | "stopPropagation">, close: () => void) {
|
||||
if (event.repeat || event.defaultPrevented || isCapturingInput()) return;
|
||||
@@ -31,13 +31,14 @@ function MapDialog() {
|
||||
const encounter = useManastormStore((state) => state.currentEncounter);
|
||||
const activeDungeonId = useGameStore((state) => state.activeDungeonId);
|
||||
const dungeon = requireDungeonDefinition(activeDungeonId);
|
||||
const map = wowDungeonMapFor(dungeon);
|
||||
const map = dungeonArtworkMapFor(dungeon);
|
||||
const navigationPlan = map?.kind === "runewaker" && map.source.kind === "navigation";
|
||||
const [floorLevel, setFloorLevel] = useState<number | null>(null);
|
||||
const [showPatrols, setShowPatrols] = useState(false);
|
||||
const [artworkStatus, setArtworkStatus] = useState<MapArtworkStatus>(map ? "loading" : "unavailable");
|
||||
const floor = map ? wowMapFloorFor(map, position, floorLevel) : null;
|
||||
const mapPosition = map && floor ? wowMapPoint(map, floor, position) : null;
|
||||
const positionOnMap = Boolean(map && floor && wowMapContains(map, floor, position));
|
||||
const floor = map ? dungeonArtworkFloorFor(map, position, floorLevel) : null;
|
||||
const mapPosition = map && floor ? dungeonArtworkPoint(map, floor, position) : null;
|
||||
const positionOnMap = Boolean(map && floor && dungeonArtworkContains(map, floor, position));
|
||||
const stagePresentation = resolveStagePresentation(gameMode, encounter, {
|
||||
title: dungeon.title,
|
||||
mapId: dungeon.mapId,
|
||||
@@ -49,7 +50,7 @@ function MapDialog() {
|
||||
<aside className="map-panel" role="dialog" aria-modal="true" aria-labelledby="map-title" onKeyDown={(event) => closeMapForKey(event, close)}>
|
||||
<header>
|
||||
<div>
|
||||
<p className="eyebrow">{artworkStatus === "ready" ? "Dungeon atlas" : "Expedition survey"}</p>
|
||||
<p className="eyebrow">{artworkStatus === "ready" ? navigationPlan ? "Dungeon floorplan" : "Dungeon atlas" : "Expedition survey"}</p>
|
||||
<h2 id="map-title">{stagePresentation.title}</h2>
|
||||
</div>
|
||||
<button type="button" className="icon-button" onClick={close} aria-label="Close map">X</button>
|
||||
@@ -71,15 +72,15 @@ function MapDialog() {
|
||||
<div className="map-panel__readout">
|
||||
<div><span>Current area</span><strong>{stagePresentation.areaName}</strong></div>
|
||||
<div><span>{artworkStatus === "ready" ? floor?.name : "Position"}</span><strong>{artworkStatus === "ready" && mapPosition
|
||||
? positionOnMap ? `${(mapPosition[0] / 1002 * 100).toFixed(1)}%, ${(mapPosition[1] / 668 * 100).toFixed(1)}%` : "Outside selected floor"
|
||||
? positionOnMap ? `${(mapPosition[0] / map!.width * 100).toFixed(1)}%, ${(mapPosition[1] / map!.height * 100).toFixed(1)}%` : "Outside selected floor"
|
||||
: position.map((value) => Math.round(value)).join(" / ")}</strong></div>
|
||||
</div>
|
||||
<p className="map-panel__note">
|
||||
{stagePresentation.usingFallbackEnvironment
|
||||
? "Stage location is authoritative; the survey artwork is temporary fallback geometry. "
|
||||
: artworkStatus === "ready"
|
||||
? "Original game artwork. White: you and camera direction. Green: entrance. Gold: numbered encounters. "
|
||||
: artworkStatus === "loading" ? "Loading original game artwork. " : "Original artwork unavailable; showing the survey fallback. "}
|
||||
? `${navigationPlan ? "Navigation floorplan" : "Original game artwork"}. White: you and camera direction. Green: entrance. Gold: numbered encounters. `
|
||||
: artworkStatus === "loading" ? navigationPlan ? "Loading dungeon floorplan. " : "Loading original game artwork. " : "Original artwork unavailable; showing the survey fallback. "}
|
||||
{map && map.floors.length > 1 && "Choose a floor when rooms overlap. "}
|
||||
Press {bindingLabel("pc", "map")} to close or {bindingLabel("controller", "menu-back")} to return to Pause.
|
||||
</p>
|
||||
|
||||
Reference in new issue
Block a user