bypass target animation on clickcast

This commit is contained in:
shagu
2016-09-29 22:07:16 +02:00
parent e6364ace64
commit 9b851402ce
2 changed files with 13 additions and 4 deletions
+5 -1
View File
@@ -132,10 +132,11 @@ pfUI:RegisterModule("raid", function ()
DropItemOnUnit("raid" .. this.id);
else
TargetUnit("raid" .. this.id);
-- clickcast: Shift-modifier
-- 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"
TargetLastTarget()
return
end
@@ -143,6 +144,7 @@ pfUI:RegisterModule("raid", function ()
elseif IsAltKeyDown() then
if pfUI_config.unitframes.raid.clickcast_alt ~= "" then
CastSpellByName(pfUI_config.unitframes.raid.clickcast_alt)
pfUI.uf.target.noanim = "yes"
TargetLastTarget()
return
end
@@ -150,6 +152,7 @@ pfUI:RegisterModule("raid", function ()
elseif IsControlKeyDown() then
if pfUI_config.unitframes.raid.clickcast_ctrl ~= "" then
CastSpellByName(pfUI_config.unitframes.raid.clickcast_ctrl)
pfUI.uf.target.noanim = "yes"
TargetLastTarget()
return
end
@@ -157,6 +160,7 @@ pfUI:RegisterModule("raid", function ()
else
if pfUI_config.unitframes.raid.clickcast ~= "" then
CastSpellByName(pfUI_config.unitframes.raid.clickcast)
pfUI.uf.target.noanim = "yes"
TargetLastTarget()
return
else
+8 -3
View File
@@ -68,7 +68,6 @@ pfUI:RegisterModule("target", function ()
pfUI.uf.target.hp.lootIcon:Hide()
end
if event == "PLAYER_TARGET_CHANGED" or event == "PLAYER_ENTERING_WORLD" then
pfUI.uf.target.power.bar:SetValue(0)
pfUI.uf.target.hp.bar:SetValue(0)
@@ -162,7 +161,9 @@ pfUI:RegisterModule("target", function ()
local hpReal = pfUI.uf.target.hpReal
local hpDiff = abs(hpReal - hpDisplay)
if hpDisplay < hpReal then
if pfUI.uf.target.noanim == "yes" then
pfUI.uf.target.hp.bar:SetValue(hpReal)
elseif hpDisplay < hpReal then
pfUI.uf.target.hp.bar:SetValue(hpDisplay + ceil(hpDiff / pfUI_config.unitframes.animation_speed))
elseif hpDisplay > hpReal then
pfUI.uf.target.hp.bar:SetValue(hpDisplay - ceil(hpDiff / pfUI_config.unitframes.animation_speed))
@@ -172,11 +173,15 @@ pfUI:RegisterModule("target", function ()
local powerReal = pfUI.uf.target.powerReal
local powerDiff = abs(powerReal - powerDisplay)
if powerDisplay < powerReal then
if pfUI.uf.target.noanim == "yes" then
pfUI.uf.target.power.bar:SetValue(powerReal)
elseif powerDisplay < powerReal then
pfUI.uf.target.power.bar:SetValue(powerDisplay + ceil(powerDiff / pfUI_config.unitframes.animation_speed))
elseif powerDisplay > powerReal then
pfUI.uf.target.power.bar:SetValue(powerDisplay - ceil(powerDiff / pfUI_config.unitframes.animation_speed))
end
pfUI.uf.target.noanim = "no"
end)
pfUI.uf.target.hp = CreateFrame("Frame",nil, pfUI.uf.target)