1 OmaRF = LibStub("AceAddon-3.0"):NewAddon("OmaRF");
3 OmaRF.normalBarColor = CreateColor(0.3, 0.3, 0.3);
4 OmaRF.dispelBarColor = CreateColor(1, 0.5, 0);
5 OmaRF.normalBackColor = {0.7, 0.7, 0.7};
6 OmaRF.dispelBackColor = {0.5, 0.2, 0};
10 "TOPLEFT", "TOPRIGHT", "CENTER", "BOTTOMLEFT", "BOTTOMRIGHT"
13 OmaRF.running = false;
17 indicatorFont = "Arial Narrow",
23 textColor = {1, 1, 1, 1},
28 useDefaultIcon = true,
30 iconColor = {1, 1, 1, 1},
36 function OmaRF:OnInitialize()
37 self.db = LibStub("AceDB-3.0"):New("OmaRFDB", defaults);
38 self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig");
39 self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig");
40 self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig");
43 function OmaRF:OnEnable()
47 function OmaRF:OnDisable()
49 for _, frame in pairs(self.frames) do
50 for _, ind in pairs(frame) do
52 ind.icon:SetTexture("");
57 SLASH_OMARF1 = "/omarf";
58 function SlashCmdList.OMARF(msg, editBox)
59 local loaded, finished = IsAddonLoaded("OmaRFConfig");
61 local loaded, reason = LoadAddon("OmaRFConfig");
63 if reason == "DISABLED" then
64 print("OmaRFConfig is disabled");
65 elseif reason == "MISSING" then
66 print("OmaRFConfig is missing");
67 elseif reason == "CORRUPT" then
68 print("OmaRFConfig is corrupt");
69 elseif reason == "INCOMPATIBLE" then
70 print("OmaRFConfig is incompatible");
71 elseif reason == "INTERFACE_VERSION" then
72 print("OmaRFConfig has wrong interface version");
76 elseif not finished then
77 -- slash command sent again when loading process is in progress
81 InterfaceOptionsFrame_OpenToCategory(OmaRF.optionsFrames.Indicators);