Skip to Content
The Alchemy Project

src/shop/shop_item_picker.c

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

Included by shop.c.

Macros

NameDescription
#defineITEM_PICKER_PRICE_LABEL_X GERMAN_OR(0, 8)Where the line under the item draws "Price", the stack's sale value and the coins word, in pixels, and how far back from MsgPriceHeading the coins word is: MsgCoins, or in Japanese the message just before.
#defineITEM_PICKER_PRICE_NUMBER_X BY_LANGUAGE(40, 40, 32, 40, 32, 40)
#defineITEM_PICKER_COINS_LABEL_X BY_LANGUAGE(80, 80, 72, 88, 72, 80)
#defineITEM_PICKER_COINS_MESSAGE_OFFSET JAPANESE_OR(1, 5)

Functions

NameDescription
Sint32mnItemPickerRun (Sint32 *selectedUnit, Sint32 *selectedSlot)Lets the player choose a party member, then one of their items that may be dropped, in the selling screen without its shopkeeper.
Sint32mnItemPickerSelectItem (Sint32 unitId)Lets the player choose one of the party member's items to drop, refusing an indispensable one with a message and an equipped cursed one with only the cancel sound (the game's bug; BUGFIX shows its message, see SHOP_CANNOT_REMOVE_STATUS).
voidmnItemPickerDrawItem (WINDOW *window, Sint32 unitId, Sint32 slot)Draws the slot's item name and, below it, why it cannot be dropped or what the whole stack would sell for.

Description

The item picker: which party member's item to drop when every pack is full. Part of shop.c.

Macros in detail

ITEM_PICKER_PRICE_LABEL_X

#define ITEM_PICKER_PRICE_LABEL_X GERMAN_OR(0, 8)

Where the line under the item draws "Price", the stack's sale value and the coins word, in pixels, and how far back from MsgPriceHeading the coins word is: MsgCoins, or in Japanese the message just before.

Referenced by mnItemPickerDrawItem().

Definition at line 105 of file shop_item_picker.c.

ITEM_PICKER_PRICE_NUMBER_X

#define ITEM_PICKER_PRICE_NUMBER_X BY_LANGUAGE(40, 40, 32, 40, 32, 40)

Referenced by mnItemPickerDrawItem().

Definition at line 106 of file shop_item_picker.c.

ITEM_PICKER_COINS_LABEL_X

#define ITEM_PICKER_COINS_LABEL_X BY_LANGUAGE(80, 80, 72, 88, 72, 80)

Referenced by mnItemPickerDrawItem().

Definition at line 107 of file shop_item_picker.c.

ITEM_PICKER_COINS_MESSAGE_OFFSET

#define ITEM_PICKER_COINS_MESSAGE_OFFSET JAPANESE_OR(1, 5)

Referenced by mnItemPickerDrawItem().

Definition at line 108 of file shop_item_picker.c.

Functions in detail

mnItemPickerRun

Sint32 mnItemPickerRun(Sint32 *selectedUnit, Sint32 *selectedSlot)

Lets the player choose a party member, then one of their items that may be dropped, in the selling screen without its shopkeeper. Returns 0 with the choice in selectedUnit and selectedSlot, or -1 for B with both -1.

References gmInventoryCountStub(), mnCreatePartyFiguresStub(), mnCursorPlace(), mnCursorSetPosImmediate(), mnItemPickerSelectItem(), mnReleasePartyFiguresStub(), mnShopDrawMemberItems(), mnShopDrawParty(), mnShopInitState(), mnShopReleaseState(), mnWindowCloseStub(), mnWindowCreateStub(), mnWindowSpriteCreateStub(), PerPush, PerRepeat, Sint32, sySoundPlayStub() and sySynch().

Referenced by dbMenuTestOpenItemPicker() and scSolSanctumElementalStarRoomGiveMythrilBags().

Definition at line 9 of file shop_item_picker.c.

mnItemPickerSelectItem

Sint32 mnItemPickerSelectItem(Sint32 unitId)

Lets the player choose one of the party member's items to drop, refusing an indispensable one with a message and an equipped cursed one with only the cancel sound (the game's bug; BUGFIX shows its message, see SHOP_CANNOT_REMOVE_STATUS). Returns the slot, or -1 when cancelled.

References gmInventoryCheckDiscardStub(), gmInventoryCountStub(), gmUnitGetStub(), mnCursorPlace(), mnItemPickerDrawItem(), mnMessageAllTypedStub(), mnMessageCloseFinishedWindowsStub(), mnMessageOpenWindowStub(), mnShopDrawMessage(), mnWindowCloseStub(), mnWindowCreateStub(), PerPush, PerRepeat, Sint32, sySoundPlayStub() and sySynch().

Referenced by mnItemPickerRun().

Definition at line 114 of file shop_item_picker.c.

mnItemPickerDrawItem

void mnItemPickerDrawItem(WINDOW *window, Sint32 unitId, Sint32 slot)

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

References gmInventoryCheckDiscardStub(), gmUnitGetStub(), mnShopSalePrice(), mnTextDrawMessageAsTilesStub(), mnTextDrawNumberInWindowStub(), mnWindowSpriteRedrawSavedRectStub() and Sint32.

Referenced by mnItemPickerSelectItem().

Definition at line 247 of file shop_item_picker.c.