local checkIndicators = OmaRFIndicators.CheckIndicators;
local Settings = OmaRFSettings;
-local width = Settings.Character.Width;
local baseColor = Settings.BaseColor;
local overlayColorDispel = Settings.OverlayColorDispel;
local overlayColorCharm = Settings.OverlayColorCharm;
local overlayColorAlert = Settings.OverlayColorAlert;
local powerColors = Settings.PowerColors;
+local width = 10;
local M = {};
OmaRFEvents = M;
local healthLost = max - current;
if UnitIsDeadOrGhost(unit) then
frame.text:SetText("Dead");
+ frame.text:Show();
elseif not UnitIsConnected(unit) then
frame.text:SetText("DC");
+ frame.text:Show();
elseif healthLost > 0 then
if healthLost > 1200000000 then -- 1.2B
frame.text:SetFormattedText("-%.1fB", healthLost / 1000000000);
function M.UnitEvent(self, event)
eventFuncs[event](self);
end
+
+function M.LoadChar()
+ width = Settings.Character.Width;
+end
local CTimerAfter = C_Timer.After;
local Settings = OmaRFSettings;
-local positions = Settings.Positions;
-local watchedAuras = Settings.Character["WatchedAuras"];
local majorAuras = Settings.MajorAuras;
+local positions = {};
+local watchedAuras = {};
local updaters = {};
local updating = {};
frame.major:Hide();
end
end
+
+function M.LoadChar()
+ watchedAuras = Settings.Character["WatchedAuras"];
+ positions = Settings.Character.Positions;
+end
local unitEvent = OmaRFEvents.UnitEvent;
local Settings = OmaRFSettings;
-local positions = Settings.Positions;
-local width, height = Settings.Character.Width, Settings.Character.Height;
-local anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY;
local indSize = Settings.IndSize;
local baseColor = Settings.BaseColor;
local bgColor = Settings.BgColor;
local shieldhlColor = Settings.ShieldhlColor;
local healpredColor = Settings.HealpredColor;
local healabsorbColor = Settings.HealabsorbColor;
-local attributes = Settings.Character.Clickheal;
+-- placeholders with visible values when error happens
+local positions = {};
+local width, height = 10, 10;
+local anchorX, anchorY = 10, 10;
+local attributes = {};
local CFrame = CreateFrame("Frame", "OmaRFFrame", UIParent);
local inheritedFrames = "SecureUnitButtonTemplate,SecureHandlerStateTemplate";
initializeRaid(CFrame);
end
+local function loadCharSettings()
+ width, height = Settings.Character.Width, Settings.Character.Height;
+ anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY;
+ attributes = Settings.Character.Clickheal;
+ positions = Settings.Character.Positions;
+end
+
+CFrame:RegisterEvent("ADDON_LOADED");
CFrame:RegisterEvent("PLAYER_LOGIN");
CFrame:SetScript("OnEvent", function(self, event)
if event == "PLAYER_LOGIN" then
initialize();
+ elseif event == "ADDON_LOADED" then
+ OmaRFLoadChar();
+ loadCharSettings();
+ OmaRFEvents.LoadChar();
+ OmaRFIndicators.LoadChar();
end
end);
-- configurable settings
-- character specific settings
local charDefaults = {
+ Positions = {"TOPRIGHT", "BOTTOMLEFT"},
Width = 80,
Height = 40,
AnchorX = 0,
local chars = {
["Stormreaver"] = {
["Vildan"] = {
+ Positions = {"TOPRIGHT", "BOTTOMLEFT"},
Width = 80,
Height = 40,
AnchorX = 0,
["alt-shift-spell2"] = "Beacon of Faith",
},
},
+ ["Gedren"] = {
+ Positions = {"TOPLEFT", "TOPRIGHT", "BOTTOMLEFT"},
+ Width = 80,
+ Height = 40,
+ AnchorX = 0,
+ AnchorY = -330,
+ WatchedAuras = {
+ ["Rejuvenation"] = "TOPRIGHT",
+ ["Lifebloom"] = "TOPLEFT",
+ },
+ Clickheal = {
+ ["type1"] = "spell",
+ ["type2"] = "spell",
+ ["shift-type1"] = "spell",
+ ["shift-type2"] = "spell",
+ ["ctrl-type1"] = "spell",
+ ["alt-type2"] = "spell",
+ ["spell1"] = "Healing Touch",
+ ["spell2"] = "Swiftmend",
+ ["shift-spell1"] = "Regrowth",
+ ["shift-spell2"] = "Lifebloom",
+ ["ctrl-spell1"] = "Nature's Cure",
+ ["alt-spell2"] = "Rebirth",
+ },
+ },
},
};
-- account-wide settings
local settings = {
- Positions = {"TOPRIGHT", "BOTTOMLEFT"},
IndSize = 14,
BaseColor = {0, 0, 0},
BgColor = {0.7, 0.7, 0.7},
-- watch to not remove mana entry
setmetatable(settings.PowerColors, {__index = function(t) return rawget(t, PowerTypeMana) end});
-local name, realm = UnitFullName("player");
-if chars[realm] and chars[realm][name] then
- settings.Character = chars[realm][name];
-else
- settings.Character = charDefaults;
+function OmaRFLoadChar()
+ local name, realm = UnitFullName("player");
+ if chars[realm] and chars[realm][name] then
+ settings.Character = chars[realm][name];
+ else
+ settings.Character = charDefaults;
+ end
end