mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-29 18:56:02 +00:00
mouseover: introducing mouseover casts
This commit is contained in:
@@ -56,6 +56,9 @@ The term "*pfui!*" is german and simply stands for "*pooh!*", because I'm not a
|
||||
big fan of creating configuration UI's especially not via the Wow-API
|
||||
(you might have noticed that in ShaguUI).
|
||||
|
||||
**How can I enable mouseover cast?**
|
||||
Create a macro with "/pfcast SPELLNAME".
|
||||
|
||||
**How can I checkout the current state?**
|
||||
See Installation Section. But be aware that things might not work for you.
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
pfUI:RegisterModule("mouseover", function ()
|
||||
pfUI.uf.mouseover = CreateFrame("Frame", "pfMouseOver", UIParent)
|
||||
|
||||
SLASH_PFCAST1, SLASH_LPFCAST2 = "/pfcast", "/pfmouse"
|
||||
function SlashCmdList.PFCAST(msg, editbox)
|
||||
local oldt = true
|
||||
local unit = "mouseover"
|
||||
if not UnitExists(unit) then
|
||||
local frame = GetMouseFocus()
|
||||
if frame.label and frame.id then
|
||||
unit = frame.label .. frame.id
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if UnitIsUnit("target", unit) then oldt = nil end
|
||||
|
||||
TargetUnit(unit)
|
||||
CastSpellByName(msg)
|
||||
|
||||
if oldt then TargetLastTarget() end
|
||||
end
|
||||
end)
|
||||
@@ -8,6 +8,8 @@ pfUI:RegisterModule("pet", function ()
|
||||
end
|
||||
|
||||
pfUI.uf.pet = CreateFrame("Button","pfPet",UIParent)
|
||||
pfUI.uf.pet.label = "pet"
|
||||
pfUI.uf.pet.id = ""
|
||||
pfUI.uf.pet:SetFrameStrata("LOW")
|
||||
pfUI.uf.pet:SetWidth(100)
|
||||
pfUI.uf.pet:SetHeight(20 + 2*default_border + pfUI_config.unitframes.pet.pspace)
|
||||
|
||||
@@ -11,6 +11,8 @@ pfUI:RegisterModule("player", function ()
|
||||
PlayerFrame:UnregisterAllEvents()
|
||||
|
||||
pfUI.uf.player = CreateFrame("Button","pfPlayer",UIParent)
|
||||
pfUI.uf.player.label = "player"
|
||||
pfUI.uf.player.id = ""
|
||||
pfUI.uf.player:SetFrameStrata("LOW")
|
||||
pfUI.uf.player:SetWidth(pfUI_config.unitframes.player.width)
|
||||
pfUI.uf.player:SetHeight(pfUI_config.unitframes.player.height + pfUI_config.unitframes.player.pheight + 2*default_border + pfUI_config.unitframes.player.pspace)
|
||||
|
||||
@@ -16,6 +16,8 @@ pfUI:RegisterModule("target", function ()
|
||||
ComboFrame:UnregisterAllEvents()
|
||||
|
||||
pfUI.uf.target = CreateFrame("Button","pfTarget",UIParent)
|
||||
pfUI.uf.target.label = "target"
|
||||
pfUI.uf.target.id = ""
|
||||
pfUI.uf.target:SetFrameStrata("LOW")
|
||||
pfUI.uf.target:Hide()
|
||||
pfUI.uf.target:SetWidth(pfUI_config.unitframes.target.width)
|
||||
|
||||
@@ -17,6 +17,8 @@ pfUI:RegisterModule("targettarget", function ()
|
||||
end)
|
||||
|
||||
pfUI.uf.targettarget = CreateFrame("Button","pfTargetTarget",UIParent)
|
||||
pfUI.uf.targettarget.label = "targettarget"
|
||||
pfUI.uf.targettarget.id = ""
|
||||
pfUI.uf.targettarget:SetFrameStrata("LOW")
|
||||
pfUI.uf.targettarget:SetWidth(100)
|
||||
pfUI.uf.targettarget:SetHeight(20 + 2*default_border + pfUI_config.unitframes.ttarget.pspace)
|
||||
|
||||
Reference in New Issue
Block a user