diff --git a/BagBrother/Events.lua b/BagBrother/Events.lua index 9ebde3f..79e9be3 100644 --- a/BagBrother/Events.lua +++ b/BagBrother/Events.lua @@ -31,7 +31,7 @@ local Reagents = REAGENTBANK_CONTAINER function BagBrother:BAG_UPDATE(bag) local isBag = bag > Bank and bag <= BagSlots - + if isBag then self:SaveBag(bag, bag == Backpack) if bag == Backpack then @@ -136,4 +136,4 @@ function BagBrother:GUILDBANKBAGSLOTS_CHANGED() self.Realm[id] = tabs end -end \ No newline at end of file +end diff --git a/BagBrother/Startup.lua b/BagBrother/Startup.lua index d7e7cca..820bb21 100644 --- a/BagBrother/Startup.lua +++ b/BagBrother/Startup.lua @@ -33,10 +33,10 @@ end function Brother:StartupCache() local Player = UnitName('player') local Realm = GetRealmName() - + BrotherBags = BrotherBags or {} BrotherBags[Realm] = BrotherBags[Realm] or {} - + self.Realm = BrotherBags[Realm] self.Realm[Player] = self.Realm[Player] or {equip = {}} self.Player = self.Realm[Player] @@ -90,4 +90,4 @@ end function Brother:RemoveEvent(event) self:UnregisterEvent(event) self[event] = nil -end \ No newline at end of file +end diff --git a/libs/LibItemCache-1.1/Caches/BagBrother.lua b/libs/LibItemCache-1.1/Caches/BagBrother.lua index f9db5c2..b578a6d 100644 --- a/libs/LibItemCache-1.1/Caches/BagBrother.lua +++ b/libs/LibItemCache-1.1/Caches/BagBrother.lua @@ -47,7 +47,7 @@ function Cache:GetItem(realm, player, bag, tab, slot) else bag = self:GetPersonalBag(realm, player, bag) end - + local item = bag and bag[slot] if item then return strsplit(';', item) @@ -79,15 +79,15 @@ function Cache:GetItemCounts(realm, player, id) local bank = self:GetItemCount(personal[BANK_CONTAINER], id) + self:GetItemCount(personal[REAGENTBANK_CONTAINER], id) local bags, guild = 0, 0 - + for i = BACKPACK_CONTAINER, NUM_BAG_SLOTS do bags = bags + self:GetItemCount(personal[i], id) end - + for i = FIRST_BANK_SLOT, LAST_BANK_SLOT do bank = bank + self:GetItemCount(personal[i], id) end - + for i = 1, GetNumGuildBankTabs() do guild = guild + self:GetItemCount(self:GetGuildTab(realm, player, i), id) end @@ -98,7 +98,7 @@ end function Cache:GetItemCount(bag, id, unique) local count = 0 local id = '^'..id - + if bag then for i,item in pairs(bag) do if type(i) == 'number' and item:find(id) then @@ -106,7 +106,7 @@ function Cache:GetItemCount(bag, id, unique) end end end - + return count end @@ -170,4 +170,4 @@ function Cache:GetRealms() end return realms -end \ No newline at end of file +end diff --git a/libs/LibItemCache-1.1/Core.lua b/libs/LibItemCache-1.1/Core.lua index e91d8a7..6bcd9a4 100644 --- a/libs/LibItemCache-1.1/Core.lua +++ b/libs/LibItemCache-1.1/Core.lua @@ -47,7 +47,7 @@ function Lib:GetPlayerInfo(player) local _,class = UnitClass('player') local _,race = UnitRace('player') local sex = UnitSex('player') - + return class, race, sex, self.FACTION end end @@ -144,7 +144,7 @@ function Lib:GetBagInfo(player, bag) local isCached, _,_, tab = self:GetBagType(player, bag) local realm, player = self:GetPlayerAddress(player) local owned = true - + if tab then if isCached then return Cache('GetBag', realm, player, bag, tab) @@ -164,7 +164,7 @@ function Lib:GetBagInfo(player, bag) if isCached then local data, size = Cache('GetBag', realm, player, bag, nil, slot) local link, icon = self:RestoreLink(data) - + return link, 0, icon, slot, tonumber(size) or 0, true else local link = GetInventoryItemLink('player', slot) @@ -204,13 +204,13 @@ function Lib:GetItemInfo(player, bag, slot) local realm, player = self:GetPlayerAddress(player) local data, count = Cache('GetItem', realm, player, bag, tab, slot) local link, icon, quality = self:RestoreLink(data) - + if isVault then return link, icon, nil, nil, nil, true else return icon, tonumber(count) or 1, nil, quality, nil, nil, link, true end - + elseif isVault then return GetVoidItemInfo(1, slot) elseif tab then @@ -225,7 +225,7 @@ function Lib:GetItemInfo(player, bag, slot) if link and quality < 0 then quality = self:GetItemQuality(link) end - + return icon, count, locked, quality, readable, lootable, link end end @@ -276,10 +276,10 @@ end function Lib:RestorePetLink(partial) local id, _, quality = strsplit(':', partial) local name, icon = C_PetJournal.GetPetInfoBySpeciesID(id) - + local color = select(4, GetItemQualityColor(quality)) local link = PetLinkFormat:format(color, partial, name) - + return link, icon, tonumber(quality) end @@ -299,4 +299,4 @@ end function Lib:HasCache() return not self.NewCache -end \ No newline at end of file +end