api: update StripTextures

add layer argument
fix hide argument
This commit is contained in:
Artur Morozov
2019-03-31 14:59:21 +02:00
committed by shagu
parent 62c694df95
commit e21207784a
+13 -6
View File
@@ -391,13 +391,20 @@ end
-- [ StripTextures ]
-- Strips all textures off a frame.
-- 'frame' [frame] the frame that should be stripped.
function pfUI.api.StripTextures(frame, hide)
for i,v in ipairs({frame:GetRegions()}) do
-- 'frame' [frame] the frame that should be stripped.
-- 'layer' [string] texture layer.
function pfUI.api.StripTextures(frame, hide, layer)
for _,v in ipairs({frame:GetRegions()}) do
if v.SetTexture then
v:SetTexture(nil)
if hide then
v:Hide()
local check = true
if layer and v:GetDrawLayer() ~= layer then check = false end
if check then
if hide then
v:Hide()
else
v:SetTexture(nil)
end
end
end
end