mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-23 20:40:50 +00:00
api: handle escaping within the function
This commit is contained in:
+7
-8
@@ -960,11 +960,10 @@ end
|
|||||||
-- 'layer' [string]
|
-- 'layer' [string]
|
||||||
-- 'arg1' [string]
|
-- 'arg1' [string]
|
||||||
-- return object
|
-- return object
|
||||||
|
|
||||||
-- NOTE: special symbols must be escaped by the SAME symbol!
|
|
||||||
-- e.g. symbol '\': '\\'
|
|
||||||
-- symbol '-': '--'
|
|
||||||
function pfUI.api.GetNoNameObject(frame, objtype, layer, arg1, arg2)
|
function pfUI.api.GetNoNameObject(frame, objtype, layer, arg1, arg2)
|
||||||
|
local arg1 = arg1 and gsub(arg1, "([%+%-%*%(%)%?%[%]%^])", "%%%1")
|
||||||
|
local arg2 = arg2 and gsub(arg2, "([%+%-%*%(%)%?%[%]%^])", "%%%1")
|
||||||
|
|
||||||
local objects
|
local objects
|
||||||
if objtype == "Texture" or objtype == "FontString" then
|
if objtype == "Texture" or objtype == "FontString" then
|
||||||
objects = {frame:GetRegions()}
|
objects = {frame:GetRegions()}
|
||||||
@@ -980,25 +979,25 @@ function pfUI.api.GetNoNameObject(frame, objtype, layer, arg1, arg2)
|
|||||||
if objtype == "Texture" and object.SetTexture and object:GetTexture() ~= "Interface\\BUTTONS\\WHITE8X8" then
|
if objtype == "Texture" and object.SetTexture and object:GetTexture() ~= "Interface\\BUTTONS\\WHITE8X8" then
|
||||||
if arg1 then
|
if arg1 then
|
||||||
local texture = object:GetTexture()
|
local texture = object:GetTexture()
|
||||||
if texture and not string.find(texture, arg1) then check = false end
|
if texture and not string.find(texture, arg1, 1) then check = false end
|
||||||
end
|
end
|
||||||
|
|
||||||
if check then return object end
|
if check then return object end
|
||||||
elseif objtype == "FontString" and object.SetText then
|
elseif objtype == "FontString" and object.SetText then
|
||||||
if arg1 then
|
if arg1 then
|
||||||
local text = object:GetText()
|
local text = object:GetText()
|
||||||
if text and not string.find(text, arg1) then check = false end
|
if text and not string.find(text, arg1, 1) then check = false end
|
||||||
end
|
end
|
||||||
|
|
||||||
if check then return object end
|
if check then return object end
|
||||||
elseif objtype == "Button" and object.GetNormalTexture and object:GetNormalTexture() then
|
elseif objtype == "Button" and object.GetNormalTexture and object:GetNormalTexture() then
|
||||||
if arg1 then
|
if arg1 then
|
||||||
local texture = object:GetNormalTexture():GetTexture()
|
local texture = object:GetNormalTexture():GetTexture()
|
||||||
if texture and not string.find(texture, arg1) then check = false end
|
if texture and not string.find(texture, arg1, 1) then check = false end
|
||||||
end
|
end
|
||||||
if arg2 then
|
if arg2 then
|
||||||
local text = object:GetText()
|
local text = object:GetText()
|
||||||
if text and not string.find(text, arg2) then check = false end
|
if text and not string.find(text, arg2, 1) then check = false end
|
||||||
end
|
end
|
||||||
|
|
||||||
if check then return object end
|
if check then return object end
|
||||||
|
|||||||
@@ -129,8 +129,8 @@ pfUI:RegisterSkin("Mailbox", function ()
|
|||||||
button.icon:SetTexture(tex)
|
button.icon:SetTexture(tex)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
SkinButton(GetNoNameObject(InboxFrame, "Button", nil, "UI--Panel--Button--Up", OPENMAIL))
|
SkinButton(GetNoNameObject(InboxFrame, "Button", nil, "UI-Panel-Button-Up", OPENMAIL))
|
||||||
local button = GetNoNameObject(SendMailFrame, "Button", nil, "UI--Panel--Button--Up", SEND_LABEL) -- this is SendMailMailButton
|
local button = GetNoNameObject(SendMailFrame, "Button", nil, "UI-Panel-Button-Up", SEND_LABEL) -- this is SendMailMailButton
|
||||||
SkinButton(button) -- hack! only it happened to do it
|
SkinButton(button) -- hack! only it happened to do it
|
||||||
button:ClearAllPoints()
|
button:ClearAllPoints()
|
||||||
button:SetPoint("RIGHT", SendMailCancelButton, "LEFT", -2*bpad, 0)
|
button:SetPoint("RIGHT", SendMailCancelButton, "LEFT", -2*bpad, 0)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ pfUI:RegisterSkin("Options - Interface", function ()
|
|||||||
UIOptionsFrame.backdrop:SetPoint("BOTTOMRIGHT", 0, 50)
|
UIOptionsFrame.backdrop:SetPoint("BOTTOMRIGHT", 0, 50)
|
||||||
UIOptionsFrame:SetHitRectInsets(0,0,0,50)
|
UIOptionsFrame:SetHitRectInsets(0,0,0,50)
|
||||||
|
|
||||||
local close = GetNoNameObject(UIOptionsFrame, "Button", nil, "UI--Panel--MinimizeButton--Up")
|
local close = GetNoNameObject(UIOptionsFrame, "Button", nil, "UI-Panel-MinimizeButton-Up")
|
||||||
|
|
||||||
-- increase button layer
|
-- increase button layer
|
||||||
UIOptionsFrameTab1:SetFrameLevel(8)
|
UIOptionsFrameTab1:SetFrameLevel(8)
|
||||||
|
|||||||
Reference in New Issue
Block a user