Thread Tools Display Modes
05-23-15, 10:36 AM   #1
Naisz
A Deviate Faerie Dragon
 
Naisz's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 12
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!
  Reply With Quote
05-23-15, 12:32 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Are you just calling the function that one time as the file is loaded?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » sFilter Customization

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off