Commit a33a9fd0 authored by Blazeflack's avatar Blazeflack

Added first custom tag to the collection: "num:targeting"

parent 970403b8
## Interface: 60200
## Author: Blazeflack
## Version: 1.00
## Version: 1.01
## Title: |cff1784d1ElvUI|r |cff4beb2cCustomTags|r
## Notes: A collection of custom unitframe tags requested by users.
## RequiredDeps: ElvUI
......
......@@ -10,8 +10,26 @@ local unpack, pairs = unpack, pairs
local twipe = table.wipe
local ceil, sqrt, floor = math.ceil, math.sqrt, math.floor
local format = string.format
--WoW API
local IsInGroup = IsInGroup
local IsInRaid = IsInRaid
local UnitIsUnit = UnitIsUnit
--[[
Add custom tags below this block
--]]
ElvUF.Tags.Events['num:targeting'] = "UNIT_TARGET PLAYER_TARGET_CHANGED GROUP_ROSTER_UPDATE"
ElvUF.Tags.Methods['num:targeting'] = function(unit)
if not IsInGroup() then return "" end
local targetedByNum = 0
for i = 1, GetNumGroupMembers() do
local groupUnit = (IsInRaid() and "raid"..i or "party"..i);
if (UnitIsUnit(groupUnit.."target", unit) and not UnitIsUnit(groupUnit, "player")) or UnitIsUnit("playertarget", unit) then
targetedByNum = targetedByNum + 1
end
end
return (targetedByNum > 0 and targetedByNum or "")
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment