Skip to content

Commit

Permalink
Merge pull request #7 from wolfcon/master
Browse files Browse the repository at this point in the history
Get rid of self from importing others function
  • Loading branch information
doadin authored Nov 13, 2019
2 parents 6d6abb9 + db345a5 commit 51d8ce4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Baggins-Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2947,6 +2947,8 @@ local function newSection(info)
end

function Baggins:CopyBag(from_id, to_id)
if from_id == to_id then return end

local bags = self.db.profile.bags

for i, v in ipairs(bags[from_id].sections) do
Expand All @@ -2957,10 +2959,12 @@ function Baggins:CopyBag(from_id, to_id)
end

local bags_list = { }
local function ListBags()
local function ListBagsExcept(bagid)
wipe(bags_list)
for id, bag in ipairs(Baggins.db.profile.bags) do
bags_list[id] = bag.name
if id ~= bagid then
bags_list[id] = bag.name
end
end
return bags_list
end
Expand Down Expand Up @@ -3116,7 +3120,9 @@ function Baggins:RebuildBagOptions()
desc = L["New Bag"],
func = newBag,
}

for bagid, bag in ipairs(bags) do
local bagListExceptSelected = ListBagsExcept(bagid)
local bagconfig = {
name = getArgName,
desc = getArgName,
Expand Down Expand Up @@ -3178,7 +3184,7 @@ function Baggins:RebuildBagOptions()
desc = "",
type = 'select',
set = CopyBagFromEdit,
values = ListBags,
values = bagListExceptSelected,
arg = bagid,
order = 6,
},
Expand Down

0 comments on commit 51d8ce4

Please sign in to comment.