Skip to content

Instantly share code, notes, and snippets.

@nefftd
Created August 15, 2014 20:57
Show Gist options
  • Save nefftd/9b9661edd7171f5a91c7 to your computer and use it in GitHub Desktop.
Save nefftd/9b9661edd7171f5a91c7 to your computer and use it in GitHub Desktop.
local scaler = CreateFrame('frame', nil, WorldFrame, 'SecureHandlerStateTemplate')
scaler:SetAllPoints()
scaler:Execute('Children = newtable()')
scaler:SetFrameRef('PlayerFrame', PlayerFrame)
scaler:SetAttribute('_onstate-mousestate', ([[ -- Resizes clickable area of all nameplates on mouseover
print('RUN')
if newstate == 'on' then
local prevNum = #Children
wipe(Children)
local PlayerFrame = self:GetFrameRef('PlayerFrame')
self:GetParent():GetChildList(Children)
print(#Children) local n = 0
for i, f in pairs(Children) do
if strmatch(f:GetName() or '', '^NamePlate%d+$') then
--f:SetScale(0.6)
f:SetWidth(%d) f:SetHeight(%d)
n = n + 1
end
end
print('SETSIZE on '..n..' items')
end
]]):format(unpack(psize)))
RegisterStateDriver(scaler, 'mousestate', '[@mouseover,exists] on; off;')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment