include/menu/menu.h
What the menus share with the window module, the shops and the debug rooms: the item list's sort orders, the strings and tables the menus draw from, and the functions each side calls of the other.
Included by battle_internal.h, battle_effect_internal.h, level.c, shop_test.c, field_engine_internal.h, field_internal.h, field_psynergy_internal.h, lucky_dice.c, script_commands_internal.h, super_lucky_dice.c, credits.c, menu_internal.h, menu_tables.c, clear.c, epilogue.c, emote_pop_tilted.c, title.c, world_map.c, shop_internal.h and window_internal.h.
Macros
| Name | Description | |
|---|---|---|
#define | LIST_ORDER_TYPE_MASK 0x7f | The item menu's sort orders (MenuListOrderItemsFirst and the three after it): one byte per group, an item type, with LIST_ORDER_EQUIPPED for only the equipped items of that type, ending with LIST_ORDER_END. |
#define | LIST_ORDER_EQUIPPED 0x80 | |
#define | LIST_ORDER_END 255 | |
#define | LIST_PAGE_SIZE 5 | The rows a page of the item and Psynergy lists shows. |
#define | MENU_MEMBER_Y 26 | The y of the menus' row of party figures, and of the chosen member's, lowered below the rest. |
#define | MENU_MEMBER_CHOSEN_Y 30 |
Enumerations
| Name | Description | |
|---|---|---|
enum | LIST_SORT { LIST_SORT_EQUIPPED_THEN_ITEMS, LIST_SORT_EQUIPPED_THEN_EQUIP … } | The item menu's four sort orders (mnItemMenuSort), which L + A cycles through in this order. |
enum | CREDITS_MODE { CREDITS_MODE_STORY_CRAWL, CREDITS_MODE_FIRST_PAGE } | mnCreditsRun's modes: the title's story crawl over the slideshow, or the staff credits from a page, CREDITS_MODE_FIRST_PAGE being their first. |
Functions
| Name | Description | |
|---|---|---|
void | mnHideEntryIcons (void) | Moves the 32 entry icons off screen before a screen lays them out again. |
void | mnDjinnMenuDrawPage (struct DJINN_MENU_BACKDROP *backdrop, Sint32 page) | Routines the menus and the window module call of each other and of the field and game modules. |
void | fdScriptFinishScreenTransitionStub (void) | |
void | mnItemMenuArrangeCategoryItemIcons (Uint16 *items) | Places the icon of each worn weapon, armor, shield and helm at x 216, on its slot's row of mnItemMenuDrawEquipment's window; the others stay off screen. |
void | mnItemMenuDrawEquippedItemNames (Sint32 window, Uint16 *items) | Writes the name of each equipped item of the inventory into window, below its slot's label: the weapon, the helm, the shield, then the armor. |
void | gmPartyAdjustCoinsStub (Sint32 amount) | |
Sint32 | gmPartyListMembersStub (Sint16 *unitIds) | |
Sint32 | gmPartySumDjinnCountsStub (Sint32 element) | |
void * | mnStringFormatPlayTime (Sint32 ticks, Uint8 *out) | Writes the play time ticks into out as hours and minutes, "hhh:mm" with the hours right-aligned in three characters, and returns out. |
Sint32 | mnItemMenuRun (void) | The menu module's functions in the order of its stub table. |
Sint32 | mnPsynergyMenuRun (void) | The field menu's Psynergy screen (mnFieldMenuRun, FIELD_MENU_PSYNERGY), over the field, which stops meanwhile. |
Sint32 | mnStatusScreenRun (void) | The Status screen, the field menu's Status, over the field: saves the background palettes and the window tiles it draws over, sets up the party row, the five command icons and, when the party has Djinn, the Djinn figures, runs the status pages, then puts everything back. |
Sint32 | mnPartyMemberChooserOpen (void) | Lets the player choose one party member, over the field. |
Sint32 | mnIconCreateHandCursor (struct WINDOW *window, Sint32 x, Sint32 y) | Creates a hand cursor sprite in window at (x, y), loading the hand's tiles into a free VRAM block. |
void | mnIconShow (struct WINDOW_SPR *icon) | Shows an icon at its place, unscaled. |
Sint32 | mnDjinnMenuRun (void) | Runs the Djinn menu over the field: the field menu's Djinn screen (mnFieldMenuRun, FIELD_MENU_DJINN), and the Djinn tutorial. |
void | mnItemMenuDrawItemDetails (Sint32 window, Sint32 item) | Describes item in window with the entry's own count, through mnItemMenuDrawItemDetailsWithCount. |
void | mnItemMenuDrawItemDetailsWithCount (Sint32 window, Sint32 item, Sint32 count) | Describes an item (an inventory entry) in window, one 8-pixel row a line: its equip bonuses and effects, a curse, the Psynergy it bestows, its uses and its count, or failing all of these whether it is rare or important. |
void | mnPaletteLoadIconsIntoHighlight (void) | Lends HIGHLIGHT_PALETTE to the element icons: copies the first sprite palette, the icons' colours, into it, then WINDOW_BACKGROUND_COLOR over its TEXT_BACKGROUND_COLOR. |
void | mnUpdatePartyFigures (void) | An event while the party figures show: places each party member's figure at its menu position and scale through the projected placement. |
void | mnCreatePartyFigures (Sint32 first) | Replaces the menu's party figures with up to four party members' figures, from party place first on, standing (ANIM_STAND), and counts the party. |
void | mnShowPartyFigures (struct WINDOW *window, Sint32 originX, Sint32 originY) | Creates the first four party members' figures in a row from tile (originX, originY) inside window, three tiles apart, and starts placing them each tick (mnUpdatePartyFigures). |
void | mnReleasePartyFigures (void) | Destroys the menu's party figures and stops placing them. |
void | mnDjinnFiguresInitTopRow (void) | Replaces the four Djinn figures with one Djinni of each element (DjinnFiguresSpriteIds) walking (ANIM_WALK), at FIGURE_START_X and MENU_FIGURE_HIDDEN_Y until the screen moves them, and starts placing them each tick (mnDjinnFiguresUpdateTopRow). |
void | mnDjinnFiguresReleaseTopRow (void) | Destroys the four Djinn figures and stops placing them. |
void | mnDjinnFiguresSetShown (Sint32 shown) | Shows the Djinn figures of the top row (nonzero) or hides them (0). |
void | mnDjinnFiguresReplaceSlot (Sint32 index, Sint32 kind, Sint32 animation) | Replaces Djinn figure index with a Djinni of element kind (DjinnFiguresSpriteIds) playing animation. |
void | mnDjinnFiguresSetSlotPos (Sint32 index, Sint32 x, Sint32 y) | Moves Djinn figure index to screen pixel (x, y), if it exists. |
void | mnDjinnFiguresSetSlotFacing (Sint32 index, Sint32 facing) | Turns Djinn figure index to face facing (FACING), if it exists. |
void | mnDjinnFiguresSetSlotPhase (Sint32 index, Sint32 scale) | Sets Djinn figure index's scale, if it exists: a positive scale grows towards full size, a negative one holds at its size. |
Sint32 | mnTitleShowTitleScreen (Sint32 prompt) | The title module's functions in the order of its stub table. |
void | mnTitleAfterIntroNoOperation (void) | Unused: an empty entry the stub table keeps. |
void | mnTitleBeforeLogosNoOperation (void) | Unused: an empty entry the stub table keeps. |
Sint32 | mnTitleShowPublisherLogo (Sint32 mode) | Shows the publisher's logo with its chime. |
Sint32 | mnTitleShowCamelotLogo (void) | Shows the Camelot logo for two seconds, cycling the four pictures of its flag. |
Sint32 | mnTitleIntroRun (Sint32 unused) | The intro (menu/title_intro.c): it takes a flag, 1 from the title and 0 before the prologue, that it never reads. |
Sint32 | mnCreditsRun (Sint32 mode) | The credits module's functions in the order of its stub table. |
void | mnEndingImageStart (void) | Starts the ending's images (the epilogue scene calls it first): resets the event table and the scroll, adds mnEndingImageScroll, sets up BG2, BG3 and blending, and builds the border strips. |
void | mnEndingImageShow (Sint32 resource, Uint8 *map, Sint32 pos) | Shows a scrolling image on the hidden one of the two BG character blocks. |
void | mnEndingImageSetTargetRow (Uint16 row) | Sets the row the ending's scrolling image moves to, in pixels from its top, at most EndingImageSpeed a tick. |
void | mnEndingImageWaitForScroll (void) | Waits, for at most 300 ticks, until the scroll reaches its row. |
void | mnEndingImageLowerTopStrip (Sint32 enable) | Moves the top strip's eight sprites to y 120 when enable is set, and to y 0 otherwise. |
Sint32 | mnBattleClassifyEntryKind (const struct ABILITY_DEFINITION *entry) | Classifies ability act's effect for target selection: the hint mnBattleTargetRunSelection shows on a party member and starts on (enum BATTLE_TARGET_HINT). |
Variables
| Name | Description | |
|---|---|---|
extern Uint8 | StatusScreenCursorWidths [] | The width in tiles of each status row's highlight on the status page (enum UNIT_STAT). |
extern Uint8 | MenuListOrderItemsFirst [] | The item menu's sort orders (LIST_SORT, mnCopyListOrder): one item type per byte, with LIST_ORDER_EQUIPPED for only the equipped items of that type, ending with LIST_ORDER_END. |
extern Uint8 | MenuListOrderEquippedThenItems [] | LIST_SORT_EQUIPPED_THEN_ITEMS: the equipped items, the items that are not equipment, then the other equipment. |
extern Uint8 | MenuListOrderEquippedThenEquipment [] | LIST_SORT_EQUIPPED_THEN_EQUIPMENT: the equipped items, the other equipment, then the rest. |
extern Uint8 | MenuListOrderEquipmentFirst [] | LIST_SORT_EQUIPMENT_FIRST: the equipment first, the rest last. |
extern Uint8 | MenuMinusSignString | -, before a stat change that is not a gain (mnItemMenuDrawStat). |
extern Uint8 | MenuPlusSignString | +, before a stat gain. |
extern Sint8 | MenuTopEntryCommandByPosition [] | The field menu's four icons: the command at each place, and the place of each command. |
extern Sint8 | MenuTopEntryPositionByCommand [] | The icon position + 1 of each field menu command (FIELD_MENU_COMMAND), in the same two rows; without Djinn, Djinn starts on the first icon. |
extern const Uint8 | StatusMenuLevelLetterString [] | L, before a level in the file list (screens_save.c). |
extern Uint8 | MenuClassChangeArrowTile [] | The down arrow from the class now to the class an equipment would give (backdrop.4bpp), which mnWatchStart blinks every four ticks at CLASS_CHANGE_ARROW_TILE. |
extern const Uint8 | MenuColonString [] | : and the sixteen hex digits, for the debug rooms' flag and destination lists. |
extern const Uint8 | MenuHexDigitsString [] | The flag browser's column heading, one hex digit a column. |
extern Uint8 | MenuSelectionStepDelays [] | The ticks a selection made for the player to watch waits at each step, by the icons still to go (mnIconMenuAnimateTo). |
Description
What the menus share with the window module, the shops and the debug rooms: the item list's sort orders, the strings and tables the menus draw from, and the functions each side calls of the other.
Macros in detail
LIST_ORDER_TYPE_MASK
#define LIST_ORDER_TYPE_MASK 0x7f
The item menu's sort orders (MenuListOrderItemsFirst and the three after it):
one byte per group, an item type, with LIST_ORDER_EQUIPPED for only the
equipped items of that type, ending with LIST_ORDER_END.
Referenced by mnItemMenuSort().
Definition at line 14 of file menu.h.
LIST_ORDER_EQUIPPED
#define LIST_ORDER_EQUIPPED 0x80
Referenced by MenuListOrderEquippedThenEquipment, MenuListOrderEquippedThenItems and mnItemMenuSort().
Definition at line 15 of file menu.h.
LIST_ORDER_END
#define LIST_ORDER_END 255
Referenced by MenuListOrderEquipmentFirst, MenuListOrderEquippedThenEquipment, MenuListOrderEquippedThenItems, MenuListOrderItemsFirst, mnCopyListOrder() and mnItemMenuSort().
Definition at line 16 of file menu.h.
LIST_PAGE_SIZE
#define LIST_PAGE_SIZE 5
The rows a page of the item and Psynergy lists shows.
Referenced by mnItemMenuBuildPagedList(), mnItemMenuDrawListPage(), mnItemMenuRunList(), mnItemMenuShowSelectedRow(), mnPsynergyMenuBuildPagedList(), mnPsynergyMenuDrawPage(), mnPsynergyMenuRunList() and mnPsynergyMenuShowSelectedRow().
Definition at line 38 of file menu.h.
MENU_MEMBER_Y
#define MENU_MEMBER_Y 26
The y of the menus' row of party figures, and of the chosen member's, lowered below the rest.
Referenced by mnItemMenuInit(), mnMarkChosenMember(), mnPartyMemberChooserOpen() and mnStatusScreenShowDjinnList().
Definition at line 42 of file menu.h.
MENU_MEMBER_CHOSEN_Y
#define MENU_MEMBER_CHOSEN_Y 30
Referenced by mnMarkChosenMember().
Definition at line 43 of file menu.h.
Enumerations in detail
LIST_SORT
enum LIST_SORT
The item menu's four sort orders (mnItemMenuSort), which L + A cycles through
in this order.
| Enumerator | Value | Description |
|---|---|---|
LIST_SORT_EQUIPPED_THEN_ITEMS | 0 | The equipped items, the items that |
LIST_SORT_EQUIPPED_THEN_EQUIPMENT | 1 | are not equipment, then the other equipment (MenuListOrderEquippedThenItems). The equipped items, the other equipment, then the rest (MenuListOrderEquippedThenEquipment). |
LIST_SORT_EQUIPMENT_FIRST | 2 | The equipment first (MenuListOrderEquipmentFirst). |
LIST_SORT_ITEMS_FIRST | 3 | The items that are not equipment |
LIST_SORT_COUNT | 4 | first (MenuListOrderItemsFirst). |
Definition at line 20 of file menu.h.
CREDITS_MODE
enum CREDITS_MODE
mnCreditsRun's modes: the title's story crawl over the slideshow, or the
staff credits from a page, CREDITS_MODE_FIRST_PAGE being their first.
| Enumerator | Value | Description |
|---|---|---|
CREDITS_MODE_STORY_CRAWL | 1 | |
CREDITS_MODE_FIRST_PAGE | 2 |
Definition at line 95 of file menu.h.
Functions in detail
fdScriptFinishScreenTransitionStub
void fdScriptFinishScreenTransitionStub(void)
Referenced by mnInnPlaySleep().
Definition at line 77 of file menu.h.
gmPartyAdjustCoinsStub
void gmPartyAdjustCoinsStub(Sint32 amount)
Referenced by btAwardSpoils(), fdLuckyDiceRun(), fdSuperLuckyDiceRun(), fdTalkToActor(), mnInnPlaySleep(), mnSanctumRunPartyService(), mnShopBuyDone(), mnShopRepairItem() and mnShopSellItem().
Definition at line 80 of file menu.h.
gmPartyListMembersStub
Sint32 gmPartyListMembersStub(Sint16 *unitIds)
Referenced by mnCreatePartyFigures(), mnDjinnMenuRun(), mnDjinnMenuRunPreview(), mnForgePartyHasMaterial(), mnInnPlaySleep(), mnItemMenuRun(), mnPartyMemberChooserOpen(), mnPsynergyMenuRun(), mnSaveBuildFileSummary(), mnShopInitState(), mnStatusScreenMovePartyMember() and mnStatusScreenRun().
Definition at line 81 of file menu.h.
gmPartySumDjinnCountsStub
Sint32 gmPartySumDjinnCountsStub(Sint32 element)
Referenced by mnBattleStatusScreenRun(), mnDjinnMenuDrawPage(), mnFieldMenuSelectCommand(), mnSaveBuildFileSummary(), mnStatusScreenDrawStatusPage(), mnStatusScreenRun() and mnStatusScreenRunStatusPage().
Definition at line 82 of file menu.h.
Variables in detail
StatusScreenCursorWidths
extern Uint8 StatusScreenCursorWidths[]
The width in tiles of each status row's highlight on the status page (enum
UNIT_STAT).
Referenced by mnStatusScreenDrawSelectionCursor().
Definition at line 47 of file menu.h.
StatusMenuLevelLetterString
extern const Uint8 StatusMenuLevelLetterString[]
L, before a level in the file list (screens_save.c).
Referenced by mnFileListDrawSummary().
Definition at line 61 of file menu.h.
MenuClassChangeArrowTile
extern Uint8 MenuClassChangeArrowTile[]
The down arrow from the class now to the class an equipment would give
(backdrop.4bpp), which mnWatchStart blinks every four ticks at
CLASS_CHANGE_ARROW_TILE.
Referenced by mnWatchStart().
Definition at line 73 of file menu.h.