Commit ba80fe47 authored by Ivaria's avatar Ivaria
Browse files

Migrate from LibThreatClassic2 to restored Blizzard APIs

parent 6be87406
......@@ -22,7 +22,6 @@
<Include file="LibCustomGlow-1.0\LibCustomGlow-1.0.xml" />
<Include file="NickTag-1.0\NickTag-1.0.xml" />
<Include file="LibThreatClassic2\lib.xml" />
<Include file="!LibTotemInfo\embeds.xml" />
<Include file="LibClassicDurations\LibClassicDurations.xml" />
<Include file="LibHealComm-4.0\LibHealComm-4.0.xml" />
......
......@@ -98,7 +98,7 @@ local GetNumGroupMembers = GetNumGroupMembers;
local UnitName = UnitName;
local UnitPower = UnitPower;
local UnitPowerMax = UnitPowerMax;
local VUHDO_unitThreatSituation = VUHDO_unitThreatSituation;
local UnitThreatSituation = UnitThreatSituation;
local UnitClass = UnitClass;
local UnitPowerType = UnitPowerType;
local VUHDO_unitHasVehicleUI = VUHDO_unitHasVehicleUI;
......@@ -349,7 +349,7 @@ function VUHDO_setHealth(aUnit, aMode)
tInfo["dead"] = tIsDead;
tInfo["afk"] = tIsAfk;
tInfo["connected"] = tIsConnected;
tInfo["threat"] = VUHDO_unitThreatSituation(aUnit) or 0;
tInfo["threat"] = UnitThreatSituation(aUnit) or 0;
tInfo["threatPerc"] = 0;
tInfo["isVehicle"] = VUHDO_unitHasVehicleUI(aUnit);
tInfo["className"] = tLocalClass or "";
......
## Interface: 11304
## Interface: 11305
## Title: VuhDo ['vu:du:]
## Author: Iza@Gilneas, humfras, Ivaria@Hyjal
## Version: 3.114-classic
......
......@@ -24,7 +24,6 @@ if VUHDO_LibClassicDurations then
VUHDO_LibClassicDurations:Register("VuhDo");
end
VUHDO_LibThreatClassic = LibStub:GetLibrary("LibThreatClassic2");
VUHDO_LibTotemInfo = LibStub("LibTotemInfo-1.0");
VUHDO_LibSharedMedia:Register("font", "Arial Black", "Interface\\AddOns\\VuhDo\\Fonts\\ariblk.ttf");
......
......@@ -43,7 +43,7 @@ local GetTime = GetTime;
local CheckInteractDistance = CheckInteractDistance;
local UnitInRange = UnitInRange;
local IsSpellInRange = IsSpellInRange;
local VUHDO_unitDetailedThreatSituation = VUHDO_unitDetailedThreatSituation;
local UnitDetailedThreatSituation = UnitDetailedThreatSituation;
local UnitIsCharmed = UnitIsCharmed;
local UnitCanAttack = UnitCanAttack;
local UnitName = UnitName;
......@@ -52,7 +52,7 @@ local UnitIsTrivial = UnitIsTrivial;
local GetSpellCooldown = GetSpellCooldown;
local HasFullControl = HasFullControl;
local pairs = pairs;
local VUHDO_unitThreatSituation = VUHDO_unitThreatSituation;
local UnitThreatSituation = UnitThreatSituation;
local InCombatLockdown = InCombatLockdown;
local type = type;
......@@ -198,7 +198,7 @@ local tEmpty = {};
local function VUHDO_updateThreat(aUnit)
tInfo = (VUHDO_RAID or tEmpty)[aUnit];
if tInfo then
tInfo["threat"] = VUHDO_unitThreatSituation(aUnit) or 0;
tInfo["threat"] = UnitThreatSituation(aUnit) or 0;
if VUHDO_INTERNAL_TOGGLES[17] then -- VUHDO_UPDATE_THREAT_LEVEL
VUHDO_updateBouquetsForEvent(aUnit, 17); -- VUHDO_UPDATE_THREAT_LEVEL
......@@ -1052,7 +1052,7 @@ local function VUHDO_updateAllAggro()
tTarget = tInfo["targetUnit"];
if not UnitIsFriend(tUnit, tTarget) then
if VUHDO_INTERNAL_TOGGLES[14] then -- VUHDO_UPDATE_AGGRO
_, _, tThreatPerc = VUHDO_unitDetailedThreatSituation(tUnit, tTarget);
_, _, tThreatPerc = UnitDetailedThreatSituation(tUnit, tTarget);
tInfo["threatPerc"] = tThreatPerc or 0;
end
......@@ -1060,7 +1060,7 @@ local function VUHDO_updateAllAggro()
if tAggroUnit then
if VUHDO_INTERNAL_TOGGLES[14] then -- VUHDO_UPDATE_AGGRO
_, _, tThreatPerc = VUHDO_unitDetailedThreatSituation(tAggroUnit, tTarget);
_, _, tThreatPerc = UnitDetailedThreatSituation(tAggroUnit, tTarget);
VUHDO_RAID[tAggroUnit]["threatPerc"] = tThreatPerc or 0;
end
......
## Interface: 11304
## Interface: 11305
## Title: VuhDo ['vu:du:] - Options
## Author: Iza@Gilneas, humfras, Ivaria@Hyjal
## Version: 3.114-classic
......
......@@ -1149,65 +1149,6 @@ end
function VUHDO_unitThreatSituation(aUnit)
if not aUnit then
return nil;
end
if not UnitThreatSituation then
if VUHDO_LibThreatClassic then
local tOtherUnit = nil;
-- check target and boss unit threat
if UnitExists(aUnit .. "target") and UnitIsEnemy(aUnit, aUnit .. "target") then
tOtherUnit = aUnit .. "target";
elseif UnitExists("target") and UnitIsEnemy("player", "target") then
tOtherUnit = "target";
elseif UnitExists("boss1") and UnitIsEnemy("player", "boss1") then
tOtherUnit = "boss1";
elseif UnitExists("boss2") and UnitIsEnemy("player", "boss2") then
tOtherUnit = "boss2";
elseif UnitExists("boss3") and UnitIsEnemy("player", "boss3") then
tOtherUnit = "boss3";
elseif UnitExists("boss4") and UnitIsEnemy("player", "boss4") then
tOtherUnit = "boss4";
elseif UnitExists("boss5") and UnitIsEnemy("player", "boss5") then
tOtherUnit = "boss5";
end
return VUHDO_LibThreatClassic:UnitThreatSituation(aUnit, tOtherUnit);
else
return nil;
end
else
return UnitThreatSituation(aUnit);
end
end
function VUHDO_unitDetailedThreatSituation(aUnit, aOtherUnit)
if not aUnit or not aOtherUnit then
return nil;
end
if not UnitDetailedThreatSituation then
if VUHDO_LibThreatClassic then
return VUHDO_LibThreatClassic:UnitDetailedThreatSituation(aUnit, aOtherUnit);
else
return nil;
end
else
return UnitDetailedThreatSituation(aUnit, aOtherUnit);
end
end
function VUHDO_unitIsWarModePhased(...)
if not UnitIsWarModePhased then
......
......@@ -15,7 +15,8 @@ Bugfixes:
Improvements:
-- Bump TOC interface for 1.13.4
-- Bump TOC interface for 1.13.5
-- Migrate from LibThreatClassic2 to restored Blizzard APIs
--------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment