mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 14:00:48 +00:00
focus: add /clearfocus command
This commit is contained in:
@@ -1,3 +1,25 @@
|
|||||||
|
SLASH_PFFOCUS1 = '/focus'
|
||||||
|
function SlashCmdList.PFFOCUS(msg)
|
||||||
|
if not pfUI.uf or not pfUI.uf.focus then return end
|
||||||
|
|
||||||
|
if msg ~= "" then
|
||||||
|
pfUI.uf.focus:Show()
|
||||||
|
pfUI.uf.focus.unitname = strlower(msg)
|
||||||
|
elseif UnitName("target") then
|
||||||
|
pfUI.uf.focus:Show()
|
||||||
|
pfUI.uf.focus.unitname = strlower(UnitName("target"))
|
||||||
|
else
|
||||||
|
pfUI.uf.focus:Hide()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
SLASH_PFCLEARFOCUS1 = '/clearfocus'
|
||||||
|
function SlashCmdList.PFCLEARFOCUS(msg)
|
||||||
|
if pfUI.uf and pfUI.uf.focus then
|
||||||
|
pfUI.uf.focus:Hide()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
pfUI:RegisterModule("focus", function ()
|
pfUI:RegisterModule("focus", function ()
|
||||||
-- do not go further on disabled UFs
|
-- do not go further on disabled UFs
|
||||||
if C.unitframes.disable == "1" then return end
|
if C.unitframes.disable == "1" then return end
|
||||||
|
|||||||
@@ -17,19 +17,6 @@ function SlashCmdList.GM(msg, editbox)
|
|||||||
ToggleHelpFrame(1)
|
ToggleHelpFrame(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
SLASH_PFFOCUS1 = '/focus'
|
|
||||||
function SlashCmdList.PFFOCUS(msg)
|
|
||||||
if msg ~= "" then
|
|
||||||
pfUI.uf.focus:Show()
|
|
||||||
pfUI.uf.focus.unitname = strlower(msg)
|
|
||||||
elseif UnitName("target") then
|
|
||||||
pfUI.uf.focus:Show()
|
|
||||||
pfUI.uf.focus.unitname = strlower(UnitName("target"))
|
|
||||||
else
|
|
||||||
pfUI.uf.focus:Hide()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
pfUI = CreateFrame("Frame",nil,UIParent)
|
pfUI = CreateFrame("Frame",nil,UIParent)
|
||||||
pfUI:RegisterEvent("ADDON_LOADED")
|
pfUI:RegisterEvent("ADDON_LOADED")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user