Alchemy
Loading...
Searching...
No Matches

item_picker.c File Reference

The item picker: which member's item to drop when every bag is full. More...

Go to the source code of this file.

Macros

#define SHOP_USE_PRICE_LABEL_X   8
#define SHOP_USE_PRICE_NUMBER_X   40
#define SHOP_USE_COIN_LABEL_X   80
#define SHOP_USE_COIN_MESSAGE_OFFSET   5

Functions

s32 Shop_PickUnitItem (s32 *selectedUnit, s32 *selectedSlot)
 Lets the player choose a party member, then one of its items that may be dropped.
s32 Shop_SelectUse (s32 unitId)
 Lets the player choose one of the member's items to drop, refusing an indispensable or cursed equipped one with a message.
void Shop_DrawUseItem (struct UiWindow *window, s32 unitId, s32 slot)
 Draws the slot's item name and, below it, why it cannot be dropped or what the whole stack would sell for.

Detailed Description

The item picker: which member's item to drop when every bag is full.

Part of shop.c, the shop object, compiled only through it.

Definition in file item_picker.c.

Macro Definition Documentation

◆ SHOP_USE_PRICE_LABEL_X

#define SHOP_USE_PRICE_LABEL_X   8

Definition at line 101 of file item_picker.c.

Referenced by Shop_DrawUseItem().

◆ SHOP_USE_PRICE_NUMBER_X

#define SHOP_USE_PRICE_NUMBER_X   40

Definition at line 102 of file item_picker.c.

Referenced by Shop_DrawUseItem().

◆ SHOP_USE_COIN_LABEL_X

#define SHOP_USE_COIN_LABEL_X   80

Definition at line 103 of file item_picker.c.

Referenced by Shop_DrawUseItem().

◆ SHOP_USE_COIN_MESSAGE_OFFSET

#define SHOP_USE_COIN_MESSAGE_OFFSET   5

Definition at line 104 of file item_picker.c.

Referenced by Shop_DrawUseItem().

Function Documentation

◆ Shop_PickUnitItem()

s32 Shop_PickUnitItem ( s32 * selectedUnit,
s32 * selectedSlot )

Lets the player choose a party member, then one of its items that may be dropped.

Writes the member and inventory slot to selectedUnit and selectedSlot and returns 0, or writes -1 to both and returns -1 when cancelled. Holds the shop's work block while it runs. Reached through SHOP.S when an item is found with every bag full ("What will you drop?", PartyInventory_GiveItem), by the Elemental Star room's Mythril Bags and by the debug menu.

Definition at line 14 of file item_picker.c.

Referenced by DebugMenu_TestItemSelection(), Shop_PickUnitItem(), and SolSanctumElementalStarRoom_GiveMythrilBags().

◆ Shop_SelectUse()

s32 Shop_SelectUse ( s32 unitId)

Lets the player choose one of the member's items to drop, refusing an indispensable or cursed equipped one with a message.

Returns the slot, or -1 when cancelled. Called by Shop_PickUnitItem.

Definition at line 130 of file item_picker.c.

Referenced by Shop_PickUnitItem(), and Shop_SelectUse().

◆ Shop_DrawUseItem()

void Shop_DrawUseItem ( struct UiWindow * window,
s32 unitId,
s32 slot )

Draws the slot's item name and, below it, why it cannot be dropped or what the whole stack would sell for.

Called by Shop_SelectUse each time the cursor moves.

Definition at line 244 of file item_picker.c.

Referenced by Shop_DrawUseItem(), and Shop_SelectUse().