diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-11-01 18:06:15 -0400 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2021-11-02 18:06:06 -0400 |
commit | afb9ff3a40dcfb2681ef274752bceb726d14b783 (patch) | |
tree | 4e41abebf769019ead392d3fa0034df04b796d79 /src/menu_helpers.c | |
parent | c98fbb5ca6edf4f2bb3d2eada318082051f0849d (diff) |
Document files with a few remaining symbols
Diffstat (limited to 'src/menu_helpers.c')
-rw-r--r-- | src/menu_helpers.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/menu_helpers.c b/src/menu_helpers.c index 331755590..3e6b6a914 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -278,51 +278,45 @@ u8 GetLRKeysPressedAndHeld(void) bool8 IsHoldingItemAllowed(u16 itemId) { // Enigma Berry can't be held in link areas - if (itemId != ITEM_ENIGMA_BERRY) - return TRUE; - else if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(TRADE_CENTER) - && gSaveBlock1Ptr->location.mapNum == MAP_NUM(TRADE_CENTER)) + if (itemId == ITEM_ENIGMA_BERRY + && ((gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(TRADE_CENTER) + && gSaveBlock1Ptr->location.mapNum == MAP_NUM(TRADE_CENTER)) + || InUnionRoom() == TRUE)) return FALSE; - else if (InUnionRoom() != TRUE) - return TRUE; else - return FALSE; + return TRUE; } bool8 IsWritingMailAllowed(u16 itemId) { - if (IsUpdateLinkStateCBActive() != TRUE && InUnionRoom() != TRUE) - return TRUE; - else if (ItemIsMail(itemId) != TRUE) - return TRUE; - else + if ((IsOverworldLinkActive() == TRUE || InUnionRoom() == TRUE) && ItemIsMail(itemId) == TRUE) return FALSE; + else + return TRUE; } -bool8 MenuHelpers_LinkSomething(void) +bool8 MenuHelpers_IsLinkActive(void) { - if (IsUpdateLinkStateCBActive() == TRUE || gReceivedRemoteLinkPlayers == 1) + if (IsOverworldLinkActive() == TRUE || gReceivedRemoteLinkPlayers == 1) return TRUE; else return FALSE; } -static bool8 sub_81221D0(void) +static bool8 IsActiveOverworldLinkBusy(void) { - if (!MenuHelpers_LinkSomething()) + if (!MenuHelpers_IsLinkActive()) return FALSE; else - return Overworld_LinkRecvQueueLengthMoreThan2(); + return Overworld_IsRecvQueueAtMax(); } -bool8 MenuHelpers_CallLinkSomething(void) +bool8 MenuHelpers_ShouldWaitForLinkRecv(void) { - if (sub_81221D0() == TRUE) + if (IsActiveOverworldLinkBusy() == TRUE || IsLinkRecvQueueAtOverworldMax() == TRUE ) return TRUE; - else if (IsLinkRecvQueueLengthAtLeast3() != TRUE) - return FALSE; else - return TRUE; + return FALSE; } void SetItemListPerPageCount(struct ItemSlot *slots, u8 slotsCount, u8 *pageItems, u8 *totalItems, u8 maxPerPage) |