Skip to content
Permalink
Browse files

A new way to change the text color for MagePortals.

  • Loading branch information
Wetxius committed Oct 23, 2014
1 parent 7c04740 commit 7a8fe5425dece084fd7151fab5c1e4768fe50e69
Showing with 14 additions and 1 deletion.
  1. +14 −1 ShestakUI/Modules/Misc/MagePortals.lua
@@ -49,7 +49,7 @@ for i, spell in pairs(spells) do
b:SetBackdropBorderColor(T.color.r, T.color.g, T.color.b)
b:SetFrameStrata("HIGH")

local l = b:CreateFontString(nil, "OVERLAY")
local l = b:CreateFontString("TeleportMenuName"..i, "OVERLAY")
l:SetFont(C.media.pixel_font, C.media.pixel_font_size, C.media.pixel_font_style)
l:SetText(string.sub(teleport, string.find(teleport, ":") + 1))
b:SetFontString(l)
@@ -61,6 +61,19 @@ for i, spell in pairs(spells) do
b:SetAttribute("spell2", GetSpellInfo(spell[2]))
end

local learnSpell = CreateFrame("Frame")
learnSpell:RegisterEvent("PLAYER_LOGIN")
learnSpell:RegisterEvent("LEARNED_SPELL_IN_TAB")
learnSpell:SetScript("OnEvent", function()
for i, spell in pairs(spells) do
if not IsSpellKnown(spell[1]) then
_G["TeleportMenuName"..i]:SetTextColor(0.4, 0.4, 0.4)
else
_G["TeleportMenuName"..i]:SetTextColor(1, 1, 1)
end
end
end)

local button = CreateFrame("Button", nil, UIParent)
button:SetTemplate("ClassColor")
button:SetPoint("TOPLEFT", Minimap, "TOPLEFT")

1 comment on commit 7a8fe54

@Wetxius

This comment has been minimized.

Copy link
Collaborator Author

Wetxius commented on 7a8fe54 Oct 23, 2014

Теперь всё хорошо :)

Please sign in to comment.
You can’t perform that action at this time.