Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- BankItems 6.0.3.2
- -- Add support for oGlow (github version - http://github.com/haste/oGlow, not the wowinterface one)
- if oGlow and oGlow.RegisterPipe then
- do -- bags
- local hook
- local update = function(bagID)
- if(oGlow:IsPipeEnabled'bankitemsbags') then
- theBag = bankPlayer[format("Bag%d", bagID)]
- if theBag and theBag.size then
- for bagItem = 1, theBag.size do
- idx = theBag.size - (bagItem - 1)
- if (bagID == 101) then -- Adjust for page number
- idx = idx + (mailPage - 1) * 18
- elseif (bagID == 103) then -- Adjust for page number
- idx = idx + (AHPage - 1) * 18
- elseif (bagID == 104) then -- Adjust for page number
- idx = idx + (voidPage - 1) * voidPageSize
- elseif (bagID == 105) then -- Adjust for page number
- idx = idx + (reagentBankPage - 1) * reagentBankPageSize
- end
- if theBag[idx] then
- oGlow:CallFilters('bags', BagContainerAr[bagID][bagItem], theBag[idx].link)
- else
- oGlow:CallFilters('bags', BagContainerAr[bagID][bagItem], nil)
- end
- end
- end
- end
- end
- local enable = function(self)
- if(not hook) then
- hooksecurefunc("BankItems_PopulateBag", update)
- hook = true
- end
- end
- oGlow:RegisterPipe('bankitemsbags', enable, nil, update, "BankItems Bag Frames", nil)
- oGlow:EnablePipe('bankitemsbags')
- end
- do -- bank
- local hook
- local update = function()
- if(oGlow:IsPipeEnabled'bankitemsbank') then
- for i = 1, 28 do
- if bankPlayer[i] then
- oGlow:CallFilters('bank', ItemButtonAr[i], bankPlayer[i].link)
- else
- oGlow:CallFilters('bank', ItemButtonAr[i], nil)
- end
- end
- end
- end
- local enable = function(self)
- if(not hook) then
- hooksecurefunc("BankItems_PopulateFrame", update)
- hook = true
- end
- end
- oGlow:RegisterPipe('bankitemsbank', enable, nil, update, "BankItems Bank Frame", nil)
- oGlow:EnablePipe('bankitemsbank')
- end
- do -- guild bank
- local hook
- local update = function(guildName, tab)
- if(oGlow:IsPipeEnabled'bankitemsgbank') then
- local selfGuild = BankItems_SaveGuild[guildName]
- tab = tab or 1
- if selfGuild[tab] and selfGuild[tab].seen then
- for i = 1, 98 do
- if selfGuild[tab][i] then
- oGlow:CallFilters('gbank', GBButtonAr[i], selfGuild[tab][i].link)
- else
- oGlow:CallFilters('gbank', GBButtonAr[i], nil)
- end
- end
- end
- end
- end
- local enable = function(self)
- if(not hook) then
- hooksecurefunc("BankItems_PopulateGuildBank", update)
- hook = true
- end
- end
- oGlow:RegisterPipe('bankitemsgbank', enable, nil, update, "BankItems Guild Bank Frame", nil)
- oGlow:EnablePipe('bankitemsgbank')
- end
- do -- reagentbank
- local hook
- local update = function()
- if(oGlow:IsPipeEnabled'bankitemsreagentbank') then
- for i = 1, NUM_REAGENTBANKGENERIC_SLOTS do
- if bankPlayer.Bag105[i] then
- oGlow:CallFilters('bank', RBButtonAr[i], bankPlayer.Bag105[i].link)
- else
- oGlow:CallFilters('bank', RBButtonAr[i], nil)
- end
- end
- end
- end
- local enable = function(self)
- if(not hook) then
- hooksecurefunc("BankItems_PopulateReagentBank", update)
- hook = true
- end
- end
- oGlow:RegisterPipe('bankitemsreagentbank', enable, nil, update, "BankItems Reagent Bank Frame", nil)
- oGlow:EnablePipe('bankitemsreagentbank')
- end
- do -- void storage
- local hook
- local update = function(tab)
- if(oGlow:IsPipeEnabled'bankitemsvoidstorage') then
- tab = tab or 1
- local slotOffset = (tab - 1) * 80
- for i = 1, 80 do
- if bankPlayer.Bag104[i+slotOffset] then
- oGlow:CallFilters('voidstorage', VoidButtonAr[i], bankPlayer.Bag104[i+slotOffset].link)
- else
- oGlow:CallFilters('voidstorage', VoidButtonAr[i], nil)
- end
- end
- end
- end
- local enable = function(self)
- if(not hook) then
- hooksecurefunc("BankItems_PopulateVoidStorage", update)
- hook = true
- end
- end
- oGlow:RegisterPipe('bankitemsvoidstorage', enable, nil, update, "BankItems Void Storage Frame", nil)
- oGlow:EnablePipe('bankitemsvoidstorage')
- end
- end
Add Comment
Please, Sign In to add comment