1 OmaRF = CreateFrame("Frame");
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};
9 OmaRF.majorFrames = {};
11 "TOPLEFT", "TOPRIGHT", "CENTER", "BOTTOMLEFT", "BOTTOMRIGHT"
14 OmaRF.running = false;
22 auras = {"Aqua Bomb"},
31 textColor = {1, 1, 1, 1},
36 useDefaultIcon = true,
38 iconColor = {1, 1, 1, 1},
44 function OmaRF:OnInitialize()
45 self.db = LibStub("AceDB-3.0"):New("OmaRFDB", defaults);
46 self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig");
47 self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig");
48 self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig");
51 function OmaRF:OnEnable()
55 function OmaRF:OnDisable()
57 for name, frame in pairs(self.frames) do
58 for _, ind in pairs(frame) do
62 for _, ind in ipairs(self.majorFrames[name]) do
70 local function onEvent(self, event, ...)
71 if event == "PLAYER_REGEN_ENABLED" then
72 for _, t in pairs(self.ooc_queue) do
75 if next(self.ooc_queue) ~= nil then
78 elseif event == "PLAYER_LOGIN" then
80 elseif event == "ADDON_LOADED" then
85 SLASH_OMARF1 = "/omarf";
86 function SlashCmdList.OMARF(msg, editBox)
87 local loaded, finished = IsAddOnLoaded("OmaRFConfig");
89 local loaded, reason = LoadAddOn("OmaRFConfig");
91 if reason == "DISABLED" then
92 print("OmaRFConfig is disabled");
93 elseif reason == "MISSING" then
94 print("OmaRFConfig is missing");
95 elseif reason == "CORRUPT" then
96 print("OmaRFConfig is corrupt");
97 elseif reason == "INCOMPATIBLE" then
98 print("OmaRFConfig is incompatible");
99 elseif reason == "INTERFACE_VERSION" then
100 print("OmaRFConfig has wrong interface version");
104 elseif not finished then
105 -- slash command sent again when loading process is in progress
109 InterfaceOptionsFrame_OpenToCategory(OmaRF.optionsFrames.Profile);
110 InterfaceOptionsFrame_OpenToCategory(OmaRF.optionsFrames.Indicators);
113 OmaRF:RegisterEvent("ADDON_LOADED");
114 OmaRF:RegisterEvent("PLAYER_LOGIN");
115 OmaRF:RegisterEvent("PLAYER_REGEN_ENABLED");
116 OmaRF:SetScript("OnEvent", onEvent);