0721829 - Remove unused code
[wowui.git] / Core.lua
1 RaidFrameCustomization = LibStub("AceAddon-3.0"):NewAddon("RaidFrameCustomization", "AceTimer-3.0");
2
3 RaidFrameCustomization.normalBarColor = CreateColor(0.3, 0.3, 0.3);
4 RaidFrameCustomization.dispelBarColor = CreateColor(1, 0.5, 0);
5 RaidFrameCustomization.normalBackColor = {0.7, 0.7, 0.7};
6 RaidFrameCustomization.dispelBackColor = {0.5, 0.2, 0};
7
8 RaidFrameCustomization.frames = {};
9 RaidFrameCustomization.positions = {
10     "TOPLEFT", "TOPRIGHT", "CENTER", "BOTTOMLEFT", "BOTTOMRIGHT"
11 };
12
13 local defaults = {
14     profile = {
15         indicatorFont = "Arial Narrow",
16         showIcons = true,
17         enabled = true,
18         indicators = {
19             ['**'] = {
20                 textSize = 10,
21                 color = {1, 1, 1, 1},
22                 mine = false,
23                 stack = true,
24                 showText = true,
25                 showIcon = true,
26                 useDefaultIcon = true,
27                 iconSize = 10,
28             },
29         },
30     }
31 };
32
33 function RaidFrameCustomization:OnInitialize()
34     self.db = LibStub("AceDB-3.0"):New("RaidFrameCustomizationDB", defaults);
35     self:SetupOptions();
36     self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig");
37     self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig");
38     self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig");
39 end
40
41 function RaidFrameCustomization:OnEnable()
42     self:RefreshConfig();
43 end
44
45 function RaidFrameCustomization:OnDisable()
46     self:CancelAllTimers();
47     for _, frame in pairs(self.frames) do
48         for _, ind in pairs(frame) do
49             ind.text:SetText("");
50             ind.icon:SetTexture("");
51         end
52     end
53 end