diff --git a/MyBank/MyBank.lua b/MyBank/MyBank.lua index 7e1deda..34fd489 100644 --- a/MyBank/MyBank.lua +++ b/MyBank/MyBank.lua @@ -470,7 +470,7 @@ end function MyBank:UserDropDown_Initialize() local this = self or _G.this - local chars, char_num, i + local chars, char_num chars = MyBank:GetSortedCharList(MyBank.GetOpt("Sort")) char_num = getn(chars) if (char_num == 0) then @@ -526,18 +526,20 @@ function MyBank:ToggleAllBags(forceopen) else ToggleBackpack() end - local action, i + local action if (IsBagOpen(0) or MyInventory.frame:IsVisible()) then action = "OpenBag" else action = "CloseBag" end - for i=1, 4, 1 do + + for i = 1, 4, 1 do if not (MyInventory.GetOpt("Replace") and MyInventory:IncludeBag(i)) then self.hooks[action](i) end end - for i=5, 11, 1 do + + for i = 5, 11, 1 do if not MyBank.GetOpt("Replace") or not MyBank:IncludeBag(i) then self.hooks[action](i) end @@ -609,7 +611,6 @@ end function MyBank:GetSortedCharList(sorttype, realm) if IsAddOnLoaded("DataStore_Containers") then - local realmname local realmlist = {} local realmcount = 0 if not realm then @@ -623,9 +624,7 @@ function MyBank:GetSortedCharList(sorttype, realm) end local result = {} local idx = 0 - local i - local charname, charkey - for i=1, realmcount do + for i = 1, realmcount do for charname, charkey in pairs(DataStore:GetCharacters(realmlist[i])) do -- charkey = DataStore:GetCharacter(charname, realmlist[i]) if DataStore_Containers.Characters[charkey] then