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;
22 textColor = {1, 1, 1, 1},
27 useDefaultIcon = true,
29 iconColor = {1, 1, 1, 1},
35 function OmaRF:OnInitialize()
36 self.db = LibStub("AceDB-3.0"):New("OmaRFDB", defaults);
37 self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig");
38 self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig");
39 self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig");
42 function OmaRF:OnEnable()
46 function OmaRF:OnDisable()
48 for _, frame in pairs(self.frames) do
49 for _, ind in pairs(frame) do
51 ind.icon:SetTexture("");
56 SLASH_OMARF1 = "/omarf";
57 function SlashCmdList.OMARF(msg, editBox)
58 local loaded, finished = IsAddOnLoaded("OmaRFConfig");
60 local loaded, reason = LoadAddOn("OmaRFConfig");
62 if reason == "DISABLED" then
63 print("OmaRFConfig is disabled");
64 elseif reason == "MISSING" then
65 print("OmaRFConfig is missing");
66 elseif reason == "CORRUPT" then
67 print("OmaRFConfig is corrupt");
68 elseif reason == "INCOMPATIBLE" then
69 print("OmaRFConfig is incompatible");
70 elseif reason == "INTERFACE_VERSION" then
71 print("OmaRFConfig has wrong interface version");
75 elseif not finished then
76 -- slash command sent again when loading process is in progress
80 InterfaceOptionsFrame_OpenToCategory(OmaRF.optionsFrames.Profile);
81 InterfaceOptionsFrame_OpenToCategory(OmaRF.optionsFrames.Indicators);