Skip to content

Commit

Permalink
Added Custom FramePools too
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Jul 27, 2024
1 parent 2669485 commit ff4aae0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Aptechka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4625,7 +4625,7 @@ do
end

function Aptechka:CreateDebuffTooltips()
local tooltipPool = CreateFramePool("GameTooltip", UIParent, "GameTooltipTemplate")
local tooltipPool = helpers.CreateFramePool("GameTooltip", UIParent, "GameTooltipTemplate")
tooltipPool.resetterFunc = Tooltip_resetterFunc
tooltipPool.creationFunc = Tooltip_creationFunc
self.tooltipPool = tooltipPool
Expand Down
11 changes: 10 additions & 1 deletion helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -894,4 +894,13 @@ function helpers.CreateTexturePool(parent, layer, subLayer, textureTemplate, res
texturePool.resetterFunc = TextureDefaultReset

return texturePool;
end
end

function helpers.CreateFramePool(frameType, parent, frameTemplate, resetterFunc)
local framePool = setmetatable({}, { __index = ObjectPool })
framePool:Init(parent)
framePool.frameType = frameType;
framePool.frameTemplate = frameTemplate;
framePool.resetterFunc = resetterFunc or Pool_HideAndClearAnchors
return framePool
end

0 comments on commit ff4aae0

Please sign in to comment.