Приветствуем вас на форуме проекта WoW Circle. Если вы читаете это, значит не зарегистрировались у нас. Для того, чтобы получить доступ к расширенным возможностям нашего форума нажмите сюда и пройди регистрацию, которая не займет у вас много времени. После регистрации будут доступны новые, более расширенные, возможности.
Нейм плейты

Упомянутые в теме пользователи:

Показано с 1 по 2 из 2

Древовидный режим

Предыдущее сообщение Предыдущее сообщение   Следующее сообщение Следующее сообщение
  1. #2
    Инопланетянин
    Регистрация
    20.03.2012
    Сообщений
    4,201
    Поблагодарил(а)
    362
    Получено благодарностей: 1,439 (сообщений: 839).
    Репутация: 2399
    Наверное финальная версия , кастбары отображаются для всех юнитов. Комментировать весь код не особо охота , больно уж я завелся. По этому довольствуемся комментами для конфига :p

    PHP код:
    --//НАСТРОЙКИ НАЧАЛО\\--
    --//Для удобства выннес настройки на верх]]
    local cfg = {

            --
    //Полосы здоровья и касты]]--
            
    HPheight 15 ,--высота
            HPwidth 
    155 ,--ширина
            
            
            CBheight 
    10 , --Высота каст бара
            CBtieFont 
    10 , --Размер шрифта каст бар
            border 
    , --размер бортика
            
            
    --//рейдовая иконка]]--
            
    rheight 15 ,-- размер (например 15 означает что размер иконки будет высотой 15 и шириной 15 пикселей)
            
    Rpoint          "RIGHT" , --чем цепляем
            RrelativePoint 
    "LEFT" , --куда цепляем
            Rx             
    , --координата Х (по ширине)
            
    Ry             = -, --координата У (по высоте)
            
            --
    //Уровень]]--
            
    LvLFontSize 14 , --размер букв
            LvLpoint          
    "RIGHT" , --чем цепляем
            LvLrelativePoint 
    "LEFT"  ,--куда цепляем
            LvLx             
    = -, --координата Х (по ширине)
            
    LvLy             , --координата У (по высоте)
            
            --
    //Имя]]--
            
    NameFontSize 14 , --размер букв имени
            Npoint          
    "BOTTOM" , --чем цепляем
            NrelativePoint 
    "TOP"  ,--куда цепляем
            Nx             
    , --координата Х (по ширине)
            
    Ny             , --координата У (по высоте))
            
            --
    //Цвета]]
            
    hostileunit    = {r=0.69g=0.31b=0.31},  --цвет враждебного инита
            friendlyunit   
    = {r=0.33g=0.59b=0.33},  --цвет дружественного юнита
            friendlyplayer 
    = {r=0.31g=0.45b=0.63},  --цвет дружественного игрока
            neutralunit    
    = {r=0.65g=0.63b=0.35},  --цвет нейтрального юнита
    }

    --
    //Так же для удобства редактирования выношу сюда же и текстурки со шрифтами]]
    local media = {
        [
    "font"] = [=[Fonts\FRIZQT__.TTF]=],
        [
    "normTex"] = [[Interface\Buttons\WHITE8x8]],
        [
    "glowTex"] = [[Interface\Buttons\WHITE8x8]],
        [
    "back"] = [[Interface\Buttons\WHITE8x8]],
    }

    local backdrop = {
        
    edgeFile media.glowTexedgeSize cfg.border,
        
    insets = {left cfg.borderright cfg.bordertop cfg.borderbottom cfg.border}
    }


    --\\!!!
    НАСТРОЙКИ КОНЕЦ!!! НЕ ЗНАЯ БРОДУ НЕ ПиХАТЬ КЛЕШНЯМИ!!!//--



    local numChildren = -1
    local frames 
    = {}


    local function Castbar_OnEvent(selfevent, ...)
        
    local arg1 = ...
        
    local unit arg1
        
    if(arg1 ~= unit and arg1 == "player"then
            
    return
        
    end
           
        local name 
    string.gsub(select(7self:GetParent():GetRegions()):GetText(), "%s%(%*%)","")
        if 
    not(name == UnitName(unit) and self:GetParent():GetChildren():GetValue() == UnitHealth(unit)) then
            
    return
        
    end
           
        
    if(event == "UNIT_SPELLCAST_START"then
            local name
    nameSubtexttexttexturestartTimeendTimeisTradeSkillcastIDnotInterruptible UnitCastingInfo(unit)
            if(
    not name or (not self.showTradeSkills and isTradeSkill)) then
                self
    :Hide()
                return
            
    end
                   
            self
    :SetStatusBarColor(1.00.70.0)
            
    self.duration GetTime() - (startTime/1000)
            
    self.max = (endTime startTime) / 1000
                   
            self
    :SetValue(0)
            
    self:SetMinMaxValues(0self.max)
            
    self:SetAlpha(1.0)
                   
            if(
    self.Iconthen
                self
    .Icon:SetTexture(texture)
            
    end
                   
            self
    :SetAlpha(1.0)
            
    self.holdTime 0
            self
    .casting 1
            self
    .castID castID
            self
    .delay 0
            self
    .channeling nil
            self
    .fadeOut nil
                   
            
    if(self.Shieldthen
                
    if(self.showShield and notInterruptiblethen
                    self
    .Shield:Show()
                    if(
    self.Borderthen
                        self
    .Border:Hide()
                    
    end
                    
    else
                    
    self.Shield:Hide()
                    if(
    self.Borderthen
                        self
    .Border:Show()
                    
    end
                end
             end
                   
        self
    :Show()
        elseif(
    event == "UNIT_SPELLCAST_STOP" or event == "UNIT_SPELLCAST_CHANNEL_STOP"then
            
    if((self.casting and event == "UNIT_SPELLCAST_STOP" and select(4, ...) == self.castID) or (self.channeling and event == "UNIT_SPELLCAST_CHANNEL_STOP")) then
                self
    :SetValue(self.max)
                           
                if(
    event == "UNIT_SPELLCAST_STOP"then
                    self
    .casting nil
                    self
    :SetStatusBarColor(0.01.00.0)
                    else
                        
    self.channeling nil
                end
                           
                        self
    .flash 1
                        self
    .fadeOut 1
                        self
    .holdTime 0
            end
                
    elseif(event == "UNIT_SPELLCAST_FAILED" or event == "UNIT_SPELLCAST_INTERRUPTED"then
                    
    if(self:IsShown() and (self.casting and select(4, ...) == self.castID) and not self.fadeOutthen
                            self
    :SetValue(self.max)
                            
    self:SetStatusBarColor(1.00.00.0)
                           
                            
    self.casting nil
                            self
    .channeling nil
                            self
    .fadeOut 1
                            self
    .holdTime GetTime() + CASTING_BAR_HOLD_TIME
                    end
            
    elseif(event == "UNIT_SPELLCAST_DELAYED"then
                    local castbar 
    self
                    
    if(castbar:IsShown()) then
                            local name
    nameSubtexttexttexturestartTimeendTimeisTradeSkill UnitCastingInfo(unit)
                            if(
    not name or (not self.showTradeSkills and isTradeSkill)) then
                                    self
    :Hide()
                                    return
                            
    end
                           
                            local duration 
    GetTime() - (startTime 1000)
                            if(
    duration 0then duration 0 end
                            castbar
    .delay castbar.delay castbar.duration duration
                            castbar
    .duration duration
                           
                            castbar
    :SetValue(duration)
                           
                            if(
    not castbar.castingthen
                                    castbar
    :SetStatusBarColor(1.00.70.0)
                                   
                                    
    castbar.casting 1
                                    castbar
    .channeling nil
                                    castbar
    .fadeOut 0
                            end
                    end
            
    elseif(event == "UNIT_SPELLCAST_CHANNEL_START"then
                    local name
    nameSubtexttexttexturestartTimeendTimeisTradeSkillnotInterruptible UnitChannelInfo(unit)
                    if(
    not name or (not self.showTradeSkills and isTradeSkill)) then
                            self
    :Hide()
                            return
                    
    end
                   
                    self
    :SetStatusBarColor(0.01.00.0)
                    
    self.duration = ((endTime 1000) - GetTime())
                    
    self.max = (endTime startTime) / 1000
                    self
    .delay 0
                    self
    :SetMinMaxValues(0self.max)
                    
    self:SetValue(self.duration)
                   
                    if(
    self.Iconthen
                            self
    .Icon:SetTexture(texture)
                    
    end
                   
                    self
    :SetAlpha(1.0)
                    
    self.holdTime 0
                    self
    .casting nil
                    self
    .channeling 1
                    self
    .fadeOut nil
                   
                    
    if(self.Shieldthen
                            
    if(self.showShield and notInterruptiblethen
                                    self
    .Shield:Show()
                                    if(
    self.Borderthen
                                            self
    .Border:Hide()
                                    
    end
                            
    else
                                    
    self.Shield:Hide()
                                    if(
    self.Borderthen
                                            self
    .Border:Show()
                                    
    end
                            end
                    end
                   
                    self
    :Show()
            elseif(
    event == "UNIT_SPELLCAST_CHANNEL_UPDATE"then
                    local castbar 
    self
                    
    if(castbar:IsShown()) then
                            local name
    nameSubtexttexttexturestartTimeendTimeisTradeSkill UnitChannelInfo(unit)
                            if(
    not name or (not self.showTradeSkills and isTradeSkill)) then
                                    self
    :Hide()
                                    return
                            
    end
                           
                            local duration 
    = ((endTime 1000) - GetTime())
                            
    castbar.delay castbar.delay castbar.duration duration
                            castbar
    .duration duration
                            castbar
    .max = (endTime startTime) / 1000
                           
                            castbar
    :SetMinMaxValues(0castbar.max)
                            
    castbar:SetValue(duration)
                    
    end
            
    elseif(event == "UNIT_SPELLCAST_INTERRUPTIBLE"then
                    
    if(self.Shieldthen
                            self
    .Shield:Hide()
                            if(
    self.Borderthen
                                    self
    .Border:Show()
                            
    end
                    end
            
    elseif(event == "UNIT_SPELLCAST_NOT_INTERRUPTIBLE"then
                    
    if(self.Shieldthen
                            self
    .Shield:Show()
                            if(
    self.Borderthen
                                    self
    .Border:Hide()
                            
    end
                    end
            end
    end
     
    local 
    function Castbar_OnUpdate(selfelapsed)
        if(
    self.castingthen
            local duration 
    self.duration elapsed
            
    if(duration >= self.maxthen
                self
    :SetValue(self.max)
                
    self:SetStatusBarColor(0.01.00.0)
                
    self.holdTime 0
                self
    .fadeOut 0
                self
    .casting nil
                
    return
            
    end
                   
            self
    .duration duration
            self
    :SetValue(duration)
        elseif(
    self.channelingthen
                local duration 
    self.duration elapsed
            
    if(duration <= 0then
                self
    :SetStatusBarColor(0.01.00.0)
                
    self.fadeOut 0
                self
    .channeling nil
                self
    .holdTime 0
                
    return
            
    end
                self
    .duration duration
                self
    :SetValue(duration)
            elseif(
    GetTime() < self.holdTimethen
                
    return
            elseif(
    self.fadeOutthen
                local alpha 
    self:GetAlpha() - CASTING_BAR_ALPHA_STEP
            
    if(alpha 0.05then
                self
    :SetAlpha(alpha)
            else
                
    self.fadeOut nil
                self
    :Hide()
            
    end
        end
    end

    local 
    function UpdateCastTime(selfcurValue)
        
    local minValuemaxValue self:GetMinMaxValues()
        if 
    self.channeling then
            local casttime 
    string.format("%.1f"curValue)
            
    local castcur string.format("\n%.1f"maxValue)
            
    self.time:SetText(casttime..castcur)
        else
            
    local casttime string.format("%.1f", (maxValue-curValue))
            
    local castcur string.format("\n%.1f"maxValue)
            
    self.time:SetText(casttime..castcur)
        
    end
    end



    local 
    function Healthbar_OnUpdate(self)

        
    local rgself:GetStatusBarColor()
        if 
    == 0 then
            self
    .rself.gself.cfg.hostileunit.rcfg.hostileunit.gcfg.hostileunit.b
            self
    :SetStatusBarColor(cfg.hostileunit.rcfg.hostileunit.gcfg.hostileunit.b)
        elseif 
    == 0 then
            self
    .rself.gself.cfg.friendlyunit.rcfg.friendlyunit.gcfg.friendlyunit.b
            self
    :SetStatusBarColor(cfg.friendlyunit.rcfg.friendlyunit.gcfg.friendlyunit.b)
        elseif 
    == 0 then
            self
    .rself.gself.cfg.friendlyplayer.rcfg.friendlyplayer.gcfg.friendlyplayer.b
            self
    :SetStatusBarColor(cfg.friendlyplayer.rcfg.friendlyplayer.gcfg.friendlyplayer.b)
        elseif 
    - (g) < 0.05 and == 0 then
            self
    .rself.gself.cfg.neutralunit.rcfg.neutralunit.gcfg.neutralunit.b
            self
    :SetStatusBarColor(cfg.neutralunit.rcfg.neutralunit.gcfg.neutralunit.b)
        else
            
    self.rself.gself.rgb
        end

        frame 
    self:GetParent()
        if 
    not frame.oldglow:IsShown() then
            self
    .hpBorder:SetBackdropBorderColor(000)
        else
            
    local rgframe.oldglow:GetVertexColor()
            if 
    == 0 then
                self
    .hpBorder:SetBackdropBorderColor(100)
            else
                
    self.hpBorder:SetBackdropBorderColor(110)
            
    end
        end
            self
    :SetStatusBarColor(self.rself.gself.b)

        
    self:ClearAllPoints()
        
    self:SetPoint("CENTER"self:GetParent(), 010)
        
    self:SetHeight(cfg.HPheight)
        
    self:SetWidth(cfg.HPwidth)
        
        
    self.hpBackground:SetVertexColor(self.0.25self.0.25self.0.25)
        
        
    local nameString frame.oldname:GetText()
        if 
    string.len(nameString) < cfg.HPwidth/5 then
            frame
    .name:SetText(nameString)
        else
            
    frame.name:SetFormattedText(nameString:sub(0cfg.HPwidth/5).."...")
        
    end
        
        frame
    .level:ClearAllPoints()
        
    frame.level:SetPoint(cfg.LvLpointframe.healthBarcfg.LvLrelativePointcfg.LvLxcfg.LvLy)
        if 
    frame.boss:IsShown() then
            frame
    .level:SetText("БОС")
            
    frame.level:SetTextColor(0.80.050)
            
    frame.level:Show()
        
    end
        frame
    .highlight:SetAllPoints(self)
    end

    local 
    function onHide(self)
        
    self.highlight:Hide()
    end
     
    local 
    function SkinObjects(frame)
        
        
    frame.healthBarframe.castBar frame:GetChildren()
        
    local healthBarcastBar frame.healthBarframe.castBar
        local glowRegion
    overlayRegioncastbarOverlayshieldedRegionspellIconRegionhighlightRegionnameTextRegionlevelTextRegionbossIconRegionraidIconRegionstateIconRegion frame:GetRegions()
        
        
    frame.oldname nameTextRegion
        nameTextRegion
    :Hide()
        
    nameTextRegion.Show = function() end
        
        frame
    .name frame:CreateFontString()
        
    frame.name:SetPoint(cfg.NpointhealthBarcfg.NrelativePointcfg.Nxcfg.Ny)
        
    frame.name:SetFont(media.fontcfg.NameFontSize"OUTLINE")
        
    frame.name:SetTextColor(0.840.750.65)
        
    frame.name:SetShadowOffset(1, -1)
        
        
    frame.level levelTextRegion
        levelTextRegion
    :SetFont(media.fontcfg.LvLFontSize"OUTLINE")
        
    levelTextRegion:SetShadowOffset(1, -1)
        
    frame.boss bossIconRegion
        
        healthBar
    :SetStatusBarTexture(media.normTex)

        
    healthBar.hpBackground healthBar:CreateTexture(nil"BORDER")
        
    healthBar.hpBackground:SetAllPoints(healthBar)
        
    healthBar.hpBackground:SetTexture(media.back)
        
    healthBar.hpBackground:SetVertexColor(0.150.150.15)

        
    healthBar.hpBorder CreateFrame("Frame"nilhealthBar)
        
    healthBar.hpBorder:SetFrameLevel(healthBar:GetFrameLevel() -and healthBar:GetFrameLevel() -or 0)
        
    healthBar.hpBorder:SetPoint("TOPLEFT"healthBar"TOPLEFT", -cfg.bordercfg.border)
        
    healthBar.hpBorder:SetPoint("BOTTOMRIGHT"healthBar"BOTTOMRIGHT"cfg.border, -cfg.border)
        
    healthBar.hpBorder:SetBackdrop(backdrop)
        
    healthBar.hpBorder:SetBackdropColor(000)
        
    healthBar.hpBorder:SetBackdropBorderColor(000)
        
    healthBar:SetScript('OnUpdate'Healthbar_OnUpdate)
        
        
    highlightRegion:SetTexture(media.normTex)
        
    highlightRegion:SetVertexColor(0.250.250.25)
        
    frame.highlight highlightRegion
            
        local castbar 
    CreateFrame("StatusBar"nilframe)
        
    castbar:SetHeight(cfg.CBheight)
        
    castbar:SetWidth(cfg.HPwidth-(cfg.CBheight+8))
        
    castbar:SetStatusBarTexture(media.normTex)
        
    castbar:GetStatusBarTexture():SetHorizTile(false)
        
    castbar:GetStatusBarTexture():SetVertTile(false)
        
    castbar:SetPoint("TOPRIGHT"healthBar"BOTTOMRIGHT"0, -8)
           
        
    castbar.showTradeSkills true
        castbar
    .showShield true
        castbar
    .casting true
        castbar
    .channeling true
        castbar
    .holdTime 0
              
        castbar
    .Border castbar:CreateTexture(nil"BACKGROUND")
        
    castbar.Border:SetSize(castbarOverlay:GetSize())
        
    castbar.Border:SetAllPoints(castbar)
        
    castbar.Border:SetTexture(media.back)
        
    castbar.Border:SetVertexColor(0,0,00.8)
           
        -- 
    castbar.Shield castbar:CreateTexture(nil"ARTWORK")
        -- 
    castbar.Shield:SetSize(shieldedRegion:GetSize())
        -- 
    castbar.Shield:SetPoint(shieldedRegion:GetPoint())
        -- 
    castbar.Shield:SetTexture(shieldedRegion:GetTexture())
        -- 
    castbar.Shield:SetTexCoord(shieldedRegion:GetTexCoord())
           
        
    castbar.Icon castbar:CreateTexture(nil"ARTWORK")
        
    castbar.Icon:SetSize(spellIconRegion:GetSize())
        
    castbar.Icon:SetPoint('RIGHT'castbar'LEFT', -20)
        
    castbar.Icon:SetTexCoord(0.10.90.10.9)
        
        
    castbar.time castbar:CreateFontString(nil"ARTWORK")
        
    castbar.time:SetPoint("RIGHT"castbar.Icon"LEFT", -40)
        
    castbar.time:SetFont(media.fontcfg.CBtieFont"OUTLINE")
        
    castbar.time:SetTextColor(0.840.750.65)
        
    castbar.time:SetShadowOffset(1, -1)
           
         --  print(
    shielded)

        
    castbar:Hide()
           
        
    castbar:RegisterEvent("UNIT_SPELLCAST_START")
        
    castbar:RegisterEvent("UNIT_SPELLCAST_FAILED")
        
    castbar:RegisterEvent("UNIT_SPELLCAST_STOP")
        
    castbar:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
        
    castbar:RegisterEvent("UNIT_SPELLCAST_INTERRUPTIBLE")
        
    castbar:RegisterEvent("UNIT_SPELLCAST_NOT_INTERRUPTIBLE")
        
    castbar:RegisterEvent("UNIT_SPELLCAST_DELAYED")
        
    castbar:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
        
    castbar:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE")
        
    castbar:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP")
        
    castbar:SetScript("OnEvent"Castbar_OnEvent)
        
    castbar:SetScript("OnUpdate"Castbar_OnUpdate)
        
    castbar:HookScript("OnValueChanged"UpdateCastTime)
           
        
    frame.oldglow glowRegion
        frame
    :SetScript('OnHide'onHide)
        
        
    frames[frame] = true
            
        glowRegion
    :SetTexture(nil)
        
    overlayRegion:SetTexture(nil)
        
    shieldedRegion:SetTexture(nil)
        
    castbarOverlay:SetTexture(nil)
        
    stateIconRegion:SetTexture(nil)
        
    bossIconRegion:SetTexture(nil)
        
    end
     
    local select 
    select
    local 
    function HookFrames(...)
        for 
    index 1select("#", ...) do
            
    local frame select(index, ...)
            
    local region frame:GetRegions()
            if(
    not frames[frame] and not frame:GetName() and region and region:GetObjectType() == "Texture" and region:GetTexture() == [=[Interface\TargetingFrame\UI-TargetingFrame-Flash]=]) then
                SkinObjects
    (frame)
            
    end
        end
    end
     
    local t 
    .1
    CreateFrame
    ("Frame"):SetScript("OnUpdate", function(selfelapsed)
        if(
    WorldFrame:GetNumChildren() ~= numChildrenthen
            numChildren 
    WorldFrame:GetNumChildren()
            
    HookFrames(WorldFrame:GetChildren())
        
    end
    end

    Последний раз редактировалось DreamlØlz; 21.12.2014 в 23:22.

  2. 10 пользователей сказали cпасибо DreamlØlz за это полезное сообщение:

    (Станислав) (20.01.2020),Arena_noTdie (02.07.2019),Cosmic Psychо (29.07.2020),greensun (13.03.2015),HiBerni (19.01.2019),j.Foxy (15.02.2015),Lophophora (03.08.2015),Tombstalker (22.05.2019),Юрий. (17.03.2015),аффтор (14.01.2016)

Похожие темы

  1. ОР, Флейм
    от Grandhades в разделе Корзина
    Ответов: 6
    Последнее сообщение: 26.06.2015, 08:46
  2. Фрейм босса
    от RIKODOU в разделе Аддоны
    Ответов: 4
    Последнее сообщение: 03.03.2015, 20:52
  3. Прозьба к Гейм мастерам.
    от Rainhart в разделе Архив
    Ответов: 1
    Последнее сообщение: 04.01.2014, 22:42
  4. Мат ,флейм.
    от -Agrael- в разделе Заявки на бан
    Ответов: 2
    Последнее сообщение: 06.11.2013, 19:22
  5. Ув. Гейм мастера
    от boss110986 в разделе Архив
    Ответов: 7
    Последнее сообщение: 07.11.2012, 23:21

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •