end
local function updateReadyCheck(frame, unit)
- if GetReadyCheckTimeLeft() <= 0 then return end
local status = GetReadyCheckStatus(unit);
if status == "ready" then
frame.ready:SetTexture(READY_CHECK_READY_TEXTURE);
eventFuncs["UNIT_PET"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["GROUP_ROSTER_UPDATE"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["PLAYER_ENTERING_WORLD"] = eventFuncs["UPDATE_ALL_BARS"];
+eventFuncs["PLAYER_FOCUS_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
function M.UnitEvent(self, event)
eventFuncs[event](self);
frame:RegisterEvent("READY_CHECK");
frame:RegisterEvent("READY_CHECK_CONFIRM");
frame:RegisterEvent("READY_CHECK_FINISHED");
+ if frame.unit == "focus" then frame:RegisterEvent("PLAYER_FOCUS_CHANGED") end
registerEvents(frame);
frame:SetScript("OnUpdate", unitUpdate);
unitEvent(frame, "UPDATE_ALL_BARS", frame.displayed);
end
end
+local function initializeFocus(parent)
+ local secure = CreateFrame("Button", "OmaFocusSecure", parent, inheritedFrames);
+ local frame = CreateFrame("Frame", "OmaFocus", parent);
+ local unit = "focus";
+ secure:SetPoint("BOTTOMLEFT", parent, "TOPLEFT");
+ frame:SetPoint("BOTTOMLEFT", parent, "TOPLEFT");
+ setupFrame(frame, secure, unit);
+ RegisterUnitWatch(frame);
+ RegisterUnitWatch(secure);
+ local vehicle = format("[@%s,unithasvehicleui] vehicle; no", unit);
+ RegisterStateDriver(secure, "vehicleui", vehicle);
+ secure:SetAttribute("_onstate-vehicleui", vehicletoggle);
+end
+
local function initialize()
CFrame:SetPoint("CENTER", nil, "CENTER", anchorX, anchorY);
CFrame:SetHeight((height+2)*8);
CFrame:SetWidth((width+2)*5+1);
initializeParty(CFrame);
initializeRaid(CFrame);
+ initializeFocus(CFrame);
end
local function loadCharSettings()