Цитата Сообщение от alexdubovyck Посмотреть сообщение
Что он от меня хочет?
World_of_Warcraft_2016-01-16_22-31-34.jpg
PHP код:
local anchor CreateFrame("frame"nilUIParent)
anchor.unit "player"
anchor.size 22
anchor
.hold 10

anchor
:SetPoint("CENTER"PlayerFrame"CENTER"524)
anchor:SetSize(anchor.sizeanchor.size)

local OnUpdate = function(selfelapsed)
    
self.hold self.hold elapsed

    
if self.hold 0 then
        self
:Hide()
    else
        
self:SetAlpha(self.hold)
    
end
end

local CreateIcon 
= function(self)
    
local icon CreateFrame("frame"nilself)
    
icon:Hide()
    
icon:SetSize(self.sizeself.size)
    
    
local tex icon:CreateTexture()
    
tex:SetAllPoints()
    
icon.tex tex
    
    icon
.hold 0
    icon
.parent self
    
    icon
:SetScript("OnUpdate"OnUpdate)
    
    
table.insert(selficon)
    
    return 
icon
end

local sort 
= function(ab)
    if 
and b then
        
return a.hold b.hold
    end
end

local UpdatePosition 
= function(self)
    
table.sort(selfsort)
    
    for 
1#self do
        
local icon self[i]
        
        if 
not icon then return end
        icon
:ClearAllPoints()
        if 
== 1 then
            icon
:SetPoint("CENTER"self00)
        else
            
icon:SetPoint("LEFT"self[i-1], "RIGHT"20)
        
end
    end
end

local UpdateIcons 
= function(selfunitlimittexture)

    
local index 1
    local icon
    
    
for limit do
        
local tmp self[i] or CreateIcon(self)
        
        if 
tmp:IsShown() then
            index 
index 1
        
else
            
icon self[index]
        
end
    end
    
    icon
.tex:SetTexture(texture)
    
icon.hold self.hold
    icon
:SetAlpha(1)
    
icon:Show()
    
    
UpdatePosition(self)
end

anchor
:SetScript("OnEvent", function(selfeventunitspellrank, ...)
    if 
unit ~= self.unit then return end
    
    local name
ranktexture GetSpellInfo(spellrank)
    
    
UpdateIcons(selfunit10texture)
    
end)

anchor:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED"
Имя себе скрыл: PlayerFrame.name:Hide()
Таргету: TargetFrameTextureFrameName:Hide()
PHP код:
local UpdateIcons = function(selfunitlimittexture)

    
local index 1
    local icon
    
    
for limit do
        
local tmp self[i] or CreateIcon(self)
        
        if 
tmp:IsShown() then
            index 
index 1
        
else
            
icon self[index]
        
end
    end
    
    
if icon then
        icon
.tex:SetTexture(texture)
        
icon.hold self.hold
        icon
:SetAlpha(1)
        
icon:Show()
    
end
    
    UpdatePosition
(self)
end 
У тебя большое время показа иконки . Итерация идет от 1 до 10 , а иконок иза большого времени показа хочет создавать больше 10 , тем самым выходя за предел итератора =)