Skip to content
This repository has been archived by the owner on Aug 9, 2020. It is now read-only.
Travis edited this page Jul 13, 2018 · 11 revisions

The Parent mixin is the lowest object the layout has to interact with.
The layout would typically want to create two separate parents - one for bags, one for bank.
Once created, the Parent serves as the ground layer for the entirety of LibContainer, and it's where the layout starts to adjust preferences and hook into the rest of the mixins with Callbacks.


Parent:OverrideToggles()

Overrides the methods for toggling the visible state of the stock bags to instead toggle the visibility of the Parent container.

This is optional, but highly recommended for typical usage.
The layout could instead override the methods themselves and add custom bindings.


Parent:CreateBag(bagID)

Creates and returns a new bag for the Parent.

  • bagID - identifier for the bag to create (integer)

Parent:GetBag(bagID)

Returns the bag by identifier.

  • bagID - identifier for the bag (integer)

Parent:GetBags()

Returns a table of all bags on the Parent.
The table is indexed by the bag identifier and valued with the Bag object.


Parent:UpdateContainerPositions()

Updates all (visible) container positions for the Parent.


Parent:UpdateContainers()

Initializes a update chain for all "dirty" Containers.


Parent:GetContainer(categoryIndex)

Returns the Container object for the given category.

  • categoryIndex - index of the category the container represents (integer)

Parent:GetContainers()

Returns a table of all Containers.
The table is indexed by the category index and valued with the Container object.


Parent:CreateContainers()

Creates containers for all registered categories for the Parent.


Parent:GetCategories()

Returns a (filtered) table of all categories.
The table is indexed by the category index and valued with the Category data table.

Any categories that has been ignored on the Parent will not be included.


Parent:DisableCategories(...)

Disables one or more categories by name from the Parent containers.

  • ... - category name(s) (string)

Parent:GetType()

Returns 'bags' or 'bank' depending on which type of parent it is.
See LibContainer:New().


Parent:GetParentOfType(parentType)

Returns the parent of the given type, see LibContainer:New().

  • parentType - parent type (string)

Parent:Toggle([force])

Toggles the visibility of the Parent and its containers.
Can be forced to show or hide, or just toggle between the states.

  • force - flag to force show/hide (boolean, optional)

Parent:AddBagSlots()

Adds a BagSlot widget to the Parent.


Parent:AddFreeSlot()

Adds a Free Slots widget to the Inventory Container.