Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetOverflowData

From RoR Wiki

UI Lua API · Item functions
Version: WAR 1.4.8

Returns the first item waiting in the player's inventory overflow, and how many overflow items there are.

item, count = GetOverflowData()

Arguments

None.

Returns

item
table – Item data table of the first item in the overflow. A table is returned even when the overflow is empty, so check count first.
count
number – Number of items in the overflow.

Details

  • Only one item is returned, however many are waiting. The stock UI comments call it "the topmost overflow itemData".
  • If there is no player object or the Lua state is not available, nothing is returned.
  • The stock backpack window calls it once at start-up and otherwise relies on SystemData.Events.PLAYER_INVENTORY_OVERFLOW_UPDATED.

Errors

None.

Example

From default/ea_backpackwindow/source/backpackwindow.lua:

function EA_Window_Backpack.InitializeOverflowSlot()

    WindowRegisterEventHandler( EA_Window_Backpack.windowName, SystemData.Events.PLAYER_INVENTORY_OVERFLOW_UPDATED, "EA_Window_Backpack.OnOverflowSlotUpdated")

    local overflowItem, overflowCount = GetOverflowData()
    EA_Window_Backpack.OnOverflowSlotUpdated( overflowItem, overflowCount )
end

From default/easystem_utils/source/datautils.lua:

return GetOverflowData()   -- only returns the topmost overflow itemData

See also