vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 -- Interrupt support
2  
3 lazyr.interrupt = {}
4  
5 lazyr.interrupt.targetCasting = nil
6 lazyr.interrupt.castingDetectedAt = 0
7 lazyr.interrupt.lastSpellInterrupted = nil
8  
9  
10 function lazyr.interrupt.OnChatMsgSpell(arg1)
11 local tName = UnitName("target")
12 if (tName) then
13 for idx, pat in { lrLocale.SPELLCASTOTHERSTART, lrLocale.SPELLPERFORMOTHERSTART } do
14 for mob, spell in string.gfind(arg1, pat) do
15 if (mob == tName) then
16 lazyr.d("Detected your target is casting "..spell..", will suggest Interrupt.")
17 if (lazyr.perPlayerConf.showTargetCasts) then
18 lazyr.p(tName.." is casting "..spell..".")
19 end
20 lazyr.interrupt.targetCasting = spell
21 lazyr.interrupt.castingDetectedAt = GetTime()
22 return
23 end
24 end
25 end
26 end
27 end
28  
29  
30 -- Interrupt Criteria Edit Box
31  
32 lazyr.iceb = {}
33  
34 lazyr.iceb.cancelEdit = false
35  
36 function lazyr.iceb.OnShow()
37 local text = table.concat(lrConf.interruptExceptionCriteria, "\n")
38 LazyRogueInterruptExceptionCriteriaEditFrameForm:SetText(text)
39 end
40  
41 function lazyr.iceb.OnHide()
42 if (lazyr.iceb.cancelEdit) then
43 lazyr.iceb.cancelEdit = false
44 return
45 end
46  
47 local text = LazyRogueInterruptExceptionCriteriaEditFrameForm:GetText()
48  
49 local args = {}
50 for arg in string.gfind(text, "[^\r\n]+") do
51 table.insert(args, arg)
52 end
53 lrConf.interruptExceptionCriteria = args
54  
55 lazyr.p("Global interrupt criteria updated.")
56 lazyr.ParseForm(args)
57 end
58  
59