From 9b851402ce364ea300ef07718974be69b976d24e Mon Sep 17 00:00:00 2001 From: shagu Date: Thu, 29 Sep 2016 22:07:16 +0200 Subject: [PATCH] bypass target animation on clickcast --- modules/raid.lua | 6 +++++- modules/target.lua | 11 ++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/raid.lua b/modules/raid.lua index bd024879..644a85bc 100644 --- a/modules/raid.lua +++ b/modules/raid.lua @@ -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 diff --git a/modules/target.lua b/modules/target.lua index f3c9c5a9..ba172b52 100644 --- a/modules/target.lua +++ b/modules/target.lua @@ -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)