LibRangeCheck-2.0
From WowAce Wiki
| Summary | |
|---|---|
| Lib: RangeCheck-2.0 | |
| A library to determine estimated range. | |
| TOC | 2.4 (20400) |
| Category | Libraries |
| Author | mitch0 |
| Details | |
| Version | 2.0 |
| Links | |
| Betas | Ace SVN Zip |
| Changelog | FishEye |
Contents |
[edit]
:getRange(unit [, checkVisible])
Find the estimated range to unit.
[edit]
Args
- unit
- string - The unit to measure distance to, like "target" or "mouseover"
- checkVisible
- boolean - If set, a UnitIsVisible() check will also be done (so max range will be ~100 yd)
[edit]
Returns
number, number - The range estimate as minRange, maxRange. minRange, nil if out of range, nil if invalid target.
[edit]
Remarks
Melee range is returned as 0, 5.
[edit]
Example
local rc = LibStub("LibRangeCheck-2.0")
local minRange, maxRange = rc:getRange("target")
[edit]
:getRangeAsString(unit [, checkVisible, showOutOfRange])
Find the range estimate to unit, returned as a formatted string, like "20 - 28".
[edit]
Args
- unit
- string - The unit to measure distance to, like "target" or "mouseover".
- checkVisible
- boolean - If set, a UnitIsVisible() check will also be done (so max range will be ~100 yd)
- showOutOfRange
- boolean - If set, out of range will be returned as "minRange +", otherwise it'll be returned as nil
[edit]
Returns
string - The range estimate as a string formatted like "minRange - maxRange". Nil if the unit is invalid (dead, nonexistent, etc).
[edit]
Example
local rc = LibStub("LibRangeCheck-2.0")
local range = rc:getRangeAsString("target")
[edit]
:init(forced)
Initialize the library, parse spell ranges, build checker tables.
[edit]
Args
- forced
- boolean - force an init even if the lib has been initialized before
[edit]
Returns
none
[edit]
Remarks
This method is called whenever necessary by the library, end users should not need to call it. It is called whenever talents are changed or new spells are learnt.
[edit]
Example
local rc = LibStub("LibRangeCheck-2.0")
local rc:init(true) -- force a re-init

