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

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

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

Тема: Tooltip

  1. #1
    Гуру Аватар для Екзорцист
    Регистрация
    27.03.2016
    Сообщений
    329
    Поблагодарил(а)
    131
    Получено благодарностей: 69 (сообщений: 54).
    Репутация: 69

    Question Tooltip

    Hадо чтобы иконка отображалась в обоих случаях, при наведении, и при клике по итему, есть идеи ?

    помню была где-то тема про чтото похожее, спруди кидал но найти немогу

  2. #2
    Гуру Аватар для Екзорцист
    Регистрация
    27.03.2016
    Сообщений
    329
    Поблагодарил(а)
    131
    Получено благодарностей: 69 (сообщений: 54).
    Репутация: 69
    https://forum.wowcircle.net/showthre...=1#post6333539
    это почти то что нужно, но нету иконки при наведении

    help please

  3. #3
    Гуру Аватар для Попкина_Сладость
    Регистрация
    01.02.2018
    Сообщений
    387
    Поблагодарил(а)
    85
    Получено благодарностей: 53 (сообщений: 43).
    Репутация: 53
    https://yadi.sk/d/Y32VLkp2goLtsw

    Спелл_ИтемИД можешь оттуда выпилить, я его туда запихал для себя!

  4. 1 пользователь сказал cпасибо Попкина_Сладость за это полезное сообщение:

    Екзорцист (31.03.2020)

  5. #4
    Заблокирован
    Регистрация
    09.06.2016
    Адрес
    Rivne, Ukraine
    Сообщений
    908
    Поблагодарил(а)
    244
    Получено благодарностей: 412 (сообщений: 237).
    Репутация: 412
    PHP код:
    -- icons\ilvl\id tooltip
    do
        
    local TOOLTIPS = {ItemRefTooltip,GameTooltip,ShoppingTooltip1,ShoppingTooltip2,ShoppingTooltip3}
        
    local GetItemIcon GetItemIcon
        local GetItemInfo 
    GetItemInfo
        local _G 
    _G

        local 
    function OnTooltipSetSpell(self)
            
    local _,_,spell self:GetSpell()
            if 
    spell and GetSpellInfo(spellthen
                local title 
    _G[self:GetName().."TextLeft1"]
                if 
    title then
                    local _
    ,_,texture GetSpellInfo(spell)
                    
    title:SetFormattedText("|T%s:20:20:0:0:64:64:5:59:5:59:20|t %s",texture,title:GetText())
                
    end

                self
    :AddLine(("|cff3366ffID|r: |cffffffff%d|r"):format(spell))
                
    self:Show()
            
    end
        end

        local 
    function OnTooltipSetItem(self)
            
    local itemName,link self:GetItem()
            if 
    link and GetItemInfo(linkthen
                local title
                
    for 1,do
                    
    title _G[("%sTextLeft%d"):format(self:GetName(),i)]
                    if 
    title and title:GetText() and title:GetText():find(itemNamethen
                        title
    :SetFormattedText("|T%s:20:20:0:0:64:64:5:59:5:59:20|t %s",GetItemIcon(link),title:GetText())
                        break
                    
    end
                end

                local _
    ,_,_,ilvl GetItemInfo(link)
                
    local id link:match("|Hitem:(%d+):")
                
    ilvl ilvl and ("|cff3366ffilvl|r: |cffffffff%d|r"):format(ilvl)
                
    id id and ("|cff3366ffID|r: |cffffffff%d|r"):format(id)

                
    self:AddDoubleLine(id,ilvl)
                
    self:Show()
            
    end
        end

        
    for _,tooltip in pairs(TOOLTIPS) do
            
    tooltip:HookScript("OnTooltipSetSpell",OnTooltipSetSpell)
            
    tooltip:HookScript("OnTooltipSetItem",OnTooltipSetItem)
        
    end
    end 
    Вот моё

    - - - Updated - - -

    Похожий модуль из сборки дримлолза

    PHP код:
    local enginemodulesmedia select(2, ...):unpack()

    local tooltip modules:LoadModule("Tooltip")

    local SetIcon = function(selficon)
        
    local title icon and _G[self:GetName().."TextLeft1"]
        if 
    title then
            title
    :SetFormattedText("|T%s:20:20:0:0:64:64:5:59:5:59:%d|t %s"icon20title:GetText())
        
    end
    end

    local Hook 
    = function(methodfunc)
        return function(
    tooltip)
            
    local modified false

            tooltip
    :HookScript("OnTooltipCleared", function(self, ...)
                
    modified false
            end
    )

            
    tooltip:HookScript(method, function(self, ...)
                if 
    not modified then
                    modified 
    true
                    func
    (self, ...)
                
    end
            end
    )
        
    end
    end

    local hookItem 
    Hook("OnTooltipSetItem", function(self, ...)
        
    local _link self:GetItem()
        if 
    link then
            SetIcon
    (selfGetItemIcon(link))
        
    end
    end
    )

    local hookSpell Hook("OnTooltipSetSpell", function(self, ...)
        
    local __id self:GetSpell()
        if 
    id then
            SetIcon
    (selfselect(3GetSpellInfo(id)))
        
    end
    end
    )

    local addLine = function(selfidisItem)
        for 
    1self:NumLines() do
            
    local line _G["GameTooltipTextLeft"..i]
            if 
    not line then break end
            local text 
    line:GetText()
            if 
    text and (text:match("ID") or text:match("ID")) then return end
        end
        
    if isItem then
            self
    :AddLine("|cFF4488FFID|r "..id)
        else
            
    self:AddLine("|cFF4488FFID|r "..id)
        
    end
        self
    :Show()
    end

    local attachItemTooltip 
    = function(self)
        
    local link select(2self:GetItem())
        if 
    not link then return end
        local id 
    select(3strfind(link"^|%x+|Hitem:(%-?%d+):(%d+):(%d+):(%d+):(%d+):(%d+):(%-?%d+):(%-?%d+)"))
        if 
    id then addLine(selfidtrueend
    end

    function tooltip:Init()

        for 
    _tooltip in pairs{GameTooltipItemRefTooltipItemRefShoppingTooltip1ItemRefShoppingTooltip2ShoppingTooltip1ShoppingTooltip2} do
            
    hookItem(tooltip)
            
    hookSpell(tooltip)
        
    end
        
        hooksecurefunc
    (GameTooltip"SetUnitAura", function(self, ...)
            
    local id select(11UnitAura(...))
            if 
    id then addLine(selfidend
        end
    )

        
    GameTooltip:HookScript("OnTooltipSetSpell", function(self)
            
    local id select(3self:GetSpell())
            if 
    id then addLine(selfidend
        end
    )

        
    hooksecurefunc("SetItemRef", function(link, ...)
            
    local id tonumber(link:match("spell:(%d+)"))
            if 
    id then addLine(ItemRefTooltipidend
        end
    )
        
        
    GameTooltip:HookScript("OnTooltipSetItem"attachItemTooltip)
        
    ItemRefTooltip:HookScript("OnTooltipSetItem"attachItemTooltip)
        
    ItemRefShoppingTooltip1:HookScript("OnTooltipSetItem"attachItemTooltip)
        
    ItemRefShoppingTooltip2:HookScript("OnTooltipSetItem"attachItemTooltip)
        
    ShoppingTooltip1:HookScript("OnTooltipSetItem"attachItemTooltip)
        
    ShoppingTooltip2:HookScript("OnTooltipSetItem"attachItemTooltip)
    end 
    [свернуть]
    Последний раз редактировалось Sproody; 31.03.2020 в 16:37. Причина: minor bug

  6. #5
    Гуру Аватар для Екзорцист
    Регистрация
    27.03.2016
    Сообщений
    329
    Поблагодарил(а)
    131
    Получено благодарностей: 69 (сообщений: 54).
    Репутация: 69
    спасибо!

Похожие темы

  1. Atlasloot Enhanced (Wishlist) & Tooltip
    от Toyota в разделе Аддоны
    Ответов: 4
    Последнее сообщение: 07.03.2020, 03:14
  2. Помогите с Lua Tooltip
    от hnser в разделе Аддоны
    Ответов: 8
    Последнее сообщение: 17.07.2015, 21:44
  3. Помогите с Lua Tooltip
    от hnser в разделе Корзина
    Ответов: 0
    Последнее сообщение: 17.07.2015, 16:09
  4. tooltip
    от Dionis1108 в разделе Корзина
    Ответов: 1
    Последнее сообщение: 05.12.2014, 12:50

Ваши права

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