WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   sFilter Customization (https://www.wowinterface.com/forums/showthread.php?t=52332)

Naisz 05-23-15 10:36 AM

sFilter Customization
 
Hey dear PPL on here!

Some Days ago i had to discover that WeakAuras is to Strong for my Computer, so i made the plan to customise sFilter to my liking.
I wanted to give an option to show icons desaturated when not applied to my target ...
So i edited some code:

config-file (gray=true indicated that the spell should be shown desaturated when not applied)
Lua Code:
  1. {spellId = 774 ,size = 32, unitId = "target", gray=true, isMine = 1, filter="HELPFUL", setPoint = {"CENTER",UiParent,"Center",slot1,firstrow}},


Lua Code:
  1. local affectingCombat = UnitAffectingCombat("player");
  2.  
  3. ...
  4.  
  5. if(not self.found) then
  6. if data.gray == true and (not duration) and affectingCombat then
  7.                     self.icon:SetTexture(spellIcon)
  8.                     self.count:SetText("")
  9.                     self.cooldown:Show()
  10.                     self:SetAlpha(.5)
  11.                 else
  12.                     self:SetAlpha(0)
  13.                     self.icon:SetTexture(spellIcon)
  14.                     self.count:SetText("")
  15.                     self.cooldown:Hide()
  16.                 end
My knowledge in programming explains it to me like If not applied && gray=true && no duration(nearly the same as not applied && UnitAffectingCombat("player") then show icon at .5 Alpha otherwise don't show at all.

For some reason the UnitAffectingCombat doesn't fire at all. So whenever i log in, the spells are shown at .5 Alpha. In Combat, the duration is shown when i change target, which somehow is nice (e.g. on Lifebloom). But what really bothers me, is that it is shown although i'm not in combat.

Anyone know an explanation why the UnitAffectingCombat isn't working?

greetings!

Seerah 05-23-15 12:32 PM

Are you just calling the function that one time as the file is loaded? ;)


All times are GMT -6. The time now is 09:36 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI