13#define OVL_NAME(name) STITSHOP_##name
16#if VERSION_US || VERSION_JP
17#define FILE_SHOP_SPRITES 0x3F2
19#define FILE_SHOP_SPRITES 0x402
#define TASK_HEADER(Type)
void STITSHOP_startFade(PanelAnim *fade, s32 fadeIn)
void STITSHOP_listSellable(ShopItemList *list)
Lists the bag's items of the list's type that can be sold, those with a sell price (list->listBag,...
void STITSHOP_createBuyWindows(ShopBuy *buy, ShopBuyWindows *win)
trade.c
void STITSHOP_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames)
void STITSHOP_drawShop(ItemShop *shop, ItemShopWindows *win)
Draws the shop's four frames as they open by scaling, and the background, which scrolls one pixel eve...
void STITSHOP_computeStats(s32 partner, StatBlock *out)
info.c
void STITSHOP_updateBuy(ShopBuy *buy, ShopBuyWindows *win)
The buying dialog's task: creates its windows, starting at a quantity of 1, then runs and draws it.
void STITSHOP_refreshItemList(ShopItemList *list)
Lists the sellable items again, shows the page and the selection in the dialog (list->refresh)
void STITSHOP_showItemRows(ShopInfo *info, ShopInfoWindows *win, s32 show)
Shows the item's name, how many are equipped and in the bag, and its price; or hides them.
ShopInfo * STITSHOP_createInfo(s32 selling, s32 item)
Creates the details panel (task) of the item selected, when buying or selling.
void STITSHOP_createInfoWindows(ShopInfo *info, ShopInfoWindows *win)
Creates the details panel's windows: the item's rows, then, when buying, each partner's name,...
void STITSHOP_refreshPartner(ShopInfo *info, s32 member)
Refreshes the details panel once the item is equipped on a party member (info->refreshPartner): the i...
ShopSell * STITSHOP_createSell(ItemShop *shop)
Creates the selling dialog (task), when sell is chosen in the shop.
void STITSHOP_runSell(ShopSell *sell, ShopSellWindows *win)
The selling dialog: pick the kind of item, then the item in the list, how many, and confirm.
s32 STITSHOP_getSelectedItem(ShopItemList *list)
The item at the list's selection, of the shop's or of the bag's sellable ones (list->getSelected)
s32 STITSHOP_stats[]
the stats the info shows
void STITSHOP_closeItemList(ShopItemList *list)
Closes the list (list->close): hides the cursor and fades it out.
void STITSHOP_showOtherChanges(ShopInfo *info, TextWindow **win, ShopStatRow *row)
Shows the new values of the other stats the item would change (palette 1 up, 5 down),...
void STITSHOP_createSellWindows(ShopSell *sell, ShopSellWindows *win)
Creates the selling dialog's windows: the cursor, the four kinds of sale, the quantity,...
void STITSHOP_drawStatsPage(ShopInfo *info, ShopInfoWindows *win)
Draws the second page's frames: the panel, then for each partner its frame and either the icons of th...
s32 STITSHOP_updateLerp(MenuLerp *lerp)
void STITSHOP_updateScene(Task *task, ItemShop **child)
scene.c
s32 STITSHOP_sellLists[]
STITSHOP's data (data/stitshop.c), in its order.
void STITSHOP_showQuantity(ShopBuy *buy, ShopBuyWindows *win, s32 show)
Shows the quantity to buy; or hides it.
s32 STITSHOP_updateFade(PanelAnim *fade)
s32 STITSHOP_filesLoading(void)
Whether the shop's strings are still loading.
void STITSHOP_createItemListWindows(ShopItemList *list, ShopItemListWindows *win)
item_list.c
void STITSHOP_updateItemList(ShopItemList *list, ShopItemListWindows *win)
The item list: L1 and R1 turn its pages, the d-pad moves in the page, and the dialog shows the select...
s32 STITSHOP_kindStrings[]
the strings of the item kinds
s16 * STITSHOP_getShopItems(s32 shop)
equip.c
void STITSHOP_showItemPage(ShopItemList *list, ShopItemListWindows *win, s32 show)
Shows the page of items, the page number and the arrows' labels; or hides them.
void STITSHOP_showMoney(ItemShop *shop)
Shows the money left (shop->showMoney), after buying or selling.
ItemShopFuncs STITSHOP_funcs
The shop's helpers.
void STITSHOP_drawBuy(ShopBuy *buy, ShopBuyWindows *win)
Draws the buying screen's frames, the quantity's blinking arrows and the marker over a partner.
ItemShop * STITSHOP_createShop(void)
Creates the item shop (task) for the shop of the mode's argument.
void STITSHOP_updateShop(ItemShop *shop, ItemShopWindows *win)
The shop's task: loads its files, then runs it; goes back to the field when killed.
void STITSHOP_fillPartnerRows(ShopInfo *info, ShopInfoWindows *win, s32 member)
Fills a partner's rows of the details panel's second page: the stats of the slot the item goes in,...
ShopItemList * STITSHOP_createItemList(ShopDialog *dialog, s32 type, s32 selling)
Creates the item list (task) of a dialog: the items of the shop type when buying, the bag's of the it...
void STITSHOP_addStat(s16 *p, s32 stat, s32 delta)
Adds an item's bonus to a stat, up to 999: 1 to 6 one of the six battle stats, 7 all of them,...
void STITSHOP_createShopWindows(ItemShop *shop, ItemShopWindows *win)
shop.c
void STITSHOP_closeInfo(ShopInfo *info)
Closes the details panel (info->close), when it is open and idle.
void STITSHOP_runSellInfo(ShopInfo *info, ShopInfoWindows *win)
The details panel's first page: fades in, shows the item, then fades out when closed.
ScreenFade * STITSHOP_createFader(void)
void STITSHOP_drawSell(ShopSell *sell, ShopSellWindows *win)
Draws the selling screen's frames, and the quantity's blinking arrows.
void STITSHOP_updateInfo(ShopInfo *info, ShopInfoWindows *win)
The details panel: counts the party, then runs the pages and draws the item's icon and frames.
void STITSHOP_updateSell(ShopSell *sell, ShopSellWindows *win)
The selling dialog's task: creates its windows, starting at a quantity of 1, then runs and draws it.
void STITSHOP_startFader(ScreenFade *task, s32 fadeIn, s32 duration)
void STITSHOP_equip(s32 partner, s32 slot, s32 item, s32 fromBag)
Puts an item in a partner's equipment slot like STSTATUS_equip, moving the counts between GAME....
ShopList STITSHOP_shops[31]
STITSHOP_stock0 to 30, the items of each shop, are only STITSHOP_shops'.
s32 STITSHOP_canEquip(s32 partner, s32 item)
1 when a partner can equip an item: the partner's bit in its partners
void STITSHOP_runBuy(ShopBuy *buy, ShopBuyWindows *win)
The buying dialog: pick the item in the list, how many, confirm, then (equipment) whether to equip it...
void STITSHOP_showStat(ShopInfo *info, TextWindow *win, ShopStatRow *row)
Shows a row's stat of a partner in the details panel: as it is, or with the item equipped when the ro...
void STITSHOP_runItemList(ShopItemList *list, ShopItemListWindows *win)
The list's states: lists the shop's items or the bag's, fades in, then fades out when closed.
void STITSHOP_updateFader(ScreenFade *task)
void STITSHOP_drawItemList(ShopItemList *list)
Draws the list's frame, the items' icons and the blinking page arrows.
void STITSHOP_showBuyItem(ShopBuy *buy, s32 item, s32 quantity)
Shows the item selected in the list, and the quantity, in the details panel (buy->showItem)
void STITSHOP_showListCursor(ShopItemList *list, s32 visible)
Shows the list's cursor at the selection and takes the d-pad, or hides it and stops (list->showCursor...
void STITSHOP_setKindVisible(ShopInfo *info, s32 visible)
Shows or hides the weapon's kind in the details panel (info->setKindVisible)
ShopBuy * STITSHOP_createBuy(ItemShop *shop)
Creates the buying dialog (task), when buy is chosen in the shop.
s32 STITSHOP_shopNames[]
The shops' names, by ItemShop.shop.
Vec2 STITSHOP_changePos[]
Where the stat change arrows go in a partner's column.
void STITSHOP_turnInfoPage(ShopInfo *info)
Turns the details panel between the description and the partners' stats (info->turnPage); only for th...
void STITSHOP_runShop(ItemShop *shop, ItemShopWindows *win)
Opens the shop's panels, then up/down and cross pick buy or sell and run that dialog,...
void STITSHOP_showItemDesc(ShopInfo *info, ShopInfoWindows *win, s32 show)
Shows the item's description and, for a weapon, its kind; or hides them.
void STITSHOP_loadFiles(void)
Loads the shop's textures and requests its strings.
void STITSHOP_startItemList(ShopItemList *list)
Runs the list's states again (list->start), to reopen it after the quantity and the yes/no.
void STITSHOP_showBuyTotal(ShopBuy *buy, ShopBuyWindows *win, s32 show)
Shows the total price with yes and no to confirm the purchase; or hides them.
void STITSHOP_setInfoItem(ShopInfo *info, s32 item, s32 quantity)
Shows an item and the quantity (for the price) in the details panel (info->showItem); the windows are...
void STITSHOP_freezeListCursor(ShopItemList *list, s32 frozen)
Freezes the list's cursor (still, in palette 7) and its input, or lets them go again (list->freezeCur...
void STITSHOP_drawFader(ScreenFade *task)
void STITSHOP_showPartnerStats(ShopInfo *info, ShopInfoWindows *win, s32 show)
Shows the party's names and, for those who can equip the item, the stats it changes; or hides them.
s32 STITSHOP_compareEquip(s32 partner, s32 item)
Which equipment slot a bought item would go in: 2 or 3 for the weapons (the one with the weaker item ...
void STITSHOP_showSellItem(ShopSell *sell, s32 item, s32 quantity)
Shows the item selected in the list, and the quantity, in the details panel (sell->showItem)
void STITSHOP_runBuyInfo(ShopInfo *info, ShopInfoWindows *win)
The details panel's states when buying: fades in its first page, turns between the pages (10-16),...
void STITSHOP_colorStat(ShopInfo *info, TextWindow *win, ShopStatRow *row)
Colors a row's stat: palette 1 when the item would raise it, 5 when it would lower it,...
A menu cursor: a text window showing one of the CURSOR_FRAMES glyphs.
The shop's helpers (STITSHOP_funcs)
s32(* updateLerp)(MenuLerp *lerp)
void(* equip)(s32 partner, s32 slot, s32 item, s32 fromBag)
s32 count
the items of the shop getShopItems returned
s32(* updateFade)(PanelAnim *fade)
void(* startFade)(PanelAnim *fade, s32 fadeIn)
s32(* compareEquip)(s32 partner, s32 item)
void(* startLerp)(MenuLerp *lerp, s32 from, s32 to, s32 frames)
s32(* filesLoading)(void)
s32(* canEquip)(s32 partner, s32 item)
The children of the shop.
Task * dialog
ShopBuy or ShopSell.
TextWindow * title
the shop's name
The main task of the shop (STITSHOP_createShop)
s32 shop
the game mode's argument
void(* showMoney)(struct ItemShop *shop)
Opens or closes a menu panel: level goes 0 -> ONE in duration frames (or back at twice the speed),...
Fades the whole screen to black and back with a subtractive rectangle.
TextWindow * quantityLabel
The dialog to buy an item (STITSHOP_createBuy)
void(* showItem)(struct ShopBuy *buy, s32 item, s32 quantity)
s32 partner
the one the marker is over
s32 markerFrame
the marker's clut row, 0-7
What ShopBuy and ShopSell start with, and are passed to the item list as: the list shows its selectio...
void(* showItem)(struct ShopDialog *dialog, s32 item, s32 quantity)
A partner's rows of the details panel's second page.
TextWindow * equippedLabel
TextWindow * kind
the weapons'
TextWindow * owned
GAME.items.
ShopInfoPartner partners[3]
TextWindow * equipped
GAME.equippedItems.
The panel with the selected item's details (STITSHOP_createInfo)
void(* turnPage)(struct ShopInfo *info)
void(* showItem)(struct ShopInfo *info, s32 item, s32 quantity)
void(* close)(struct ShopInfo *info)
void(* setKindVisible)(struct ShopInfo *info, s32 visible)
s32 page
0: the description, 1: the partners' stats
void(* refreshPartner)(struct ShopInfo *info, s32 member)
ShopPartnerInfo partners[3]
The list of the items to buy or sell (STITSHOP_createItemList)
void(* freezeCursor)(struct ShopItemList *list, s32 frozen)
void(* close)(struct ShopItemList *list)
void(* refresh)(struct ShopItemList *list)
s16 items[0x194]
the bag's items that can be sold
void(* showCursor)(struct ShopItemList *list, s32 visible)
void(* start)(struct ShopItemList *list)
void(* listBag)(struct ShopItemList *list)
s32(* getSelected)(struct ShopItemList *list)
s32 clutRow
the arrows' blink
s32 type
the shop, or the item type to sell
ShopDialog * dialog
ShopBuy or ShopSell.
s32 selling
0: the shop's items, 1: the bag's
A shop: the items it sells.
What the details panel shows of a partner.
s32 changes
how many of the stats would change
s32 rows[8]
from 2: the stats that change (from 1)
StatBlock withItem
with the item equipped
TextWindow * quantityLabel
The dialog to sell an item (STITSHOP_createSell)
void(* showItem)(struct ShopSell *sell, s32 item, s32 quantity)
s32 blink
the quantity's arrows are shown
A row of the details panel's stats.
s32 compare
show the stat with the item equipped
s32 stat
into STITSHOP_stats
PartnerStats' stats[] and the status[] after them as one block, which computeStats and STITSHOP_compu...
Any task, seen through its header.
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...