-
-
Notifications
You must be signed in to change notification settings - Fork 43
Sorting Items
Bagnon and Combuctor are bundled with a generic item sorting algorithm. However, they can make use of external item sorting addons, both on retail and classic realms. There are two different methods to declare to Wildpants that your mod implements an item sorting algorithm it can use. Both are described bellow.
The simplest method is to replace the official SortBags
and SortBankBags
global functions, as Wildpants looks for these methods before using its internal sorting algorithm. This also has the advantage that your addon does not need to be aware of Wildpant's existance.
function SortBags()
-- your inventory sorting algorithm
end
function SortBankBags()
-- your bank sorting algorithm
end
function SortReagentBankBags()
-- your reagent bank sorting algorithm
end
However, this approach suffers from multiple disadvantages:
- It requires your addon to replace an official global API.
- It is limited to sorting the inventory and bank.
- It forces bank sorting to be divided into 2 stages in servers with reagent banks.
Instead, we recommend developers to instead replace the method :SortItems
for each of the Wildpants panel classes:
local Addon = Bagnon or Combuctor
function Addon.Inventory:SortItems()
-- your inventory sorting algorithm
end
function Addon.Bank:SortItems()
-- your bank (and reagent bank) sorting algorithm
end
function Addon.Vault:SortItems()
-- your void storage sorting algorithm
end
function Addon.GuildBank:SortItems()
-- your guild bank sorting algorithm
end
This ensures your algorithm takes priority over all others, works for all windows and doesn't require official API rewriting on retail servers.
This is the Wildpants wiki. Wiki Home
For Users
FAQ
Existing Plugins
Search Syntax
For Developers
Ruleset API
Custom Events
Sorting Items