mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 20:20:01 +00:00
unitframes: add support for clickcast
This commit is contained in:
+11
-5
@@ -76,11 +76,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", nil, "animation_speed", "5")
|
||||
pfUI:UpdateConfig("unitframes", nil, "portraitalpha", "0.1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "portraittexture", "1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", nil, "buff_size", "20") -- TODO migrate, deprecated
|
||||
pfUI:UpdateConfig("unitframes", nil, "debuff_size", "20") -- TODO migrate, deprecated
|
||||
pfUI:UpdateConfig("unitframes", nil, "layout", "default")
|
||||
pfUI:UpdateConfig("unitframes", nil, "globalclick", "0")
|
||||
|
||||
-- pfUI:UpdateConfig("unitframes", nil, "buff_size", "20") -- TODO migrate, deprecated
|
||||
-- pfUI:UpdateConfig("unitframes", nil, "debuff_size", "20") -- TODO migrate, deprecated
|
||||
|
||||
pfUI:UpdateConfig("unitframes", nil, "show_hots", "0")
|
||||
pfUI:UpdateConfig("unitframes", nil, "all_hots", "0")
|
||||
@@ -105,6 +104,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "player", "invert_healthbar", "0")
|
||||
pfUI:UpdateConfig("unitframes", "player", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "player", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "player", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "player", "txtleft", "unit")
|
||||
pfUI:UpdateConfig("unitframes", "player", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "player", "txtright", "healthdyn")
|
||||
@@ -125,6 +125,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "target", "invert_healthbar", "0")
|
||||
pfUI:UpdateConfig("unitframes", "target", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "target", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "target", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "target", "txtleft", "unit")
|
||||
pfUI:UpdateConfig("unitframes", "target", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "target", "txtright", "healthdyn")
|
||||
@@ -142,11 +143,11 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "group", "invert_healthbar", "0")
|
||||
pfUI:UpdateConfig("unitframes", "group", "buff_indicator", "1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "debuff_indicator", "1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "group", "txtleft", "unit")
|
||||
pfUI:UpdateConfig("unitframes", "group", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "group", "txtright", "healthmiss")
|
||||
pfUI:UpdateConfig("unitframes", "group", "hide_in_raid", "0")
|
||||
pfUI:UpdateConfig("unitframes", "group", "clickcast", "0")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "portrait", "off")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "width", "120")
|
||||
@@ -160,6 +161,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "invert_healthbar", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "txtleft", "unit")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "txtright", "healthperc")
|
||||
@@ -176,6 +178,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "invert_healthbar", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "txtleft", "unit")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "txtright", "healthperc")
|
||||
@@ -192,6 +195,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "raid", "invert_healthbar", "0")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "buff_indicator", "1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "debuff_indicator", "1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "txtleft", "name")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "txtright", "healthmiss")
|
||||
@@ -208,6 +212,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "invert_healthbar", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "txtleft", "none")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "txtcenter", "name")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "txtright", "none")
|
||||
@@ -224,6 +229,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "pet", "invert_healthbar", "0")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "txtleft", "none")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "txtcenter", "name")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "txtright", "none")
|
||||
|
||||
+29
-41
@@ -889,50 +889,38 @@ function pfUI.uf:ClickAction(button)
|
||||
-- default click
|
||||
TargetUnit(unitstr)
|
||||
|
||||
-- break here if party frame and no clickcast is activated
|
||||
if label == "party" and pfUI_config.unitframes.group.clickcast == "0" and pfUI_config.unitframes.globalclick == "0" then
|
||||
return
|
||||
end
|
||||
if this.config.clickcast == "1" then
|
||||
-- clickcast: shift modifier
|
||||
if IsShiftKeyDown() then
|
||||
if pfUI_config.unitframes.clickcast_shift ~= "" then
|
||||
CastSpellByName(pfUI_config.unitframes.clickcast_shift)
|
||||
if not tswitch then TargetLastTarget() end
|
||||
return
|
||||
end
|
||||
|
||||
-- break here for non-party and non-raid frames without clickcast
|
||||
if label ~= "raid" and label ~= "party" and pfUI_config.unitframes.globalclick == "0" then
|
||||
return
|
||||
end
|
||||
-- clickcast: alt modifier
|
||||
elseif IsAltKeyDown() then
|
||||
if pfUI_config.unitframes.clickcast_alt ~= "" then
|
||||
CastSpellByName(pfUI_config.unitframes.clickcast_alt)
|
||||
if not tswitch then TargetLastTarget() end
|
||||
return
|
||||
end
|
||||
|
||||
-- clickcast: shift modifier
|
||||
if IsShiftKeyDown() then
|
||||
if pfUI_config.unitframes.raid.clickcast_shift ~= "" then
|
||||
CastSpellByName(pfUI_config.unitframes.raid.clickcast_shift)
|
||||
pfUI.uf.target.noanim = "yes"
|
||||
if not tswitch then TargetLastTarget() end
|
||||
return
|
||||
end
|
||||
-- clickcast: ctrl modifier
|
||||
elseif IsControlKeyDown() then
|
||||
if pfUI_config.unitframes.clickcast_ctrl ~= "" then
|
||||
CastSpellByName(pfUI_config.unitframes.clickcast_ctrl)
|
||||
if not tswitch then TargetLastTarget() end
|
||||
return
|
||||
end
|
||||
|
||||
-- clickcast: alt modifier
|
||||
elseif IsAltKeyDown() then
|
||||
if pfUI_config.unitframes.raid.clickcast_alt ~= "" then
|
||||
CastSpellByName(pfUI_config.unitframes.raid.clickcast_alt)
|
||||
pfUI.uf.target.noanim = "yes"
|
||||
if not tswitch then TargetLastTarget() end
|
||||
return
|
||||
end
|
||||
|
||||
-- clickcast: ctrl modifier
|
||||
elseif IsControlKeyDown() then
|
||||
if pfUI_config.unitframes.raid.clickcast_ctrl ~= "" then
|
||||
CastSpellByName(pfUI_config.unitframes.raid.clickcast_ctrl)
|
||||
pfUI.uf.target.noanim = "yes"
|
||||
if not tswitch then TargetLastTarget() end
|
||||
return
|
||||
end
|
||||
|
||||
-- clickcast: default
|
||||
else
|
||||
if pfUI_config.unitframes.raid.clickcast ~= "" then
|
||||
CastSpellByName(pfUI_config.unitframes.raid.clickcast)
|
||||
pfUI.uf.target.noanim = "yes"
|
||||
if not tswitch then TargetLastTarget() end
|
||||
return
|
||||
-- clickcast: default
|
||||
else
|
||||
if pfUI_config.unitframes.clickcast ~= "" then
|
||||
CastSpellByName(pfUI_config.unitframes.clickcast)
|
||||
if not tswitch then TargetLastTarget() end
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user