Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-26-18, 10:43 AM   #1
Xancepants
A Deviate Faerie Dragon
Join Date: Oct 2014
Posts: 17
Increase OOR Alpha/Fade Transparency for Raid Frames?

Hello All!
Was wondering if anybody could help with a bit of Lua code that can Increase the Alpha / Fade Transparency of the Blizzard Raid Frames, for raid members that are out of the 40yd Spell Range? Found a number of addons out there that can achieve this, but am trying to avoid DL'ing addons as much as possible.


I found this bit of Lua which does work, but it keeps throwing errors for some reason?

Lua Code:
  1. --[Change Raid Frame OOR Fade/Alpha Transparency]
  2. hooksecurefunc("CompactUnitFrame_UpdateInRange",function(frame)
  3.     local inRange,checkedRange = UnitInRange(frame.displayedUnit)
  4.     if checkedRange and not inRange then
  5.         frame.background:SetAlpha(0.3)
  6.         frame:SetAlpha(0.3)
  7.     else
  8.         frame.background:SetAlpha(1)
  9.         frame:SetAlpha(1)
  10.     end
  11. end)


And here is the error that Bug Sack is logging:

802x Custom Settings\Custom Settings.lua:602: attempt to index field 'background' (a nil value)
Custom Settings\Custom Settings.lua:602: in function <Custom Settings\Custom Settings.lua:596>


Any help is appreciated, thank you in advance!

Last edited by Xancepants : 05-26-18 at 10:50 AM. Reason: Added Error Log
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Increase OOR Alpha/Fade Transparency for Raid Frames?


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