WoWInterface SVN mikma

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /Runeforger
    from Rev 558 to Rev 559
    Reverse comparison

Rev 558 → Rev 559

Runeforger.lua
1,4 → 1,9
-- Rune in Mainhand ( http://www.wowwiki.com/EnchantId )
 
local event = CreateFrame("Frame")
event:SetScript("OnEvent", function(self, event, ...)
if self[event] then return self[event](self, event, ...) end
end)
 
local text = event:CreateFontString(nil, "BACKGROUND")
text:SetFontObject(ZoneTextFont)
8,7 → 13,7
text:SetHeight(50)
text:Hide()
 
local total = 0
local total,texthide = 0
 
local function onUpdate(self,elapsed)
total = total + elapsed
26,9 → 31,9
 
local function checkrune()
if GetInventoryItemLink("player", 16) and GetInventoryItemLink("player", 17) == nil then
local rune = GetInventoryItemLink("player", 16):match("item:[^:]+:([^:]+):") -- Rune in Mainhand ( http://www.wowwiki.com/EnchantId )
local rune = GetInventoryItemLink("player", 16):match("item:[^:]+:([^:]+):")
if (GetActiveTalentGroup() == 1 and rune == "3368") or (GetActiveTalentGroup() == 2 and rune == "3847") then
text:Show()
if not texthide then text:Show() end
event:SetScript("OnUpdate", onUpdate)
end
end
38,4 → 43,32
event:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
event:RegisterEvent("PLAYER_ENTERING_WORLD")
event:RegisterEvent("PLAYER_DAMAGE_DONE_MODS")
event:SetScript("OnEvent", checkrune)
event:RegisterEvent("PLAYER_REGEN_DISABLED")
event:RegisterEvent("PLAYER_REGEN_ENABLED")
 
function event:PLAYER_EQUIPMENT_CHANGED()
checkrune()
end
 
function event:ACTIVE_TALENT_GROUP_CHANGED()
checkrune()
end
 
function event:PLAYER_ENTERING_WORLD()
checkrune()
end
 
function event:PLAYER_DAMAGE_DONE_MODS()
checkrune()
end
 
function event:PLAYER_REGEN_DISABLED()
texthide = true
text:Hide()
self:SetScript("OnUpdate",nil)
end
 
function event:PLAYER_REGEN_ENABLED()
texthide = nil
checkrune()
end
\ No newline at end of file