promotional bannermobile promotional banner
premium banner
Range element for Haste's oUF unit frames that works for non-group members.

Description

oUF SpellRange is an element plug-in for Haste's oUF unit frame framework that fades unit frames when out of casting range.  Unlike the default oUF range fading, SpellRange works for any hostile or friendly targets, rather than group members only.  You must have oUF and a compatible layout for oUF SpellRange to do anything.

Usage

The settings for implementing SpellRange are intentionally the same as the default Range element, because the two elements cannot work together.  SpellRange will disable the Range element for frames where both are enabled.

To enable the SpellRange element:

self.SpellRange = {
	… <font color="LimeGreen">-- At least one set of required properties, listed below</font>
};

Either of the following sets of properties is required:

  • <font color="LimeGreen">--- Takes priority over .insideRange/.outsideRange, and fires when changing between them.</font>
    function self.SpellRange.Update( self, InRange )
    	…
    end

    OR

  • self.SpellRange.insideAlpha = 1.0; <font color="LimeGreen">-- Frame alpha when in range</font>
    self.SpellRange.outsideAlpha = 0.4; <font color="LimeGreen">-- Frame alpha when out of range</font>

Don't forget to add oUF_SpellRange as an optional dependency of your layout.

Note: SpellRange is necessarily slower than the default Range element, so use it with caution for large groups like raids or parties.  The default Range element will always work for "player", "pet", and any unit that passes UnitPlayerOrPetInParty/UnitPlayerOrPetInRaid, however it is limited to 38 yard range.