Game menu: WORLD MAP -> WORLD (#17)

This commit is contained in:
xCrystal 2024-02-12 13:09:18 +01:00
parent 4b1eea55af
commit e34bac40d6
2 changed files with 9 additions and 9 deletions

View File

@ -129,7 +129,7 @@
### Overworld workflow ### Overworld workflow
1) ``OverworldLoop`` is called from ``GameMenu_WorldMap`` with either ``hMapEntryMethod`` = ``MAPSETUP_ENTERLEVEL`` or ``hMapEntryMethod`` = ``MAPSETUP_CONTINUE``. 1) ``OverworldLoop`` is called from ``GameMenu_World`` with either ``hMapEntryMethod`` = ``MAPSETUP_ENTERLEVEL`` or ``hMapEntryMethod`` = ``MAPSETUP_CONTINUE``.
2) ``StartMap`` resets ``wCurTurn`` and ``wCurSpace`` if ``MAPSETUP_ENTERLEVEL``. ``StartMap`` sets ``hCurBoardEvent`` to ``BOARDEVENT_DISPLAY_MENU``. ``wEnabledPlayerEvents`` is cleared. ``wMapStatus`` is set to ``MAPSTATUS_HANDLE`` causing ``HandleMap`` to be called. 2) ``StartMap`` resets ``wCurTurn`` and ``wCurSpace`` if ``MAPSETUP_ENTERLEVEL``. ``StartMap`` sets ``hCurBoardEvent`` to ``BOARDEVENT_DISPLAY_MENU``. ``wEnabledPlayerEvents`` is cleared. ``wMapStatus`` is set to ``MAPSTATUS_HANDLE`` causing ``HandleMap`` to be called.
3) ``MapEvents`` (from ``HandleMap``) calls ``PlayerEvents``. ``CheckBoardEvent`` queues ``BoardMenuScript`` which is executed by ``ScriptEvents``. 3) ``MapEvents`` (from ``HandleMap``) calls ``PlayerEvents``. ``CheckBoardEvent`` queues ``BoardMenuScript`` which is executed by ``ScriptEvents``.
4) ``BoardMenuScript.Upkeep`` saves the game, clears ``wTurnData[]``, increases ``wCurTurn``, and loads current space to ``wCurSpaceStruct[]``. 4) ``BoardMenuScript.Upkeep`` saves the game, clears ``wTurnData[]``, increases ``wCurTurn``, and loads current space to ``wCurSpaceStruct[]``.

View File

@ -1,6 +1,6 @@
; GameMenu.String and GameMenu.Jumptable indexes ; GameMenu.String and GameMenu.Jumptable indexes
const_def const_def
const GAMEMENU_WORLD_MAP const GAMEMENU_WORLD
const GAMEMENU_SHOP const GAMEMENU_SHOP
GameMenu: GameMenu:
@ -55,17 +55,17 @@ GameMenu_KeepMusic:
.Strings: .Strings:
; entries correspond to GAMEMENUITEM_* constants ; entries correspond to GAMEMENUITEM_* constants
db "WORLD MAP@" db "WORLD@"
db "SHOP@" db "SHOP@"
.Jumptable: .Jumptable:
; entries correspond to GAMEMENUITEM_* constants ; entries correspond to GAMEMENUITEM_* constants
dw GameMenu_WorldMap dw GameMenu_World
dw GameMenu_Shop dw GameMenu_Shop
GameMenuItems: GameMenuItems:
db 2 db 2
db GAMEMENU_WORLD_MAP db GAMEMENU_WORLD
db GAMEMENU_SHOP db GAMEMENU_SHOP
db -1 db -1
@ -92,12 +92,12 @@ GameMenuJoypadLoop:
scf scf
ret ret
GameMenu_WorldMap: GameMenu_World:
; the following 500ms fading delay applies: ; the following 500ms fading delay applies:
; - from post-level screen to level selection menu ; - from post-level screen to level selection menu
; - from overworld to level selection menu ; - from overworld to level selection menu
; - from selecting "WORLD MAP" in game menu to level selection menu (save outside ow) ; - from selecting "WORLD" in game menu to level selection menu (save outside ow)
; - from selecting "WORLD MAP" in game menu to overworld (save in ow) ; - from selecting "WORLD" in game menu to overworld (save in ow)
ld a, 8 ld a, 8
ld [wMusicFade], a ld [wMusicFade], a
ld a, LOW(MUSIC_NONE) ld a, LOW(MUSIC_NONE)
@ -165,7 +165,7 @@ GameMenu_WorldMap:
set LSMEVENT_SHOW_UNLOCKED_LEVELS, [hl] set LSMEVENT_SHOW_UNLOCKED_LEVELS, [hl]
.save_and_return .save_and_return
farcall AutoSaveGameOutsideOverworld farcall AutoSaveGameOutsideOverworld
jp GameMenu_WorldMap jp GameMenu_World
GameMenu_Shop: GameMenu_Shop:
ret ret