vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 
2 assert(BigWigs, "BigWigs not found!")
3  
4 ----------------------------
5 -- Localization --
6 ----------------------------
7  
8 local L = AceLibrary("AceLocale-2.2"):new("BigWigsTranq")
9  
10 L:RegisterTranslations("enUS", function() return {
11 CHAT_MSG_SPELL_SELF_BUFF = "You fail to dispel (.+)'s Frenzy.",
12 CHAT_MSG_SPELL_SELF_DAMAGE = "You cast Tranquilizing Shot on (.+).",
13  
14 ["Tranq - %s"] = true,
15 ["%s's Tranq failed!"] = true,
16 ["Tranq"] = true,
17 ["Options for the tranq module."] = true,
18 ["Toggle tranq bars on or off."] = true,
19 ["Bars"] = true,
20 } end)
21  
22 L:RegisterTranslations("koKR", function() return {
23 CHAT_MSG_SPELL_SELF_BUFF = "(.+)의 광기|1을;를; 무효화하지 못했습니다.", --"You fail to dispel (.+)'s Frenzy.",
24 CHAT_MSG_SPELL_SELF_DAMAGE = "(.+)에게 평정의 사격|1을;를; 시전합니다.", --"You cast Tranquilizing Shot on (.+).",
25  
26 ["Tranq - %s"] = "평정 - %s",
27 ["%s's Tranq failed!"] = "%s의 평정 실패!",
28 ["Tranq"] = "평정",
29 ["Options for the tranq module."] = "평정 모듈에 대한 설정.",
30 ["Toggle tranq bars on or off."] = "평정바 토글.",
31 ["Bars"] = "바",
32 } end)
33  
34 L:RegisterTranslations("zhCN", function() return {
35 CHAT_MSG_SPELL_SELF_BUFF = "你未能驱散(.+)的狂暴。",
36 CHAT_MSG_SPELL_SELF_DAMAGE = "你对(.+)施放了宁神射击。",
37  
38 ["Tranq - %s"] = "宁神射击 - %s",
39 ["%s's Tranq failed!"] = "%s的宁神射击失败了!",
40 ["Tranq"] = "宁神射击",
41 ["Options for the tranq module."] = "设置宁神射击模块.",
42 ["Toggle tranq bars on or off."] = "开启或禁用宁神射击计时条.",
43 ["Bars"] = "宁神射击计时条",
44 } end)
45  
46 L:RegisterTranslations("zhTW", function() return {
47 CHAT_MSG_SPELL_SELF_BUFF = "你未能驅散(.+)的狂暴。",
48 CHAT_MSG_SPELL_SELF_DAMAGE = "你對(.+)施放了寧神射擊。",
49  
50 ["Tranq - %s"] = "寧神射擊 - %s",
51 ["%s's Tranq failed!"] = "%s的寧神射擊失敗了!",
52 ["Tranq"] = "寧神射擊",
53 ["Options for the tranq module."] = "寧神射擊模組選項.",
54 ["Toggle tranq bars on or off."] = "開啟或禁用寧神射擊計時條.",
55 ["Bars"] = "寧神射擊計時條",
56 } end)
57  
58 L:RegisterTranslations("deDE", function() return {
59 CHAT_MSG_SPELL_SELF_BUFF = "(.+) kann dies nicht bannen: Raserei", -- ?
60 CHAT_MSG_SPELL_SELF_DAMAGE = "Ihr wirkt Einlullender Schuss auf (.+)",
61  
62 ["Tranq - %s"] = "Einlullender Schuss - %s",
63 ["%s's Tranq failed!"] = "%s's Einlullender Schuss verfehlt",
64 ["Tranq"] = "EinlullenderSchuss",
65 ["Options for the tranq module."] = "Optionen f\195\188r das Einlullender Schuss Modul.",
66 ["Toggle tranq bars on or off."] = "Einlullender Schuss Anzeigebalken anzeigen.",
67 ["Bars"] = "Anzeigebalken",
68 } end)
69  
70 L:RegisterTranslations("frFR", function() return {
71 CHAT_MSG_SPELL_SELF_BUFF = "Vous n'avez pas r\195\169ussi \195\160 dissiper le fr\195\169n\195\169sie de (.+).";
72 CHAT_MSG_SPELL_SELF_DAMAGE = "Vous lancez Tir tranquillisant sur (.+).",
73  
74 ["%s's Tranq failed!"] = "Le Tranq de %s a \195\169chou\195\169 !",
75 ["Options for the tranq module."] = "Options du module Tranq",
76 ["Toggle tranq bars on or off."] = "Afficher ou masquer les barres de Tranq",
77 ["Bars"] = "Barres",
78 } end)
79  
80 ----------------------------------
81 -- Module Declaration --
82 ----------------------------------
83  
84 BigWigsTranq = BigWigs:NewModule(L["Tranq"])
85 BigWigsTranq.revision = tonumber(string.sub("$Revision: 11446 $", 12, -3))
86 BigWigsTranq.defaults = {
87 bars = true,
88 }
89 BigWigsTranq.external = true
90 BigWigsTranq.consoleCmd = L["Tranq"]
91 BigWigsTranq.consoleOptions = {
92 type = "group",
93 name = L["Tranq"],
94 desc = L["Options for the tranq module."],
95 args = {
96 [L["Bars"]] = {
97 type = "toggle",
98 name = L["Bars"],
99 desc = L["Toggle tranq bars on or off."],
100 get = function() return BigWigsTranq.db.profile.bars end,
101 set = function(v)
102 BigWigsTranq.db.profile.bars = v
103 end,
104 },
105 }
106 }
107  
108 ------------------------------
109 -- Initialization --
110 ------------------------------
111  
112 function BigWigsTranq:OnEnable()
113 self:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF")
114 self:RegisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE")
115  
116 self:RegisterEvent("BigWigs_RecvSync")
117 self:RegisterEvent("BigWigs_TranqFired", 5)
118 self:RegisterEvent("BigWigs_TranqFail", 5)
119 end
120  
121  
122 ------------------------------
123 -- Event Handlers --
124 ------------------------------
125  
126 function BigWigsTranq:CHAT_MSG_SPELL_SELF_BUFF(msg)
127 if not msg then
128 self:Debug("CHAT_MSG_SPELL_SELF_BUFF: msg is nil")
129 elseif string.find(msg, L["CHAT_MSG_SPELL_SELF_BUFF"]) then
130 self:TriggerEvent("BigWigs_SendSync", "TranqShotFail "..UnitName("player"))
131 end
132 end
133  
134  
135 function BigWigsTranq:CHAT_MSG_SPELL_SELF_DAMAGE(msg)
136 if not msg then
137 self:Debug("CHAT_MSG_SPELL_SELF_DAMAGE: msg is nil")
138 elseif string.find(msg, L["CHAT_MSG_SPELL_SELF_DAMAGE"]) then
139 self:TriggerEvent("BigWigs_SendSync", "TranqShotFired "..UnitName("player"))
140 end
141 end
142  
143  
144 function BigWigsTranq:BigWigs_RecvSync(sync, details, sender)
145 if sync == "TranqShotFired" then self:TriggerEvent("BigWigs_TranqFired", details)
146 elseif sync == "TranqShotFail" then self:TriggerEvent("BigWigs_TranqFail", details) end
147 end
148  
149  
150 function BigWigsTranq:BigWigs_TranqFired(unitname)
151 if self.db.profile.bars then
152 self:TriggerEvent("BigWigs_StartBar", self, string.format(L["Tranq - %s"], unitname), 20, "Interface\\Icons\\Spell_Nature_Drowsy")
153 end
154 end
155  
156  
157 function BigWigsTranq:BigWigs_TranqFail(unitname)
158 if self.db.profile.bars then
159 self:SetCandyBarColor(string.format(L["Tranq - %s"], unitname), "Red")
160 self:TriggerEvent("BigWigs_Message", format(L["%s's Tranq failed!"], unitname), "Important", nil, "Alarm")
161 end
162 end
163