Port the Pokédex list, entries and tab (#35)
The start menu's POKéDEX runs Pokedex in New mode: the list up to the last seen Pokémon, its cursor and page moves, and DisplayDexEntry with the category, number, footprint, and the height, weight and pages once caught. The Pokédex tab shows the same records from the loaded game. Order, entries and footprints are compared with the pinned PRET source. AREA, CRY, PRNT, the option and search screens, Old and A to Z modes and Unown mode remain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
03aa913a94
commit
cdee576818
20 files changed
+1624
-29
No files matched your search
+23
-3
@@ -56,6 +56,7 @@ import {
|
||||
} from "../scripts/interpreter";
|
||||
import { IntroRun } from "../scripts/intro";
|
||||
import { FLY_MAP_BUTTONS, type FlyMapView } from "../scripts/fly-map";
|
||||
import { POKEDEX_BUTTONS, type PokedexView } from "../scripts/pokedex";
|
||||
import {
|
||||
StartMenuRun,
|
||||
type MenuCursors,
|
||||
@@ -311,6 +312,8 @@ export type Choice =
|
||||
| { kind: "mombank"; view: MomBankView; selected: 0 }
|
||||
/** A trainer card page, answered with the button pressed. */
|
||||
| { kind: "trainercard"; view: TrainerCardView; selected: 0 }
|
||||
/** A Pokédex screen, answered with the button pressed. */
|
||||
| { kind: "pokedex"; view: PokedexView; selected: 0 }
|
||||
/** The options screen, answered with the button pressed. */
|
||||
| { kind: "options"; view: OptionsView; selected: 0 }
|
||||
/** The Fly map, answered with the button pressed. */
|
||||
@@ -332,6 +335,7 @@ const buttonChoice = (choice: Choice) =>
|
||||
choice.kind === "pokegear" ||
|
||||
choice.kind === "mombank" ||
|
||||
choice.kind === "trainercard" ||
|
||||
choice.kind === "pokedex" ||
|
||||
choice.kind === "options" ||
|
||||
choice.kind === "flymap";
|
||||
export interface Dialogue {
|
||||
@@ -683,7 +687,7 @@ export class GameWorld {
|
||||
private turnTo?: Direction;
|
||||
private turnWait = 0;
|
||||
/** Start menu, party menu and pack cursors (work RAM, not saved). */
|
||||
private menuCursors: MenuCursors = { start: 0, party: 0, pocket: 0 };
|
||||
private menuCursors: MenuCursors = { start: 0, party: 0, pocket: 0, dex: 0 };
|
||||
/** OBJECT_ACTION_BUMP this tick: walking in place against an obstacle. */
|
||||
private bumping = false;
|
||||
/** A screen shake object (earthquake, step_shake) in progress. */
|
||||
@@ -2230,6 +2234,7 @@ export class GameWorld {
|
||||
{
|
||||
reader: this.assets.reader,
|
||||
data: this.assets.pokemon,
|
||||
dex: this.assets.pokedex,
|
||||
text: () => this.host(PLAYER).text(),
|
||||
bicycleScript: (state, select) => this.bicycleScript(state, select),
|
||||
timeOfDay: () => this.clockTimeOfDay,
|
||||
@@ -2619,6 +2624,14 @@ export class GameWorld {
|
||||
choice: { kind: "trainercard", view: effect.view, selected: 0 },
|
||||
};
|
||||
return true;
|
||||
case "pokedex":
|
||||
if (!effect.view) return false;
|
||||
this.dialogue = {
|
||||
pages: [""],
|
||||
index: 0,
|
||||
choice: { kind: "pokedex", view: effect.view, selected: 0 },
|
||||
};
|
||||
return true;
|
||||
case "options":
|
||||
if (!effect.view) return false;
|
||||
this.dialogue = {
|
||||
@@ -3168,7 +3181,12 @@ export class GameWorld {
|
||||
this.battleRun = undefined;
|
||||
// ExitBattle: EvolveAfterBattle after a win, then CleanUpBattleRAM.
|
||||
const { result, evolvable } = next.value;
|
||||
this.menuCursors = { start: 0, party: 0, pocket: 0 };
|
||||
this.menuCursors = {
|
||||
start: 0,
|
||||
party: 0,
|
||||
pocket: 0,
|
||||
dex: this.menuCursors.dex,
|
||||
};
|
||||
if (this.script && evolvable && !(result & 0x0f)) {
|
||||
this.script.interlude = {
|
||||
run: new PartyEvolution(
|
||||
@@ -4202,6 +4220,8 @@ export class GameWorld {
|
||||
!MOM_BANK_BUTTONS.includes(answer as never)) ||
|
||||
(dialogue.choice.kind === "trainercard" &&
|
||||
!TRAINER_CARD_BUTTONS.includes(answer as never)) ||
|
||||
(dialogue.choice.kind === "pokedex" &&
|
||||
!POKEDEX_BUTTONS.includes(answer as never)) ||
|
||||
(dialogue.choice.kind === "options" &&
|
||||
!OPTIONS_BUTTONS.includes(answer as never)) ||
|
||||
(dialogue.choice.kind === "flymap" &&
|
||||
@@ -4538,7 +4558,7 @@ export class GameWorld {
|
||||
this.battle = undefined;
|
||||
this.battleRun = undefined;
|
||||
this.memScript = undefined;
|
||||
this.menuCursors = { start: 0, party: 0, pocket: 0 };
|
||||
this.menuCursors = { start: 0, party: 0, pocket: 0, dex: 0 };
|
||||
this.clearNotice();
|
||||
this.introPending = false;
|
||||
// A save made during the introduction starts it again.
|
||||
|
||||
Reference in new issue
Block a user