diff --git a/api/api.lua b/api/api.lua index aa1af04b..64e7dd33 100644 --- a/api/api.lua +++ b/api/api.lua @@ -960,11 +960,10 @@ end -- 'layer' [string] -- 'arg1' [string] -- 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) + local arg1 = arg1 and gsub(arg1, "([%+%-%*%(%)%?%[%]%^])", "%%%1") + local arg2 = arg2 and gsub(arg2, "([%+%-%*%(%)%?%[%]%^])", "%%%1") + local objects if objtype == "Texture" or objtype == "FontString" then 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 arg1 then 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 if check then return object end elseif objtype == "FontString" and object.SetText then if arg1 then 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 if check then return object end elseif objtype == "Button" and object.GetNormalTexture and object:GetNormalTexture() then if arg1 then 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 if arg2 then 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 if check then return object end diff --git a/skins/blizzard/mail.lua b/skins/blizzard/mail.lua index 925d48b1..19830f1d 100644 --- a/skins/blizzard/mail.lua +++ b/skins/blizzard/mail.lua @@ -129,8 +129,8 @@ pfUI:RegisterSkin("Mailbox", function () button.icon:SetTexture(tex) end end - 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 + 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 SkinButton(button) -- hack! only it happened to do it button:ClearAllPoints() button:SetPoint("RIGHT", SendMailCancelButton, "LEFT", -2*bpad, 0) diff --git a/skins/blizzard/options-interface.lua b/skins/blizzard/options-interface.lua index 453e3f50..9a836a65 100644 --- a/skins/blizzard/options-interface.lua +++ b/skins/blizzard/options-interface.lua @@ -18,7 +18,7 @@ pfUI:RegisterSkin("Options - Interface", function () UIOptionsFrame.backdrop:SetPoint("BOTTOMRIGHT", 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 UIOptionsFrameTab1:SetFrameLevel(8)