addonbuttons: accept frame names as an argument

This commit is contained in:
dein0s
2019-04-06 14:48:13 +03:00
committed by shagu
parent d90f11e2cc
commit 85975eaee1
+10 -3
View File
@@ -310,10 +310,17 @@ pfUI:RegisterModule("addonbuttons", function ()
end
end
local function ManualAddOrRemove(action)
local button = GetMouseFocus()
local function ManualAddOrRemove(msg)
local _, _, action, arg = string.find(msg, "%s?(%w+)%s?(.*)")
if action ~= "reset" and action ~= "add" and action ~= "del" then
local button
if arg and arg ~= "" then
button = getglobal(arg)
else
button = GetMouseFocus()
end
if action == "" or (action ~= "reset" and action ~= "add" and action ~= "del") then
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpf|rUI Addon Button Panel:")
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc/abp add|r - " .. T["Add button to the frame"])
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc/abp del|r - " .. T["Remove button from the frame"])