Commit c606019b authored by Ivaria's avatar Ivaria
Browse files

Initial commit for spell trace feature - mostly complete minus options dialogs

parent fbf5dbae
## Interface: 70100
## Title: VuhDo ['vu:du:]
## Author: Iza@Gilneas, humfras, Ivaria@Hyjal
## Version: 3.81
## Version: 3.82
## Notes: Raid Frames providing click-heal functionality, buff and debuff control, main tank management and much more
## SavedVariablesPerCharacter: VUHDO_CONFIG, VUHDO_PANEL_SETUP, VUHDO_SPELL_ASSIGNMENTS, VUHDO_HOSTILE_SPELL_ASSIGNMENTS, VUHDO_MM_SETTINGS, VUHDO_PLAYER_TARGETS, VUHDO_MAINTANK_NAMES, VUHDO_BUFF_SETTINGS, VUHDO_POWER_TYPE_COLORS, VUHDO_SPELLS_KEYBOARD, VUHDO_SPELL_CONFIG, VUHDO_BUFF_ORDER, VUHDO_SPEC_LAYOUTS, VUHDO_GROUP_SIZE, VUHDO_RAID, VUHDO_INDICATOR_CONFIG
## SavedVariables: VUHDO_DEFAULT_LAYOUT, VUHDO_DEFAULT_PROFILE, VUHDO_PROFILES, VUHDO_MANUAL_ROLES, VUHDO_SPELL_LAYOUTS, VUHDO_USER_CLASS_COLORS, VUHDO_DEBUFF_BLACKLIST, VUHDO_BOUQUETS, VUHDO_COMBAT_LOG_TRACE, VUHDO_GLOBAL_CONFIG, VUHDO_DEBUG
......
......@@ -56,6 +56,7 @@
<Script file="VuhDoPlayerTargetEventHandler.lua" />
<Script file="VuhDoDcShield.lua" />
<Script file="VuhDoAoeAdvisor.lua" />
<Script file="VuhDoSpellTrace.lua" />
<Script file="VuhDoAddonAdapter.lua" />
<Script file="VuhDo.lua" />
......
......@@ -47,6 +47,7 @@ local VUHDO_getCurrentBouquetColor;
local VUHDO_getIncHealOnUnit;
local VUHDO_getUnitDebuffSchoolInfos;
local VUHDO_getCurrentBouquetStacks;
local VUHDO_getSpellTraceForUnit;
local VUHDO_getAoeAdviceForUnit;
local VUHDO_getCurrentBouquetTimer;
local VUHDO_getRaidTargetIconTexture;
......@@ -86,6 +87,7 @@ function VUHDO_bouquetValidatorsInitLocalOverrides()
VUHDO_getUnitDebuffSchoolInfos = _G["VUHDO_getUnitDebuffSchoolInfos"];
VUHDO_getCurrentBouquetStacks = _G["VUHDO_getCurrentBouquetStacks"];
VUHDO_getIsCurrentBouquetActive = _G["VUHDO_getIsCurrentBouquetActive"];
VUHDO_getSpellTraceForUnit = _G["VUHDO_getSpellTraceForUnit"];
VUHDO_getAoeAdviceForUnit = _G["VUHDO_getAoeAdviceForUnit"];
VUHDO_getCurrentBouquetTimer = _G["VUHDO_getCurrentBouquetTimer"];
VUHDO_getRaidTargetIconTexture = _G["VUHDO_getRaidTargetIconTexture"];
......@@ -146,6 +148,20 @@ end
--
local tInfo;
local function VUHDO_spellTraceValidator(anInfo, _)
tInfo = VUHDO_getSpellTraceForUnit(anInfo["unit"]);
if tInfo then
return true, tInfo["icon"], -1, -1, -1;
else
return false, nil, -1, -1, -1;
end
end
--
local tInfo;
local function VUHDO_aoeAdviceValidator(anInfo, _)
......@@ -1661,6 +1677,12 @@ VUHDO_BOUQUET_BUFFS_SPECIAL = {
["interests"] = { VUHDO_UPDATE_UNIT_TARGET },
},
["SPELL_TRACE"] = {
["displayName"] = VUHDO_I18N_SPELL_TRACE,
["validator"] = VUHDO_spellTraceValidator,
["interests"] = { VUHDO_UPDATE_SPELL_TRACE },
},
["AOE_ADVICE"] = {
["displayName"] = VUHDO_I18N_AOE_ADVICE,
["validator"] = VUHDO_aoeAdviceValidator,
......
......@@ -275,6 +275,7 @@ VUHDO_UPDATE_RAID_ROSTER = 33;
VUHDO_UPDATE_MINOR_FLAGS = 34;
VUHDO_UPDATE_CHI = 35;
VUHDO_UPDATE_SHIELD = 36;
VUHDO_UPDATE_SPELL_TRACE = 37;
......
......@@ -673,6 +673,8 @@ local VUHDO_DEFAULT_CONFIG = {
["IS_USE_BUTTON_FACADE"] = false,
["IS_SHARE"] = true,
["IS_READY_CHECK_DISABLED"] = false,
["SHOW_SPELL_TRACE"] = false,
};
......
......@@ -521,6 +521,18 @@ VUHDO_DEFAULT_OVERFLOW_COUNTER_BOUQUET = {
};
VUHDO_DEFAULT_SPELL_TRACE_BOUQUET = {
[VUHDO_I18N_DEF_SPELL_TRACE] = {
{
["name"] = "SPELL_TRACE",
["mine"] = true, ["icon"] = 1,
["color"] = VUHDO_makeFullColorForBouquet(1, 1, 1, 1, 1, 1, 1, 1),
["custom"] = { [1] = 3, ["radio"] = 2, ["bright"] = 1 },
},
},
};
--
VUHDO_DEFAULT_GRID_BOUQUETS = {
[VUHDO_I18N_GRID_MOUSEOVER_SINGLE] = {
......@@ -1322,6 +1334,12 @@ function VUHDO_loadDefaultBouquets()
end
VUHDO_DEFAULT_OVERFLOW_COUNTER_BOUQUET = nil;
if VUHDO_BOUQUETS["VERSION"] < 16 then
VUHDO_BOUQUETS["VERSION"] = 16;
VUHDO_addDefaultBouquet(VUHDO_DEFAULT_SPELL_TRACE_BOUQUET);
end
VUHDO_DEFAULT_SPELL_TRACE_BOUQUET = nil;
VUHDO_buildGenericHealthBarBouquet();
VUHDO_buildGenericTargetHealthBouquet();
......
......@@ -251,6 +251,7 @@ function VUHDO_initAllBurstCaches()
VUHDO_directionsInitLocalOverrides();
VUHDO_dcShieldInitLocalOverrides();
VUHDO_shieldAbsorbInitLocalOverrides();
VUHDO_spellTraceInitLocalOverrides();
VUHDO_playerTargetEventHandlerInitLocalOverrides();
end
......@@ -412,11 +413,22 @@ function VUHDO_OnEvent(_, anEvent, anArg1, anArg2, anArg3, anArg4, anArg5, anArg
-- ENVIRONMENTAL_DAMAGE - the amount of damage is the 13th arg
-- for all other events with the _DAMAGE suffix the amount of damage is the 15th arg
VUHDO_parseCombatLogEvent(anArg2, anArg8, anArg12, anArg13, anArg15);
if VUHDO_INTERNAL_TOGGLES[36] then -- VUHDO_UPDATE_SHIELD
-- for SPELL events with _AURA suffixes the amount healed is the 16th arg
-- for SPELL_HEAL/SPELL_PERIODIC_HEAL the amount absorbed is the 17th arg
VUHDO_parseCombatLogShieldAbsorb(anArg2, anArg4, anArg8, anArg13, anArg16, anArg12, anArg17);
end
if VUHDO_INTERNAL_TOGGLES[37] then -- VUHDO_UPDATE_SPELL_TRACE
VUHDO_parseCombatLogSpellTrace(
anArg2, -- message/event
anArg4, -- source GUID
anArg8, -- dest GUID
anArg13, -- spell name
anArg12 -- spell ID
);
end
end
elseif "UNIT_AURA" == anEvent then
......@@ -907,7 +919,6 @@ function VUHDO_updateGlobalToggles()
VUHDO_UnRegisterEvent(VUHDO_CONFIG["SHOW_INCOMING"] or VUHDO_CONFIG["SHOW_OWN_INCOMING"],
"UNIT_HEAL_PREDICTION");
VUHDO_UnRegisterEvent(VUHDO_CONFIG["PARSE_COMBAT_LOG"], "COMBAT_LOG_EVENT_UNFILTERED");
VUHDO_UnRegisterEvent(not VUHDO_CONFIG["IS_READY_CHECK_DISABLED"],
"READY_CHECK", "READY_CHECK_CONFIRM", "READY_CHECK_FINISHED");
......@@ -918,6 +929,12 @@ function VUHDO_updateGlobalToggles()
or VUHDO_isAnyoneInterstedIn(VUHDO_UPDATE_SHIELD);
VUHDO_UnRegisterEvent(VUHDO_INTERNAL_TOGGLES[VUHDO_UPDATE_SHIELD], "UNIT_ABSORB_AMOUNT_CHANGED");
VUHDO_INTERNAL_TOGGLES[VUHDO_UPDATE_SPELL_TRACE] = VUHDO_CONFIG["SHOW_SPELL_TRACE"]
or VUHDO_isAnyoneInterstedIn(VUHDO_UPDATE_SPELL_TRACE);
VUHDO_UnRegisterEvent(VUHDO_CONFIG["PARSE_COMBAT_LOG"] or VUHDO_INTERNAL_TOGGLES[VUHDO_UPDATE_SPELL_TRACE],
"COMBAT_LOG_EVENT_UNFILTERED");
end
......@@ -1268,9 +1285,14 @@ function VUHDO_OnUpdate(_, aTimeDelta)
if VUHDO_checkResetTimer("UPDATE_HOTS", sHotToggleUpdateSecs) then
if tHotDebuffToggle == 1 then
VUHDO_updateAllHoTs();
if VUHDO_INTERNAL_TOGGLES[18] then -- VUHDO_UPDATE_MOUSEOVER_CLUSTER
VUHDO_updateClusterHighlights();
end
if VUHDO_INTERNAL_TOGGLES[37] then -- VUHDO_UPDATE_SPELL_TRACE
VUHDO_updateSpellTrace(aTimeDelta);
end
elseif tHotDebuffToggle == 2 then
VUHDO_updateAllCyclicBouquets(false);
else
......
......@@ -440,3 +440,7 @@ VUHDO_I18N_DEFAULT_RES_ANNOUNCE_MASS = "Casting mass resurrection!";
-- 3.81
VUHDO_I18N_BOUQUET_OVERFLOW_COUNTER = "Overflow Mythic+ Affix";
-- 3.82
VUHDO_I18N_SPELL_TRACE = "Icon: Spell Trace";
VUHDO_I18N_DEF_SPELL_TRACE = "Spell Trace";
......@@ -449,3 +449,7 @@ VUHDO_I18N_DEFAULT_RES_ANNOUNCE_MASS = "Casting mass resurrection!";
-- 3.81
VUHDO_I18N_BOUQUET_OVERFLOW_COUNTER = "Overflow Mythic+ Affix";
-- 3.82
VUHDO_I18N_SPELL_TRACE = "Icon: Spell Trace";
VUHDO_I18N_DEF_SPELL_TRACE = "Spell Trace";
......@@ -450,3 +450,7 @@ VUHDO_I18N_DEFAULT_RES_ANNOUNCE_MASS = "Casting mass resurrection!";
-- 3.81
VUHDO_I18N_BOUQUET_OVERFLOW_COUNTER = "Overflow Mythic+ Affix";
-- 3.82
VUHDO_I18N_SPELL_TRACE = "Icon: Spell Trace";
VUHDO_I18N_DEF_SPELL_TRACE = "Spell Trace";
......@@ -448,3 +448,7 @@ VUHDO_I18N_DEFAULT_RES_ANNOUNCE_MASS = "Casting mass resurrection!";
-- 3.81
VUHDO_I18N_BOUQUET_OVERFLOW_COUNTER = "Overflow Mythic+ Affix";
-- 3.82
VUHDO_I18N_SPELL_TRACE = "Icon: Spell Trace";
VUHDO_I18N_DEF_SPELL_TRACE = "Spell Trace";
......@@ -514,3 +514,7 @@ VUHDO_I18N_DEFAULT_RES_ANNOUNCE_MASS = "Casting mass resurrection!";
-- 3.81
VUHDO_I18N_BOUQUET_OVERFLOW_COUNTER = "Overflow Mythic+ Affix";
-- 3.82
VUHDO_I18N_SPELL_TRACE = "Icon: Spell Trace";
VUHDO_I18N_DEF_SPELL_TRACE = "Spell Trace";
......@@ -442,3 +442,7 @@ VUHDO_I18N_DEFAULT_RES_ANNOUNCE_MASS = "Casting mass resurrection!";
-- 3.81
VUHDO_I18N_BOUQUET_OVERFLOW_COUNTER = "Overflow Mythic+ Affix";
-- 3.82
VUHDO_I18N_SPELL_TRACE = "Icon: Spell Trace";
VUHDO_I18N_DEF_SPELL_TRACE = "Spell Trace";
......@@ -442,3 +442,7 @@ VUHDO_I18N_DEFAULT_RES_ANNOUNCE_MASS = "Casting mass resurrection!";
-- 3.81
VUHDO_I18N_BOUQUET_OVERFLOW_COUNTER = "Overflow Mythic+ Affix";
-- 3.82
VUHDO_I18N_SPELL_TRACE = "Icon: Spell Trace";
VUHDO_I18N_DEF_SPELL_TRACE = "Spell Trace";
......@@ -1113,3 +1113,6 @@ VUHDO_I18N_SPEC_3 = "Spec 3";
VUHDO_I18N_SPEC_4 = "Spec 4";
VUHDO_I18N_ANNOUNCE_MASS_RES = "'Mass' Resurrection\nAnnouncement";
VUHDO_I18N_SPELL_TRACE = "Spell Trace";
......@@ -622,6 +622,7 @@ VUHDO_I18N_TT.K564 = "Select a color for Monks";
VUHDO_I18N_TT.K565 = "Select a color for Demon Hunters";
VUHDO_I18N_TT.K566 = "Click to select pain bar color.";
VUHDO_I18N_TT.K567 = "Enter a text to be shown in chat when you start casting 'mass' resurrection.";
VUHDO_I18N_TT.K568 = "Setup spell traces. A spell trace tracks which units are hit when a particular spell is cast. You can build bouquets with spell traces or use the default 'Spell Trace' bouquet e.g. as a HoT icon or indicator.";
VUHDO_I18N_DEFAULT_PROFILE = "Default Profile";
VUHDO_I18N_DEFAULT_LAYOUT = "Default Layout";
......@@ -1113,3 +1114,6 @@ VUHDO_I18N_SPEC_3 = "Spec 3";
VUHDO_I18N_SPEC_4 = "Spec 4";
VUHDO_I18N_ANNOUNCE_MASS_RES = "'Mass' Resurrection\nAnnouncement";
VUHDO_I18N_SPELL_TRACE = "Spell Trace";
......@@ -1128,3 +1128,6 @@ VUHDO_I18N_SPEC_3 = "Spec 3";
VUHDO_I18N_SPEC_4 = "Spec 4";
VUHDO_I18N_ANNOUNCE_MASS_RES = "'Mass' Resurrection\nAnnouncement";
VUHDO_I18N_SPELL_TRACE = "Spell Trace";
......@@ -1129,3 +1129,6 @@ VUHDO_I18N_SPEC_3 = "Spec 3";
VUHDO_I18N_SPEC_4 = "Spec 4";
VUHDO_I18N_ANNOUNCE_MASS_RES = "'Mass' Resurrection\nAnnouncement";
VUHDO_I18N_SPELL_TRACE = "Spell Trace";
......@@ -1293,3 +1293,6 @@ VUHDO_I18N_SPEC_3 = "Spec 3";
VUHDO_I18N_SPEC_4 = "Spec 4";
VUHDO_I18N_ANNOUNCE_MASS_RES = "'Mass' Resurrection\nAnnouncement";
VUHDO_I18N_SPELL_TRACE = "Spell Trace";
......@@ -1115,3 +1115,6 @@ VUHDO_I18N_SPEC_3 = "Spec 3";
VUHDO_I18N_SPEC_4 = "Spec 4";
VUHDO_I18N_ANNOUNCE_MASS_RES = "'Mass' Resurrection\nAnnouncement";
VUHDO_I18N_SPELL_TRACE = "Spell Trace";
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