Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Landon Wu
VuhDo
Commits
cb79ef21
Commit
cb79ef21
authored
4 years ago
by
Landon Wu
Browse files
Options
Download
Email Patches
Plain Diff
Replace Libthreat2 to WOW API
parent
e33fed7c
Pipeline
#428
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
67 deletions
+67
-67
Libs/Libs.xml
Libs/Libs.xml
+0
-1
VuhDoAddonAdapter.lua
VuhDoAddonAdapter.lua
+2
-1
VuhDoEventHandler.lua
VuhDoEventHandler.lua
+9
-9
VuhDoToolbox.lua
VuhDoToolbox.lua
+56
-56
No files found.
Libs/Libs.xml
View file @
cb79ef21
...
...
@@ -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"
/>
...
...
This diff is collapsed.
Click to expand it.
VuhDoAddonAdapter.lua
View file @
cb79ef21
...
...
@@ -24,7 +24,8 @@ if VUHDO_LibClassicDurations then
VUHDO_LibClassicDurations
:
Register
(
"VuhDo"
);
end
VUHDO_LibThreatClassic
=
LibStub
:
GetLibrary
(
"LibThreatClassic2"
);
--VUHDO_LibThreatClassic = LibStub:GetLibrary("LibThreatClassic2");
VUHDO_LibThreatClassic
=
nil
;
VUHDO_LibTotemInfo
=
LibStub
(
"LibTotemInfo-1.0"
);
VUHDO_LibSharedMedia
:
Register
(
"font"
,
"Arial Black"
,
"Interface\\AddOns\\VuhDo\\Fonts\\ariblk.ttf"
);
...
...
This diff is collapsed.
Click to expand it.
VuhDoEventHandler.lua
View file @
cb79ef21
...
...
@@ -43,7 +43,7 @@ local GetTime = GetTime;
local
CheckInteractDistance
=
CheckInteractDistance
;
local
UnitInRange
=
UnitInRange
;
local
IsSpellInRange
=
IsSpellInRange
;
local
VUHDO_u
nitDetailedThreatSituation
=
VUHDO_u
nitDetailedThreatSituation
;
local
U
nitDetailedThreatSituation
=
U
nitDetailedThreatSituation
;
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_u
nitThreatSituation
=
VUHDO_u
nitThreatSituation
;
local
U
nitThreatSituation
=
U
nitThreatSituation
;
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_u
nitThreatSituation
(
aUnit
)
or
0
;
tInfo
[
"threat"
]
=
U
nitThreatSituation
(
aUnit
)
or
0
;
if
VUHDO_INTERNAL_TOGGLES
[
17
]
then
-- VUHDO_UPDATE_THREAT_LEVEL
VUHDO_updateBouquetsForEvent
(
aUnit
,
17
);
-- VUHDO_UPDATE_THREAT_LEVEL
...
...
@@ -505,9 +505,9 @@ function VUHDO_OnEvent(_, anEvent, anArg1, anArg2, anArg3, anArg4, anArg5, anArg
elseif
"UNIT_SPELLCAST_SENT"
==
anEvent
then
if
VUHDO_VARIABLES_LOADED
then
VUHDO_spellcastSent
(
anArg1
,
anArg2
,
anArg4
);
end
--[[
elseif "UNIT_THREAT_SITUATION_UPDATE" == anEvent then
elseif
"UNIT_THREAT_SITUATION_UPDATE"
==
anEvent
then
if
VUHDO_VARIABLES_LOADED
then
VUHDO_updateThreat
(
anArg1
);
end
]]
elseif
"PLAYER_REGEN_ENABLED"
==
anEvent
then
if
VUHDO_VARIABLES_LOADED
then
for
tUnit
,
_
in
pairs
(
VUHDO_RAID
)
do
...
...
@@ -924,11 +924,11 @@ function VUHDO_updateGlobalToggles()
VUHDO_INTERNAL_TOGGLES
[
VUHDO_UPDATE_THREAT_LEVEL
]
=
VUHDO_isAnyoneInterstedIn
(
VUHDO_UPDATE_THREAT_LEVEL
);
--[[
VUHDO_UnRegisterEvent(VUHDO_INTERNAL_TOGGLES[VUHDO_UPDATE_THREAT_LEVEL]
VUHDO_UnRegisterEvent
(
VUHDO_INTERNAL_TOGGLES
[
VUHDO_UPDATE_THREAT_LEVEL
]
or
VUHDO_isAnyoneInterstedIn
(
VUHDO_UPDATE_AGGRO
),
"UNIT_THREAT_SITUATION_UPDATE"
);
]]
VUHDO_INTERNAL_TOGGLES
[
VUHDO_UPDATE_THREAT_PERC
]
=
VUHDO_isAnyoneInterstedIn
(
VUHDO_UPDATE_THREAT_PERC
);
VUHDO_INTERNAL_TOGGLES
[
VUHDO_UPDATE_AGGRO
]
=
VUHDO_isAnyoneInterstedIn
(
VUHDO_UPDATE_AGGRO
);
...
...
@@ -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_u
nitDetailedThreatSituation
(
tUnit
,
tTarget
);
_
,
_
,
tThreatPerc
=
U
nitDetailedThreatSituation
(
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_u
nitDetailedThreatSituation
(
tAggroUnit
,
tTarget
);
_
,
_
,
tThreatPerc
=
U
nitDetailedThreatSituation
(
tAggroUnit
,
tTarget
);
VUHDO_RAID
[
tAggroUnit
][
"threatPerc"
]
=
tThreatPerc
or
0
;
end
...
...
This diff is collapsed.
Click to expand it.
VuhDoToolbox.lua
View file @
cb79ef21
...
...
@@ -1149,62 +1149,62 @@ 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_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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment