frame:SetScript("OnUpdate", nil);
end
-function M.UpdateAuraTooltips()
- GameTooltip = _G["GameTooltip"];
-end
-
local function createAura(parent, prev, anchor, name, unit)
local aura = CreateFrame("Frame", name, parent);
aura:SetPoint("TOPLEFT", prev, anchor);
local healthColor = Settings.HealthColor;
local shieldColor = Settings.ShieldColor;
local shieldhlColor = Settings.ShieldhlColor;
-local healabsorbColor = Settings.HealabsorbColor;
local width, height = Settings.Boss.Width, Settings.Boss.Height;
local anchorX, anchorY = Settings.Boss.AnchorX, Settings.Boss.AnchorY;
-- placeholders with visible values when error happens
GameTooltip:FadeOut();
end
-function OmaUnitFrames.UpdateBossTooltips()
- GameTooltip = _G["GameTooltip"];
- GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
-end
-
local function bossEvent(self)
-- INSTANCE_ENCOUNTER_ENGAGE_UNIT only
for unit, frame in pairs(self.frames) do
frame.shieldhl:SetPoint("BOTTOMRIGHT", frame.healthback, "BOTTOMRIGHT", 1, 0);
frame.shieldhl:SetColorTexture(unpack(shieldhlColor));
frame.shieldhl:Hide();
- frame.healabsorb = frame:CreateTexture(nil, "ARTWORK");
- frame.healabsorb:SetPoint("TOPRIGHT", frame.health, "TOPRIGHT");
- frame.healabsorb:SetPoint("BOTTOMRIGHT", frame.health, "BOTTOMRIGHT");
- frame.healabsorb:SetColorTexture(unpack(healabsorbColor));
- frame.healabsorb:Hide();
frame.name = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight");
frame.name:SetPoint("LEFT", frame.healthback, "LEFT", 2, 1);
frame.name.count = 10;
local M = {};
OmaUFCastBar = M;
--- TODO trade skill bar updates as well, check Quartz modules/Tradeskill.lua
local function onUpdate(bar)
if not bar:IsShown() then return end
local width = bar.icon:IsShown() and bar.cast.width or bar.cast.width; -- TODO fullwidth
local UnitGetIncomingHeals, UnitGetTotalAbsorbs = UnitGetIncomingHeals, UnitGetTotalAbsorbs;
local UnitThreatSituation, GetThreatStatusColor = UnitThreatSituation, GetThreatStatusColor;
local UnitIsDeadOrGhost, UnitIsConnected = UnitIsDeadOrGhost, UnitIsConnected;
-local UnitGetTotalHealAbsorbs = UnitGetTotalHealAbsorbs;
local UnitHasVehicleUI, UnitTargetsVehicleInRaidUI = UnitHasVehicleUI, UnitTargetsVehicleInRaidUI;
local UnitLevel, UnitClassification = UnitLevel, UnitClassification;
local UnitAffectingCombat, IsResting = UnitAffectingCombat, IsResting;
if frame.shield then
frame:RegisterUnitEvent("UNIT_ABSORB_AMOUNT_CHANGED", frame.unit, displayed);
end
- if frame.healabsorb then
- frame:RegisterUnitEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", frame.unit, displayed);
- end
if frame.auras then
frame:RegisterUnitEvent("UNIT_AURA", frame.unit, displayed);
end
end
end
-local function updateHealAbsorb(frame, unit)
- local absorb = UnitGetTotalHealAbsorbs(unit) or 0;
- if absorb > 0 then
- local space = frame.health:GetWidth();
- absorb = (absorb / frame.health.max) * frame.width;
- frame.healabsorb:SetWidth(min(space, absorb));
- frame.healabsorb:Show();
- else
- frame.healabsorb:Hide();
- end
-end
-
local function updateAuras(frame, unit)
- if frame.auras then updateAuraFrames(frame, unit) end
+ updateAuraFrames(frame, unit);
end
local function updateAggro(frame, unit)
updateHealth(frame, frame.displayed);
updateHealthText(frame, frame.displayed);
if frame.shield then updateShield(frame, frame.displayed) end
- if frame.healabsorb then updateHealAbsorb(frame, frame.displayed) end
end,
["UNIT_POWER"] = function(frame)
updatePower(frame, frame.displayed);
["UNIT_ABSORB_AMOUNT_CHANGED"] = function(frame)
updateShield(frame, frame.displayed);
end,
- ["UNIT_HEAL_ABSORB_AMOUNT_CHANGED"] = function(frame)
- updateHealAbsorb(frame, frame.displayed);
- end,
["UNIT_THREAT_SITUATION_UPDATE"] = function(frame)
updateAggro(frame, frame.displayed);
end,
updateHealth(frame, frame.displayed);
updateHealthText(frame, frame.displayed);
if frame.shield then updateShield(frame, frame.displayed) end
- if frame.healabsorb then updateHealAbsorb(frame, frame.displayed) end
end,
["UNIT_MAXPOWER"] = function(frame)
updateMaxPower(frame, frame.displayed);
end
if frame.auras then updateAuras(frame, frame.displayed) end
if frame.shield then updateShield(frame, frame.displayed) end
- if frame.healabsorb then updateHealAbsorb(frame, frame.displayed) end
if frame.name then updateName(frame, frame.displayed) end
if frame.level then updateLevelText(frame, frame.unit) end
if frame.status then updateStatus(frame, frame.unit) end
end
]=]
-function OmaUnitFrames.UpdatePetTooltips()
- GameTooltip = _G["GameTooltip"];
- GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
-end
-
function OmaUnitFrames.InitializePet(parent)
attributes = Settings.Character.Clickheal; -- TODO pet clickheal separate with Mend Pet etc.
end
]=]
-function OmaUnitFrames.UpdatePlayerTooltips()
- GameTooltip = _G["GameTooltip"];
- GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
-end
-
function OmaUnitFrames.InitializePlayer(parent)
attributes = Settings.Character.Clickheal;
ShieldColor = {0.1, 0.8, 1},
ShieldhlColor = {0.5, 0.8, 1},
HealpredColor = {0.5, 0.6, 0.5},
- HealabsorbColor = {0.1, 0.1, 0.1},
PowerColors = {
[PowerTypeMana] = {0, 0.5, 1},
[PowerTypeRage] = {1, 0, 0},
GameTooltip:FadeOut();
end
-function OmaUnitFrames.UpdateTargetTooltips()
- GameTooltip = _G["GameTooltip"];
- GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
-end
-
function OmaUnitFrames.InitializeTarget(parent)
attributes = Settings.Character.Clickheal;
local _;
local pairs = pairs;
local InCombatLockdown = InCombatLockdown;
-local CTimerAfter = C_Timer.After;
-
-local updateAuraTooltips = OmaUFAuras.UpdateAuraTooltips;
local UnitFrames = CreateFrame("Frame", "OmaUnitFrame", UIParent);
hiddenFrame:Hide();
local arenaHidden = false;
local function hideArenaFrames()
- -- not run if /reload happens in combat, may cause problems?
if not arenaHidden and not InCombatLockdown() then
arenaHidden = true;
ArenaEnemyFrames:UnregisterAllEvents();
end
end
-local function updateTooltipFuncs()
- -- let MoveAnything hook these to anchor tooltip elsewhere
- M.UpdatePlayerTooltips();
- M.UpdatePetTooltips();
- M.UpdateTargetTooltips();
- M.UpdateBossTooltips();
- updateAuraTooltips();
-end
-
UnitFrames:RegisterEvent("PLAYER_LOGIN");
-UnitFrames:RegisterEvent("PLAYER_ENTERING_WORLD");
UnitFrames:RegisterEvent("ADDON_LOADED");
UnitFrames:SetScript("OnEvent", function(self, event, addon)
- if event == "PLAYER_ENTERING_WORLD" then
- CTimerAfter(0.01, updateTooltipFuncs);
- elseif event == "ADDON_LOADED" and addon == "Blizzard_ArenaUI" then
+ if event == "ADDON_LOADED" and addon == "Blizzard_ArenaUI" then
hideArenaFrames();
elseif event == "PLAYER_LOGIN" then
OmaUFLoadChar();