29 partyWindow, 0, result);
31 cursorAnchor->
kind = result;
64 *selectedUnit = unitId;
65 *selectedSlot = itemSlot;
100#if LANGUAGE == LANGUAGE_ENGLISH || LANGUAGE == LANGUAGE_ITALIAN
101#define SHOP_USE_PRICE_LABEL_X 8
102#define SHOP_USE_PRICE_NUMBER_X 40
103#define SHOP_USE_COIN_LABEL_X 80
104#define SHOP_USE_COIN_MESSAGE_OFFSET 5
105#elif LANGUAGE == LANGUAGE_GERMAN
106#define SHOP_USE_PRICE_LABEL_X 0
107#define SHOP_USE_PRICE_NUMBER_X 32
108#define SHOP_USE_COIN_LABEL_X 72
109#define SHOP_USE_COIN_MESSAGE_OFFSET 5
110#elif LANGUAGE == LANGUAGE_SPANISH
111#define SHOP_USE_PRICE_LABEL_X 8
112#define SHOP_USE_PRICE_NUMBER_X 40
113#define SHOP_USE_COIN_LABEL_X 88
114#define SHOP_USE_COIN_MESSAGE_OFFSET 5
115#elif LANGUAGE == LANGUAGE_FRENCH
116#define SHOP_USE_PRICE_LABEL_X 8
117#define SHOP_USE_PRICE_NUMBER_X 32
118#define SHOP_USE_COIN_LABEL_X 72
119#define SHOP_USE_COIN_MESSAGE_OFFSET 5
121#define SHOP_USE_PRICE_LABEL_X 8
122#define SHOP_USE_PRICE_NUMBER_X 40
123#define SHOP_USE_COIN_LABEL_X 80
124#define SHOP_USE_COIN_MESSAGE_OFFSET 1
161 if (slot > inventoryCount - 1)
162 slot = inventoryCount - 1;
171 Shop_DrawMsg(descriptionWindow, itemId + MsgItemPlainName);
178 if (discardStatus == 0) {
180 selectionResult = slot;
184 if (discardStatus == -4) {
199 selectionResult = -1;
206 slot = (slot + inventoryCount) % inventoryCount;
212 slot = (slot + inventoryCount) % inventoryCount;
219 while (slot >= inventoryCount)
226 if (slot >= inventoryCount)
238 return selectionResult;
257 if (discardStatus == -4) {
260 }
else if (discardStatus == -3) {
268 stackSalePrice = quantity * unitSalePrice;
281#undef SHOP_USE_PRICE_LABEL_X
282#undef SHOP_USE_PRICE_NUMBER_X
283#undef SHOP_USE_COIN_LABEL_X
284#undef SHOP_USE_COIN_MESSAGE_OFFSET
void Shop_DrawParty(struct UiWindow *window, s32 selected, s32 itemId)
Shows the chosen member walking and the others standing, and draws at four fifths of their size the m...
s32 Shop_SalePrice(s32 inventoryEntry)
Returns what the shops pay for an inventory entry: nothing for an indispensable item,...
void Shop_DrawMsg(struct UiWindow *window, s32 message)
Shows message, an item's description, in the help window; a NULL window is ignored.
void Shop_PlaceCursor(struct UiWindow *window, s32 x, s32 y)
Starts the hand cursor's glide to (x, y) pixels inside window (the screen when it is NULL),...
void ShopCursor_SetPositionImmediate(struct ShopCursor *cursor, s32 x, s32 y)
Places the cursor and its sprite at (x, y) at once, with a one-frame glide that has already arrived.
struct BattleUnit * UnitGetFar(u32 owner)
s32 Inventory_CountFar(s32 owner)
s32 Inventory_CheckDiscardFar(s32 owner, s32 slot)
void AudioCommand_PlayFar(s32 id)
struct UiWindow * UiWindow_CreateFar(s32 x, s32 y, s32 width, s32 height, s32 attrs)
void UiText_DrawNumberInWindowFar(s32 arg0, s32 arg1, struct UiWindow *arg2, s32 arg3, s32 arg4)
void UiText_DrawCharacterAtOffsetFar(s32 character, const struct UiWindow *position, u32 offsetX, u32 offsetY)
struct RenderOutput * RenderOutput_CreateFar(s32 slot, s32 flags, struct UiWindow *input, s32 offsetX, s32 offsetY)
void UiWork_FinalizeFar(struct UiWindow *work, s32 release)
s32 UiWork_IsCompleteFar(void)
void RenderOutput_RedrawSavedRectFar(struct UiWindow *window)
struct UiWindow * UiText_OpenMessageWindowFar(s32 message, s32 x, s32 y, u32 packed)
void UiWork_FinalizePendingCoreFar(void)
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
@ INVENTORY_QUANTITY_SHIFT
#define SHOP_USE_PRICE_LABEL_X
s32 Shop_PickUnitItem(s32 *selectedUnit, s32 *selectedSlot)
Lets the player choose a party member, then one of its items that may be dropped.
#define SHOP_USE_COIN_MESSAGE_OFFSET
#define SHOP_USE_PRICE_NUMBER_X
#define SHOP_USE_COIN_LABEL_X
s32 Shop_SelectUse(s32 unitId)
Lets the player choose one of the member's items to drop, refusing an indispensable or cursed equippe...
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...
volatile u32 gKeysPressed
Keys that went down this frame.
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
void Shop_ReleaseCursorWork(void)
Stops the cursor task, frees the six cursor icons and the work block.
void Shop_InitializeCursorWork(void)
Allocates and clears the work block in the menu's heap slot, lists the party, loads the six cursor ic...
void Shop_DrawUnitGrid(struct UiWindow *window, s32 unitId)
Draws the member's items as icons in rows of five, or a line saying it has none.
What every part of the shop object shares: its includes, the shop actions and sanctum services,...
#define SHOP_CANNOT_REMOVE_STATUS(discardStatus, selectionResult)
#define SHOP_USE_WINDOW_WIDTH
#define SHOP_USE_WINDOW_X
#define SE_MENU_CURSOR_MOVE
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
u16 inventory[15]
Items held, one entry each: bits 15..11 quantity | 10 broken | 9 equipped | 8..0 item id (INVENTORY_*...
A render output: a sprite in a window's output list (a character, an icon or a portrait),...
s8 active
its UI_SPRITE_ motion; 0 while free
s8 kind
0 for a glyph; otherwise it owns VRAM cache slot index, freed with it, and 2 (a portrait) also its pa...
struct RenderOutput * anchor
the cursor's sprite, moved with its OAM
A shop's work: its windows, the party members' icons, the stock, the cursor and its icons,...
struct UiWindow * itemWindow
struct ShopCursor cursor
the hand cursor
s16 partyMemberIds[9]
the party in order (Party_ListActiveOwners)
u16 cursorIcon
VRAM cache slots of the six cursor icons, loaded when the work is set up and freed with it.
u8 mode
passed on as the hand cursor's kind; set to 12 at first
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...