The Djinn menu: its screen, the Djinn list, help, and choosing the Djinn to set, put on standby, give or trade. More...
Go to the source code of this file.
Macros | |
| #define | DJINN_CURSOR_WIDTH 6 |
| #define | DJINN_SWAP_PREVIEW_MODE 2 |
| #define | DJINN_PREVIEW_DIGITS 3 |
| #define | DJINN_PREVIEW_CURRENT_X 48 |
| #define | DJINN_PREVIEW_MAX_X 80 |
| #define | DJINN_PREVIEW_SLASH_X 72 |
| #define | DJINN_PREVIEW_LUCK_X 56 |
| #define | DJINN_PREVIEW_ARROW_X(x, iconX) |
| #define | DJINN_PREVIEW_PP_X 88 |
| #define | DJINN_RESELECT_PAIR_ENTRY(menu, i) |
| Finds the moved Djinni in the list and selects its new position. | |
| #define | DJINN_BACKDROP_FRAME_TILE 150 |
| #define | DJINN_PREVIEW_GAINED 0x8000 |
| #define | DJINN_PREVIEW_LOST 0x4000 |
| #define | DJINN_ELEMENT_TILE 0x5001 |
| The window map entry of the first element icon, in palette 5; the four elements follow it in order. | |
| #define | DJINN_ENTRY_SET (-0x8000) |
| #define | DJINN_OWNER(v) |
| #define | DJINN_ELEMENT(v) |
| #define | DJINN_NUMBER(v) |
Enumerations | |
| enum | DjinnMenuStep { DJINN_STEP_HANDLE_RESULT = 0 , DJINN_STEP_RESERVED = 1 , DJINN_STEP_SELECT_DJINN = 2 , DJINN_STEP_SELECT_ACTION = 3 , DJINN_STEP_HANDLE_PAIR_RESULT = 4 , DJINN_STEP_CONFIRM_SET = 5 , DJINN_STEP_CONFIRM_STANDBY = 6 , DJINN_STEP_CONFIRM_GIVE = 7 , DJINN_STEP_SELECT_SECOND = 8 , DJINN_STEP_CONFIRM_TRADE = 9 , DJINN_STEP_SHOW_STATUS = 10 , DJINN_STEP_APPLY_SET = 11 , DJINN_STEP_APPLY_STANDBY = 12 , DJINN_STEP_APPLY_GIVE = 13 , DJINN_STEP_APPLY_TRADE = 14 , DJINN_STEP_SHOW_HELP = 15 } |
| The screen chooses an operation, optionally previews it, then commits it. More... | |
Functions | |
| s32 | Menu_WrapIndex (s32 value, s32 modulus) |
| Wraps a cursor index that has stepped one past either end of modulus entries: -1 becomes modulus - 1 and modulus becomes 0. | |
| s32 | Menu_SetFirstObjectRowCoordinates (s32 yOffset) |
| Places the Djinn menu's first row at its normal height plus yOffset. | |
| s32 | DjinnMenu_Run (void) |
| Runs the Djinn menu, preserving field tiles and the message speed. | |
| s32 | DjinnMenu_RunScreen (void) |
| Chooses a Djinni, previews changes, then sets, stands by, gives or trades it. | |
| void | Graphics_AdjustPaletteBank (s32 brightnessDelta) |
| Writes copies of background palettes 15, 5 and 7, each brightnessDelta lighter in every channel (clamped to 0-31), into palettes 14, 4 and 6. | |
| MenuBackdropResult | Menu_OpenBackdropScreen (void) |
| Draws the backdrop behind the Djinn menu's list: its window, tiles and palettes. | |
| s32 | OwnerAction_DiffSlots (struct OwnerActionSlot *before, struct OwnerActionSlot *after, u16 *actionsOut, s32 *gainedCountOut, s32 *lostCountOut) |
| Lists the actions after a preview, marking gains, then appends the losses. | |
| s32 | DjinnMenu_BuildLists (void *table) |
| Rebuilds the Djinn lists in table: each owner's packed Djinn entries and their count. | |
| void | DjinnMenu_DrawElementList (struct DjinnListTable *table) |
| Draws each owner's Djinn column, including set and recovering entries. | |
| s32 | UiWindow_SetInteriorPaletteBitRect (const struct UiWindow *window, s32 x, s32 y, s32 width, s32 height, s32 palette) |
| Sets the palette of a rectangle of window's interior, (x, y) and its size in tiles from the interior's corner, through UiWindow_SetPaletteBitRectFar. | |
| void | UiWindow_SetRectPalette (s32 x, s32 y, s32 width, s32 height, s32 palette) |
| Moves each tile of a screen rectangle (in tiles, clipped to the screen) that shows palette 15 to palette. | |
| void | UiWindow_SetInteriorRectPalette (void *window, s32 x, s32 y, s32 width, s32 height, s32 palette) |
| UiWindow_SetRectPalette on a rectangle of window's interior, (x, y) and its size in tiles from the interior's corner. | |
| s32 | DjinnMenu_ShowHelp (void) |
| Runs the Djinn help choices and restores the list when the player leaves. | |
| s32 | DjinnMenu_SelectDjinn (s32 mode) |
| Chooses an owner and Djinni, or a set, standby, give or trade action. | |
| s32 | Djinn_ListOwnerEntries (u16 *entriesOut, s32 ownerId, s32 element) |
| Lists owned Djinn by element and index, marking those that are set. | |
| s32 | DjinnMenu_DrawPairPreview (s32 mode, s32 pageIndex) |
| Draws both sides of the give or trade preview for the selected page. | |
| static __inline__ void | Unit_Copy (struct BattleUnit *destination, struct BattleUnit *source) |
| Copies a full unit for a temporary Djinn-stat preview. | |
| s32 | DjinnMenu_DrawStatPreview (struct UiWindow *window, s32 x, s32 y, s32 ownerId, s32 removePairSlot, s32 addPairSlot, s32 previewMode, s32 page, s32 side) |
| Saves the unit, applies a hypothetical Djinn change, draws its differences and restores the original unit before returning. | |
The Djinn menu: its screen, the Djinn list, help, and choosing the Djinn to set, put on standby, give or trade.
Part of menu.c, the menu object, compiled only through it.
Definition in file djinn.c.
| #define DJINN_CURSOR_WIDTH 6 |
Definition at line 14 of file djinn.c.
Referenced by DjinnMenu_SelectDjinn().
| #define DJINN_SWAP_PREVIEW_MODE 2 |
Definition at line 20 of file djinn.c.
Referenced by DjinnMenu_DrawPairPreview().
| #define DJINN_PREVIEW_DIGITS 3 |
Definition at line 28 of file djinn.c.
Referenced by DjinnMenu_DrawStatPreview().
| #define DJINN_PREVIEW_CURRENT_X 48 |
Definition at line 29 of file djinn.c.
Referenced by DjinnMenu_DrawStatPreview().
| #define DJINN_PREVIEW_MAX_X 80 |
Definition at line 30 of file djinn.c.
Referenced by DjinnMenu_DrawStatPreview().
| #define DJINN_PREVIEW_SLASH_X 72 |
Definition at line 31 of file djinn.c.
Referenced by DjinnMenu_DrawStatPreview().
| #define DJINN_PREVIEW_LUCK_X 56 |
Definition at line 32 of file djinn.c.
Referenced by DjinnMenu_DrawStatPreview().
| #define DJINN_PREVIEW_ARROW_X | ( | x, | |
| iconX ) |
| #define DJINN_PREVIEW_PP_X 88 |
Definition at line 34 of file djinn.c.
Referenced by DjinnMenu_DrawStatPreview().
| #define DJINN_RESELECT_PAIR_ENTRY | ( | menu, | |
| i ) |
Finds the moved Djinni in the list and selects its new position.
Definition at line 140 of file djinn.c.
Referenced by DjinnMenu_RunScreen().
| #define DJINN_BACKDROP_FRAME_TILE 150 |
Definition at line 455 of file djinn.c.
Referenced by Menu_OpenBackdropScreen().
| #define DJINN_PREVIEW_GAINED 0x8000 |
Definition at line 457 of file djinn.c.
Referenced by OwnerAction_DiffSlots().
| #define DJINN_PREVIEW_LOST 0x4000 |
Definition at line 458 of file djinn.c.
Referenced by OwnerAction_DiffSlots().
| #define DJINN_ELEMENT_TILE 0x5001 |
The window map entry of the first element icon, in palette 5; the four elements follow it in order.
Definition at line 580 of file djinn.c.
Referenced by DjinnMenu_DrawElementList(), DjinnMenu_DrawStatPreview(), and DjinnMenu_SelectDjinn().
| #define DJINN_ENTRY_SET (-0x8000) |
Definition at line 822 of file djinn.c.
Referenced by Djinn_ListOwnerEntries().
| #define DJINN_OWNER | ( | v | ) |
Definition at line 824 of file djinn.c.
Referenced by DjinnMenu_SelectDjinn().
| #define DJINN_NUMBER | ( | v | ) |
| enum DjinnMenuStep |
The screen chooses an operation, optionally previews it, then commits it.
Wraps a cursor index that has stepped one past either end of modulus entries: -1 becomes modulus - 1 and modulus becomes 0.
Definition at line 47 of file djinn.c.
Referenced by DjinnMenu_SelectDjinn(), DjinnMenu_ShowHelp(), DjinnMenu_ShowOwnerStatus(), Menu_WrapIndex(), and OwnerAction_RunCompareLoop().
Places the Djinn menu's first row at its normal height plus yOffset.
Definition at line 52 of file djinn.c.
Referenced by DjinnMenu_Run(), DjinnMenu_RunScreen(), and Menu_SetFirstObjectRowCoordinates().
| s32 DjinnMenu_Run | ( | void | ) |
Runs the Djinn menu, preserving field tiles and the message speed.
Definition at line 68 of file djinn.c.
Referenced by DjinnMenu_Run().
| s32 DjinnMenu_RunScreen | ( | void | ) |
Chooses a Djinni, previews changes, then sets, stands by, gives or trades it.
Confirmation states fall through to their matching commit states on success.
Definition at line 181 of file djinn.c.
Referenced by DjinnMenu_Run(), and DjinnMenu_RunScreen().
| void Graphics_AdjustPaletteBank | ( | s32 | brightnessDelta | ) |
Writes copies of background palettes 15, 5 and 7, each brightnessDelta lighter in every channel (clamped to 0-31), into palettes 14, 4 and 6.
Palette 7's copy is 12 darker instead.
Definition at line 401 of file djinn.c.
Referenced by Graphics_AdjustPaletteBank(), and Menu_OpenBackdropScreen().
| MenuBackdropResult Menu_OpenBackdropScreen | ( | void | ) |
Draws the backdrop behind the Djinn menu's list: its window, tiles and palettes.
Definition at line 462 of file djinn.c.
Referenced by DjinnMenu_RunScreen(), and Menu_OpenBackdropScreen().
| s32 OwnerAction_DiffSlots | ( | struct OwnerActionSlot * | before, |
| struct OwnerActionSlot * | after, | ||
| u16 * | actionsOut, | ||
| s32 * | gainedCountOut, | ||
| s32 * | lostCountOut ) |
Lists the actions after a preview, marking gains, then appends the losses.
The two output counts distinguish gained and lost actions.
Definition at line 495 of file djinn.c.
Referenced by DjinnMenu_DrawStatPreview(), DjinnMenu_ShowOwnerStatus(), OwnerAction_DiffSlots(), and OwnerAction_RunCompareLoop().
| s32 DjinnMenu_BuildLists | ( | void * | table | ) |
Rebuilds the Djinn lists in table: each owner's packed Djinn entries and their count.
Definition at line 548 of file djinn.c.
Referenced by DjinnMenu_BuildLists(), and DjinnMenu_RunScreen().
| void DjinnMenu_DrawElementList | ( | struct DjinnListTable * | table | ) |
Draws each owner's Djinn column, including set and recovering entries.
Definition at line 583 of file djinn.c.
Referenced by DjinnMenu_DrawElementList(), DjinnMenu_RunScreen(), DjinnMenu_SelectDjinn(), and Menu_OpenBackdropScreen().
| s32 UiWindow_SetInteriorPaletteBitRect | ( | const struct UiWindow * | window, |
| s32 | x, | ||
| s32 | y, | ||
| s32 | width, | ||
| s32 | height, | ||
| s32 | palette ) |
Sets the palette of a rectangle of window's interior, (x, y) and its size in tiles from the interior's corner, through UiWindow_SetPaletteBitRectFar.
Definition at line 648 of file djinn.c.
Referenced by DjinnMenu_SelectDjinn(), DjinnMenu_ShowHelp(), and UiWindow_SetInteriorPaletteBitRect().
Moves each tile of a screen rectangle (in tiles, clipped to the screen) that shows palette 15 to palette.
Definition at line 660 of file djinn.c.
Referenced by DjinnMenu_ShowHelp(), UiWindow_SetInteriorRectPalette(), and UiWindow_SetRectPalette().
| void UiWindow_SetInteriorRectPalette | ( | void * | window, |
| s32 | x, | ||
| s32 | y, | ||
| s32 | width, | ||
| s32 | height, | ||
| s32 | palette ) |
UiWindow_SetRectPalette on a rectangle of window's interior, (x, y) and its size in tiles from the interior's corner.
Definition at line 702 of file djinn.c.
Referenced by DjinnMenu_SelectDjinn(), DjinnMenu_ShowHelp(), and UiWindow_SetInteriorRectPalette().
| s32 DjinnMenu_ShowHelp | ( | void | ) |
Runs the Djinn help choices and restores the list when the player leaves.
Definition at line 710 of file djinn.c.
Referenced by DjinnMenu_RunScreen(), and DjinnMenu_ShowHelp().
Chooses an owner and Djinni, or a set, standby, give or trade action.
The tutorial can replace the sampled input without changing the input order.
Definition at line 830 of file djinn.c.
Referenced by DjinnMenu_RunScreen(), and DjinnMenu_SelectDjinn().
Lists owned Djinn by element and index, marking those that are set.
For element -1, entries also encode their owner.
Definition at line 1506 of file djinn.c.
Referenced by Djinn_ListOwnerEntries(), DjinnMenu_BuildLists(), and DjinnMenu_DrawElementList().
Draws both sides of the give or trade preview for the selected page.
Definition at line 1538 of file djinn.c.
Referenced by DjinnMenu_DrawPairPreview(), and OwnerAction_RunCompareLoop().
|
static |
Copies a full unit for a temporary Djinn-stat preview.
Definition at line 1557 of file djinn.c.
Referenced by DjinnMenu_DrawStatPreview(), and Unit_Copy().
| s32 DjinnMenu_DrawStatPreview | ( | struct UiWindow * | window, |
| s32 | x, | ||
| s32 | y, | ||
| s32 | ownerId, | ||
| s32 | removePairSlot, | ||
| s32 | addPairSlot, | ||
| s32 | previewMode, | ||
| s32 | page, | ||
| s32 | side ) |
Saves the unit, applies a hypothetical Djinn change, draws its differences and restores the original unit before returning.
Definition at line 1564 of file djinn.c.
Referenced by DjinnMenu_DrawPairPreview(), DjinnMenu_DrawStatPreview(), DjinnMenu_ShowOwnerStatus(), and OwnerAction_RunCompareLoop().