View Single Post
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