Цитата Сообщение от Ururu Посмотреть сообщение

Скрытый текст

PHP код:
do
    
local n = {
        
"Тренировочный манекен",
        
"Древо войны",
        
"Ястребиная сова",
    }
    
local f,CreateFrame("frame",'-=T=-',UIParent),24 
    f
:SetSize(140100)
    
f:SetPoint("CENTER")
    
f:SetMovable(true); f:SetClampedToScreen(true); f:EnableMouse(true)
    
f:SetScript("OnMouseDown",function(self,buttonself:StartMoving() end)
    
f:SetScript("OnMouseUp",function(self,buttonself:StopMovingOrSizing() end)
    
f:SetBackdrop({
        
bgFile "Interface\\DialogFrame\\UI-DialogBox-Background",
        
edgeFile "Interface\\DialogFrame\\UI-DialogBox-Border"
        
edgeSize 32tile truetileSize 32insets={left 11right 12top 12bottom 11}
    })
    
f.f:CreateTexture(nil,"ARTWORK")
    
f.h:SetSize(171,44)
    
f.h:SetPoint('top',0,5)
    
f.h:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header")
    
f.ht f:CreateFontString(nil,"ARTWORK","GameFontNormal")
    
f.ht:SetPoint('top',f.h,0,-8)
    
f.ht:SetText("-=T=-")
    
    for 
_,v in ipairs(n) do
        
local b CreateFrame("Button"nilf"SecureActionButtonTemplate, GameMenuButtonTemplate")
        
b:GetRegions():SetSize(100,12); b:SetText(v)
        
b:GetNormalTexture():SetVertexColor(.7,.7,.7)
        
b:SetAttribute("type""macro");
        
b:SetAttribute("macrotext""/target "..v)
        
b:SetSize(120,20)
        
b:SetPoint("top",f,"top",0,-xx=x+22
        f
:SetSize(140x+12)
    
end
end 
[свернуть]
Ururu, почему по такому принципу такое как тут сделать нельзя?
детектит же по имени