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

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

Страница 2 из 3 ПерваяПервая 123 ПоследняяПоследняя
Показано с 13 по 24 из 36
  1. #13
    Гуру Аватар для Попкина_Сладость
    Регистрация
    01.02.2018
    Сообщений
    387
    Поблагодарил(а)
    85
    Получено благодарностей: 53 (сообщений: 43).
    Репутация: 53
    Цитата Сообщение от Sproody Посмотреть сообщение
    PHP код:
    local function healthbar_valuechanged_cb(self,value)
        
    self.text:SetText(value)
    end

    local 
    function healthbar_show_cb(self)
        
    self.text:SetText(self:GetValue())
    end

    local 
    function nameplate_update_cb(self)
        
    self:SetAlpha(1)
    end

    local 
    function InitNamePlate(frame)
        
    local healthbar frame:GetChildren()
        
    healthbar.text healthbar:CreateFontString(nil,"ARTWORK")
        
    healthbar.text:SetFont("Fonts\\FRIZQT__.TTF",11,"OUTLINE")
        
    healthbar.text:SetPoint("CENTER")

        
    healthbar_show_cb(healthbar)
        
    healthbar:SetScript("OnValueChanged",healthbar_valuechanged_cb)
        
    healthbar:SetScript("OnShow",healthbar_show_cb)
        
    frame:SetScript("OnUpdate",nameplate_update_cb)
    end

    local 
    function IdentifyFrame(self)
        if 
    self:GetName() then return end
        
    if self.GetRegions then
            local region 
    self:GetRegions()
            if 
    region.GetTexture then
                local texturePath 
    region:GetTexture()
                if 
    texturePath == "Interface\\TargetingFrame\\UI-TargetingFrame-Flash" then
                    
    return "NamePlate"
                
    elseif texturePath == "Interface\\Tooltips\\ChatBubble-Background" then
                    
    return "ChatBubble"
                
    end
            end
        end
    end

    local 
    function iterateChildrens(object,...)
        if 
    not object then return end

        local type 
    IdentifyFrame(object)
        if 
    type == "NamePlate" then
            InitNamePlate
    (object)
        elseif 
    type == "ChatBubble" then
            
    --InitChatBubble(object)
        
    end

        
    return iterateChildrens(...)
    end


    local select
    ,WorldFrame select,WorldFrame
    local lastWorldFrameChildsCount 
    0
    CreateFrame
    ("frame"):SetScript("OnUpdate",function()
        
    local worldFrameChildsCount WorldFrame:GetNumChildren()
        if 
    worldFrameChildsCount ~= lastWorldFrameChildsCount then
            iterateChildrens
    (select(lastWorldFrameChildsCount+1,WorldFrame:GetChildren()))
            
    lastWorldFrameChildsCount worldFrameChildsCount
        end
    end

    Спасибо фурычит!


    А можно ещё сюда запихать иконку класса?
    С возможностью регулировать размер иконке в коде?
    Screenshot_1.jpg

  2. #14
    Заблокирован
    Регистрация
    09.06.2016
    Адрес
    Rivne, Ukraine
    Сообщений
    908
    Поблагодарил(а)
    244
    Получено благодарностей: 412 (сообщений: 237).
    Репутация: 412
    Цитата Сообщение от Попкина_Сладость Посмотреть сообщение
    Спасибо фурычит!


    А можно ещё сюда запихать иконку класса?
    С возможностью регулировать размер иконке в коде?
    Screenshot_1.jpg

    PHP код:
    local CLASSICON_SIZE 28
    local ACCURACY 
    8
    local CLASS_ICON_TCOORDS 
    CLASS_ICON_TCOORDS
    local UnitClass 
    UnitClass
    local pairs 
    pairs


    local math_round
    do
        
    local math_floor math.floor
        math_round 
    = function(x)
            return 
    math_floor(x+0.5)
        
    end
    end

    local 
    function GetUnitTypeByNameplateRGB(r,g,b)
        if 
    == 0 then -- red
            
    return "enemy"
        
    elseif == 0 then -- green
            
    return "friend_pvp"
        
    elseif == 0 then -- blue
            
    return "friend_nopvp"
        
    elseif 1.99 and == 0 then -- yellow
            
    return "neutral"
        
    else
            return 
    "enemy_player"
        
    end
    end

    local GetClassByRGB
    do
        
    local RAID_CLASS_COLORS RAID_CLASS_COLORS
        GetClassByRGB 
    = function(r,g,b)

            for class,
    tbl in pairs(RAID_CLASS_COLORS) do
                if 
    math_round(tbl.r*ACCURACY) == math_round(r*ACCURACY)
                    and 
    math_round(tbl.g*ACCURACY) == math_round(g*ACCURACY)
                    and 
    math_round(tbl.b*ACCURACY) == math_round(b*ACCURACYthen

                    
    return class
                
    end
            end
        end
    end

    local 
    function healthbar_UpdateClassIcon(self,r,g,b)
        if 
    GetUnitTypeByNameplateRGB(r,g,b) == "enemy_player" then
            local 
    class = GetClassByRGB(r,g,b)
            if class 
    then
                self
    .classIcon:SetTexCoord(unpack(CLASS_ICON_TCOORDS[class]))
                
    self.classIcon:Show()
                return
            
    end
        end

        self
    .classIcon:Hide()
    end

    local 
    function healthbar_valuechanged_cb(self,value)
        
    self.text:SetText(value)
    end

    local 
    function healthbar_show_cb(self)
        
    self.text:SetText(self:GetValue())
    end

    local 
    function healthbar_update_cb(self)
        
    local r,g,self:GetStatusBarColor()
        if 
    not (== self.and == self.and == self.bthen
            healthbar_UpdateClassIcon
    (self,r,g,b)
            
    self.r,self.g,self.r,g,b
        end
    end

    local 
    function nameplate_update_cb(self)
        
    self:SetAlpha(1)
    end

    local 
    function InitNamePlate(frame)
        
    local healthbar frame:GetChildren()
        
    healthbar.text healthbar:CreateFontString(nil,"ARTWORK")
        
    healthbar.text:SetFont("Fonts\\FRIZQT__.TTF",11,"OUTLINE")
        
    healthbar.text:SetPoint("CENTER")

        
    healthbar.classIcon healthbar:CreateTexture(nil,"BORDER")
        
    healthbar.classIcon:SetPoint("RIGHT",healthbar,"LEFT",-4,0)
        
    healthbar.classIcon:SetSize(CLASSICON_SIZE,CLASSICON_SIZE)
        
    healthbar.classIcon:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles")
        
    healthbar.classIcon:Hide()

        
    healthbar_show_cb(healthbar)
        
    healthbar:SetScript("OnValueChanged",healthbar_valuechanged_cb)
        
    healthbar:SetScript("OnShow",healthbar_show_cb)
        
    healthbar:SetScript("OnUpdate",healthbar_update_cb)
        
    frame:SetScript("OnUpdate",nameplate_update_cb)
    end

    local 
    function IdentifyFrame(self)
        if 
    self:GetName() then return end
        
    if self.GetRegions then
            local region 
    self:GetRegions()
            if 
    region.GetTexture then
                local texturePath 
    region:GetTexture()
                if 
    texturePath == "Interface\\TargetingFrame\\UI-TargetingFrame-Flash" then
                    
    return "NamePlate"
                
    elseif texturePath == "Interface\\Tooltips\\ChatBubble-Background" then
                    
    return "ChatBubble"
                
    end
            end
        end
    end

    local 
    function iterateChildrens(object,...)
        if 
    not object then return end

        local type 
    IdentifyFrame(object)
        if 
    type == "NamePlate" then
            InitNamePlate
    (object)
        elseif 
    type == "ChatBubble" then
            
    --InitChatBubble(object)
        
    end

        
    return iterateChildrens(...)
    end


    local select
    ,WorldFrame select,WorldFrame
    local lastWorldFrameChildsCount 
    0
    CreateFrame
    ("frame"):SetScript("OnUpdate",function()
        
    local worldFrameChildsCount WorldFrame:GetNumChildren()
        if 
    worldFrameChildsCount ~= lastWorldFrameChildsCount then
            iterateChildrens
    (select(lastWorldFrameChildsCount+1,WorldFrame:GetChildren()))
            
    lastWorldFrameChildsCount worldFrameChildsCount
        end
    end

    Вот вроде, пробуй. Если классы будет неверно определять - поиграйся с значением константы ACCURACY

  3. #15
    Старожил Аватар для ida
    Регистрация
    24.04.2020
    Сообщений
    154
    Поблагодарил(а)
    33
    Получено благодарностей: 60 (сообщений: 31).
    Репутация: 60
    Sproody, скажи, пожалуйста, что на счет этого поста? https://forum.wowcircle.net/showthre...=1#post7327200
    Возможно убрать смешивание полосок как на скрине выше и сделать всегда как на скрине ниже не зависимо берешь в таргет или нет?
    Если возьмешься, возьми, пожалуйста, за основу код из 2 поста.
    Последний раз редактировалось ida; 06.07.2020 в 12:19.

  4. #16
    Гуру Аватар для Попкина_Сладость
    Регистрация
    01.02.2018
    Сообщений
    387
    Поблагодарил(а)
    85
    Получено благодарностей: 53 (сообщений: 43).
    Репутация: 53
    Цитата Сообщение от Sproody Посмотреть сообщение
    PHP код:
    local CLASSICON_SIZE 28
    local ACCURACY 
    8
    local CLASS_ICON_TCOORDS 
    CLASS_ICON_TCOORDS
    local UnitClass 
    UnitClass
    local pairs 
    pairs


    local math_round
    do
        
    local math_floor math.floor
        math_round 
    = function(x)
            return 
    math_floor(x+0.5)
        
    end
    end

    local 
    function GetUnitTypeByNameplateRGB(r,g,b)
        if 
    == 0 then -- red
            
    return "enemy"
        
    elseif == 0 then -- green
            
    return "friend_pvp"
        
    elseif == 0 then -- blue
            
    return "friend_nopvp"
        
    elseif 1.99 and == 0 then -- yellow
            
    return "neutral"
        
    else
            return 
    "enemy_player"
        
    end
    end

    local GetClassByRGB
    do
        
    local RAID_CLASS_COLORS RAID_CLASS_COLORS
        GetClassByRGB 
    = function(r,g,b)

            for class,
    tbl in pairs(RAID_CLASS_COLORS) do
                if 
    math_round(tbl.r*ACCURACY) == math_round(r*ACCURACY)
                    and 
    math_round(tbl.g*ACCURACY) == math_round(g*ACCURACY)
                    and 
    math_round(tbl.b*ACCURACY) == math_round(b*ACCURACYthen

                    
    return class
                
    end
            end
        end
    end

    local 
    function healthbar_UpdateClassIcon(self,r,g,b)
        if 
    GetUnitTypeByNameplateRGB(r,g,b) == "enemy_player" then
            local 
    class = GetClassByRGB(r,g,b)
            if class 
    then
                self
    .classIcon:SetTexCoord(unpack(CLASS_ICON_TCOORDS[class]))
                
    self.classIcon:Show()
                return
            
    end
        end

        self
    .classIcon:Hide()
    end

    local 
    function healthbar_valuechanged_cb(self,value)
        
    self.text:SetText(value)
    end

    local 
    function healthbar_show_cb(self)
        
    self.text:SetText(self:GetValue())
    end

    local 
    function healthbar_update_cb(self)
        
    local r,g,self:GetStatusBarColor()
        if 
    not (== self.and == self.and == self.bthen
            healthbar_UpdateClassIcon
    (self,r,g,b)
            
    self.r,self.g,self.r,g,b
        end
    end

    local 
    function nameplate_update_cb(self)
        
    self:SetAlpha(1)
    end

    local 
    function InitNamePlate(frame)
        
    local healthbar frame:GetChildren()
        
    healthbar.text healthbar:CreateFontString(nil,"ARTWORK")
        
    healthbar.text:SetFont("Fonts\\FRIZQT__.TTF",11,"OUTLINE")
        
    healthbar.text:SetPoint("CENTER")

        
    healthbar.classIcon healthbar:CreateTexture(nil,"BORDER")
        
    healthbar.classIcon:SetPoint("RIGHT",healthbar,"LEFT",-4,0)
        
    healthbar.classIcon:SetSize(CLASSICON_SIZE,CLASSICON_SIZE)
        
    healthbar.classIcon:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles")
        
    healthbar.classIcon:Hide()

        
    healthbar_show_cb(healthbar)
        
    healthbar:SetScript("OnValueChanged",healthbar_valuechanged_cb)
        
    healthbar:SetScript("OnShow",healthbar_show_cb)
        
    healthbar:SetScript("OnUpdate",healthbar_update_cb)
        
    frame:SetScript("OnUpdate",nameplate_update_cb)
    end

    local 
    function IdentifyFrame(self)
        if 
    self:GetName() then return end
        
    if self.GetRegions then
            local region 
    self:GetRegions()
            if 
    region.GetTexture then
                local texturePath 
    region:GetTexture()
                if 
    texturePath == "Interface\\TargetingFrame\\UI-TargetingFrame-Flash" then
                    
    return "NamePlate"
                
    elseif texturePath == "Interface\\Tooltips\\ChatBubble-Background" then
                    
    return "ChatBubble"
                
    end
            end
        end
    end

    local 
    function iterateChildrens(object,...)
        if 
    not object then return end

        local type 
    IdentifyFrame(object)
        if 
    type == "NamePlate" then
            InitNamePlate
    (object)
        elseif 
    type == "ChatBubble" then
            
    --InitChatBubble(object)
        
    end

        
    return iterateChildrens(...)
    end


    local select
    ,WorldFrame select,WorldFrame
    local lastWorldFrameChildsCount 
    0
    CreateFrame
    ("frame"):SetScript("OnUpdate",function()
        
    local worldFrameChildsCount WorldFrame:GetNumChildren()
        if 
    worldFrameChildsCount ~= lastWorldFrameChildsCount then
            iterateChildrens
    (select(lastWorldFrameChildsCount+1,WorldFrame:GetChildren()))
            
    lastWorldFrameChildsCount worldFrameChildsCount
        end
    end

    Вот вроде, пробуй. Если классы будет неверно определять - поиграйся с значением константы ACCURACY
    Иконок вообще нету никаких!

  5. #17
    Заблокирован
    Регистрация
    09.06.2016
    Адрес
    Rivne, Ukraine
    Сообщений
    908
    Поблагодарил(а)
    244
    Получено благодарностей: 412 (сообщений: 237).
    Репутация: 412
    Цитата Сообщение от Попкина_Сладость Посмотреть сообщение
    Иконок вообще нету никаких!
    А да, не сказал. Они только на вражеских плейтах будут. И только со включенным цветовым отображением.

  6. #18
    Гуру Аватар для Попкина_Сладость
    Регистрация
    01.02.2018
    Сообщений
    387
    Поблагодарил(а)
    85
    Получено благодарностей: 53 (сообщений: 43).
    Репутация: 53
    Цитата Сообщение от Sproody Посмотреть сообщение
    А да, не сказал. Они только на вражеских плейтах будут. И только со включенным цветовым отображением.
    Да работает, а можно иконки квадратные сделать?
    Screenshot_1.jpg

  7. #19
    Заблокирован
    Регистрация
    09.06.2016
    Адрес
    Rivne, Ukraine
    Сообщений
    908
    Поблагодарил(а)
    244
    Получено благодарностей: 412 (сообщений: 237).
    Репутация: 412
    Цитата Сообщение от Попкина_Сладость Посмотреть сообщение
    Да работает, а можно иконки квадратные сделать?
    Screenshot_1.jpg
    замени в 88 строчке "Interface\\TargetingFrame\\UI-Classes-Circles" на "Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes"

    - - - Updated - - -

    Цитата Сообщение от ida Посмотреть сообщение
    Sproody, скажи, пожалуйста, что на счет этого поста? https://forum.wowcircle.net/showthre...=1#post7327200
    Возможно убрать смешивание полосок как на скрине выше и сделать всегда как на скрине ниже не зависимо берешь в таргет или нет?
    Если возьмешься, возьми, пожалуйста, за основу код из 2 поста.
    Чуть позже чекну, отпишу

  8. #20
    Гуру Аватар для Попкина_Сладость
    Регистрация
    01.02.2018
    Сообщений
    387
    Поблагодарил(а)
    85
    Получено благодарностей: 53 (сообщений: 43).
    Репутация: 53
    Цитата Сообщение от Sproody Посмотреть сообщение
    замени в 88 строчке "Interface\\TargetingFrame\\UI-Classes-Circles" на "Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes"

    - - - Updated - - -



    Чуть позже чекну, отпишу
    Спс работает!
    И последнее:
    Если захочется убрать показ ХП какой код удалить-закомментировать? (А то когда в толпе в глазах рябит от цифр)

  9. #21
    Заблокирован
    Регистрация
    09.06.2016
    Адрес
    Rivne, Ukraine
    Сообщений
    908
    Поблагодарил(а)
    244
    Получено благодарностей: 412 (сообщений: 237).
    Репутация: 412
    Цитата Сообщение от Попкина_Сладость Посмотреть сообщение
    Спс работает!
    И последнее:
    Если захочется убрать показ ХП какой код удалить-закомментировать? (А то когда в толпе в глазах рябит от цифр)
    93-94 строчки
    PHP код:
        healthbar:SetScript("OnShow",healthbar_show_cb)
        
    healthbar:SetScript("OnUpdate",healthbar_update_cb

  10. #22
    Гуру Аватар для Попкина_Сладость
    Регистрация
    01.02.2018
    Сообщений
    387
    Поблагодарил(а)
    85
    Получено благодарностей: 53 (сообщений: 43).
    Репутация: 53
    Цитата Сообщение от Sproody Посмотреть сообщение
    93-94 строчки
    PHP код:
        healthbar:SetScript("OnShow",healthbar_show_cb)
        
    healthbar:SetScript("OnUpdate",healthbar_update_cb
    неа)
    Удаляется иконка а надо показ ПХ!
    Проще напиши код на Иконку класса противника, без показа ХП игрока!
    А я по мере необходимости буду менять код да и всё...
    Последний раз редактировалось Попкина_Сладость; 06.07.2020 в 17:42.

  11. #23
    Старожил Аватар для ida
    Регистрация
    24.04.2020
    Сообщений
    154
    Поблагодарил(а)
    33
    Получено благодарностей: 60 (сообщений: 31).
    Репутация: 60
    Цитата Сообщение от Попкина_Сладость Посмотреть сообщение
    неа)
    Удаляется иконка а надо показ ПХ!
    Проще напиши код на Иконку класса противника, без показа ХП игрока!
    А я по мере необходимости буду менять код да и всё...
    Я бы тебе вообще ничего не писал

  12. #24
    Старожил Аватар для ida
    Регистрация
    24.04.2020
    Сообщений
    154
    Поблагодарил(а)
    33
    Получено благодарностей: 60 (сообщений: 31).
    Репутация: 60
    Цитата Сообщение от Sproody Посмотреть сообщение
    Чуть позже чекну, отпишу
    Спруди, актуально все еще?

Страница 2 из 3 ПерваяПервая 123 ПоследняяПоследняя

Похожие темы

  1. Ответов: 43
    Последнее сообщение: 12.12.2016, 09:22
  2. [Wotlk] Кросс ПВП для хай рейтов и лоу рейтов отдельно как раньше
    от rovrnomy в разделе Вопросы Logon, TBC, Legion, BFa, SL
    Ответов: 1
    Последнее сообщение: 02.07.2015, 09:31
  3. вор взлом сейфов
    от neronrex в разделе Корзина
    Ответов: 0
    Последнее сообщение: 13.04.2013, 04:47

Ваши права

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