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 -- Are you local? --
6 ------------------------------
7  
8 local L = AceLibrary("AceLocale-2.0"):new("BigWigsSound")
9 --~~ local dewdrop = DewdropLib:GetInstance("1.0")
10  
11 local sounds = {
12 Long = "Interface\\AddOns\\BigWigs\\Sounds\\Long.mp3",
13 Info = "Interface\\AddOns\\BigWigs\\Sounds\\Info.mp3",
14 Alert = "Interface\\AddOns\\BigWigs\\Sounds\\Alert.mp3",
15 Alarm = "Interface\\AddOns\\BigWigs\\Sounds\\Alarm.mp3",
16 Victory = "Interface\\AddOns\\BigWigs\\Sounds\\Victory.mp3",
17 }
18  
19  
20 ----------------------------
21 -- Localization --
22 ----------------------------
23  
24 L:RegisterTranslations("enUS", function() return {
25 ["Sounds"] = true,
26 ["sounds"] = true,
27 ["Options for sounds."] = true,
28  
29 ["toggle"] = true,
30 ["Use sounds"] = true,
31 ["Toggle sounds on or off."] = true,
32 ["default"] = true,
33 ["Default only"] = true,
34 ["Use only the default sound."] = true,
35 } end)
36  
37 L:RegisterTranslations("koKR", function() return {
38 ["Sounds"] = "효과음",
39 ["Options for sounds."] = "효과음 옵션.",
40  
41 ["Use sounds"] = "효과음 사용",
42 ["Toggle sounds on or off."] = "효과음을 켜거나 끔.",
43 ["Default only"] = "기본음",
44 ["Use only the default sound."] = "기본음만 사용.",
45 } end)
46  
47 L:RegisterTranslations("zhCN", function() return {
48 ["Sounds"] = "声音",
49 ["Use sounds"] = "使用声音",
50 ["Options for sounds."] = "声音设置。",
51 ["Toggle sounds on or off."] = "切换是否使用声音。",
52 } end)
53  
54 L:RegisterTranslations("deDE", function() return {
55 ["Sounds"] = "Sound",
56 -- ["sounds"] = true,
57 ["Use sounds"] = "Benutze Sounds",
58 ["Options for sounds."] = "Optionen f\195\188r Sound.",
59 ["Toggle sounds on or off."] = "Aktiviere oder deaktiviere Sound.",
60 } end)
61  
62 ----------------------------------
63 -- Module Declaration --
64 ----------------------------------
65  
66 BigWigsSound = BigWigs:NewModule(L["Sounds"])
67 BigWigsSound.defaults = {
68 defaultonly = false,
69 sound = true,
70 }
71 BigWigsSound.consoleCmd = L["sounds"]
72 BigWigsSound.consoleOptions = {
73 type = "group",
74 name = L["Sounds"],
75 desc = L["Options for sounds."],
76 args = {
77 [L["toggle"]] = {
78 type = "toggle",
79 name = L["Sounds"],
80 desc = L["Toggle sounds on or off."],
81 get = function() return BigWigsSound.db.profile.sound end,
82 set = function(v)
83 BigWigsSound.db.profile.sound = v
84 BigWigs:ToggleModuleActive(L["Sounds"], v)
85 end,
86 },
87 [L["default"]] = {
88 type = "toggle",
89 name = L["Default only"],
90 desc = L["Use only the default sound."],
91 get = function() return BigWigsSound.db.profile.defaultonly end,
92 set = function(v) BigWigsSound.db.profile.defaultonly = v end,
93 },
94 }
95 }
96  
97 ------------------------------
98 -- Initialization --
99 ------------------------------
100  
101 function BigWigsSound:OnEnable()
102 self:RegisterEvent("BigWigs_Message")
103 end
104  
105 function BigWigsSound:BigWigs_Message(text, color, noraidsay, sound, broadcastonly)
106 if not text or sound == false or broadcastonly then return end
107  
108 if sounds[sound] and not self.db.profile.defaultonly then PlaySoundFile(sounds[sound])
109 else PlaySound("RaidWarning") end
110 end
111