WoWInterface SVN kRestack

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 14 to Rev 15
    Reverse comparison

Rev 14 → Rev 15

kRestack/changelog.txt
1,9 → 1,13
v1.0 r14 release 2009-05-18
v1.0.1 2009-05-19
- Fixed the handling of initializing saved variables when updating from previous versions.
- Fixed a bug that disabled guild tab switching when guild bank auto-stacking is turned off.
 
v1.0 2009-05-18
- Added support for restacking guild vault tabs.
- Hooked bag auto-stack to LOOT_OPEN and TRADE_SHOW, and guild bank auto-stack to GUILDBANKFRAME_OPENED and SetCurrentGuildBankTab(i).
- Extended auto-stack toggle to enable or disable bags, bank, or guild bank individually.
- Will now move items that can go into special class/profession bags into those bags if possible (soul shards, herbs, arrows, etc).
- Cleaned up and commented code.
 
v0.9 r13 release 2009-05-13
v0.9 2009-05-13
- Added option to auto-stack when opening bags or bank, off by default. Toggle with '/restack auto'
\ No newline at end of file
kRestack/kRestack.lua
18,27 → 18,22
for i = 1, NUM_BAG_SLOTS do table.insert(container.bags, i) end
for i = NUM_BAG_SLOTS + 1, NUM_BAG_SLOTS + NUM_BANKBAGSLOTS do table.insert(container.bank, i) end
 
--[[ initiate defaults ]]
if type(AutoRestack) ~= "table" then
AutoRestack = { }
elseif AutoRestack.bags == nil then
table.insert(AutoRestack.bags, true)
elseif AutoRestack.bank == nil then
table.insert(AutoRestack.bank, true)
elseif AutoRestack.guild == nil then
table.insert(AutoRestack.guild, false)
end
 
--[[ watching some events ]]
local frame = CreateFrame("FRAME")
local events = { "BANKFRAME_OPENED", "LOOT_OPENED", "TRADE_SHOW", "GUILDBANKFRAME_OPENED" }
local events = { "ADDON_LOADED", "BANKFRAME_OPENED", "LOOT_OPENED", "TRADE_SHOW", "GUILDBANKFRAME_OPENED" }
for _, r in pairs(events) do frame:RegisterEvent(r) end
frame:SetScript("OnEvent", function(_, e)
if AutoRestack.bank and e == events[1] then
if e == events[1] then
--[[ initialize saved variables ]]
if type(AutoRestack) ~= "table" then AutoRestack = { } end
if AutoRestack.bags == nil then AutoRestack.bags = true end
if AutoRestack.bank == nil then AutoRestack.bank = true end
if AutoRestack.guild == nil then AutoRestack.guild = false end
elseif AutoRestack.bank and e == events[2] then
kRestack("bank", true)
elseif AutoRestack.bags and (e == events[2] or e == events[3]) then
elseif AutoRestack.bags and (e == events[3] or e == events[4]) then
kRestack("bags", true)
elseif AutoRestack.guild and e == events[4] then
elseif AutoRestack.guild and e == events[5] then
kRestack("guild", true)
end
end)
52,9 → 47,9
 
local oSetCurrentGuildBankTab = SetCurrentGuildBankTab
SetCurrentGuildBankTab = function(tab)
if AutoRestack.guild and (type(restacker) ~= "thread" or coroutine.status(restacker) == "dead") then
kRestack("guild", true, tab)
return oSetCurrentGuildBankTab(tab)
if type(restacker) ~= "thread" or coroutine.status(restacker) == "dead" then
if AutoRestack.guild then kRestack("guild", true, tab) end
return oSetCurrentGuildBankTab(tab)
end
end
 
kRestack/kRestack.toc
1,6 → 1,6
## Interface: 30100
## Title: kRestack
## Version: 1.0 rwowi:revision
## Version: 1.0.1
## Author: Katae of Anvilmar
## Notes: Function for restacking inventory items.
## SavedVariablesPerCharacter: AutoRestack