WoWInterface SVN mikma

Compare Revisions

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

Rev 559 → Rev 558

Runeforger.lua
1,9 → 1,4
-- 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)
13,7 → 8,7
text:SetHeight(50)
text:Hide()
 
local total,texthide = 0
local total = 0
 
local function onUpdate(self,elapsed)
total = total + elapsed
31,9 → 26,9
 
local function checkrune()
if GetInventoryItemLink("player", 16) and GetInventoryItemLink("player", 17) == nil then
local rune = GetInventoryItemLink("player", 16):match("item:[^:]+:([^:]+):")
local rune = GetInventoryItemLink("player", 16):match("item:[^:]+:([^:]+):") -- Rune in Mainhand ( http://www.wowwiki.com/EnchantId )
if (GetActiveTalentGroup() == 1 and rune == "3368") or (GetActiveTalentGroup() == 2 and rune == "3847") then
if not texthide then text:Show() end
text:Show()
event:SetScript("OnUpdate", onUpdate)
end
end
43,32 → 38,4
event:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
event:RegisterEvent("PLAYER_ENTERING_WORLD")
event:RegisterEvent("PLAYER_DAMAGE_DONE_MODS")
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 +event:SetScript("OnEvent", checkrune)