src/window/window_shortcuts.c
The area name shown on entering an area, the debug Psynergy shortcut picker and the unused selection state. More…
Included by window.c.
Structures
| Name | Description | |
|---|---|---|
struct | ABILITY_LIST_ENTRY | A Psynergy the debug shortcut picker lists: its party member and the Psynergy. |
struct | SELECTION_STATE | The state block of HEAP_SLOT_SELECTION_STATE (SelectionStateWork): two VRAM cache entries with their flags and a window, among fields nothing here uses. |
Macros
| Name | Description | |
|---|---|---|
#define | SHORTCUT_LIST_ENTRIES 448 | The entries of the debug shortcut picker's list, which mnFindShortcutEntries searches whole. |
#define | SHORTCUT_MEMBER_SHIFT 10 | A shortcut (MainRoutineStateWork.firstShortcut and secondShortcut) is member << SHORTCUT_MEMBER_SHIFT | action, as mnDebugSelectShortcuts stores it. |
#define | SHORTCUT_ABILITY_MASK 0x3ff |
Functions
| Name | Description | |
|---|---|---|
void | mnAreaNameWindowShow (void) | Shows the area's name in a window centred in the screen's top ten rows, for AREA_NAME_WINDOW_TICKS; a per-tick event closes it. |
void | mnAreaNameWindowUpdate (void) | Counts the area name down, and closes it at 0. |
void | mnAreaNameWindowHide (void) | Closes the area name at once, if it is shown. |
Sint32 | mnItemRemoveFromInventory (Sint32 unused, Sint32 itemId) | Removes itemId from the party's inventory and returns 0. |
Sint32 | mnItemReturnTrue (void) | Returns 1; the overlays reach it through the stub table. |
void | mnSettingsMenuStepWindowHue (Sint32 keys) | Steps the window hue one step: back when keys contains LEFT, on otherwise. |
void | mnDebugSelectShortcuts (void) | Lets the player pick two Psynergy shortcuts from all the party's Psynergy, showing each one's cost and description, and stores them in MainRoutineStateWork.firstShortcut and secondShortcut (member << SHORTCUT_MEMBER_SHIFT | Psynergy). |
Sint32 | mnPartyListPsynergy (ABILITY_LIST_ENTRY *output) | Lists every Psynergy of the active party members as (party member, Psynergy) pairs in output and returns how many. output must hold every party member's nonzero action slots; there is no capacity argument. |
void | mnFindShortcutEntries (Uint32 *firstIndex, Uint32 *secondIndex, const ABILITY_LIST_ENTRY *entries) | Finds the two Psynergy shortcuts in a list from mnPartyListPsynergy, and returns their indexes (0 for one not found). |
void | mnRunSelectionHook (void) | Runs the debug Psynergy shortcut picker (mnDebugSelectShortcuts). |
void | mnAllocateSelectionState (void) | Unused: allocates the state block of HEAP_SLOT_SELECTION_STATE and clears its two flags. |
void | mnReleaseSelectionState (void) | Unused: closes the window of HEAP_SLOT_SELECTION_STATE's state block, frees the VRAM cache entries its flags mark and frees the block. |
Description
The area name shown on entering an area, the debug Psynergy shortcut picker
and the unused selection state. Part of window.c.
Macros in detail
SHORTCUT_LIST_ENTRIES
#define SHORTCUT_LIST_ENTRIES 448
The entries of the debug shortcut picker's list, which mnFindShortcutEntries
searches whole.
Referenced by mnDebugSelectShortcuts() and mnFindShortcutEntries().
Definition at line 6 of file window_shortcuts.c.
SHORTCUT_MEMBER_SHIFT
#define SHORTCUT_MEMBER_SHIFT 10
A shortcut (MainRoutineStateWork.firstShortcut and secondShortcut) is member
<< SHORTCUT_MEMBER_SHIFT | action, as mnDebugSelectShortcuts stores it.
Referenced by mnDebugSelectShortcuts() and mnFindShortcutEntries().
Definition at line 9 of file window_shortcuts.c.
SHORTCUT_ABILITY_MASK
#define SHORTCUT_ABILITY_MASK 0x3ff
Referenced by mnFindShortcutEntries().
Definition at line 10 of file window_shortcuts.c.
Functions in detail
mnAreaNameWindowShow
void mnAreaNameWindowShow(void)
Shows the area's name in a window centred in the screen's top ten rows, for
AREA_NAME_WINDOW_TICKS; a per-tick event closes it.
References fdAreaGetNameIndexStub(), MainRoutineStateWork, mnAreaNameWindowUpdate(), mnTextDrawMessage(), mnTextGetMessageSize(), mnWindowCreate(), Sint32, state, sySetEvent() and width.
Definition at line 14 of file window_shortcuts.c.
mnAreaNameWindowUpdate
void mnAreaNameWindowUpdate(void)
Counts the area name down, and closes it at 0.
References mnWindowClose(), state and syCloseEvent().
Referenced by mnAreaNameWindowHide() and mnAreaNameWindowShow().
Definition at line 41 of file window_shortcuts.c.
mnAreaNameWindowHide
void mnAreaNameWindowHide(void)
Closes the area name at once, if it is shown.
References mnAreaNameWindowUpdate(), mnWindowClose() and syCloseEvent().
Definition at line 58 of file window_shortcuts.c.
mnItemRemoveFromInventory
Sint32 mnItemRemoveFromInventory(Sint32 unused, Sint32 itemId)
Removes itemId from the party's inventory and returns 0.
References gmPartyInventoryRemoveStub() and Sint32.
Definition at line 71 of file window_shortcuts.c.
mnItemReturnTrue
Sint32 mnItemReturnTrue(void)
Returns 1; the overlays reach it through the stub table.
References Sint32.
Definition at line 78 of file window_shortcuts.c.
mnSettingsMenuStepWindowHue
void mnSettingsMenuStepWindowHue(Sint32 keys)
Steps the window hue one step: back when keys contains LEFT, on otherwise.
References MainRoutineStateWork and Sint32.
Definition at line 84 of file window_shortcuts.c.
mnDebugSelectShortcuts
void mnDebugSelectShortcuts(void)
Lets the player pick two Psynergy shortcuts from all the party's Psynergy,
showing each one's cost and description, and stores them in
MainRoutineStateWork.firstShortcut and secondShortcut (member <<
SHORTCUT_MEMBER_SHIFT | Psynergy).
References gmAbilityGetDefinitionStub(), gmUnitLearnPsynergyStub(), MainRoutineStateWork, mnFindShortcutEntries(), mnPartyListPsynergy(), mnTextDrawMessageAsTiles(), mnTextDrawNumberAtOffset(), mnWindowClose(), mnWindowCreate(), mnWindowDrawDividerLine(), mnWindowSpriteCreate(), mnWindowSpriteRedrawSavedRect(), PerPush, PerRepeat, PointingHandTiles, Sint32, syHeapAllocate(), syHeapRelease(), sySoundPlayStub(), sySynch(), syVRAMCacheFindFreeEntry() and syVRAMCacheLoad().
Referenced by mnRunSelectionHook().
Definition at line 106 of file window_shortcuts.c.
mnPartyListPsynergy
Sint32 mnPartyListPsynergy(ABILITY_LIST_ENTRY *output)
Lists every Psynergy of the active party members as (party member, Psynergy) pairs in output and returns how many. output must hold every party member's nonzero action slots; there is no capacity argument.
References gmAbilityGetDefinitionStub(), gmPartyListMembersStub(), gmUnitGetStub() and Sint32.
Referenced by mnDebugSelectShortcuts().
Definition at line 269 of file window_shortcuts.c.
mnFindShortcutEntries
void mnFindShortcutEntries(Uint32 *firstIndex, Uint32 *secondIndex, const ABILITY_LIST_ENTRY *entries)
Finds the two Psynergy shortcuts in a list from mnPartyListPsynergy, and
returns their indexes (0 for one not found).
References firstIndex, MainRoutineStateWork, secondIndex and Sint32.
Referenced by mnDebugSelectShortcuts().
Definition at line 304 of file window_shortcuts.c.
mnRunSelectionHook
void mnRunSelectionHook(void)
Runs the debug Psynergy shortcut picker (mnDebugSelectShortcuts).
References mnDebugSelectShortcuts().
Definition at line 341 of file window_shortcuts.c.
mnAllocateSelectionState
void mnAllocateSelectionState(void)
Unused: allocates the state block of HEAP_SLOT_SELECTION_STATE and clears its
two flags.
References state and syHeapSlotAllocateEWRAM().
Definition at line 368 of file window_shortcuts.c.
mnReleaseSelectionState
void mnReleaseSelectionState(void)
Unused: closes the window of HEAP_SLOT_SELECTION_STATE's state block, frees
the VRAM cache entries its flags mark and frees the block.
References mnWindowClose(), mnWindowIsClosed(), state, syHeapSlotRelease(), sySynch() and syVRAMCacheFreeEntry().
Definition at line 380 of file window_shortcuts.c.