bool8 ScrCmd_bufferitem(struct ScriptContext *ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 itemId = VarGet(ScriptReadHalfword(ctx)); CopyItemName(itemId, gUnknown_083762F0[stringVarIndex]); return FALSE; }
static void ItemStorage_DrawItemName(struct ItemSlot *itemSlot, u8 var, int isSwapSelected) { CopyItemName(itemSlot->itemId, gStringVar1); if(isSwapSelected != FALSE) Menu_PrintText(gSelectedItemFormattedText, 16, var); else Menu_PrintText(gNonSelectedItemFormattedText, 16, var); }
static void ItemStorage_DoItemWithdraw(u8 taskId) { s16 *data = TASK.data; u8 trueIndex = PAGE_INDEX + ITEMS_ABOVE_TOP; if(AddBagItem(gSaveBlock1.pcItems[trueIndex].itemId, NUM_QUANTITY_ROLLER) == TRUE) // add item works. { CopyItemName(gSaveBlock1.pcItems[trueIndex].itemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, NUM_QUANTITY_ROLLER, 0, 3); ItemStorage_PrintItemPcResponse(ITEMPC_WITHDREW_THING); TASK.FUNC = ItemStorage_HandleRemoveItem; } else { NUM_QUANTITY_ROLLER = 0; ItemStorage_PrintItemPcResponse(ITEMPC_NO_MORE_ROOM); TASK.FUNC = ItemStorage_WaitPressHandleResumeProcessInput; } }
static void ItemStorage_DoItemToss(u8 taskId) { s16 *data = TASK.data; u8 var = PAGE_INDEX + ITEMS_ABOVE_TOP; if(ItemId_GetImportance(gSaveBlock1.pcItems[var].itemId) == FALSE) { CopyItemName(gSaveBlock1.pcItems[var].itemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, NUM_QUANTITY_ROLLER, 0, 3); ItemStorage_PrintItemPcResponse(ITEMPC_OKAY_TO_THROW_AWAY); DisplayYesNoMenu(7, 6, 1); DoYesNoFuncWithChoice(taskId, (struct YesNoFuncTable *)&ResumeFromTossYesNoFuncList); } else { NUM_QUANTITY_ROLLER = 0; ItemStorage_PrintItemPcResponse(ITEMPC_TOO_IMPORTANT); TASK.FUNC = ItemStorage_HandleRemoveItem; } }