Add the Johto and Kanto atlas to the Map tab
The Map tab draws the region's Town Map from the ROM with the player's landmark, the visited flypoints as Fly destinations and the landmarks whose maps are ported. Kanto opens with the Fly map's Indigo Plateau rule. Landmark positions and flypoints are compared with the pinned PRET source. Closes #36 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cdee576818
commit
29248172bd
13 files changed
+536
-30
No files matched your search
@@ -57,6 +57,7 @@ import {
|
||||
import { IntroRun } from "../scripts/intro";
|
||||
import { FLY_MAP_BUTTONS, type FlyMapView } from "../scripts/fly-map";
|
||||
import { POKEDEX_BUTTONS, type PokedexView } from "../scripts/pokedex";
|
||||
import { regionAtlas, type AtlasRegion, type AtlasView } from "./atlas";
|
||||
import {
|
||||
StartMenuRun,
|
||||
type MenuCursors,
|
||||
@@ -763,6 +764,26 @@ export class GameWorld {
|
||||
get liveState(): ScriptState {
|
||||
return this.script?.run.state ?? this.state;
|
||||
}
|
||||
/** The Map tab's region atlas, from the live state. */
|
||||
atlas(region?: AtlasRegion): AtlasView {
|
||||
const state = this.liveState;
|
||||
let landmark = this.map.landmark;
|
||||
if (landmark === OW.LANDMARK_SPECIAL && state.backupWarp)
|
||||
landmark = this.assets.map(state.backupWarp.map).landmark;
|
||||
return regionAtlas(
|
||||
{
|
||||
reader: this.assets.reader,
|
||||
text: () => this.host(PLAYER).text(),
|
||||
landmark,
|
||||
visited: (spawn) => {
|
||||
const flag = this.assets.spawnEngineFlag(spawn);
|
||||
return flag !== undefined && state.flags.has(flag);
|
||||
},
|
||||
open: this.assets.portedLandmarks(),
|
||||
},
|
||||
region,
|
||||
);
|
||||
}
|
||||
/** What the player is waiting for: a scene, a step, or nothing. */
|
||||
get activity(): "scene" | "walking" | "idle" {
|
||||
return this.script
|
||||
|
||||
Reference in new issue
Block a user