diff --git a/.luacheckrc b/.luacheckrc index 8897a486..62e10fe5 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -11,6 +11,7 @@ ignore = { '312/event', -- unused value of argument event '312/unit', -- unused value of argument unit '431', -- shadowing an upvalue + '614', -- trailing whitespace in comment (which is valid markdown for our docs) '631', -- line is too long } diff --git a/ouf.lua b/ouf.lua index 47b1985c..4eae223b 100644 --- a/ouf.lua +++ b/ouf.lua @@ -302,16 +302,6 @@ local function initObject(unit, style, styleFunc, header, ...) object:SetAttribute('*type2', 'togglemenu') object:SetAttribute('toggleForVehicle', true) - --[[ frame.IsPingable - This boolean can be set to false to disable the frame from being pingable. Enabled by default. - --]] - --[[ Override: frame:GetContextualPingType() - Used to define which contextual ping is used for the frame. - - By default this wraps `C_Ping.GetContextualPingTypeForUnit(UnitGUID(frame.unit))`. - --]] - object:SetAttribute('ping-receiver', true) - if(isEventlessUnit(objectUnit)) then oUF:HandleEventlessUnit(object) else @@ -356,8 +346,6 @@ local function initObject(unit, style, styleFunc, header, ...) func(object) end - Mixin(object, PingableType_UnitFrameMixin) - -- Make Clique kinda happy if(not object.isNamePlate) then _G.ClickCastFrames = _G.ClickCastFrames or {} @@ -606,8 +594,6 @@ do frame:SetAttribute('*type1', 'target') frame:SetAttribute('*type2', 'togglemenu') frame:SetAttribute('oUF-guessUnit', unit) - - frame:SetAttribute('ping-receiver', true) end local body = header:GetAttribute('oUF-initialConfigFunction') @@ -638,7 +624,7 @@ do for possible values. In addition to the standard group headers, oUF implements some of its own attributes. These can be supplied by the - layout, but are optional. + layout, but are optional. PingableUnitFrameTemplate is inherited for Ping support. * oUF-initialConfigFunction - can contain code that will be securely run at the end of the initial secure configuration (string?) @@ -653,7 +639,7 @@ do local name = overrideName or generateName(nil, ...) local header = CreateFrame('Frame', name, PetBattleFrameHider, template) - header:SetAttribute('template', 'SecureUnitButtonTemplate, SecureHandlerStateTemplate, SecureHandlerEnterLeaveTemplate') + header:SetAttribute('template', 'SecureUnitButtonTemplate, SecureHandlerStateTemplate, SecureHandlerEnterLeaveTemplate, PingableUnitFrameTemplate') for i = 1, select('#', ...), 2 do local att, val = select(i, ...) if(not att) then break end @@ -732,7 +718,8 @@ Used to create a single unit frame and apply the currently active style to it. * overrideName - unique global name to use for the unit frame. Defaults to an auto-generated name based on the unit (string?) -oUF implements some of its own attributes. These can be supplied by the layout, but are optional. +oUF implements some of its own attributes. These can be supplied by the layout, but are optional. +PingableUnitFrameTemplate is inherited for Ping support. * oUF-enableArenaPrep - can be used to toggle arena prep support. Defaults to true (boolean) --]] @@ -743,7 +730,7 @@ function oUF:Spawn(unit, overrideName) unit = unit:lower() local name = overrideName or generateName(unit) - local object = CreateFrame('Button', name, PetBattleFrameHider, 'SecureUnitButtonTemplate') + local object = CreateFrame('Button', name, PetBattleFrameHider, 'SecureUnitButtonTemplate, PingableUnitFrameTemplate') Private.UpdateUnits(object, unit) self:DisableBlizzard(unit) @@ -764,6 +751,8 @@ Used to create nameplates and apply the currently active style to them. the callback are the updated nameplate, if any, the event that triggered the update, and the new unit (function?) * variables - list of console variable-value pairs to be set when the player logs in (table?) + +PingableUnitFrameTemplate is inherited for Ping support. --]] function oUF:SpawnNamePlates(namePrefix, nameplateCallback, nameplateCVars) argcheck(nameplateCallback, 3, 'function', 'nil') @@ -820,7 +809,7 @@ function oUF:SpawnNamePlates(namePrefix, nameplateCallback, nameplateCVars) if(not nameplate.unitFrame) then nameplate.style = style - nameplate.unitFrame = CreateFrame('Button', prefix..nameplate:GetName(), nameplate) + nameplate.unitFrame = CreateFrame('Button', prefix..nameplate:GetName(), nameplate, 'PingableUnitFrameTemplate') nameplate.unitFrame:EnableMouse(false) nameplate.unitFrame.isNamePlate = true