mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 18:36:01 +00:00
focus: add swapfocus command
This commit is contained in:
@@ -31,6 +31,7 @@ This is **not** an addon-pack like [ShaguUI](http://shagu.org/ShaguUI/), however
|
||||
/focus Creates a Focus-Frame for the current target
|
||||
/castfocus Same as /cast but for focus frame
|
||||
/clearfocus Clears the Focus-Frame
|
||||
/swapfocus Toggle Focus and Target-Frame
|
||||
/abp Addon Button Panel
|
||||
|
||||
## Languages
|
||||
|
||||
+14
-2
@@ -1,4 +1,4 @@
|
||||
SLASH_PFFOCUS1 = '/focus'
|
||||
SLASH_PFFOCUS1, SLASH_PFFOCUS2 = '/focus', '/pffocus'
|
||||
function SlashCmdList.PFFOCUS(msg)
|
||||
if not pfUI.uf or not pfUI.uf.focus then return end
|
||||
|
||||
@@ -13,7 +13,7 @@ function SlashCmdList.PFFOCUS(msg)
|
||||
end
|
||||
end
|
||||
|
||||
SLASH_PFCLEARFOCUS1 = '/clearfocus'
|
||||
SLASH_PFCLEARFOCUS1, SLASH_PFCLEARFOCUS2 = '/clearfocus', '/pfclearfocus'
|
||||
function SlashCmdList.PFCLEARFOCUS(msg)
|
||||
if pfUI.uf and pfUI.uf.focus then
|
||||
pfUI.uf.focus:Hide()
|
||||
@@ -65,6 +65,18 @@ function SlashCmdList.PFCASTFOCUS(msg)
|
||||
end
|
||||
end
|
||||
|
||||
SLASH_PFSWAPFOCUS1, SLASH_PFSWAPFOCUS2 = '/swapfocus', '/pfswapfocus'
|
||||
function SlashCmdList.PFSWAPFOCUS(msg)
|
||||
if not pfUI.uf or not pfUI.uf.focus then return end
|
||||
|
||||
local oldunit = UnitExists("target") and strlower(UnitName("target"))
|
||||
if oldunit and pfUI.uf.focus.unitname then
|
||||
TargetByName(pfUI.uf.focus.unitname)
|
||||
pfUI.uf.focus.unitname = oldunit
|
||||
pfUI.uf.focus:Show()
|
||||
end
|
||||
end
|
||||
|
||||
pfUI:RegisterModule("focus", function ()
|
||||
-- do not go further on disabled UFs
|
||||
if C.unitframes.disable == "1" then return end
|
||||
|
||||
Reference in New Issue
Block a user