1 local unpack, wipe, next, pairs, ipairs = unpack, wipe, next, pairs, ipairs;
3 OmaRF = CreateFrame("Frame");
5 OmaRF.normalBarColor = CreateColor(0.3, 0.3, 0.3);
6 OmaRF.dispelBarColor = CreateColor(1, 0.5, 0);
7 OmaRF.normalBackColor = {0.7, 0.7, 0.7};
8 OmaRF.dispelBackColor = {0.5, 0.2, 0};
10 "TOPLEFT", "TOPRIGHT", "CENTER", "BOTTOMLEFT", "BOTTOMRIGHT"
12 OmaRF.running = false;
19 auras = {"Aqua Bomb"},
28 textColor = {1, 1, 1, 1},
33 useDefaultIcon = true,
35 iconColor = {1, 1, 1, 1},
41 function OmaRF:OnInitialize()
42 self.db = LibStub("AceDB-3.0"):New("OmaRFDB", defaults);
43 self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig");
44 self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig");
45 self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig");
48 function OmaRF:OnEnable()
52 function OmaRF:OnDisable()
54 self.frameBase:Hide();
57 local function onEvent(self, event, ...)
58 if event == "PLAYER_REGEN_ENABLED" then
59 for _, t in pairs(self.ooc_queue) do
60 t.func(unpack(t.args));
62 if next(self.ooc_queue) ~= nil then
65 elseif event == "PLAYER_LOGIN" then
67 elseif event == "ADDON_LOADED" then
72 SLASH_OMARF1 = "/omarf";
73 function SlashCmdList.OMARF(msg, editBox)
74 local loaded, finished = IsAddOnLoaded("OmaRFConfig");
76 local loaded, reason = LoadAddOn("OmaRFConfig");
78 if reason == "DISABLED" then
79 print("OmaRFConfig is disabled");
80 elseif reason == "MISSING" then
81 print("OmaRFConfig is missing");
82 elseif reason == "CORRUPT" then
83 print("OmaRFConfig is corrupt");
84 elseif reason == "INCOMPATIBLE" then
85 print("OmaRFConfig is incompatible");
86 elseif reason == "INTERFACE_VERSION" then
87 print("OmaRFConfig has wrong interface version");
91 elseif not finished then
92 -- slash command sent again when loading process is in progress
96 InterfaceOptionsFrame_OpenToCategory(OmaRF.optionsFrames.Profile);
97 InterfaceOptionsFrame_OpenToCategory(OmaRF.optionsFrames.Indicators);
100 OmaRF:RegisterEvent("ADDON_LOADED");
101 OmaRF:RegisterEvent("PLAYER_LOGIN");
102 OmaRF:RegisterEvent("PLAYER_REGEN_ENABLED");
103 OmaRF:SetScript("OnEvent", onEvent);