Go Back   Shestak UI > Interface Forums > Russian Community > Modified Versions

Modified Versions Your modified version of ShestakUI.

Advertising

 
Thread Tools
Old 08.12.2012, 02:58   #1
 Junior Member User Information

Shestak's Avatar
Question Гара'джал и Духовная связь

Скопировать код в ShestakUI\Core\Temp.lua или создать эддон.
lua Code [Select]:
local spell = select(1, GetSpellInfo(117543))

local button = CreateFrame("Button", "InnervationBuff", UIParent)
button:SetTemplate("Default")
button:SetPoint("CENTER")
button:SetSize(50, 50)
button:Hide()
button:SetMovable(true)
button:SetUserPlaced(true)
button:SetScript("OnMouseDown", function()
    button:StartMoving()
end)
button:SetScript("OnMouseUp", function()
    button:StopMovingOrSizing()
end)

local texture = button:CreateTexture(nil, "OVERLAY")
texture:SetTexCoord(0.1, 0.9, 0.1, 0.9)
texture:SetPoint("TOPLEFT", 2, -2)
texture:SetPoint("BOTTOMRIGHT", -2, 2)

local text = button:CreateFontString(nil, "OVERLAY")
text:SetFont(C.media.pixel_font, C.media.pixel_font_size, C.media.pixel_font_style)
text:SetPoint("CENTER")

local frame = CreateFrame("Frame")
frame:RegisterEvent("UNIT_AURA")
frame:SetScript("OnEvent", function(self, event)
    if event == "UNIT_AURA" then
        local name, _, icon, _, _, duration, expiration, _, _, _, _, _, _, _, val1, val2, val3 = UnitAura("player", spell)
        if name and name == spell then
            button:Show()
            texture:SetTexture(icon)
            val1 = (val1 and val1 > 0) and val1 or ""
            val2 = (val2 and val2 > 0) and val2 or ""
            val3 = (val3 and val3 > 0) and val3 or ""
            text:SetText(val1.."\n"..val2.."\n"..val3)
        else
            button:Hide()
            texture:SetTexture(nil)
            text:SetText("")
        end
    end
end)

Добавлено через 142 часа 57 минут
Проверил, работает.
Old 08.12.2012, 02:58   #1.5 - Disable Ads

Advertise on this site


Thread Tools



Mobile Style Русский English Deutsch Italian Chinese