7 OmaRF = CreateFrame("Frame");
9 OmaRF.normalBarColor = CreateColor(0.3, 0.3, 0.3);
10 OmaRF.dispelBarColor = CreateColor(1, 0.5, 0);
11 OmaRF.normalBackColor = {0.7, 0.7, 0.7};
12 OmaRF.dispelBackColor = {0.5, 0.2, 0};
14 OmaRF.majorFrames = {};
16 "TOPLEFT", "TOPRIGHT", "CENTER", "BOTTOMLEFT", "BOTTOMRIGHT"
18 OmaRF.running = false;
25 auras = {"Aqua Bomb"},
34 textColor = {1, 1, 1, 1},
39 useDefaultIcon = true,
41 iconColor = {1, 1, 1, 1},
47 function OmaRF:OnInitialize()
48 self.db = LibStub("AceDB-3.0"):New("OmaRFDB", defaults);
49 self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig");
50 self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig");
51 self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig");
54 function OmaRF:OnEnable()
58 function OmaRF:OnDisable()
60 for name, frame in pairs(self.frames) do
61 for _, ind in pairs(frame) do
65 for _, ind in ipairs(self.majorFrames[name]) do
67 ind.expireText:Hide();
73 local function onEvent(self, event, ...)
74 if event == "PLAYER_REGEN_ENABLED" then
75 for _, t in pairs(self.ooc_queue) do
76 t.func(unpack(t.args));
78 if next(self.ooc_queue) ~= nil then
81 elseif event == "PLAYER_LOGIN" then
83 elseif event == "ADDON_LOADED" then
88 SLASH_OMARF1 = "/omarf";
89 function SlashCmdList.OMARF(msg, editBox)
90 local loaded, finished = IsAddOnLoaded("OmaRFConfig");
92 local loaded, reason = LoadAddOn("OmaRFConfig");
94 if reason == "DISABLED" then
95 print("OmaRFConfig is disabled");
96 elseif reason == "MISSING" then
97 print("OmaRFConfig is missing");
98 elseif reason == "CORRUPT" then
99 print("OmaRFConfig is corrupt");
100 elseif reason == "INCOMPATIBLE" then
101 print("OmaRFConfig is incompatible");
102 elseif reason == "INTERFACE_VERSION" then
103 print("OmaRFConfig has wrong interface version");
107 elseif not finished then
108 -- slash command sent again when loading process is in progress
112 InterfaceOptionsFrame_OpenToCategory(OmaRF.optionsFrames.Profile);
113 InterfaceOptionsFrame_OpenToCategory(OmaRF.optionsFrames.Indicators);
116 OmaRF:RegisterEvent("ADDON_LOADED");
117 OmaRF:RegisterEvent("PLAYER_LOGIN");
118 OmaRF:RegisterEvent("PLAYER_REGEN_ENABLED");
119 OmaRF:SetScript("OnEvent", onEvent);