Alchemy
Loading...
Searching...
No Matches

djinn_preview.c File Reference

The preview of what setting or removing a Djinni changes. More...

Go to the source code of this file.

Macros

#define NUMBER_TEXT_WIDE_LENGTH   14
 The decimal formatter writes eleven characters plus a terminator.
#define DJINN_PREVIEW_ABILITY_GAINED   0x8000
#define DJINN_PREVIEW_ABILITY_LOST   0x4000
#define DJINN_PREVIEW_ABILITY_CAPACITY   48

Functions

s32 UiText_FormatNumberToHalfwords (s16 *out, s32 value)
s32 DjinnMenu_ListChangedDjinn (const struct OwnerActionSlot *oldGrid, const struct OwnerActionSlot *newGrid, u16 *out, s32 *gained, s32 *lost)
 List Psynergy in the new grid, marking newly gained entries with bit 15, then append lost entries with bit 14.
s32 Ui_CreateOutputFromResourceSlot (struct UiWindow *window, s32 x, s32 y, s32 abilityId)
struct UiWindow * DjinnMenu_ShowChangePreview (struct UiWindow *win, s32 owner, s32 encodedDjinn, s32 page, s32 *pageCount)
 Temporarily toggle a Djinni and recalculate its owner's stats to show the change.

Detailed Description

The preview of what setting or removing a Djinni changes.

Part of battle_command.c, the menu object, compiled only through it.

Definition in file djinn_preview.c.

Macro Definition Documentation

◆ NUMBER_TEXT_WIDE_LENGTH

#define NUMBER_TEXT_WIDE_LENGTH   14

The decimal formatter writes eleven characters plus a terminator.

Keep the original two trailing bytes in the widened copy as well.

Definition at line 9 of file djinn_preview.c.

Referenced by UiText_FormatNumberToHalfwords().

◆ DJINN_PREVIEW_ABILITY_GAINED

#define DJINN_PREVIEW_ABILITY_GAINED   0x8000

Definition at line 32 of file djinn_preview.c.

Referenced by DjinnMenu_ListChangedDjinn(), and DjinnMenu_ShowChangePreview().

◆ DJINN_PREVIEW_ABILITY_LOST

#define DJINN_PREVIEW_ABILITY_LOST   0x4000

Definition at line 33 of file djinn_preview.c.

Referenced by DjinnMenu_ListChangedDjinn(), and DjinnMenu_ShowChangePreview().

◆ DJINN_PREVIEW_ABILITY_CAPACITY

#define DJINN_PREVIEW_ABILITY_CAPACITY   48

Definition at line 34 of file djinn_preview.c.

Referenced by DjinnMenu_ShowChangePreview().

Function Documentation

◆ UiText_FormatNumberToHalfwords()

s32 UiText_FormatNumberToHalfwords ( s16 * out,
s32 value )

◆ DjinnMenu_ListChangedDjinn()

s32 DjinnMenu_ListChangedDjinn ( const struct OwnerActionSlot * oldGrid,
const struct OwnerActionSlot * newGrid,
u16 * out,
s32 * gained,
s32 * lost )

List Psynergy in the new grid, marking newly gained entries with bit 15, then append lost entries with bit 14.

Return the number of entries and report the gained/lost counts separately.

Definition at line 39 of file djinn_preview.c.

Referenced by DjinnMenu_ListChangedDjinn(), DjinnMenu_ShowChangePreview(), and NameEntry_CountLetters().

◆ Ui_CreateOutputFromResourceSlot()

s32 Ui_CreateOutputFromResourceSlot ( struct UiWindow * window,
s32 x,
s32 y,
s32 abilityId )

◆ DjinnMenu_ShowChangePreview()

struct UiWindow * DjinnMenu_ShowChangePreview ( struct UiWindow * win,
s32 owner,
s32 encodedDjinn,
s32 page,
s32 * pageCount )

Temporarily toggle a Djinni and recalculate its owner's stats to show the change.

Page 0 compares stats; later pages show gained and lost Psynergy. Restore the complete unit snapshot before returning the preview window.

Definition at line 109 of file djinn_preview.c.

Referenced by Battle_SelectAbility(), DjinnMenu_ShowChangePreview(), and NameEntry_CountLetters().