The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
do
-- Helper function
local function AllBagsOpen(bags)
for _,v in pairs(bags) do
if not v:IsShown() then
return false
end
end
return true
end
local available_bags = {}
local frame
function OpenAllBags(arg)
available_bags = wipe(available_bags)
for i=1, NUM_CONTAINER_FRAMES + NUM_BANKBAGSLOTS, 1 do
frame = getglobal("ContainerFrame"..i)
if frame then
available_bags[i] = frame
end
end
if arg == true or arg == 1 then
for _,v in pairs(available_bags) do
v:Show()
v:SetChecked(1)
end
elseif not arg then
if AllBagsOpen(available_bags) then
for _,v in pairs(available_bags) do
v:Hide()
v:SetChecked(0)
end
else
for _,v in pairs(available_bags) do
v:Show()
v:SetChecked(1)
end
end
else
_ERRORMESSAGE('Usage: OpenAllBags([boolean])')
end
end
end
function SetBindingClick(key, command, button)
if command then
command = "CLICK " .. command
end
if button then
command = command .. ":" .. button
end
return SetBinding(key, command)
end
function print(...)
local n
local out = tostring((select(1, ...)))
for i = 2, select("#", ...) do
out = out .. " " .. tostring((select(i, ...)))
end
DEFAULT_CHAT_FRAME:AddMessage(out)
end
tostringall
do
local strtab = {}
function tostringall(...)
wipe(strtab)
for i = 1, select('#', ...) do
table.insert(strtab, tostring(select(i, ...)))
end
return unpack(strtab)
end
end