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

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

Страница 95 из 279 ПерваяПервая ... 45859394959697105145195 ... ПоследняяПоследняя
Показано с 1,129 по 1,140 из 3343
  1. #1129
    Ветеран форума Аватар для Chrone
    Регистрация
    14.03.2013
    Адрес
    Дарнас
    Сообщений
    1,005
    Поблагодарил(а)
    181
    Получено благодарностей: 89 (сообщений: 71).
    Репутация: 537
    Цитата Сообщение от Dontcrybaby Посмотреть сообщение
    То ли bChat
    он самый
    https://www.heroicstrike.org/
    Цитата Сообщение от Netherheal Посмотреть сообщение
    Кап защиты: 560 для цлк+рс, а не 540. 540 только для ргеров. в ЦЛК лвл боссов 85.
    .
    Цитата Сообщение от Dmitry272 Посмотреть сообщение
    Предложение вааще убрать ворота , нет ворот - нечему ломаться
    Цитата Сообщение от Wpq Посмотреть сообщение
    ПОСЛЕ КАЖДОГО ВАЙПА КАЖДЫЙ ЧЕЛОВЕК УМИРАЕТ И БЕЖИТ В ИНСТ А НЕ ВСТАЁТ ПЕРЕРОЖДЕНИЕМ ИЛИ ЭСЭСОМ ИЛИ ХАНТЫ ПРИТВОРЯТСЯ.

  2. 1 пользователь сказал cпасибо Chrone за это полезное сообщение:

    poxod (04.10.2015)

  3. #1130
    Старожил Аватар для Topgun
    Регистрация
    01.07.2014
    Сообщений
    78
    Поблагодарил(а)
    80
    Получено благодарностей: 133 (сообщений: 113).
    Репутация: 133
    Тут как-то очень давно дрим код кидал, один в один чат будет.

  4. #1131
    Флудер года Аватар для Dontcrybaby
    Регистрация
    05.01.2012
    Адрес
    Москва / Волгоград
    Сообщений
    11,755
    Поблагодарил(а)
    58
    Получено благодарностей: 701 (сообщений: 508).
    Репутация: 1737
    Цитата Сообщение от Topgun Посмотреть сообщение
    Тут как-то очень давно дрим код кидал, один в один чат будет.
    и на панельки... скрипт на панельки вообще топ

  5. #1132
    Дедушка форума
    Регистрация
    20.03.2012
    Сообщений
    4,173
    Поблагодарил(а)
    358
    Получено благодарностей: 1,437 (сообщений: 836).
    Репутация: 2397
    Цитата Сообщение от Dontcrybaby Посмотреть сообщение
    скинь аддон, по типу TidyPlates... дримовский
    Если адаптируешь ...

    core.lua:

    PHP код:
    local _G                    _G
    local tostring                
    tostring
    local WorldFrame            
    WorldFrame
    local select                
    select
    local UnitExists            
    UnitExists
    local UnitGUID                
    UnitGUID
    local UnitName                
    UnitName
    local pairs                    
    pairs
    local table_insert            
    table.insert
    local GetMouseFocus            
    GetMouseFocus
    local GetNumRaidMembers        
    GetNumRaidMembers
    local GetNumPartyMembers    
    GetNumPartyMembers
    local UnitIsUnit            
    UnitIsUnit
    local GetRaidTargetIndex    
    GetRaidTargetIndex
    local 
    print                    = print
    local table_getn            table.getn
    local _ 
    --localized underscore so FindGlobals
    local IsAddOnLoaded            
    IsAddOnLoaded
    local unpack 
    unpack
    local math_floor 
    math.floor
    local tonumber 
    tonumber
    local UnitHealth 
    UnitHealth
    local UnitHealthMax 
    UnitHealthMax
    local UnitClass 
    UnitClass
    local UnitInRange 
    UnitInRange
    local UnitCastingInfo 
    UnitCastingInfo
    local UnitChannelInfo 
    UnitChannelInfo

    local FAuras 
    = {
            [
    118] = true, --Polymorph
            
    [51514] = true, --Hex
            
    [710] = true, --Banish
            
    [6358] = true, --Seduction
            
    [6770] = true, --Sap
            
    [605] = true, --Mind Control
            
    [33786] = true, --Cyclone
            
    [5782] = true, --Fear
            
    [5484] = true, --Howl of Terror
            
    [6789] = true, --Death Coil
            
    [45438] = true, --Ice Block
            
    [642] = true, --Divine Shield
            
    [8122] = true, --Psychic Scream
            
    [339] = true, --Entangling Roots
            
    [23335] = true, -- Silverwing Flag (alliance WSG flag)
            [
    23333] = true, -- Warsong Flag (horde WSG flag)
            [
    34976] = true, -- Netherstorm Flag (EotS flag)
            [
    2094] = true, --Blind
            
    [33206] = true, --Pain Suppression (priest
            [
    29166] = true, --Innervate (druid
            [
    47585] = true, --Dispersion (priest)
            [
    19386] = true, --Wyvern Sting (hunter)
            [
    15487] = true, --Silence (priest)
            [
    10060] = true, --Power Infusion (priest
            [
    2825] = true, --Bloodlust
            
    [5246] = true, --Intimidating Shout (warrior
            [
    31224] = true, --Cloak of Shadows (rogue
            [
    498] = true, --Divine Protection
            
    [47476] = true, --Strangulate (warlock
            [
    31884] = true, --Avenging Wrath (pally
            [
    37587] = true, --Bestial Wrath (hunter
            [
    12472] = true, --Icy Veins (mage)
            [
    49039] = true, --Lichborne (DK)
            [
    48792] = true, --Icebound Fortitude (DK)
            [
    5277] = true, --Evasion (rogue)
            [
    53563] = true, --Beacon of Light (pally)
            [
    22812] = true, --Barkskin (druid)
            [
    67867] = true, --Trampled (ToC arena spell when you run over someone)
            [
    1499] = true, --Freezing Trap
            
    [2637] = true, --Hibernate
            
    [64044] = true, --Psychic Horror
            
    [19503] = true, --Scatter Shot (hunter)
            [
    34490] = true, --Silencing Shot (hunter)
            [
    10278] = true, --Hand of Protection (pally)
            [
    10326] = true, --Turn Evil (pally)
            [
    44572] = true, --Deep Freeze (mage)
            [
    20066] = true, --Repentance (pally)
            [
    46968] = true, --Shockwave (warrior)
            [
    46924] = true, --Bladestorm (warrior)
            [
    16689] = true, --Nature's Grasp (Druid)
            [53601] = true, --блядощит пеладина
            [56222] = false,
            [49284] = true,
            [26669] = true,
            [51724] = true
    }

    local UI, M = select(2, ...):unpack()

    local NP = UI:NewModule("NamePlates")

    local scanDelay = 1
    local updateDelay = 1

    NP.nameplates = {}
    NP.GUIDs = {}
    NP.names = {}
    NP.onShowHooks = {}
    NP.onHideHooks = {}
    NP.onUpdateHooks = {}
    NP.healthOnValueChangedHooks = {}
    NP.plateGUIDs = {}
    NP.isOnScreen = {}
    NP.isOnUpdating = {}
    NP.realPlate = {}
    NP.fakePlate = {}
    NP.combatStatus = {}

    local function IsNamePlateFrame(frame)
        if frame:GetName() then return false end
        if frame:GetID() ~= 0 then return false end
        if frame:GetObjectType() ~= "Frame" then return false end
        if frame:GetNumChildren() == 0 then return false end
        if frame:GetNumRegions() == 0 then return false end
        return true
    end

    local function RemoveHexColor(inputString)
        local find = inputString:find("|c")
        if find then
            inputString = inputString:sub(find+10)
        end
        inputString = inputString:gsub("|r", "")
        return inputString
    end

    function NP:GetName(frame)
        local frame = self.realPlate[frame] or frame

        local nameRegion = frame.nameTextRegion or self:GetNameRegion(frame)
        if nameRegion and nameRegion.GetText then
            return RemoveHexColor( nameRegion:GetText() )
        end

        return nil
    end

    function NP:GetHightlightRegion(frame)
        local hl = select(6, frame:GetRegions())
        return hl
    end

    function NP:GetNameRegion(frame)
        local nr = select(7, frame:GetRegions())
        return nr
    end

    function NP:GetReaction(frame)
        local frame = self.realPlate[frame] or frame

        local r,g,b = GetHealthBarColor(frame)
        if r then
            return reactionByColor(r, g, b )
        end

        return nil
    end

    function NP:GetHealthBar(frame)
        return select(1, frame:GetChildren())
    end


    function NP:GetCastBar(frame)
        return select(2, frame:GetChildren())
    end

    function NP:IsMouseover(frame)
        local frame = self.realPlate[frame] or frame

        local region = frame.highlightRegion or self:GetHightlightRegion(frame)
        if region and region.IsShown then
            return region:IsShown() and true or false
        end
        
        return nil
    end

    local function FoundPlateGUID(frame, GUID, unitID)
        NP.plateGUIDs[frame] = GUID
        NP.GUIDs[GUID] = frame
        NP:FoundGUID(NP.fakePlate[frame] or frame, GUID, unitID)
    end

    local function GetMouseoverGUID(frame)
        local unitID = "mouseover"
        if UnitExists(unitID) then
            FoundPlateGUID(frame, UnitGUID(unitID), unitID)
        end
    end

    local function HideMouseoverRegion(frame)
        local region = frame.highlightRegion or NP:GetHightlightRegion(frame)
        if region and region.Hide then
            region:Hide()
        end
    end

    local function UpdateNameplateInfo(frame)
        if NP:IsMouseover(frame) and not UnitExists("mouseover") then
            HideMouseoverRegion(frame)
        end

        if not NP.plateGUIDs[frame] then
            if NP:IsMouseover(frame) then
                GetMouseoverGUID(frame)
            end
        end
        frame.lnpLastUpdate = 0
    end

    local function combatByColor(r, g, b, a) 
        return (r > .5 and g < .5)
    end

    function NP:IsInCombat(frame)
        local frame = self.realPlate[frame] or frame

        local region = frame.nameTextRegion or self:GetNameRegion(frame)
        if region and region.GetTextColor then
            return combatByColor( region:GetTextColor() ) and true or false
        end
        
        return nil
    end

    local function CheckUnitIDForMatchingHP(unitID, frameName, current, max)
        local targetID = unitID.."target"
        
        if UnitName(targetID) == frameName then
            local health = UnitHealth(targetID)
            local maxHealth = UnitHealthMax(targetID)

            if health == current and maxHealth == max then
                return true
            end
        end
        return false
    end

    function NP:NewNameplateCheckHP(frame)
        local bar = frame.healthBar or self:GetHealthBar(frame)
        if bar and bar.GetValue then
            local _, max = bar:GetMinMaxValues()
            local current = bar:GetValue()
            NP.prevHealth[frame] = current
            
            if current > 0 and current ~= max then
                
                local group, num = "", 0
                if GetNumRaidMembers() > 1 then
                    group, num = "raid", GetNumRaidMembers()
                elseif GetNumPartyMembers() > 0 then
                    group, num = "party", GetNumPartyMembers()
                else
                    return
                end
            
                local possibleUnits = {}

                local frameName = self:GetName(frame)
                local unitID, targetID, targetIndex
                for i = 1, num do
                    unitID = group..i;
                    if CheckUnitIDForMatchingHP(unitID, frameName, current, max) then
                        table_insert(possibleUnits, #possibleUnits+1, unitID.."target")
                    end
                    
                    if UnitExists(unitID.."pet") then
                        if CheckUnitIDForMatchingHP(unitID.."pet", frameName, current, max) then
                            table_insert(possibleUnits, #possibleUnits+1, unitID.."pettarget")
                        end
                    end
                    
                end
                
                if #possibleUnits == 1 then
                    FoundPlateGUID(frame, UnitGUID(possibleUnits[1]), possibleUnits[1])
                    return true
                end
            
            end
        end
    end

    NP.prevHealth = {}

    function NP.OnNameplateShow(frame, ...)
        NP:SetupNameplate(frame)
        NP:NewNameplateCheckHP(frame)
    end
    local function ourOnShow(...) return NP.OnNameplateShow(...) end


    local function RecycleNameplate(frame)

        NP:RecycleNameplate(NP.fakePlate[frame] or frame)
        
        if NP.plateGUIDs[frame] then
            NP.GUIDs[NP.plateGUIDs[frame]] = false
        end
        
        local plateName = NP:GetName(frame)
        
        if plateName and NP.names[plateName] then
            NP.names[plateName] = false
        end
        
        
        
        NP.plateGUIDs[frame] = false
        local fake = NP.fakePlate[frame]
        if fake then
            NP.realPlate[fake] = false
        end
        NP.fakePlate[frame] = false
    end

    function NP.OnNameplateHide(frame, ...)
        NP.isOnScreen[frame] = false
        NP.isOnUpdating[frame] = false
        NP.combatStatus[frame] = false
        RecycleNameplate(frame)
    end
    local function ourOnHide(...) return NP.OnNameplateHide(...) end

    function NP.OnNameplateUpdate(frame, elapsed, ...)
        NP.isOnUpdating[frame] = true
        if frame.lnpCheckForTarget then
            frame.lnpCheckForTarget = false
            if not NP.plateGUIDs[frame] and frame:IsShown() and ((frame:GetAlpha() == 1) and UnitExists("target")) then
                FoundPlateGUID(frame, UnitGUID("target"), "target")
            end
        end

        frame.lnpLastUpdate = (frame.lnpLastUpdate or 0) + elapsed
        if frame.lnpLastUpdate > updateDelay then
            UpdateNameplateInfo(frame)
            
            NP:NameplateOnUpdate(frame)
            
            local inCombat = NP:IsInCombat(frame)
            
            if NP.combatStatus[frame] ~= inCombat then
                NP.combatStatus[frame] = inCombat
                NP:CombatChange(NP.fakePlate[frame] or frame, inCombat)
            end
            
        end
    end
    local function ourOnUpdate(...) return NP.OnNameplateUpdate(...) end

    function NP.healthOnValueChanged(frame, ...)

        local plate = frame:GetParent()
        local currentHP = ...
        local min, max = frame:GetMinMaxValues()
        if plate and NP.isOnScreen[plate] and (not NP.prevHealth[plate] or NP.prevHealth[plate] ~= currentHP) then
            NP:HealthChange(plate, min, max, currentHP)
            local plateName = NP:GetName(plate)
            if not NP.plateGUIDs[plate] then
                NP:NewNameplateCheckHP(plate)
            end
        end
    end
    local function ourHealthOnValueChanged(...) return NP.healthOnValueChanged(...) end

    function NP:HookNameplate(frame)
        if frame:HasScript("OnHide") and not self.onHideHooks[frame] then
            self.onHideHooks[frame] = true
            frame:HookScript("OnHide", ourOnHide)
        end
        
        if frame:HasScript("OnShow") and not self.onShowHooks[frame] then
            self.onShowHooks[frame] = true
            frame:HookScript("OnShow", ourOnShow)
        end

        if frame:HasScript("OnUpdate") and not self.onUpdateHooks[frame] then
            self.onUpdateHooks[frame] = true
            frame:HookScript("OnUpdate", ourOnUpdate)
        end

        local healthBar = frame.healthBar
        if healthBar and not self.healthOnValueChangedHooks[frame] then
            self.healthOnValueChangedHooks[frame] = true
            healthBar:HookScript("OnValueChanged", ourHealthOnValueChanged)
        end
    end

    function NP:SaveFrameRegions(frame)
        local glowRegion, overlayRegion, castbarOverlay, shieldedRegion, spellIconRegion, highlightRegion, nameTextRegion, levelTextRegion, bossIconRegion, raidIconRegion, stateIconRegion = frame:GetRegions()
        
        frame.glowRegion = glowRegion
        frame.overlayRegion = overlayRegion
        frame.castbarOverlay = castbarOverlay
        frame.shieldedRegion = shieldedRegion
        frame.spellIconRegion = spellIconRegion
        frame.highlightRegion = highlightRegion
        frame.nameTextRegion = nameTextRegion
        frame.levelTextRegion = levelTextRegion
        frame.bossIconRegion = bossIconRegion
        frame.raidIconRegion = raidIconRegion
        frame.stateIconRegion = stateIconRegion

    end

    function NP:SaveFrameBars(frame)
        frame.healthBar =  self:GetHealthBar(frame)
        frame.castBar =  self:GetCastBar(frame)
    end

    function NP:NameplateFirstLoad(frame)

        NP:SaveFrameRegions(frame)
        NP:SaveFrameBars(frame)
        
        self:HookNameplate(frame)
        
        if self.combatStatus[frame] == nil then
            self.combatStatus[frame] = false
        end
    end

    function NP:SetupNameplate(frame)
        self.isOnScreen[frame] = true

        local plateName = self:GetName(frame)
        self.nameplates[frame] = plateName
        self.names[plateName] = frame
        self:NewNameplate(self.fakePlate[frame] or frame)

        frame.lnpCheckForTarget = true
        UpdateNameplateInfo(frame)
    end

    local function ScanWorldFrameChildren(n, ...)
        for i = 1, n do
            local frame = select(i, ...)
            if frame:IsShown() and IsNamePlateFrame(frame) then
                if not NP.nameplates[frame] then
                    NP:NameplateFirstLoad(frame)
                    NP:SetupNameplate(frame)                    
                end
            end    
        end
    end

    local lastChildren = 0
    local function FindNameplates()
        local curChildren = WorldFrame:GetNumChildren()
        if curChildren ~= lastChildren then
            lastChildren = curChildren
            ScanWorldFrameChildren(curChildren, WorldFrame:GetChildren())
        end
    end

    function NP:IsTarget(frame)
        local frame = self.realPlate[frame] or frame
        return frame:IsShown() and frame:GetAlpha() == 1 and UnitExists("target") or false
    end

    local function CheckForTargetGUID()
        local unitID = "target"
        local GUID
        for frame in pairs(NP.nameplates) do 
            if NP:IsTarget(frame) then
                NP.targeted = frame
                if not NP.plateGUIDs[frame] then
                    FoundPlateGUID(frame, UnitGUID(unitID), unitID)
                end
                NP:TargetNameplate(NP.fakePlate[frame] or frame)
                return
            end
        end
    end

    local function OnUpdate(frame, elapsed)
        if frame.checkTarget then
            frame.checkTarget = false
            CheckForTargetGUID()
        end

        FindNameplates()

        frame.lastUpdate = frame.lastUpdate + elapsed
        if frame.lastUpdate >= scanDelay then
            frame.lastUpdate = 0
            for frame, value in pairs(NP.isOnScreen) do 
                if (value == true and not frame:IsShown()) then --OnHide fail
                    print("OnHide fail", frame, value, frame:IsShown())
                    NP.onHideHooks[frame] = false
                    NP.isOnScreen[frame] = false
                    NP:HookNameplate(frame)
                    NP.OnNameplateHide(frame)
                    
                elseif (value == false and frame:IsShown()) then --OnShow fail
                    print("OnShow fail", frame, value, frame:IsShown())
                    NP.onShowHooks[frame] = false
                    NP.isOnScreen[frame] = false
                    NP:HookNameplate(frame)
                    NP:SetupNameplate(frame, true)
                    
                end
            end
            for frame, value in pairs(NP.isOnUpdating) do 
                if value == false and frame:IsShown() then
                    print("OnUpdate fail?")
                    NP.onUpdateHooks[frame] = false
                    NP:HookNameplate(frame)
                end
            end
        end
    end

    local function OnEvent(frame, event, ...)
        if event == "UPDATE_MOUSEOVER_UNIT" then
            if GetMouseFocus():GetName() == "WorldFrame" then
                local i = 0
                local mouseoverPlate
                for frame in pairs(NP.nameplates) do 
                    if frame:IsShown() and NP:IsMouseover(frame) then
                        i = i + 1
                        mouseoverPlate = frame

                    end
                end
                if i == 1 then
                    if not NP.plateGUIDs[mouseoverPlate] then
                        GetMouseoverGUID(mouseoverPlate)
                    end
                    NP:MouseoverNameplate(NP.fakePlate[mouseoverPlate] or mouseoverPlate)
                elseif i > 1 then
                    debugPrint(i.." mouseover frames")
                end
                
            end
            
        elseif event == "PLAYER_TARGET_CHANGED" then
            if UnitExists("target") then
                frame.checkTarget = true
            else
                NP.targeted = nil
            end
            
        elseif event == "UNIT_TARGET" then
            local unitID = ...
            local targetID = unitID.."target"
            if UnitExists(targetID) and not UnitIsUnit("player", unitID) and UnitInRange(unitID) then
                local targetGUID = UnitGUID(targetID) 
                local iconNum = GetRaidTargetIndex(targetID)
                if iconNum and iconNum > 0 then
                    local foundPlate = FindPlateWithRaidIcon(iconNum)
                    if foundPlate and not NP.plateGUIDs[foundPlate] then
                        FoundPlateGUID(foundPlate, targetGUID, targetID)
                    end
                end

                if NP.GUIDs[targetGUID] and NP.GUIDs[targetGUID]:IsShown() then
                    return
                end
                
                local health = UnitHealth(targetID)
                local maxHealth = UnitHealthMax(targetID)
                if health > 0 and health ~= maxHealth then
                    local foundPlate = NP:GetNameplateByHealth(health, maxHealth)
                    if foundPlate and not NP.plateGUIDs[foundPlate] then
                        local name = UnitName(targetID)
                        if name == NP:GetName(foundPlate) then
                            FoundPlateGUID(foundPlate, targetGUID, targetID)
                        end
                    end
                end
            end
        elseif event == "UNIT_AURA" and arg1~="player" then
            NP:UnitAura(arg1)
        else
            if ... ~= "player" then
                NP:UnitCasting(event, arg1)
            end
        end
    end

    function NP:GetNameplateByHealth(current, max)
        local possibleFrames = {}
        local bar, barMax, barCurrent
        for frame in pairs(self.nameplates) do 
            if frame:IsShown() then
                bar = frame.healthBar or self:GetHealthBar(frame)

                if bar and bar.GetMinMaxValues then
                    _, barMax = bar:GetMinMaxValues()
                    if barMax == max then
                        if bar:GetValue() == current then
                            table_insert(possibleFrames, #possibleFrames+1, frame)
                        end
                    end
                
                end
            end
        end
        if #possibleFrames == 1 then
            return possibleFrames[1]
        end
        return nil
    end

    function NP:GetTargetNameplate()
        if self.targeted and self.targeted:IsShown() then
            return self.fakePlate[self.targeted] or self.targeted
        end
    end

    function NP:GetNameplateByGUID(GUID)
        if self.GUIDs[GUID] and self.GUIDs[GUID]:IsShown() then
            return self.fakePlate[self.GUIDs[GUID]] or self.GUIDs[GUID]
        end
    end


    function NP:GetNameplateByName(name)
        if self.names[name] and self.names[name]:IsShown() then
            return self.fakePlate[self.names[name]] or self.names[name]
        end
    end

    function NP:GetNameplateByUnit(unitID)
        if UnitIsUnit(unitID, "target") then
            return self:GetTargetNameplate()
        end
        local GUID = UnitGUID(unitID)
        if self.GUIDs[GUID] and self.GUIDs[GUID]:IsShown() then
            return self.fakePlate[self.GUIDs[GUID]] or self.GUIDs[GUID]
        end
        
        local health = UnitHealth(unitID)
        local maxHealth = UnitHealthMax(unitID)
        local frame = self:GetNameplateByHealth(health, maxHealth)
        local name = UnitName(unitID)
        if frame then
            if name == self:GetName(frame) then
                return self.fakePlate[frame] or frame
            end
        end
        
        if self.names[GUID] and self.names[GUID]:IsShown() then
            return self.fakePlate[self.names[GUID]] or self.names[GUID]
        end
    end

    local floor = math.floor
    local tinsert = table.insert

    local function createAuraIcon(icons, index)
        local button = CreateFrame("frame", nil, icons)

        button:SetWidth(icons.size or 16)
        button:SetHeight(icons.size or 16)

        local icon = button:CreateTexture(nil, "BORDER")
        icon:SetAllPoints(button)
        icon:SetTexCoord(.08, .92, .08, .92)
        
        local timer = button:CreateFontString(nil, "OVERLAY", "NumberFontNormal")
        timer:SetPoint("BOTTOM", button, "BOTTOM", 0, -6)
        
        local count = button:CreateFontString(nil, "OVERLAY")
        count:SetFontObject(NumberFontNormal)
        count:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 0)

        tinsert(icons.frames, button)

        button.parent = icons
        button.icon = icon
        button.count = count
        button.timer = timer
        
        return button
    end

    local function customFilter(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster)
        local isPlayer

        if(caster == '
    player' or caster == 'vehicle') then
            isPlayer = true
        end

        if((icons.onlyShowPlayer and isPlayer) or (not icons.onlyShowPlayer and name)) then
            icon.isPlayer = isPlayer
            icon.owner = caster
            return true
        end
    end

    local function in_array(e, t)
        if ( t[e] ) then
            return true
        end
        return false
    end

    local function FilterBlacklist(spellID, list)
        if ( in_array(spellID, list) ) then
            return false
        end
        return true
    end

    local function FilterWhitelist(spellID, list)
            if ( in_array(spellID, list) ) then
                return true
            end
        return false
    end

    local function Filter(icons, caster, spellID)
        if icons.type=="auras" then
            return FilterWhitelist(spellID, FAuras)
        elseif icons.type=="debuffs" then
            if caster then
                if caster=="player" or caster=="pet" or caster==caster:match("party%d") or caster==caster:match("partypet%d") then
                    return FilterBlacklist(spellID, FAuras)
                else
                    return false
                end
            end
        end
    end

    local function SetPosition(icons, x)
        if(icons and x > 0) then
            local col, row, gap = 0, 0, icons.gap
            local sizex = (icons.size or 16) + (icons['
    spacing-x'] or icons.spacing or 0)
            local sizey = (icons.size or 16) + (icons['
    spacing-y'] or icons.spacing or 0)
            local anchor = icons.initialAnchor or "BOTTOMLEFT"
            local growthx = (icons["growth-x"] == "LEFT" and -1) or 1
            local growthy = (icons["growth-y"] == "DOWN" and -1) or 1
            local cols = floor(icons:GetWidth() / sizex + .5)
            local rows = floor(icons:GetHeight() / sizey + .5)

            for i = 1, #icons.frames do
                local button = icons.frames[i]
                if(button and button:IsShown()) then
                    if(gap and button.debuff) then
                        if(col > 0) then
                            col = col + 1
                        end

                        gap = false
                    end

                    if(col >= cols) then
                        col = 0
                        row = row + 1
                    end
                    button:ClearAllPoints()
                    button:SetPoint(anchor, icons, anchor, col * sizex * growthx, row * sizey * growthy)

                    col = col + 1
                elseif(not button) then
                    break
                end
            end
        end
    end

    local function UpdateIcons(unit, icons, index, offset, filter, isDebuff, visible)
        if not unit then return; end
        local name, rank, texture, count, dtype, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID = UnitAura(unit, index, filter)
        
        if(name) then
            local n = visible + offset + 1
            local icon = icons.frames[n]
            if(not icon) then
                icon = createAuraIcon(icons)
            end

            local show = Filter(icons, caster, spellID)
            if(show) then
                icon.icon:SetTexture(texture)
                icon.count:SetText((count > 1 and count))

                icon.filter = filter
                icon.isDebuff = isDebuff

                icon:SetID(index)
                icon:Show()
                icon.duration = timeLeft - GetTime()
                icon:SetScript("OnUpdate", function(self, elaps) 
                    self.duration = self.duration - elaps
                    if self.duration <= 0 then
                        self:Hide()
                        SetPosition(icons, icons.num)
                    else
                        self.timer:SetFormattedText("%.1f", self.duration)
                    end
                end)
                
                icon:SetScript("OnHide", function(self)
                    self.duration = 0
                end)

                return 1
            else
                return 0
            end
        end
    end

    local function filterIcons(unit, icons, filter, limit, isDebuff, offset, dontHide)
        if(not offset) then offset = 0 end
        local index = 1
        local visible = 0
        while(visible < limit) do
            local result = UpdateIcons(unit, icons, index, offset, filter, isDebuff, visible)
            if(not result) then
                break
            elseif(result == 1) then
                visible = visible + 1
            end

            index = index + 1
        end

        if(not dontHide) then
            for i = visible + offset + 1, #icons.frames do
                icons.frames[i]:Hide()
            end
        end

        return visible
    end

    local function UpdateAuras(self, unit)
        
        if not self then return end
        local auras = self.Auras
        if(auras) then
            local numBuffs = auras.numBuffs or 32
            local numDebuffs = auras.numDebuffs or 40
            local max = numBuffs + numDebuffs

            local visibleBuffs = filterIcons(unit, auras, auras.buffFilter or auras.filter or '
    HELPFUL', numBuffs, nil, 0, true)
            auras.visibleBuffs = visibleBuffs

            auras.visibleDebuffs = filterIcons(unit, auras, auras.debuffFilter or auras.filter or '
    HARMFUL', numDebuffs, true, visibleBuffs)
            auras.visibleAuras = auras.visibleBuffs + auras.visibleDebuffs

            SetPosition(auras, max)
        end

        local debuffs = self.Debuffs
        if(debuffs) then
            local numDebuffs = debuffs.num or 40
            debuffs.visibleDebuffs = filterIcons(unit, debuffs, debuffs.filter or '
    HARMFUL', numDebuffs, true)
            SetPosition(debuffs, numDebuffs)
        end
    end

    local update_units = {"party1", "party2", "party3", "party4",
     "arena1", "arena2", "arena3", "arenapet1", "arenapet2", "arenapet3",
     "partypet1", "partypet2", "partypet3", "partypet4"}

    function NP:NewNameplate(frame)
        
        self:StylePlate(frame)
        
        for _, unit in pairs(update_units) do
            if UnitCastingInfo(unit) then
                self:UnitCasting("UNIT_SPELLCAST_START", unit)
            elseif UnitChannelInfo(unit) then
                self:UnitCasting("UNIT_SPELLCAST_CHANNEL_START", unit)
            end
        end
        
        if not frame.Debuffs then
            local debuffs = CreateFrame("Frame", nil, frame)
            debuffs.frames = {}
            debuffs.size = 26
            debuffs.spacing = 2
            debuffs:SetPoint("BOTTOM", frame, "TOP", 0, 0)
            debuffs["growth-x"] = "RIGHT"
            debuffs["growth-y"] = "UP"
            debuffs.initialAnchor = "BOTTOMLEFT"
            debuffs:SetWidth(frame:GetWidth())
            debuffs:SetHeight(debuffs.size*2+debuffs.spacing)
            debuffs.num = 24
            debuffs.type = "debuffs"
            frame.Debuffs = debuffs
        end
        
        if not frame.Auras then
            local auras = CreateFrame("Frame", nil, frame)
            auras.frames = {}
            auras.size = 32
            auras.spacing = 2
            auras:SetPoint("BOTTOM", debuffs, "TOP", 0, 6)
            auras["growth-x"] = "RIGHT"
            auras["growth-y"] = "UP"
            auras.initialAnchor = "BOTTOMLEFT"
            auras:SetWidth(frame:GetWidth())
            auras:SetHeight(auras.size*2+auras.spacing)
            auras.num = 24
            auras.type = "auras"
            frame.Auras = auras
        end
        
    end

    function NP:NameplateOnUpdate(frame)
        self:UpdateStatusbarColor(frame)
    end

    function NP:TargetNameplate(frame)
        UpdateAuras(frame, "target")
        
        if UnitCastingInfo("target") then
            self:UnitCasting("UNIT_SPELLCAST_START", "target", frame)
        elseif UnitChannelInfo(unit) then
            self:UnitCasting("UNIT_SPELLCAST_CHANNEL_START", "target", frame)
        end
    end

    function NP:MouseoverNameplate(frame)
        UpdateAuras(frame, "mouseover")
        
        if UnitCastingInfo("mouseover") then
            self:UnitCasting("UNIT_SPELLCAST_START", "mouseover", frame)
        elseif UnitChannelInfo(unit) then
            self:UnitCasting("UNIT_SPELLCAST_CHANNEL_START", "mouseover", frame)
        end
    end

    function NP:HealthChange(frame, min, max, cur)
        self:UpdateHealthBarValue(frame, min, max, cur)
    end

    function NP:FoundGUID(frame, guid, unit)
        UpdateAuras(frame, unit)
        
        if UnitCastingInfo(unit) then
            self:UnitCasting("UNIT_SPELLCAST_START", unit, frame)
        elseif UnitChannelInfo(unit) then
            self:UnitCasting("UNIT_SPELLCAST_CHANNEL_START", unit, frame)
        end
    end

    function NP:RecycleNameplate(frame)

        if frame.Debuffs and #frame.Debuffs.frames > 0 then
            for _, icon in pairs(frame.Debuffs.frames) do
                icon.duration = 0
            end
        end
        
        if frame.Auras and #frame.Auras.frames > 0 then
            for _, icon in pairs(frame.Auras.frames) do
                icon.duration = 0
            end
        end
        
        frame.health:Hide()
        frame.cast:Hide()
    end

    function NP:CombatChange(frame, inCombat)
        self:UpdateNameText(frame, inCombat)
    end

    function NP:UnitAura(unit)
        local frame
        local GUID = UnitGUID(unit)
        frame = self:GetNameplateByGUID(GUID)
        if frame then
            UpdateAuras(frame, unit)
        else
            frame = self:GetNameplateByUnit(unit)
            UpdateAuras(frame, unit)
        end
    end

    function NP:Init()

        self.lastUpdate = 0
        self.lastHPCheck = 0
        self.checkTarget = false
        self:SetScript("OnUpdate", OnUpdate)
        self:SetScript("OnEvent", OnEvent)
        self:RegisterEvent('
    UPDATE_MOUSEOVER_UNIT')
        self:RegisterEvent('
    PLAYER_TARGET_CHANGED')
        self:RegisterEvent('
    UNIT_TARGET')
        self:RegisterEvent('
    RAID_TARGET_UPDATE')
        self:RegisterEvent('
    UNIT_AURA')
        self:RegisterEvent("UNIT_SPELLCAST_START")
        self:RegisterEvent("UNIT_SPELLCAST_FAILED")
        self:RegisterEvent("UNIT_SPELLCAST_STOP")
        self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
        self:RegisterEvent("UNIT_SPELLCAST_DELAYED")
        self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
        self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE")
        self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP")
        
    end 
    шкурка не влезла , превышен лимит в 35 000 букв , нужно ждать 20 минут что бы следующий пост был как новый , а не updated.
    Последний раз редактировалось DreamlØlz; 11.10.2015 в 03:17.

  6. #1133
    Старожил Аватар для Wbtest2
    Регистрация
    21.02.2015
    Адрес
    Minsk
    Сообщений
    180
    Поблагодарил(а)
    46
    Получено благодарностей: 114 (сообщений: 60).
    Репутация: 114
    local function IsNamePlateFrame(frame)
    if frame:GetName() then return false end
    if frame:GetID() ~= 0 then return false end
    if frame:GetObjectType() ~= "Frame" then return false end
    if frame:GetNumChildren() == 0 then return false end
    if frame:GetNumRegions() == 0 then return false end
    return true
    end
    А разве при таком отсеве неймплейт не начнутся проблемы и спам ероров при включении /fstack ?
    P.S Все не осилил )

  7. #1134
    Дедушка форума
    Регистрация
    20.03.2012
    Сообщений
    4,173
    Поблагодарил(а)
    358
    Получено благодарностей: 1,437 (сообщений: 836).
    Репутация: 2397
    Цитата Сообщение от Wbtest2 Посмотреть сообщение
    А разве при таком отсеве неймплейт не начнутся проблемы и спам ероров при включении /fstack ?
    P.S Все не осилил )
    В плане проблемы при фрейм стаке? Ничего не выдает же , кастбары на всех юнитов (наконец сделал как хотел , а не как получилось) и бафы , фреймы не теряют прозрачность при смене цели(не OnUpdate прозрачность) и тд.

    100% нет не лагов не вылетов, не ошибок сценариев , единственно при фстак идет расход памяти хз куда , которая потом выгружается через некоторое время после отмены фрейм стака.

    Последний раз редактировалось DreamlØlz; 11.10.2015 в 13:48.

  8. #1135
    Дедушка форума
    Регистрация
    20.03.2012
    Сообщений
    4,173
    Поблагодарил(а)
    358
    Получено благодарностей: 1,437 (сообщений: 836).
    Репутация: 2397
    Цитата Сообщение от Wbtest2 Посмотреть сообщение
    А разве при таком отсеве неймплейт не начнутся проблемы и спам ероров при включении /fstack ?
    P.S Все не осилил )
    Потестил -- такой метод быстрее работает ... особенно заметно когда плейтов овердафига (например вендоры на фане).

    PHP код:
    local function IsNamePlateFrame(obj)
        
    local Object obj
        local Name 
    Object:GetName()
        
    local OverlayRegion select(2Object:GetRegions())
        
        if (
    Namethen
            
    return
        
    end
        
        
    return OverlayRegion and OverlayRegion:GetObjectType() == "Texture" and OverlayRegion:GetTexture() == [=[Interface\Tooltips\Nameplate-Border]=]
    end 

  9. #1136
    Ветеран форума Аватар для PirateTV
    Регистрация
    28.03.2013
    Адрес
    https://www.twitch.tv/piratetvx
    Сообщений
    1,213
    Поблагодарил(а)
    387
    Получено благодарностей: 370 (сообщений: 308).
    Репутация: 370
    Привет, ребят.
    Можно ли перетащить бафы/дебафы в это место?


  10. #1137
    Дедушка форума
    Регистрация
    20.03.2012
    Сообщений
    4,173
    Поблагодарил(а)
    358
    Получено благодарностей: 1,437 (сообщений: 836).
    Репутация: 2397
    Цитата Сообщение от Neighbourhood Посмотреть сообщение
    Привет, ребят.
    Можно ли перетащить бафы/дебафы в это место?

    Тут уже вопрос ребром) Перетащить то можно , но тогда рост аур придется менять ... Нужно ли оно ...

  11. #1138
    Ветеран форума Аватар для PirateTV
    Регистрация
    28.03.2013
    Адрес
    https://www.twitch.tv/piratetvx
    Сообщений
    1,213
    Поблагодарил(а)
    387
    Получено благодарностей: 370 (сообщений: 308).
    Репутация: 370
    Цитата Сообщение от DreamlØlz Посмотреть сообщение
    Тут уже вопрос ребром) Перетащить то можно , но тогда рост аур придется менять ... Нужно ли оно ...
    Просто хочу перетащить фреймы вот сюда, с целью увеличить обзор)







    Бафы/дебафы девать некуда, знаю, что можно сделать такое в х-перле, но мне больше нравится дефолт)

  12. #1139
    Флудер года Аватар для Dontcrybaby
    Регистрация
    05.01.2012
    Адрес
    Москва / Волгоград
    Сообщений
    11,755
    Поблагодарил(а)
    58
    Получено благодарностей: 701 (сообщений: 508).
    Репутация: 1737
    Цитата Сообщение от Neighbourhood Посмотреть сообщение
    Просто хочу перетащить фреймы вот сюда, с целью увеличить обзор)







    Бафы/дебафы девать некуда, знаю, что можно сделать такое в х-перле, но мне больше нравится дефолт)
    moveanything




  13. #1140
    Ветеран форума Аватар для PirateTV
    Регистрация
    28.03.2013
    Адрес
    https://www.twitch.tv/piratetvx
    Сообщений
    1,213
    Поблагодарил(а)
    387
    Получено благодарностей: 370 (сообщений: 308).
    Репутация: 370
    Цитата Сообщение от Dontcrybaby Посмотреть сообщение
    moveanything



    Я видимо слепой, не понял что ты хотел показать на своём скрине)
    А на счет MoveAnything, так там я только нарыл менять ТОЛЬКО дебафы и только у таргета.

    Последний раз редактировалось PirateTV; 17.10.2015 в 18:37.

Страница 95 из 279 ПерваяПервая ... 45859394959697105145195 ... ПоследняяПоследняя

Похожие темы

  1. И где же описание апдейта 114 ??
    от Gozya в разделе Вопросы Logon, TBC, Legion, BFa, SL
    Ответов: 2
    Последнее сообщение: 27.06.2012, 09:46
  2. Скрины интерфейса, Прото-паладин
    от amigoxxx в разделе Корзина
    Ответов: 3
    Последнее сообщение: 28.05.2012, 13:53
  3. Интерфейс
    от Romka_163 в разделе Вопросы Logon, TBC, Legion, BFa, SL
    Ответов: 0
    Последнее сообщение: 26.05.2012, 02:34
  4. Сброс рейта тим на х100
    от CriminalMind в разделе Вопросы Logon, TBC, Legion, BFa, SL
    Ответов: 1
    Последнее сообщение: 25.05.2012, 23:12

Ваши права

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