f79abd5 - Add functions visible globally for profiling
[wowui.git] / OmaUF / Events.lua
index d8cc7af..9a06947 100644 (file)
@@ -62,6 +62,7 @@ local registerUnitEvents = M.RegisterUnitEvents;
 local function updateMaxHealth(frame, unit)
     frame.health.max = UnitHealthMax(unit);
 end
 local function updateMaxHealth(frame, unit)
     frame.health.max = UnitHealthMax(unit);
 end
+M.UpdateMaxHealth = updateMaxHealth;
 
 local function updateHealth(frame, unit)
     local current, max = UnitHealth(unit), frame.health.max;
 
 local function updateHealth(frame, unit)
     local current, max = UnitHealth(unit), frame.health.max;
@@ -77,6 +78,7 @@ local function updateHealth(frame, unit)
         frame.health:Show();
     end
 end
         frame.health:Show();
     end
 end
+M.UpdateHealth = updateHealth;
 
 local function updateHealthText(frame, unit)
     if UnitIsDeadOrGhost(unit) then
 
 local function updateHealthText(frame, unit)
     if UnitIsDeadOrGhost(unit) then
@@ -98,10 +100,12 @@ local function updateHealthText(frame, unit)
         end
     end
 end
         end
     end
 end
+M.UpdateHealthText = updateHealthText;
 
 local function updateMaxPower(frame, unit)
     frame.mana.max = UnitPowerMax(unit);
 end
 
 local function updateMaxPower(frame, unit)
     frame.mana.max = UnitPowerMax(unit);
 end
+M.UpdateMaxPower = updateMaxPower;
 
 local function updatePower(frame, unit)
     local current, max = UnitPower(unit), frame.mana.max;
 
 local function updatePower(frame, unit)
     local current, max = UnitPower(unit), frame.mana.max;
@@ -116,6 +120,7 @@ local function updatePower(frame, unit)
         frame.mana:Show();
     end
 end
         frame.mana:Show();
     end
 end
+M.UpdatePower = updatePower;
 
 local function updatePowerText(frame, unit)
     local current, max = UnitPower(unit), frame.mana.max;
 
 local function updatePowerText(frame, unit)
     local current, max = UnitPower(unit), frame.mana.max;
@@ -128,16 +133,19 @@ local function updatePowerText(frame, unit)
         frame.manaText:Hide();
     end
 end
         frame.manaText:Hide();
     end
 end
+M.UpdatePowerText = updatePowerText;
 
 local function updatePowerColor(frame, unit)
     frame.mana:SetVertexColor(unpack(powerColors[UnitPowerType(unit)]));
 end
 
 local function updatePowerColor(frame, unit)
     frame.mana:SetVertexColor(unpack(powerColors[UnitPowerType(unit)]));
 end
+M.UpdatePowerColor = updatePowerColor;
 
 local function updateName(frame, unit)
     local name = UnitName(unit);
     if not name then return end
     frame.name:SetText(ssub(name, 1, frame.name.count));
 end
 
 local function updateName(frame, unit)
     local name = UnitName(unit);
     if not name then return end
     frame.name:SetText(ssub(name, 1, frame.name.count));
 end
+M.UpdateName = updateName;
 
 local function updateShield(frame, unit)
     local shield = UnitGetTotalAbsorbs(unit) or 0;
 
 local function updateShield(frame, unit)
     local shield = UnitGetTotalAbsorbs(unit) or 0;
@@ -161,10 +169,12 @@ local function updateShield(frame, unit)
         frame.shieldhl:Hide();
     end
 end
         frame.shieldhl:Hide();
     end
 end
+M.UpdateShield = updateShield;
 
 local function updateAuras(frame, unit)
     updateAuraFrames(frame, unit);
 end
 
 local function updateAuras(frame, unit)
     updateAuraFrames(frame, unit);
 end
+M.UpdateAuras = updateAuras;
 
 local function updateAggro(frame, unit)
     local status = UnitThreatSituation(unit);
 
 local function updateAggro(frame, unit)
     local status = UnitThreatSituation(unit);
@@ -174,6 +184,7 @@ local function updateAggro(frame, unit)
         frame.base:SetVertexColor(unpack(baseColor));
     end
 end
         frame.base:SetVertexColor(unpack(baseColor));
     end
 end
+M.UpdateAggro = updateAggro;
 
 -- only works for player frame
 local function updateVehicle(frame)
 
 -- only works for player frame
 local function updateVehicle(frame)
@@ -191,6 +202,7 @@ local function updateVehicle(frame)
         registerUnitEvents(frame);
     end
 end
         registerUnitEvents(frame);
     end
 end
+M.UpdateVehicle = updateVehicle;
 
 local function updateLevelText(frame, unit, levelup)
     if levelup then
 
 local function updateLevelText(frame, unit, levelup)
     if levelup then
@@ -221,6 +233,7 @@ local function updateLevelText(frame, unit, levelup)
         frame.level:SetFormattedText("%s%s", leveltext, classtext);
     end
 end
         frame.level:SetFormattedText("%s%s", leveltext, classtext);
     end
 end
+M.UpdateLevelText = updateLevelText;
 
 local function updateStatus(frame, unit)
     -- coords from FrameXML/PlayerFrame.lua
 
 local function updateStatus(frame, unit)
     -- coords from FrameXML/PlayerFrame.lua
@@ -234,6 +247,7 @@ local function updateStatus(frame, unit)
         frame.status:Hide();
     end
 end
         frame.status:Hide();
     end
 end
+M.UpdateStatus = updateStatus;
 
 local pvpIcons = {
     Alliance = "Interface\\TARGETINGFRAME\\UI-PVP-Alliance",
 
 local pvpIcons = {
     Alliance = "Interface\\TARGETINGFRAME\\UI-PVP-Alliance",
@@ -263,6 +277,7 @@ local function updatePVP(frame, unit)
         frame.pvp:Hide();
     end
 end
         frame.pvp:Hide();
     end
 end
+M.UpdatePVP = updatePVP;
 
 local function updateLeaderIcon(frame, unit)
     if UnitIsGroupLeader(frame.unit) then
 
 local function updateLeaderIcon(frame, unit)
     if UnitIsGroupLeader(frame.unit) then
@@ -282,6 +297,7 @@ local function updateLeaderIcon(frame, unit)
         frame.leader:Hide();
     end
 end
         frame.leader:Hide();
     end
 end
+M.UpdateLeaderIcon = updateLeaderIcon;
 
 local function updateHealthColor(frame, unit)
     if not UnitPlayerControlled(unit) and UnitIsTapDenied(unit) then
 
 local function updateHealthColor(frame, unit)
     if not UnitPlayerControlled(unit) and UnitIsTapDenied(unit) then
@@ -300,6 +316,7 @@ local function updateHealthColor(frame, unit)
         frame.health:SetVertexColor(UnitSelectionColor(unit));
     end
 end
         frame.health:SetVertexColor(UnitSelectionColor(unit));
     end
 end
+M.UpdateHealthColor = updateHealthColor;
 
 local function updateRaidMarker(frame, unit)
     local index = GetRaidTargetIndex(unit);
 
 local function updateRaidMarker(frame, unit)
     local index = GetRaidTargetIndex(unit);
@@ -310,6 +327,7 @@ local function updateRaidMarker(frame, unit)
         frame.targeticon:Hide();
     end
 end
         frame.targeticon:Hide();
     end
 end
+M.UpdateRaidMarker = updateRaidMarker;
 
 local eventFuncs = {
     ["UNIT_HEALTH"] = function(frame)
 
 local eventFuncs = {
     ["UNIT_HEALTH"] = function(frame)