-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Make Key Items That Cannot Be Used In The Field Not Show A Use or Register Option
voloved edited this page Apr 8, 2023
·
1 revision
In OpenContextMenu
in item_menu.c
:
break;
case KEYITEMS_POCKET:
gBagMenu->contextMenuItemsPtr = gBagMenu->contextMenuItemsBuffer;
- gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_KeyItemsPocket);
- memcpy(&gBagMenu->contextMenuItemsBuffer, &sContextMenuItems_KeyItemsPocket, sizeof(sContextMenuItems_KeyItemsPocket));
+ if (ItemId_GetFieldFunc(gSpecialVar_ItemId) == ItemUseOutOfBattle_CannotUse){
+ gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_Cancel);
+ memcpy(&gBagMenu->contextMenuItemsBuffer, &sContextMenuItems_Cancel, sizeof(sContextMenuItems_Cancel));
+ }
+ else{
+ gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_KeyItemsPocket);
+ memcpy(&gBagMenu->contextMenuItemsBuffer, &sContextMenuItems_KeyItemsPocket, sizeof(sContextMenuItems_KeyItemsPocket));
+ }
if (gSaveBlock1Ptr->registeredItem == gSpecialVar_ItemId)
gBagMenu->contextMenuItemsBuffer[1] = ACTION_DESELECT;
if (gSpecialVar_ItemId == ITEM_MACH_BIKE || gSpecialVar_ItemId == ITEM_ACRO_BIKE)
{
If you still want to show the Use
option, but just not show Register
, change the occurrances of sContextMenuItems_Cancel
to sContextMenuItems_KeyItemsPocket_NoReg
and create that array:
static const u8 sContextMenuItems_QuizLady[] = {
ACTION_CONFIRM_QUIZ_LADY, ACTION_CANCEL
};
+
+static const u8 sContextMenuItems_KeyItemsPocket_NoReg[] = {
+ ACTION_USE, ACTION_CANCEL
+};