Commit 24e180fd authored by Merathilis's avatar Merathilis

Thanks @Azilroka for pointing that out. No need to call it 3 times per key!

parent d823de1d
......@@ -4,9 +4,11 @@ local MAB = MER:GetModule("mUIActionbars")
--Cache global variables
--Lua functions
local pairs, select, tonumber, type = pairs, select, tonumber, type
local format = string.format
local tinsert = table.insert
--WoW API / Variables
local GetItemInfo = GetItemInfo
local COLOR = COLOR
-- GLOBALS:
local function abTable()
......@@ -495,21 +497,21 @@ local function abTable()
},
}
local texString = '|T%s:18:18:0:0:64:64:4:60:4:60|t %s'
for k, v in pairs(E.db.mui.actionbars.autoButtons.whiteList) do
if type(k) == "string" then k = tonumber(k) end
if GetItemInfo(k) then
local name = select(1, GetItemInfo(k))
local tex = select(10, GetItemInfo(k))
E.Options.args.mui.args.modules.args.actionbars.args.autoButtons.args.general.args.whiteList.values[k] = '|T'..tex..':18:18:0:0:64:64:4:60:4:60|t '..name
local name, _, _, _, _, _, _, _, _, tex = GetItemInfo(k)
if name then
E.Options.args.mui.args.modules.args.actionbars.args.autoButtons.args.general.args.whiteList.values[k] = format(texString, tex, name)
end
end
for k, v in pairs(E.db.mui.actionbars.autoButtons.blackList) do
if type(k) == "string" then k = tonumber(k) end
if GetItemInfo(k) then
local name = select(1, GetItemInfo(k))
local tex = select(10, GetItemInfo(k))
E.Options.args.mui.args.modules.args.actionbars.args.autoButtons.args.general.args.blackList.values[k] = '|T'..tex..':18:18:0:0:64:64:4:60:4:60|t '..name
local name, _, _, _, _, _, _, _, _, tex = GetItemInfo(k)
if name then
E.Options.args.mui.args.modules.args.actionbars.args.autoButtons.args.general.args.blackList.values[k] = format(texString, tex, name)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment