Commit 60930edc authored by humfras's avatar humfras
Browse files

No commit message

No commit message
parent 0b7caa30
<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Script file="Libs\LibStub\LibStub.lua" />
<Script file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua" />
<Script file="Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua" />
<Script file="Libs\LibSharedMedia-3.0\LibSharedMedia-3.0.lua" />
<Script file="Libs\UTF8\utf8.lua" />
<Script file="Libs\LibCompress\LibCompress.lua" />
<Script file="Libs\LibBase64-1.0\LibBase64-1.0.lua" />
<Script file="Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua" />
<Script file="Libs\LibCustomGlow-1.0\LibCustomGlow-1.0.lua" />
<Script file="VuhDoLocalization_en.lua" />
<Script file="VuhDoLocalization_de.lua" />
<Script file="VuhDoLocalization_fr.lua" />
<Script file="VuhDoLocalization_es.lua" />
<Script file="VuhDoLocalization_ru.lua" />
<Script file="VuhDoLocalization_zhCN.lua" />
<Script file="VuhDoLocalization_zhTW.lua" />
<Script file="VuhDoConstSpells.lua" />
<Script file="VuhDoConst.lua" />
<Script file="VuhDoGuiConst.lua" />
<Script file="VuhDoToolbox.lua" />
<Script file="VuhDoBuffConst.lua" />
<Script file="VuhDoDebuffConst.lua" />
<Script file="VuhDoTextProviders.lua" />
<Script file="VuhDoTextProviderHandler.lua" />
<Script file="VuhDoDefaultsBouquets.lua" />
<Script file="VuhDoDefaults.lua" />
<Script file="VuhDoConfigConvenience.lua" />
<Script file="VuhDoGuiToolbox.lua" />
<Script file="VuhDoModelTools.lua" />
<Script file="VuhDoPanelConvenience.lua" />
<Script file="VuhDoSizeCalculator.lua" />
<Script file="VuhDoSizeCalculatorHor.lua" />
<Script file="VuhDoSizeCalculatorVer.lua" />
<Script file="VuhDoDirections.lua" />
<Script file="VuhDoRoleChecker.lua" />
<Script file="VuhDoDropdownFactory.lua" />
<Script file="VuhDoReadyCheck.lua" />
<Script file="VuhDoEventHandler.lua" />
<Script file="VuhDoDebuffs.lua" />
<Script file="VuhDoBouquetValidators.lua" />
<Script file="VuhDoBouquets.lua" />
<Script file="VuhDoEventHandler.lua" />
<Script file="VuhDoTooltip.lua" />
<Script file="VuhDoCtraAdapter.lua" />
<Script file="VuhDoHealCommAdapter.lua" />
<Script file="VuhDoShieldAbsorb.lua" />
<Script file="VuhDoCombatLogParser.lua" />
<Script file="VuhDoSpellEstimator.lua" />
<Script file="VuhDoClusterBuilder.lua" />
<Script file="VuhDoMacroFactory.lua" />
<Script file="VuhDoSpellEventHandler.lua" />
<Script file="VuhDoPlayerTargetEventHandler.lua" />
<Script file="VuhDoDcShield.lua" />
<Script file="VuhDoAoeAdvisor.lua" />
<Script file="VuhDoSpellTrace.lua" />
<Script file="VuhDoAddonAdapter.lua" />
<Script file="VuhDo.lua" />
<Script file="VuhDoSerializer.lua" />
<Script file="VuhDoNewOptionsSpellFireShared.lua" />
<Script file="VuhDoNewOptionsGeneralSkinsShared.lua" />
<Frame name="VuhDoStatusBar" enableMouse="false" virtual="true" hidden="false">
<Frames>
<Frame name="$parentLabel" setAllPoints="true">
<Layers>
<Layer>
<FontString name="$parentLabel" text="" font="SystemFont_Tiny">
</FontString>
</Layer>
</Layers>
</Frame>
</Frames>
<Scripts>
<OnLoad>
VUHDO_refactorStatusbar(self);
</OnLoad>
</Scripts>
</Frame>
<Frame name="VuhDoMinimapDropDown" inherits="UIDropDownMenuTemplate" clampedToScreen="true" id="1" hidden="true">
<Scripts>
<OnLoad>
VUHDO_minimapDropdownOnLoad();
</OnLoad>
</Scripts>
</Frame>
<Frame name="VuhDoPlayerTargetDropDown" inherits="UIDropDownMenuTemplate" clampedToScreen="true" id="2" hidden="true">
<Scripts>
<OnLoad>
VUHDO_playerTargetDropdownOnLoad();
</OnLoad>
</Scripts>
</Frame>
<Frame name="VuhDo" parent="UIParent" frameStrata="LOW" toplevel="true" inherits="SecureFrameTemplate">
<Scripts>
<OnLoad>
VUHDO_OnLoad(self);
</OnLoad>
</Scripts>
</Frame>
<Frame name="VuhDoTooltip" frameStrata="TOOLTIP" movable="true" parent="UIParent" hidden="true">
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentTextL1" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="10" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextR1" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-10" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL2" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextR2" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentTextR1" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL3" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL2" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextR3" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentTextR2" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL4" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL3" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextR4" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentTextR3" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL5" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL4" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextR5" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentTextR4" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL6" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL5" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextR6" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentTextR5" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL7" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL6" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextR7" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentTextR6" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL8" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL7" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextR8" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentTextR6" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL9" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL8" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL10" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL9" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL11" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL10" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL12" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL11" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL13" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL12" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL14" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL13" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL15" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL14" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentTextL16" inherits="GameFontNormalSmall" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTextL14" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Backdrop tile="true"
bgFile="Interface\Tooltips\UI-Tooltip-Background"
edgeFile="Interface\Tooltips\UI-Tooltip-Border">
<EdgeSize>
<AbsValue val="8"/>
</EdgeSize>
<TileSize>
<AbsValue val="8"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="3" right="3" top="3" bottom="3"/>
</BackgroundInsets>
</Backdrop>
<Scripts>
<OnMouseDown>VuhDoTooltipOnMouseDown(self,arg1)</OnMouseDown>
<OnMouseUp>VuhDoTooltipOnMouseUp(self,arg1)</OnMouseUp>
</Scripts>
</Frame>
<GameTooltip name="VuhDoScanTooltip" hidden="true" parent="UIParent" inherits="GameTooltipTemplate" />
</Ui>
local _;
local VUHDO_IS_SMART_CAST = false;
local SecureButton_GetButtonSuffix = SecureButton_GetButtonSuffix;
local InCombatLockdown = InCombatLockdown;
local strlower = strlower;
local strfind = strfind;
local pairs = pairs;
local GameTooltip = GameTooltip;
local sMouseoverUnit = nil;
local VUHDO_updateBouquetsForEvent;
local VUHDO_highlightClusterFor;
local VUHDO_showTooltip;
local VUHDO_hideTooltip;
local VUHDO_resetClusterUnit;
local VUHDO_removeAllClusterHighlights;
local VUHDO_getHealthBar;
local VUHDO_setupSmartCast;
local VUHDO_updateDirectionFrame;
local VUHDO_getCurrentKeyModifierString;
local VUHDO_SPELL_CONFIG;
local VUHDO_SPELL_ASSIGNMENTS;
local VUHDO_getUnitButtonsSafe;
local VUHDO_CONFIG;
local VUHDO_INTERNAL_TOGGLES;
local VUHDO_RAID;
function VUHDO_actionEventHandlerInitLocalOverrides()
VUHDO_updateBouquetsForEvent = _G["VUHDO_updateBouquetsForEvent"];
VUHDO_highlightClusterFor = _G["VUHDO_highlightClusterFor"];
VUHDO_showTooltip = _G["VUHDO_showTooltip"];
VUHDO_hideTooltip = _G["VUHDO_hideTooltip"];
VUHDO_resetClusterUnit = _G["VUHDO_resetClusterUnit"];
VUHDO_removeAllClusterHighlights = _G["VUHDO_removeAllClusterHighlights"];
VUHDO_getHealthBar = _G["VUHDO_getHealthBar"];
VUHDO_setupSmartCast = _G["VUHDO_setupSmartCast"];
VUHDO_updateDirectionFrame = _G["VUHDO_updateDirectionFrame"];
VUHDO_getUnitButtonsSafe = _G["VUHDO_getUnitButtonsSafe"];
VUHDO_getCurrentKeyModifierString = _G["VUHDO_getCurrentKeyModifierString"];
VUHDO_SPELL_CONFIG = _G["VUHDO_SPELL_CONFIG"];
VUHDO_SPELL_ASSIGNMENTS = _G["VUHDO_SPELL_ASSIGNMENTS"];
VUHDO_CONFIG = _G["VUHDO_CONFIG"];
VUHDO_INTERNAL_TOGGLES = _G["VUHDO_INTERNAL_TOGGLES"];
VUHDO_RAID = _G["VUHDO_RAID"];
end
--
function VUHDO_getCurrentMouseOver()
return sMouseoverUnit;
end
--
local function VUHDO_placePlayerIcon(aButton, anIconNo, anIndex)
VUHDO_getBarIconTimer(aButton, anIconNo):SetText("");
VUHDO_getBarIconCounter(aButton, anIconNo):SetText("");
VUHDO_getBarIconCharge(aButton, anIconNo):Hide();
local tFrame = VUHDO_getBarIconFrame(aButton, anIconNo);
tFrame:SetScale(1);
tFrame:Show();
local anIcon = VUHDO_getBarIcon(aButton, anIconNo);
anIcon:ClearAllPoints();
if 2 == anIndex then
anIcon:SetPoint("CENTER", aButton:GetName(), "TOPRIGHT", -5, -10);
else
if anIndex > 2 then anIndex = anIndex - 1; end
local tCol = floor(anIndex * 0.5);
local tRow = anIndex - tCol * 2;
anIcon:SetPoint("TOPLEFT", aButton:GetName(), "TOPLEFT", tCol * 14, -tRow * 14);
end
anIcon:SetWidth(16);
anIcon:SetHeight(16);
anIcon:SetAlpha(1);
anIcon:SetVertexColor(1, 1, 1);
anIcon:Show();
end
--
local tUnitNo, tRank;
local tIsLeader;
local tIsAssist;
local tIsMasterLooter;
function VUHDO_getUnitGroupPrivileges(aUnit)
tIsLeader, tIsAssist, tIsMasterLooter = false, false, false;
if VUHDO_GROUP_TYPE_RAID == VUHDO_getCurrentGroupType() then
tUnitNo = VUHDO_getUnitNo(aUnit);
if tUnitNo then
_, tRank, _, _, _, _, _, _, _, _, tIsMasterLooter = GetRaidRosterInfo(tUnitNo);
if 2 == tRank then tIsLeader = true;
elseif 1 == tRank then tIsAssist = true; end
end
else
tIsLeader = UnitIsGroupLeader(aUnit);
end
return tIsLeader, tIsAssist, tIsMasterLooter;
end
--
local function VUHDO_showPlayerIcons(aButton, aPanelNum)
local tUnit = aButton:GetAttribute("unit");
local tInfo = VUHDO_RAID[tUnit];
if not tInfo then return; end
local tIsLeader, tIsAssist, tIsMasterLooter = VUHDO_getUnitGroupPrivileges(tUnit);
if tIsLeader or tIsAssist then
VUHDO_getOrCreateHotIcon(aButton, 1):SetTexture(
"Interface\\groupframe\\ui-group-" .. (tIsLeader and "leader" or "assistant") .. "icon");
VUHDO_placePlayerIcon(aButton, 1, 0);
end
if tIsMasterLooter then
VUHDO_getOrCreateHotIcon(aButton, 2):SetTexture("Interface\\groupframe\\ui-group-masterlooter");
VUHDO_placePlayerIcon(aButton, 2, 1);
end
local tIcon;
if UnitIsPVP(tUnit) and VUHDO_PANEL_SETUP[aPanelNum]["SCALING"]["barWidth"] > 54 then
tIcon = VUHDO_getOrCreateHotIcon(aButton, 3);
tIcon:SetTexture("Interface\\groupframe\\ui-group-pvp-"
.. ("Alliance" == (UnitFactionGroup(tUnit)) and "alliance" or "horde"));
VUHDO_placePlayerIcon(aButton, 3, 2);
tIcon:SetWidth(32);
tIcon:SetHeight(32);
end
if tInfo["class"] then
tIcon = VUHDO_getOrCreateHotIcon(aButton, 4);
tIcon:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles");
tIcon:SetTexCoord(unpack(CLASS_ICON_TCOORDS[tInfo["class"]]));
VUHDO_placePlayerIcon(aButton, 4, 3);
end
if tInfo["role"] then
tIcon = VUHDO_getOrCreateHotIcon(aButton, 5);
tIcon:SetTexture("Interface\\LFGFrame\\UI-LFG-ICON-ROLES");
tIcon:SetTexCoord(GetTexCoordsForRole(
VUHDO_ID_MELEE_TANK == tInfo["role"] and "TANK"
or VUHDO_ID_RANGED_HEAL == tInfo["role"] and "HEALER" or "DAMAGER"));
VUHDO_placePlayerIcon(aButton, 5, 5);
end
end
--
function VUHDO_hideAllPlayerIcons()
for tPanelNum = 1, 10 do -- VUHDO_MAX_PANELS
VUHDO_initLocalVars(tPanelNum);
for _, tButton in pairs(VUHDO_getPanelButtons(tPanelNum)) do
if tButton:IsShown() then
VUHDO_initButtonStatics(tButton, tPanelNum);
VUHDO_initAllHotIcons();
end
end
end
VUHDO_removeAllHots();
VUHDO_suspendHoTs(false);
end
--
local function VUHDO_showAllPlayerIcons(aPanel)
VUHDO_suspendHoTs(true);
VUHDO_removeAllHots();
local tPanelNum = VUHDO_getPanelNum(aPanel);
for _, tButton in pairs(VUHDO_getPanelButtons(tPanelNum)) do
if tButton:IsShown() then VUHDO_showPlayerIcons(tButton, tPanelNum); end
end
end
--
local tAllUnits;
local tInfo;
local tOldMouseover;
function VuhDoActionOnEnter(aButton)
VUHDO_showTooltip(aButton);
tOldMouseover = sMouseoverUnit;
sMouseoverUnit = aButton:GetAttribute("unit");
if VUHDO_INTERNAL_TOGGLES[15] then -- VUHDO_UPDATE_MOUSEOVER
VUHDO_updateBouquetsForEvent(tOldMouseover, 15); -- Seems to be ghosting sometimes, -- VUHDO_UPDATE_MOUSEOVER
VUHDO_updateBouquetsForEvent(sMouseoverUnit, 15); -- VUHDO_UPDATE_MOUSEOVER
end
if VUHDO_isShowDirectionArrow() then VUHDO_updateDirectionFrame(aButton); end
if VUHDO_isShowGcd() then
VuhDoGcdStatusBar:ClearAllPoints();
VuhDoGcdStatusBar:SetAllPoints(aButton);
VuhDoGcdStatusBar:SetValue(0);
VuhDoGcdStatusBar:Show();
end
if VUHDO_INTERNAL_TOGGLES[18] and sMouseoverUnit then -- VUHDO_UPDATE_MOUSEOVER_CLUSTER
VUHDO_highlightClusterFor(sMouseoverUnit);
end
if VUHDO_INTERNAL_TOGGLES[20] then -- VUHDO_UPDATE_MOUSEOVER_GROUP
tInfo = VUHDO_RAID[sMouseoverUnit];
if not tInfo then return; end
tAllUnits = VUHDO_GROUPS[tInfo["group"]];
if tAllUnits then
for _, tUnit in pairs(tAllUnits) do
VUHDO_updateBouquetsForEvent(tUnit, 20); -- VUHDO_UPDATE_MOUSEOVER_GROUP
end
end
end
end
--
local tOldMouseover;
local tAllUnits;
local tInfo;
function VuhDoActionOnLeave(aButton)
VUHDO_hideTooltip();
VuhDoDirectionFrame["shown"] = false;
VuhDoDirectionFrame:Hide();
tOldMouseover = sMouseoverUnit;
sMouseoverUnit = nil;
if VUHDO_INTERNAL_TOGGLES[15] then -- VUHDO_UPDATE_MOUSEOVER
VUHDO_updateBouquetsForEvent(tOldMouseover, 15); -- VUHDO_UPDATE_MOUSEOVER
end
if VUHDO_INTERNAL_TOGGLES[18] then -- VUHDO_UPDATE_MOUSEOVER_CLUSTER
VUHDO_resetClusterUnit();
VUHDO_removeAllClusterHighlights();
end
if VUHDO_INTERNAL_TOGGLES[20] then -- VUHDO_UPDATE_MOUSEOVER_GROUP
tInfo = VUHDO_RAID[aButton:GetAttribute("unit")];
if not tInfo then return; end
tAllUnits = VUHDO_GROUPS[tInfo["group"]];
if tAllUnits then
for _, tUnit in pairs(tAllUnits) do
VUHDO_updateBouquetsForEvent(tUnit, 20); -- VUHDO_UPDATE_MOUSEOVER_GROUP
end
end
end
end
--
local tQuota, tHighlightBar;
function VUHDO_highlighterBouquetCallback(aUnit, anIsActive, anIcon, aCurrValue, aCounter, aMaxValue, aColor, aBuffName, aBouquetName)
tQuota = (anIsActive or (aMaxValue or 0) > 1) and 1 or 0;
for _, tButton in pairs(VUHDO_getUnitButtonsSafe(aUnit)) do
tHighlightBar = VUHDO_getHealthBar(tButton, 8);
if aColor then tHighlightBar:SetVuhDoColor(aColor); end
tHighlightBar:SetValue(tQuota);
end
end
--
local tModi;
local tKey;
function VuhDoActionPreClick(aButton, aMouseButton)
tModi = VUHDO_getCurrentKeyModifierString();
tKey = VUHDO_SPELL_ASSIGNMENTS[tModi .. SecureButton_GetButtonSuffix(aMouseButton)];
-- allow VuhDo menu command to be bound even when using Clique compat mode
if VUHDO_CONFIG["IS_CLIQUE_COMPAT_MODE"] and
(strlower(tKey and tKey[3] or "") ~= "menu" or not VUHDO_CONFIG["IS_CLIQUE_PASSTHROUGH"]) then
return;
end
if tKey and strlower(tKey[3]) == "menu" then
if not InCombatLockdown() then
VUHDO_disableActions(aButton);
VUHDO_IS_SMART_CAST = true;
end
VUHDO_setMenuUnit(aButton);
ToggleDropDownMenu(1, nil, VuhDoPlayerTargetDropDown, aButton:GetName(), 0, -5);
elseif tKey and strlower(tKey[3]) == "tell" then
ChatFrame_SendTell(VUHDO_RAID[aButton:GetAttribute("unit")]["fullName"]);
else
if VUHDO_SPELL_CONFIG["smartCastModi"] == "all"
or strfind(tModi, VUHDO_SPELL_CONFIG["smartCastModi"], 1, true) then
VUHDO_IS_SMART_CAST = VUHDO_setupSmartCast(aButton);
else
VUHDO_IS_SMART_CAST = false;
end
end
end
--
function VuhDoActionPostClick(aButton)
if VUHDO_IS_SMART_CAST then
VUHDO_setupAllHealButtonAttributes(aButton, nil, false, false, false, false);
VUHDO_IS_SMART_CAST = false;
end
end
local sIsStatusShown = false;
---
function VUHDO_startMoving(aPanel)
if VuhDoNewOptionsPanelPanel and VuhDoNewOptionsPanelPanel:IsVisible() then
local tNewNum = VUHDO_getComponentPanelNum(aPanel);
if tNewNum ~= DESIGN_MISC_PANEL_NUM then
VuhDoNewOptionsTabbedFrame:Hide();
DESIGN_MISC_PANEL_NUM = tNewNum;
VuhDoNewOptionsTabbedFrame:Show();
VUHDO_redrawAllPanels(false);
return;
end
end
if (IsMouseButtonDown(1) and VUHDO_mayMoveHealPanels()) then
if (not aPanel["isMoving"]) then
aPanel["isMoving"] = true;
if not InCombatLockdown() then aPanel:SetFrameStrata("TOOLTIP"); end
aPanel:StartMoving();
end
elseif IsMouseButtonDown(2) and not InCombatLockdown()
and (not VuhDoNewOptionsPanelPanel or not VuhDoNewOptionsPanelPanel:IsVisible()) then
VUHDO_showAllPlayerIcons(aPanel);
sIsStatusShown = true;
end
end
--
function VUHDO_stopMoving(aPanel)
aPanel:StopMovingOrSizing();
aPanel["isMoving"] = false;
if not InCombatLockdown() then
aPanel:SetFrameStrata(VUHDO_PANEL_SETUP[VUHDO_getPanelNum(aPanel)]["frameStrata"]);
end
VUHDO_savePanelCoords(aPanel);
VUHDO_saveCurrentProfilePanelPosition(VUHDO_getPanelNum(aPanel));
if sIsStatusShown then
sIsStatusShown = false;
VUHDO_hideAllPlayerIcons();
VUHDO_initAllEventBouquets();
end
end
--
local tPosition;
function VUHDO_savePanelCoords(aPanel)
tPosition = VUHDO_PANEL_SETUP[VUHDO_getPanelNum(aPanel)]["POSITION"];
tPosition["orientation"], _, tPosition["relativePoint"], tPosition["x"], tPosition["y"] = aPanel:GetPoint(0);
tPosition["width"] = aPanel:GetWidth();
tPosition["height"] = aPanel:GetHeight();
end
--
local tButton;
local sDebuffIcon = nil;
function VUHDO_showDebuffTooltip(aDebuffIcon)
if not VUHDO_CONFIG["DEBUFF_TOOLTIP"] then return; end
tButton = aDebuffIcon:GetParent():GetParent():GetParent():GetParent();
if not GameTooltip:IsForbidden() then
GameTooltip:SetOwner(aDebuffIcon, "ANCHOR_RIGHT", 0, 0);
end
if aDebuffIcon["debuffCnt"] then
if not GameTooltip:IsForbidden() then
if aDebuffIcon["isBuff"] then
GameTooltip:SetUnitBuff(tButton["raidid"], aDebuffIcon["debuffCnt"]);
else
GameTooltip:SetUnitDebuff(tButton["raidid"], aDebuffIcon["debuffCnt"]);
end
end
end
sDebuffIcon = aDebuffIcon;
end
--
function VUHDO_hideDebuffTooltip()
sDebuffIcon = nil;
if not GameTooltip:IsForbidden() then
GameTooltip:Hide();
end
end
--
function VUHDO_updateCustomDebuffTooltip()
if sDebuffIcon then VUHDO_showDebuffTooltip(sDebuffIcon); end
end
local _;
-- For initializing the minimap
VUHDO_MM_SETTINGS = { };
VUHDO_LibSharedMedia = LibStub("LibSharedMedia-3.0");
VUHDO_LibDataBroker = LibStub("LibDataBroker-1.1", true);
VUHDO_LibDBIcon = LibStub("LibDBIcon-1.0");
VUHDO_LibButtonFacade = nil;
VUHDO_LibCompress = LibStub:GetLibrary("LibCompress");
VUHDO_LibCompressEncode = VUHDO_LibCompress:GetAddonEncodeTable();
VUHDO_LibBase64 = LibStub:GetLibrary("LibBase64-1.0");
VUHDO_LibCustomGlow = LibStub("LibCustomGlow-1.0");
VUHDO_LibSharedMedia:Register("font", "Arial Black", "Interface\\AddOns\\VuhDo\\Fonts\\ariblk.ttf");
VUHDO_LibSharedMedia:Register("font", "Emblem", "Interface\\AddOns\\VuhDo\\Fonts\\Emblem.ttf");
VUHDO_LibSharedMedia:Register("font", "Vixar", "Interface\\AddOns\\VuhDo\\Fonts\\vixar.ttf");
local function VUHDO_registerLsmBar(...)
for tCnt = 1, select('#', ...) do
VUHDO_LibSharedMedia:Register("statusbar", "VuhDo - " .. select(tCnt, ...), "Interface\\AddOns\\VuhDo\\Images\\bar" .. tCnt .. ".tga");
end
end
VUHDO_registerLsmBar("Rhombs", "Twirls", "Pipe, dark", "Concave, dark", "Pipe, light", "Flat", "Concave, light",
"Convex", "Textile", "Mirrorfinish", "Diagonals", "Zebra", "Marble", "Modern Art", "Polished Wood", "Plain",
"Minimalist", "Aluminium", "Gradient");
VUHDO_LibSharedMedia:Register("statusbar", "VuhDo - Bar Highlighter", "Interface\\AddOns\\VuhDo\\Images\\highlight.tga");
VUHDO_LibSharedMedia:Register("statusbar", "VuhDo - Plain White", "Interface\\AddOns\\VuhDo\\Images\\plain_white.tga");
VUHDO_LibSharedMedia:Register("statusbar", "LiteStepLite", "Interface\\AddOns\\VuhDo\\Images\\LiteStepLite.tga");
VUHDO_LibSharedMedia:Register("statusbar", "Tukui", "Interface\\AddOns\\VuhDo\\Images\\tukuibar.tga");
VUHDO_LibSharedMedia:Register("sound", "Tribal Bass Drum", 566027);
VUHDO_LibSharedMedia:Register("sound", "Thorns", 569022);
VUHDO_LibSharedMedia:Register("sound", "Elf Bell Toll", 566558);
VUHDO_LibSharedMedia:Register("border", "Plain White", "Interface\\AddOns\\VuhDo\\Images\\white_square_16_16");
LoadAddOn("FuBarPlugin-3.0");
--
function VUHDO_initAddonMessages()
if not C_ChatInfo.IsAddonMessagePrefixRegistered("CTRA") then C_ChatInfo.RegisterAddonMessagePrefix("CTRA"); end
if not C_ChatInfo.IsAddonMessagePrefixRegistered(VUHDO_COMMS_PREFIX) then C_ChatInfo.RegisterAddonMessagePrefix(VUHDO_COMMS_PREFIX); end
end
--
local tHasShownError = false;
function VUHDO_parseAddonMessage(aPrefix, aMessage, aUnitName)
if VUHDO_COMMS_PREFIX == aPrefix then
if VUHDO_parseVuhDoMessage then
VUHDO_parseVuhDoMessage(aUnitName, aMessage);
elseif not tHasShownError then
VUHDO_Msg("VuhDo Options module not loaded: You cannot receive data from other players.", 1, 0.4, 0.4);
tHasShownError = true;
end
elseif "CTRA" == aPrefix then
if strfind(aMessage, "#") then
local tFragments = VUHDO_splitString(aMessage, "#");
for _, tCommand in pairs(tFragments) do
VUHDO_parseCtraMessage(aUnitName, tCommand);
end
else
VUHDO_parseCtraMessage(aUnitName, aMessage);
end
end
end
--
function VUHDO_initFuBar()
-- libDataBroker
if VUHDO_LibDataBroker then
local minimapObject = VUHDO_LibDataBroker:NewDataObject("VuhDo", {
type = "launcher",
icon = VUHDO_STANDARD_ICON,
OnClick = function(aClickedFrame, aButton)
if aButton == "RightButton" then
ToggleDropDownMenu(1, nil, VuhDoMinimapDropDown, aClickedFrame:GetName(), 0, -5);
else
VUHDO_slashCmd("opt");
end
end,
OnTooltipShow = function(aTooltip)
aTooltip:AddLine("VuhDo")
aTooltip:AddLine(VUHDO_I18N_BROKER_TOOLTIP_1)
aTooltip:AddLine(VUHDO_I18N_BROKER_TOOLTIP_2)
end,
});
-- Minimap icon provided by LibDBIcon
if VUHDO_LibDBIcon then
VUHDO_LibDBIcon:Register("VuhDo", minimapObject, VUHDO_MM_SETTINGS);
VUHDO_initMinimap();
end
end
-- Native FuBar
if LibStub:GetLibrary("LibFuBarPlugin-3.0", true)
and IsAddOnLoaded("FuBar")
and not IsAddOnLoaded("FuBar2Broker")
and not IsAddOnLoaded("Broker2FuBar") then
local tLibFuBarPlugin = LibStub:GetLibrary("LibFuBarPlugin-3.0");
LibStub("AceAddon-3.0"):EmbedLibrary(VuhDo, "LibFuBarPlugin-3.0");
VuhDo:SetFuBarOption("tooltipType", "GameTooltip");
VuhDo:SetFuBarOption("hasNoColor", true);
VuhDo:SetFuBarOption("cannotDetachTooltip", true);
VuhDo:SetFuBarOption("hideWithoutStandby", true);
VuhDo:SetFuBarOption("iconPath", VUHDO_STANDARD_ICON);
VuhDo:SetFuBarOption("hasIcon", true);
VuhDo:SetFuBarOption("defaultPosition", "RIGHT");
VuhDo:SetFuBarOption("tooltipHiddenWhenEmpty", true);
VuhDo:SetFuBarOption("configType", "None");
VuhDo.title = "VuhDo";
VuhDo.name = "VuhDo";
tLibFuBarPlugin:OnEmbedInitialize(VuhDo, VuhDo);
function VuhDo:OnUpdateFuBarTooltip()
if not GameTooltip:IsForbidden() then
GameTooltip:AddLine("VuhDo");
GameTooltip:AddLine(VUHDO_I18N_BROKER_TOOLTIP_1);
GameTooltip:AddLine(VUHDO_I18N_BROKER_TOOLTIP_2);
end
end
VuhDo:Show();
function VuhDo:OnFuBarClick(aButton)
if "LeftButton" == aButton then
VUHDO_slashCmd("opt");
elseif "RightButton" == aButton then
ToggleDropDownMenu(1, nil, VuhDoMinimapDropDown, VuhDo:GetFrame():GetName(), 0, -5);
end
end
end
end
--
function VUHDO_initSharedMedia()
-- fonts
for tIndex, tValue in ipairs(VUHDO_LibSharedMedia:List("font")) do
VUHDO_FONTS[tIndex] = { VUHDO_LibSharedMedia:Fetch("font", tValue), tValue };
end
-- status bars
for tIndex, tValue in ipairs(VUHDO_LibSharedMedia:List("statusbar")) do
VUHDO_STATUS_BARS[tIndex] = { tValue, tValue };
end
-- sounds
for tIndex, tValue in ipairs(VUHDO_LibSharedMedia:List("sound")) do
VUHDO_SOUNDS[tIndex] = { VUHDO_LibSharedMedia:Fetch("sound", tValue), tValue };
end
tinsert(VUHDO_SOUNDS, 1, { nil, "-- " .. VUHDO_I18N_OFF .. " --" } );
-- borders
for tIndex, tValue in ipairs(VUHDO_LibSharedMedia:List("border")) do
VUHDO_BORDERS[tIndex] = { VUHDO_LibSharedMedia:Fetch("border", tValue) or "", tValue };
end
end
--
function VUHDO_initCliqueSupport()
if not VUHDO_CONFIG["IS_CLIQUE_COMPAT_MODE"] then return; end
if not IsAddOnLoaded("Clique") then
VUHDO_Msg("WARNING: Clique compatibility mode is enabled but clique doesn't seem to be loaded!", 1, 0.4, 0.4);
end
ClickCastFrames = ClickCastFrames or {};
local tBtnName;
local tIcon;
for tPanelNum = 1, 10 do -- VUHDO_MAX_PANELS
for tButtonNum = 1, 51 do -- VUHDO_MAX_BUTTONS_PANEL
tBtnName = format("Vd%dH%d", tPanelNum, tButtonNum);
if _G[tBtnName] then
ClickCastFrames[_G[tBtnName]] = true;
ClickCastFrames[_G[tBtnName .. "Tg"]] = true;
ClickCastFrames[_G[tBtnName .. "Tot"]] = true;
for tIconNum = 40, 44 do
tIcon = _G[format("%sBgBarIcBarHlBarIc%d", tBtnName, tIconNum)];
if tIcon then ClickCastFrames[tIcon] = true; end
end
end
end
end
end
--
function VUHDO_initButtonFacade(anInstance)
VUHDO_LibButtonFacade = VUHDO_CONFIG["IS_USE_BUTTON_FACADE"] and LibStub("Masque", true) or nil;
if VUHDO_LibButtonFacade then
VUHDO_LibButtonFacade:Group("VuhDo", VUHDO_I18N_BUFF_WATCH);
VUHDO_LibButtonFacade:Group("VuhDo", VUHDO_I18N_HOTS);
end
end
--
function VUHDO_initMinimap()
VUHDO_initShowMinimap();
end
--
function VUHDO_initShowMinimap()
if VUHDO_LibDataBroker and VUHDO_LibDBIcon then
if VUHDO_CONFIG["SHOW_MINIMAP"] then
VUHDO_LibDBIcon:Show("VuhDo");
else
VUHDO_LibDBIcon:Hide("VuhDo");
end
end
end
--
local UnitPower = UnitPower;
local UnitGetIncomingHeals = UnitGetIncomingHeals;
local pairs = pairs;
local ipairs = ipairs;
local floor = floor;
local twipe = table.wipe;
local select = select;
local _;
local sIsIncoming;
local sIsCooldown;
local sIsIncCastTimeOnly;
local sIsPerGroup;
local VUHDO_AOE_FOR_UNIT = { };
local VUHDO_getCustomDestCluster;
local VUHDO_RAID;
function VUHDO_aoeAdvisorInitLocalOverrides()
VUHDO_getCustomDestCluster = _G["VUHDO_getCustomDestCluster"];
sIsIncoming = VUHDO_CONFIG["AOE_ADVISOR"]["subInc"];
sIsCooldown = VUHDO_CONFIG["AOE_ADVISOR"]["isCooldown"];
sIsIncCastTimeOnly = VUHDO_CONFIG["AOE_ADVISOR"]["subIncOnlyCastTime"];
sIsPerGroup = VUHDO_CONFIG["AOE_ADVISOR"]["isGroupWise"];
VUHDO_RAID = _G["VUHDO_RAID"];
end
local VUHDO_SPELL_ID_COH = 34861;
local VUHDO_SPELL_ID_POH = 596;
local VUHDO_SPELL_ID_CH = 1064;
local VUHDO_SPELL_ID_WG = 48438;
local VUHDO_SPELL_ID_TQ = 740;
local VUHDO_SPELL_ID_LOD = 85222;
local VUHDO_SPELL_ID_HR = 82327;
local VUHDO_SPELL_ID_CB = 123986;
VUHDO_AOE_SPELLS = {
-- Circle of Healing
["coh"] = {
--["present"] = false,
["id"] = VUHDO_SPELL_ID_COH,
["base"] = (4599 + 5082) * 0.5, -- MOPok
["divisor"] = 10365,
["icon"] = (GetSpellTexture(VUHDO_SPELL_ID_COH)),
["name"] = (GetSpellInfo(VUHDO_SPELL_ID_COH)),
["avg"] = 0,
["max_targets"] = 5,
["degress"] = 1,
["rangePow"] = 30 * 30, -- MOPok
["isRadial"] = true,
["areTargetsRandom"] = true,
--["isSourcePlayer"] = false,
["isDestRaid"] = true,
["thresh"] = 15000,
["cone"] = 360,
["checkCd"] = true,
["time"] = select(7, GetSpellInfo(VUHDO_SPELL_ID_COH)) or 0,
},
-- Prayer of Healing
["poh"] = {
--["present"] = false,
["id"] = VUHDO_SPELL_ID_POH,
["base"] = (8450 + 8927) * 0.5, -- MOP
["divisor"] = 10368,
["icon"] = (GetSpellTexture(VUHDO_SPELL_ID_POH)),
["name"] = (GetSpellInfo(VUHDO_SPELL_ID_POH)),
["avg"] = 0,
["max_targets"] = 5,
["degress"] = 1,
["rangePow"] = 20 * 20,
["isRadial"] = true,
["areTargetsRandom"] = true,
--["isSourcePlayer"] = false,
["isDestRaid"] = false,
["thresh"] = 20000,
["cone"] = 360,
--["checkCd"] = false,
["time"] = select(7, GetSpellInfo(VUHDO_SPELL_ID_POH)) or 0,
},
-- Chain Heal
["ch"] = {
--["present"] = false,
["id"] = VUHDO_SPELL_ID_CH,
["base"] = (5135 + 5865) * 0.5, -- MOP
["divisor"] = 10035,
["icon"] = (GetSpellTexture(VUHDO_SPELL_ID_CH)),
["name"] = (GetSpellInfo(VUHDO_SPELL_ID_CH)),
["avg"] = 0,
["max_targets"] = 4,
["degress"] = 0.66,
["rangePow"] = 40 * 40,
["jumpRangePow"] = 11 * 11,
--["isRadial"] = false,
["areTargetsRandom"] = false,
--["isSourcePlayer"] = false,
["isDestRaid"] = true,
["thresh"] = 15000,
["cone"] = 360,
--["checkCd"] = false,
["time"] = select(7, GetSpellInfo(VUHDO_SPELL_ID_CH)) or 0,
},
-- Wild Growth
["wg"] = {
--["present"] = false,
["id"] = VUHDO_SPELL_ID_WG,
["base"] = 6930,
["divisor"] = 9345, -- MOP
["icon"] = (GetSpellTexture(VUHDO_SPELL_ID_WG)),
["name"] = (GetSpellInfo(VUHDO_SPELL_ID_WG)),
["avg"] = 0,
["max_targets"] = 6,
["degress"] = 1,
["rangePow"] = 30 * 30,
["isRadial"] = true,
["areTargetsRandom"] = true,
--["isSourcePlayer"] = false,
["isDestRaid"] = true,
["thresh"] = 15000,
["cone"] = 360,
["checkCd"] = true,
["time"] = select(7, GetSpellInfo(VUHDO_SPELL_ID_WG)) or 0,
},
-- Tranqulity
["tq"] = {
--["present"] = false,
["id"] = VUHDO_SPELL_ID_TQ,
["base"] = 9037, -- MOP
["divisor"] = 9345,
["icon"] = (GetSpellTexture(VUHDO_SPELL_ID_TQ)),
["name"] = (GetSpellInfo(VUHDO_SPELL_ID_TQ)),
["avg"] = 0,
["max_targets"] = 40,
["degress"] = 1,
["rangePow"] = 40 * 40,
["isRadial"] = true,
["areTargetsRandom"] = false,
["isSourcePlayer"] = true,
["isDestRaid"] = true,
["thresh"] = 15000,
["cone"] = 360,
["checkCd"] = true,
["time"] = select(7, GetSpellInfo(VUHDO_SPELL_ID_TQ)) or 0,
},
-- Light of Dawn
["lod"] = {
--["present"] = false,
["id"] = VUHDO_SPELL_ID_LOD,
["base"] = (2027 + 2257) * 3 * 0.5, -- MOP
["divisor"] = 4859,
["icon"] = (GetSpellTexture(VUHDO_SPELL_ID_LOD)),
["name"] = (GetSpellInfo(VUHDO_SPELL_ID_LOD)),
["avg"] = 0,
["max_targets"] = 5,
["degress"] = 1,
["rangePow"] = 30 * 30,
["isRadial"] = true,
["areTargetsRandom"] = true,
["isSourcePlayer"] = true,
["isDestRaid"] = true,
["thresh"] = 8000,
["cone"] = 180,
--["checkCd"] = false,
["time"] = select(7, GetSpellInfo(VUHDO_SPELL_ID_LOD)) or 0,
},
-- Chi Burst
["cb"] = {
--["present"] = false,
["id"] = VUHDO_SPELL_ID_CB,
["base"] = (325 + 972) * 0.5,
["divisor"] = 1.267, -- 1/78,9% Atk
["icon"] = (GetSpellTexture(VUHDO_SPELL_ID_CB)),
["name"] = (GetSpellInfo(VUHDO_SPELL_ID_CB)),
["avg"] = 0,
["max_targets"] = 6,
["degress"] = 1,
["rangePow"] = 4, -- not POW actually
--["isRadial"] = true,
["areTargetsRandom"] = false,
["isLinear"] = true,
["isSourcePlayer"] = true,
["isDestRaid"] = true,
["thresh"] = 10000,
["isHealsPlayer"] = true,
--["cone"] = 15,
["checkCd"] = true,
["time"] = select(7, GetSpellInfo(VUHDO_SPELL_ID_CB)) or 0,
},
};
local VUHDO_AOE_SPELLS = VUHDO_AOE_SPELLS;
--
local tAltPower;
local function VUHDO_getPlayerHealingMod()
if "PALADIN" == VUHDO_PLAYER_CLASS then
tAltPower = UnitPower("player", 9);
if (tAltPower or 6) ~= 6 then
return 1 / (6 - tAltPower);
end
end
return 1;
end
--
function VUHDO_aoeUpdateSpellAverages()
local tBonus = GetSpellBonusHealing();
local tSpellModi;
for tName, tInfo in pairs(VUHDO_AOE_SPELLS) do
if "cb" == tName then
tInfo["avg"] = 80000; -- @TODO
else
tSpellModi = tInfo["base"] / tInfo["divisor"];
tInfo["avg"] = floor((tInfo["base"] + tBonus * tSpellModi) + 0.5);
end
tInfo["thresh"] = VUHDO_CONFIG["AOE_ADVISOR"]["config"][tName]["thresh"];
--print("VUHDO_aoeUpdateSpellAverages(): name = " .. tName .. ", avg = floor((base + bonus * spellMod) + 0.5) | " .. tInfo["avg"] .. " = floor((" .. tInfo["base"] .. " + " .. tBonus .. " * " .. tSpellModi .. ") + 0.5)");
end
end
--
local function VUHDO_isAoeSpellEnabled(aSpell)
if not VUHDO_CONFIG["AOE_ADVISOR"]["config"][aSpell]["enable"] then
return false;
elseif not VUHDO_CONFIG["AOE_ADVISOR"]["knownOnly"] then
return true;
else
return VUHDO_isSpellKnown(VUHDO_AOE_SPELLS[aSpell]["name"]);
end
end
--
function VUHDO_aoeUpdateTalents()
for tName, tInfo in pairs(VUHDO_AOE_SPELLS) do
tInfo["present"] = VUHDO_isAoeSpellEnabled(tName);
end
VUHDO_aoeUpdateSpellAverages();
end
--
local function VUHDO_aoeGetIncHeals(aUnit, aCastTime)
if not sIsIncoming or (sIsIncCastTimeOnly and aCastTime == 0) then
return 0;
end
return (UnitGetIncomingHeals(aUnit) or 0) - (UnitGetIncomingHeals(aUnit, "player") or 0);
end
--
local function VUHDO_getAverageExpectedHeals(aCluster, aMaxHealAmount, aDegression, aCastTime, aMaxTargets, tTargetPlayer)
local tHealingTotal = 0;
local tNumPlayersHealed = 0;
-- Find the sum total healed
for tCnt = 1, #aCluster do
local tUnit = aCluster[tCnt];
local tInfo = VUHDO_RAID[tUnit];
if tInfo["healthmax"] > 0 and tInfo["health"] > 0 then
local tHPDeficit = tInfo["healthmax"] - tInfo["health"] - VUHDO_aoeGetIncHeals(tUnit, aCastTime);
local tHealingDonePotential = aMaxHealAmount + (1 - tInfo["health"] / tInfo["healthmax"]); -- Give slight priority to users with the least HP%
local tHealingDoneActual = math.min(tHPDeficit, tHealingDonePotential);
tHealingTotal = tHealingTotal + tHealingDoneActual;
tNumPlayersHealed = tNumPlayersHealed + 1;
end
end
if tHealingTotal == 0 or tNumPlayersHealed == 0 then
return 0;
end
-- Find out how much the aDegression multiplier has reduced our expected heals.
-- The heal-amount gets multiplied by aDegression on each jump. So the average degression multiplier is
-- (1 + 1*aDegression + 1*aDegression^2 + ... + 1*aDegression^(tNumHealTargets-1))/tNumHealTargets
-- This is a geometric series, equal to the following:
local tNumHealTargets = math.min(aMaxTargets, tNumPlayersHealed)
local tDegressionAverage = 1;
if aDegression < 1 then
tDegressionAverage = (1-aDegression^tNumHealTargets)/((1-aDegression)*tNumHealTargets);
end
--Find the average expected healed
local tAverageHealedPerPlayer = tHealingTotal / tNumPlayersHealed;
return tAverageHealedPerPlayer * tNumHealTargets * tDegressionAverage;
end
--
local tBestUnit, tBestTotal;
local tCurrTotal;
local tCluster = { };
local tInfo;
local tIsSourcePlayer;
local tIsDestRaid;
local tIsRadial;
local tIsLinear;
local tRangePow;
local tJumpRangePow;
local tMaxTargets;
local tCdSpell;
local tCone;
local tSpellHeal;
local tTime;
local tDegress;
local tThresh;
local tIsHealsPlayer;
local tAreTargetsRandom;
local function VUHDO_getBestUnitForAoeGroup(anAoeInfo, aPlayerModi, aGroup)
tBestUnit = nil;
tBestTotal = -1;
for tCnt = 1, #aGroup do
tInfo = aGroup[tCnt];
if VUHDO_RAID[tInfo] then tInfo = VUHDO_RAID[tInfo]; end
if tInfo["baseRange"] and tInfo["health"] > 0 then
if tIsLinear then
VUHDO_getUnitsInLinearCluster(tInfo["unit"], tCluster, tRangePow, tMaxTargets, tIsHealsPlayer, tCdSpell);
else
VUHDO_getCustomDestCluster(tInfo["unit"], tCluster,
tIsSourcePlayer, tIsRadial, tRangePow,
tMaxTargets, 101, tIsDestRaid, -- 101% = no health limit
tCdSpell, tCone, tJumpRangePow, tAreTargetsRandom
);
end
if #tCluster > 1 then
tCurrTotal = VUHDO_getAverageExpectedHeals(tCluster, tSpellHeal, tDegress, tTime, tMaxTargets, tInfo["unit"]);
if tCurrTotal > tBestTotal and tCurrTotal >= tThresh then
tBestTotal = tCurrTotal;
tBestUnit = tInfo["unit"];
end
end
end
end
return tBestUnit, tBestTotal;
end
--
local tSingleUnit = {
[0] = { }
};
local tGroupUnit = {
[1] = { }, [2] = { }, [3] = { }, [4] = { }, [5] = { }, [6] = { }, [7] = { }, [8] = { }
};
local function VUHDO_getBestUnitsForAoe(anAoeInfo, aPlayerModi)
tIsSourcePlayer = anAoeInfo["isSourcePlayer"];
tIsDestRaid = anAoeInfo["isDestRaid"];
tIsRadial = anAoeInfo["isRadial"];
tIsLinear = anAoeInfo["isLinear"];
tRangePow = anAoeInfo["rangePow"];
tJumpRangePow = anAoeInfo["jumpRangePow"];
tMaxTargets = anAoeInfo["max_targets"];
tCdSpell = sIsCooldown and anAoeInfo["checkCd"] and anAoeInfo["name"] or nil;
tCone = anAoeInfo["cone"];
tSpellHeal = anAoeInfo["avg"] * aPlayerModi;
tTime = anAoeInfo["time"];
tDegress = anAoeInfo["degress"];
tThresh = anAoeInfo["thresh"];
tIsHealsPlayer = anAoeInfo["isHealsPlayer"];
tAreTargetsRandom = anAoeInfo["areTargetsRandom"];
--tThresh = 1000;
if sIsPerGroup and not tIsDestRaid then
for tCnt = 1, 8 do
tGroupUnit[tCnt]["u"], tGroupUnit[tCnt]["h"] = VUHDO_getBestUnitForAoeGroup(anAoeInfo, aPlayerModi, VUHDO_GROUPS[tCnt]);
end
return tGroupUnit;
else
tSingleUnit[0]["u"], tSingleUnit[0]["h"] = VUHDO_getBestUnitForAoeGroup(anAoeInfo, aPlayerModi, VUHDO_CLUSTER_BASE_RAID);
return tSingleUnit;
end
end
--
local tUnitForAoe = { [0] = {}, [1] = {}, [2] = {}, [3] = {}, [4] = {}, [5] = {}, [6] = {}, [7] = {}, [8] = {} };
local function VUHDO_setBestUnitsForAoeInGroups(anAoeName, aGroupNum, aUnit, anAoeHealed, ...)
for tCnt = 1, select('#', ...) do
if (tUnitForAoe[select(tCnt, ...)][aUnit] or 0) >= anAoeHealed then
return;
end
end
tUnitForAoe[aGroupNum][aUnit] = anAoeHealed;
VUHDO_AOE_FOR_UNIT[aUnit] = VUHDO_AOE_SPELLS[anAoeName];
end
--
local tUnit;
local tPlayerModi;
local tBestUnits;
local tOldAoeForUnit = {};
local tAoeChangedForUnit = { };
function VUHDO_aoeUpdateAll()
if not VUHDO_INTERNAL_TOGGLES[32] then return; end -- VUHDO_UPDATE_AOE_ADVICE
tPlayerModi = VUHDO_getPlayerHealingMod();
for tCnt = 0, 8 do twipe(tUnitForAoe[tCnt]); end
twipe(tOldAoeForUnit);
for tUnit, tAoeSpell in pairs(VUHDO_AOE_FOR_UNIT) do tOldAoeForUnit[tUnit] = tAoeSpell; end
twipe(VUHDO_AOE_FOR_UNIT);
for tName, tInfo in pairs(VUHDO_AOE_SPELLS) do
if tInfo["present"] then
tBestUnits = VUHDO_getBestUnitsForAoe(tInfo, tPlayerModi);
for tIndex, tUnitInfo in pairs(tBestUnits) do
tUnit = tUnitInfo["u"];
if tUnit then
if 0 == tIndex then -- raid wide => best units in all groups or the raid?
VUHDO_setBestUnitsForAoeInGroups(tName, tIndex, tUnit, tUnitInfo["h"], 0, 1, 2, 3, 4, 5, 6, 7, 8);
else -- per group => best units in this group or the raid?
VUHDO_setBestUnitsForAoeInGroups(tName, tIndex, tUnit, tUnitInfo["h"], 0, tIndex);
end
end
end
end
end
twipe(tAoeChangedForUnit);
for tUnit, tAoeSpell in pairs(tOldAoeForUnit) do
if VUHDO_AOE_FOR_UNIT[tUnit] ~= tAoeSpell then tAoeChangedForUnit[tUnit] = true; end
end
for tUnit, tAoeSpell in pairs(VUHDO_AOE_FOR_UNIT) do
if tOldAoeForUnit[tUnit] ~= tAoeSpell then tAoeChangedForUnit[tUnit] = true; end
end
for tUnit, _ in pairs(tAoeChangedForUnit) do
VUHDO_updateBouquetsForEvent(tUnit, VUHDO_UPDATE_AOE_ADVICE);
end
end
--
function VUHDO_getAoeAdviceForUnit(aUnit)
return VUHDO_AOE_FOR_UNIT[aUnit];
end
local _;
local _G = _G;
local VUHDO_HIGLIGHT_CLUSTER = { };
local VUHDO_HIGLIGHT_NUM = 0;
local VUHDO_ICON_CLUSTER = { };
local VUHDO_NUM_IN_UNIT_CLUSTER = { };
local VUHDO_ACTIVE_HOTS = { };
local sClusterConfig;
local VUHDO_CLUSTER_UNIT = nil;
--
local twipe = table.wipe;
local pairs = pairs;
local VUHDO_RAID = { };
local VUHDO_getUnitsInRadialClusterWith;
local VUHDO_getUnitsInChainClusterWith;
local VUHDO_getUnitButtons;
local VUHDO_getHealthBar;
local VUHDO_getClusterBorderFrame;
local VUHDO_updateBouquetsForEvent;
local VUHDO_getBarIcon;
local VUHDO_getBarIconTimer;
local VUHDO_isInConeInFrontOf;
local VUHDO_backColor;
local VUHDO_getUnitButtonsSafe;
local sHealthLimit;
local sIsRaid;
local sThreshFair;
local sThreshGood;
local sColorFair;
local sColorGood;
local sIsSourcePlayer;
local sRangePow;
local sNumMaxJumps;
local sIsRadial;
local sClusterSlot;
local sCdSpell;
local sCone;
local sJumpRangePow;
local aAreTargetsRandom;
function VUHDO_customClustersInitLocalOverrides()
VUHDO_RAID = _G["VUHDO_RAID"];
VUHDO_ACTIVE_HOTS = _G["VUHDO_ACTIVE_HOTS"];
VUHDO_getUnitsInRadialClusterWith = _G["VUHDO_getUnitsInRadialClusterWith"];
VUHDO_getUnitsInChainClusterWith = _G["VUHDO_getUnitsInChainClusterWith"];
VUHDO_getUnitButtons = _G["VUHDO_getUnitButtons"];
VUHDO_getHealthBar = _G["VUHDO_getHealthBar"];
VUHDO_getClusterBorderFrame = _G["VUHDO_getClusterBorderFrame"];
VUHDO_updateBouquetsForEvent = _G["VUHDO_updateBouquetsForEvent"];
VUHDO_getBarIcon = _G["VUHDO_getBarIcon"];
VUHDO_getBarIconTimer = _G["VUHDO_getBarIconTimer"];
VUHDO_isInConeInFrontOf = _G["VUHDO_isInConeInFrontOf"];
VUHDO_backColor = _G["VUHDO_backColor"];
VUHDO_getUnitButtonsSafe = _G["VUHDO_getUnitButtonsSafe"];
sClusterConfig = VUHDO_CONFIG["CLUSTER"];
sHealthLimit = sClusterConfig["BELOW_HEALTH_PERC"] * 0.01;
sIsRaid = sClusterConfig["DISPLAY_DESTINATION"] == 2;
sThreshFair = sClusterConfig["THRESH_FAIR"];
sThreshGood = sClusterConfig["THRESH_GOOD"];
sColorFair = VUHDO_PANEL_SETUP["BAR_COLORS"]["CLUSTER_FAIR"];
sColorGood = VUHDO_PANEL_SETUP["BAR_COLORS"]["CLUSTER_GOOD"];
sIsSourcePlayer = sClusterConfig["DISPLAY_SOURCE"] == 1;
sRangePow = sClusterConfig["RANGE"] * sClusterConfig["RANGE"];
sNumMaxJumps = sClusterConfig["CHAIN_MAX_JUMP"];
sIsRadial = sClusterConfig["MODE"] == 1;
sCone = sClusterConfig["CONE_DEGREES"];
sCdSpell = sClusterConfig["COOLDOWN_SPELL"];
sJumpRangePow = sClusterConfig["RANGE_JUMP"] * sClusterConfig["RANGE_JUMP"];
sAreTargetsRandom = sClusterConfig["ARE_TARGETS_RANDOM"];
if (sCdSpell or "") == "" or not VUHDO_isSpellKnown(sCdSpell) then
sCdSpell = nil;
end
sClusterSlot = nil;
for tIndex, tHotName in pairs(VUHDO_PANEL_SETUP["HOTS"]["SLOTS"]) do
if "CLUSTER" == tHotName and (tIndex < 6 or tIndex > 8) then sClusterSlot = tIndex; end
end
end
--
local tDestCluster = { };
local tInfo, tSrcInfo, tNumArray;
local tSrcGroup;
function VUHDO_getCustomDestCluster(aUnit, anArray, anIsSourcePlayer, anIsRadial, aRangePow, aNumMaxTargets, aHealthLimit, anIsRaid, aCdSpell, aCone, aJumpRangePow, aAreTargetsRandom)
-- If targets are random, return ALL targets in range, so the caller can determine the average heals
if aAreTargetsRandom then aNumMaxTargets = 100; end
twipe(anArray);
if anIsSourcePlayer and aUnit ~= "player" then return 0; end
tSrcInfo = VUHDO_RAID[aUnit];
if not tSrcInfo or tSrcInfo["isPet"] or "focus" == aUnit or "target" == aUnit then return 0; end
if anIsRadial then VUHDO_getUnitsInRadialClusterWith(aUnit, aRangePow, tDestCluster, aCdSpell);
else VUHDO_getUnitsInChainClusterWith(aUnit, aJumpRangePow, tDestCluster, aNumMaxTargets, aCdSpell); end
tSrcGroup = tSrcInfo["group"];
for _, tUnit in pairs(tDestCluster) do
tInfo = VUHDO_RAID[tUnit];
if tInfo and tInfo["healthmax"] > 0 and not tInfo["dead"] and tInfo["health"] / tInfo["healthmax"] <= aHealthLimit then
if (anIsRaid or tInfo["group"] == tSrcGroup) and VUHDO_isInConeInFrontOf(tUnit, aCone) then -- all raid members or in same group
anArray[#anArray + 1] = tUnit;
if #anArray == aNumMaxTargets then break; end
end
end
end
return #anArray;
end
local VUHDO_getCustomDestCluster = VUHDO_getCustomDestCluster;
--
local function VUHDO_getDestCluster(aUnit, anArray)
return VUHDO_getCustomDestCluster(aUnit, anArray, sIsSourcePlayer, sIsRadial, sRangePow, sNumMaxJumps, sHealthLimit, sIsRaid, sCdSpell, sCone, sJumpRangePow, sAreTargetsRandom);
end
--
local tNumLow;
local tAllButtons;
function VUHDO_updateAllClusterIcons(aUnit, anInfo)
tAllButtons = VUHDO_getUnitButtons(aUnit);
if not tAllButtons then return; end
tNumLow = VUHDO_getDestCluster(aUnit, VUHDO_ICON_CLUSTER);
if VUHDO_NUM_IN_UNIT_CLUSTER[aUnit] ~= tNumLow then
VUHDO_NUM_IN_UNIT_CLUSTER[aUnit] = tNumLow;
VUHDO_updateBouquetsForEvent(aUnit, 16); -- VUHDO_UPDATE_NUM_CLUSTER
end
if not sClusterSlot then return; end
for _, tButton in pairs(tAllButtons) do
-- FIXME: right after spec change the bar icon frame for "CLUSTER" is nil
-- FIXME: not entirely sure why but this will prevent nil reference until next update
if not VUHDO_getBarIcon(tButton, sClusterSlot) then
return;
end
if tNumLow < sThreshFair or not anInfo["range"] then
VUHDO_getBarIconFrame(tButton, sClusterSlot):Hide();
VUHDO_getBarIconTimer(tButton, sClusterSlot):SetText("");
else
VUHDO_getBarIcon(tButton, sClusterSlot):SetVertexColor(VUHDO_backColor(tNumLow < sThreshGood and sColorFair or sColorGood));
VUHDO_getBarIconFrame(tButton, sClusterSlot):Show();
if sClusterConfig["IS_NUMBER"] then
VUHDO_getBarIconTimer(tButton, sClusterSlot):SetText(tNumLow);
end
end
end
end
--
function VUHDO_removeAllClusterHighlights()
for _, tUnit in pairs(VUHDO_HIGLIGHT_CLUSTER) do
VUHDO_updateBouquetsForEvent(tUnit, 18); -- VUHDO_UPDATE_MOUSEOVER_CLUSTER
end
twipe(VUHDO_HIGLIGHT_CLUSTER);
end
local VUHDO_removeAllClusterHighlights = VUHDO_removeAllClusterHighlights;
--
function VUHDO_highlightClusterFor(aUnit)
VUHDO_CLUSTER_UNIT = aUnit;
if VUHDO_HIGLIGHT_NUM ~= 0 then
VUHDO_removeAllClusterHighlights();
end
VUHDO_HIGLIGHT_NUM = VUHDO_getDestCluster(aUnit, VUHDO_HIGLIGHT_CLUSTER);
for _, tUnit in pairs(VUHDO_HIGLIGHT_CLUSTER) do
VUHDO_HIGLIGHT_CLUSTER[tUnit] = true;
VUHDO_updateBouquetsForEvent(tUnit, 18); -- VUHDO_UPDATE_MOUSEOVER_CLUSTER
end
end
--
function VUHDO_updateClusterHighlights()
if VUHDO_CLUSTER_UNIT then
VUHDO_highlightClusterFor(VUHDO_CLUSTER_UNIT);
end
end
--
function VUHDO_resetClusterUnit()
VUHDO_CLUSTER_UNIT = nil;
end
--
function VUHDO_getNumInUnitCluster(aUnit)
return VUHDO_NUM_IN_UNIT_CLUSTER[aUnit] or 0;
end
--
function VUHDO_getIsInHiglightCluster(aUnit)
if VUHDO_HIGLIGHT_NUM < sThreshFair then return false; end
return VUHDO_HIGLIGHT_CLUSTER[aUnit];
end
--
local tBorder;
function VUHDO_clusterBorderBouquetCallback(aUnit, anIsActive, anIcon, aTimer, aCounter, aDuration, aColor, aBuffName, aBouquetName)
for _, tButton in pairs(VUHDO_getUnitButtonsSafe(aUnit)) do
tBorder = VUHDO_getClusterBorderFrame(tButton);
if aColor then
tBorder:SetBackdropBorderColor(VUHDO_backColor(aColor));
tBorder:Show();
else
tBorder:Hide();
end
end
end
VUHDO_MAY_DEBUFF_ANIM = true;
local VUHDO_DEBUFF_ICONS = { };
local sIsName;
-- BURST CACHE ---------------------------------------------------
local floor = floor;
local GetTime = GetTime;
local pairs = pairs;
local twipe = table.wipe;
local _;
local huge = math.huge;
local _G = getfenv();
local VUHDO_getUnitButtons;
local VUHDO_getUnitButtonsSafe;
local VUHDO_getBarIconTimer
local VUHDO_getBarIconCounter;
local VUHDO_getBarIconFrame;
local VUHDO_getBarIcon;
local VUHDO_getBarIconName;
local VUHDO_getShieldPerc;
local VUHDO_CONFIG;
local sCuDeStoredSettings;
local sMaxIcons;
local sStaticConfig;
local sEmpty = { };
function VUHDO_customDebuffIconsInitLocalOverrides()
-- functions
VUHDO_getUnitButtons = _G["VUHDO_getUnitButtons"];
VUHDO_getBarIconTimer = _G["VUHDO_getBarIconTimer"];
VUHDO_getBarIconCounter = _G["VUHDO_getBarIconCounter"];
VUHDO_getBarIconFrame = _G["VUHDO_getBarIconFrame"];
VUHDO_getBarIcon = _G["VUHDO_getBarIcon"];
VUHDO_getBarIconName = _G["VUHDO_getBarIconName"];
VUHDO_getShieldPerc = _G["VUHDO_getShieldPerc"];
VUHDO_getUnitButtonsSafe = _G["VUHDO_getUnitButtonsSafe"];
VUHDO_CONFIG = _G["VUHDO_CONFIG"];
sCuDeStoredSettings = VUHDO_CONFIG["CUSTOM_DEBUFF"]["STORED_SETTINGS"];
sMaxIcons = VUHDO_CONFIG["CUSTOM_DEBUFF"]["max_num"];
if (sMaxIcons < 1) then -- Damit das Bouquet item "Letzter Debuff" funktioniert
sMaxIcons = 1;
end
sIsName = VUHDO_CONFIG["CUSTOM_DEBUFF"]["isName"];
sStaticConfig = {
["isStaticConfig"] = true,
["animate"] = VUHDO_CONFIG["CUSTOM_DEBUFF"]["animate"],
["timer"] = VUHDO_CONFIG["CUSTOM_DEBUFF"]["timer"],
["isStacks"] = VUHDO_CONFIG["CUSTOM_DEBUFF"]["isStacks"],
["isAliveTime"] = false,
["isFullDuration"] = false,
["isMine"] = true,
["isOthers"] = true,
["isBarGlow"] = false,
["isIconGlow"] = false,
};
end
----------------------------------------------------
--
local tAliveTime;
local tRemain;
local tStacks;
local tCuDeStoConfig;
local tNameLabel;
local tTimeStamp;
local tShieldPerc;
local tName;
local tButton;
local tIsAnim;
local tIsBarGlow;
local tIsIconGlow;
local function VUHDO_animateDebuffIcon(aButton, anIconInfo, aNow, anIconIndex, anIsInit, aUnit)
tCuDeStoConfig = sCuDeStoredSettings[anIconInfo[3]] or sCuDeStoredSettings[tostring(anIconInfo[7])] or sStaticConfig;
if tCuDeStoConfig["isStaticConfig"] and
(VUHDO_DEBUFF_BLACKLIST[anIconInfo[3]] or VUHDO_DEBUFF_BLACKLIST[tostring(anIconInfo[7])]) then
VUHDO_removeDebuffIcon(aUnit, anIconInfo[3]);
return;
end
tIsAnim = tCuDeStoConfig["animate"] and VUHDO_MAY_DEBUFF_ANIM;
tIsBarGlow = tCuDeStoConfig["isBarGlow"];
tIsIconGlow = tCuDeStoConfig["isIconGlow"];
tTimeStamp = anIconInfo[2];
tAliveTime = anIsInit and 0 or aNow - tTimeStamp;
tName = anIconInfo[3];
if tCuDeStoConfig["timer"] then
if tCuDeStoConfig["isAliveTime"] then
VUHDO_getBarIconTimer(aButton, anIconIndex):SetText(tAliveTime < 99.5 and floor(tAliveTime + 0.5) or ">>");
else
tRemain = (anIconInfo[4] or aNow - 1) - aNow;
if tRemain >= 0 and (tRemain < 10 or tCuDeStoConfig["isFullDuration"]) then
VUHDO_getBarIconTimer(aButton, anIconIndex):SetText(tRemain > 100 and ">>" or floor(tRemain));
else
VUHDO_getBarIconTimer(aButton, anIconIndex):SetText("");
end
end
end
tShieldPerc = VUHDO_getShieldPerc(aUnit, tName);
tStacks = tShieldPerc ~= 0 and tShieldPerc or anIconInfo[5] or 0;
VUHDO_getBarIconCounter(aButton, anIconIndex):SetText((tCuDeStoConfig["isStacks"] and tStacks > 1) and tStacks or "");
if anIsInit then
VUHDO_getBarIcon(aButton, anIconIndex):SetTexture(anIconInfo[1]);
if sIsName then
tNameLabel = VUHDO_getBarIconName(aButton, anIconIndex);
tNameLabel:SetText(tName);
tNameLabel:SetAlpha(1);
end
VUHDO_getBarIconFrame(aButton, anIconIndex):SetAlpha(1);
if tIsAnim then VUHDO_setDebuffAnimation(1.2); end
if tIsBarGlow then
VUHDO_LibCustomGlow.PixelGlow_Start(
aButton,
tCuDeStoConfig["barGlowColor"] and {
tCuDeStoConfig["barGlowColor"]["R"],
tCuDeStoConfig["barGlowColor"]["G"],
tCuDeStoConfig["barGlowColor"]["B"],
tCuDeStoConfig["barGlowColor"]["O"]
} or {
VUHDO_PANEL_SETUP.BAR_COLORS["DEBUFF_BAR_GLOW"]["R"],
VUHDO_PANEL_SETUP.BAR_COLORS["DEBUFF_BAR_GLOW"]["R"],
VUHDO_PANEL_SETUP.BAR_COLORS["DEBUFF_BAR_GLOW"]["B"],
VUHDO_PANEL_SETUP.BAR_COLORS["DEBUFF_BAR_GLOW"]["O"]
},
14, -- number of particles
0.3, -- frequency
8, -- length
2, -- thickness
0, -- x offset
0, -- y offset
false, -- border
VUHDO_CUSTOM_GLOW_CUDE_FRAME_KEY
);
end
if tIsIconGlow then
VUHDO_LibCustomGlow.PixelGlow_Start(
VUHDO_getBarIconFrame(aButton, anIconIndex),
tCuDeStoConfig["iconGlowColor"] and {
tCuDeStoConfig["iconGlowColor"]["R"],
tCuDeStoConfig["iconGlowColor"]["G"],
tCuDeStoConfig["iconGlowColor"]["B"],
tCuDeStoConfig["iconGlowColor"]["O"]
} or {
VUHDO_PANEL_SETUP.BAR_COLORS["DEBUFF_ICON_GLOW"]["R"],
VUHDO_PANEL_SETUP.BAR_COLORS["DEBUFF_ICON_GLOW"]["R"],
VUHDO_PANEL_SETUP.BAR_COLORS["DEBUFF_ICON_GLOW"]["B"],
VUHDO_PANEL_SETUP.BAR_COLORS["DEBUFF_ICON_GLOW"]["O"]
},
8, -- number of particles
0.3, -- frequency
6, -- length
2, -- thickness
0, -- x offset
0, -- y offset
false, -- border
VUHDO_CUSTOM_GLOW_CUDE_ICON_KEY
);
end
elseif VUHDO_getBarIcon(aButton, anIconIndex):GetTexture() ~= anIconInfo[1] then
VUHDO_getBarIcon(aButton, anIconIndex):SetTexture(anIconInfo[1]);
VUHDO_getBarIconFrame(aButton, anIconIndex):SetAlpha(1);
VUHDO_updateHealthBarsFor(aUnit, VUHDO_UPDATE_RANGE);
end
if tIsAnim then
tButton = VUHDO_getBarIconButton(aButton, anIconIndex);
if tAliveTime <= 0.4 then tButton:SetScale(1 + tAliveTime * 2.5);
elseif tAliveTime <= 0.6 then -- Keep size
elseif tAliveTime <= 1.1 then tButton:SetScale(3.2 - 2 * tAliveTime);
else tButton:SetScale(1); end
else -- Falls Custom Debuff vorher Animation hatte und dieser nicht
VUHDO_getBarIconButton(aButton, anIconIndex):SetScale(1);
end
if sIsName and tAliveTime > 2 then
VUHDO_getBarIconName(aButton, anIconIndex):SetAlpha(0);
end
end
--
local tNow;
function VUHDO_updateAllDebuffIcons(anIsFrequent)
tNow = GetTime();
for tUnit, tAllDebuffInfos in pairs(VUHDO_DEBUFF_ICONS) do
for tIndex, tDebuffInfo in pairs(tAllDebuffInfos) do
if not anIsFrequent or tDebuffInfo[2] + 1.21 >= tNow then
for _, tButton in pairs(VUHDO_getUnitButtonsSafe(tUnit)) do
VUHDO_animateDebuffIcon(tButton, tDebuffInfo, tNow, tIndex + 39, false, tUnit);
end
end
end
end
end
-- 1 = icon, 2 = timestamp, 3 = name, 4 = expiration time, 5 = stacks, 6 = Duration, 7 = Start time
local tSlot;
local tOldest;
local tTimestamp;
local tFrame, tIconInfo;
function VUHDO_addDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDuration, anIsBuff, aSpellId, aCnt)
if not VUHDO_DEBUFF_ICONS[aUnit] then
VUHDO_DEBUFF_ICONS[aUnit] = { };
end
tOldest = huge;
tSlot = 1;
for tCnt = 1, sMaxIcons do
if not VUHDO_DEBUFF_ICONS[aUnit][tCnt] then tSlot = tCnt; break;
else
tTimestamp = VUHDO_DEBUFF_ICONS[aUnit][tCnt][2];
if tTimestamp > 0 and tTimestamp < tOldest then
tOldest = tTimestamp;
tSlot = tCnt;
end
end
end
tIconInfo = { anIcon, -1, aName, anExpiry, aStacks, aDuration, aSpellId };
VUHDO_DEBUFF_ICONS[aUnit][tSlot] = tIconInfo;
for _, tButton in pairs(VUHDO_getUnitButtonsSafe(aUnit)) do
VUHDO_animateDebuffIcon(tButton, tIconInfo, GetTime(), tSlot + 39, true, aUnit);
tFrame = VUHDO_getBarIconFrame(tButton, tSlot + 39);
tFrame["debuffInfo"], tFrame["debuffSpellId"], tFrame["isBuff"], tFrame["debuffCnt"] = aName, aSpellId, anIsBuff, aCnt;
end
tIconInfo[2] = GetTime();
VUHDO_updateHealthBarsFor(aUnit, VUHDO_UPDATE_RANGE);
end
--
local tIconInfo;
local tFound;
function VUHDO_updateDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDuration, anIsBuff, aSpellId, aCnt)
if not VUHDO_DEBUFF_ICONS[aUnit] then
VUHDO_DEBUFF_ICONS[aUnit] = { };
end
tFound = false;
for tCnt = 1, sMaxIcons do
tIconInfo = VUHDO_DEBUFF_ICONS[aUnit][tCnt];
if tIconInfo and tIconInfo[3] == aName then
tFound = true;
tIconInfo[1], tIconInfo[3], tIconInfo[4], tIconInfo[5], tIconInfo[6], tIconInfo[7] = anIcon, aName, anExpiry, aStacks, aDuration, aSpellId;
for _, tButton in pairs(VUHDO_getUnitButtonsSafe(aUnit)) do
tFrame = VUHDO_getBarIconFrame(tButton, tCnt + 39);
tFrame["debuffInfo"], tFrame["debuffSpellId"], tFrame["isBuff"], tFrame["debuffCnt"] = aName, aSpellId, anIsBuff, aCnt;
end
end
end
if not tFound then
VUHDO_addDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDuration, anIsBuff, aSpellId, aCnt);
end
end
--
local tAllButtons2;
local tFrame;
function VUHDO_removeDebuffIcon(aUnit, aName)
tAllButtons2 = VUHDO_getUnitButtons(aUnit);
if not tAllButtons2 then return; end
for tCnt2 = 1, sMaxIcons do
if (VUHDO_DEBUFF_ICONS[aUnit][tCnt2] or sEmpty)[3] == aName then
VUHDO_DEBUFF_ICONS[aUnit][tCnt2][2] = 1; -- ~= -1, lock icon to not be processed by onupdate
for _, tButton2 in pairs(tAllButtons2) do
VUHDO_LibCustomGlow.PixelGlow_Stop(tButton2, VUHDO_CUSTOM_GLOW_CUDE_FRAME_KEY);
tFrame = VUHDO_getBarIconFrame(tButton2, tCnt2 + 39);
if tFrame then
VUHDO_LibCustomGlow.PixelGlow_Stop(tFrame, VUHDO_CUSTOM_GLOW_CUDE_ICON_KEY);
tFrame:SetAlpha(0);
tFrame["debuffInfo"] = nil;
tFrame["debuffSpellId"] = nil;
tFrame["isBuff"] = nil;
tFrame["debuffCnt"] = nil;
end
end
twipe(VUHDO_DEBUFF_ICONS[aUnit][tCnt2]);
VUHDO_DEBUFF_ICONS[aUnit][tCnt2] = nil;
end
end
end
--
local tAllButtons3;
local tFrame;
function VUHDO_removeAllDebuffIcons(aUnit)
tAllButtons3 = VUHDO_getUnitButtons(aUnit);
if not tAllButtons3 then return; end
for _, tButton3 in pairs(tAllButtons3) do
VUHDO_LibCustomGlow.PixelGlow_Stop(tButton3, VUHDO_CUSTOM_GLOW_CUDE_FRAME_KEY);
for tCnt3 = 40, 39 + sMaxIcons do
tFrame = VUHDO_getBarIconFrame(tButton3, tCnt3);
if tFrame then
VUHDO_LibCustomGlow.PixelGlow_Stop(tFrame, VUHDO_CUSTOM_GLOW_CUDE_ICON_KEY);
tFrame:SetAlpha(0);
tFrame["debuffInfo"] = nil;
tFrame["debuffSpellId"] = nil;
tFrame["isBuff"] = nil;
tFrame["debuffCnt"] = nil;
end
end
end
if VUHDO_DEBUFF_ICONS[aUnit] then twipe(VUHDO_DEBUFF_ICONS[aUnit]); end
VUHDO_updateBouquetsForEvent(aUnit, 29);
end
--
local tDebuffInfo;
local tCurrInfo;
function VUHDO_getLatestCustomDebuff(aUnit)
tDebuffInfo = sEmpty;
for tCnt = 1, sMaxIcons do
tCurrInfo = (VUHDO_DEBUFF_ICONS[aUnit] or sEmpty)[tCnt];
if tCurrInfo and tCurrInfo[2] > (tDebuffInfo[2] or 0) then
tDebuffInfo = tCurrInfo;
end
end
return tDebuffInfo[1], tDebuffInfo[4], tDebuffInfo[5], tDebuffInfo[6];
end
--
function VUHDO_getDebuffIcons()
return VUHDO_DEBUFF_ICONS;
end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--
local tTexture;
function VUHDO_threatIndicatorsBouquetCallback(aUnit, anIsActive, anIcon, aTimer, aCounter, aDuration, aColor, aBuffName, aBouquetName)
for _, sButton in pairs(VUHDO_getUnitButtonsSafe(aUnit)) do
tTexture = VUHDO_getAggroTexture(VUHDO_getHealthBar(sButton, 1));
if anIsActive then
tTexture:SetAllPoints();
tTexture:SetVertexColor(VUHDO_backColor(aColor));
tTexture:Show();
VUHDO_UIFrameFlash(tTexture, 0.2, 0.5, 3.2, true, 0, 0);
else
VUHDO_UIFrameFlashStop(tTexture);
tTexture:Hide();
end
end
end
--
local tBar;
local tQuota;
function VUHDO_threatBarBouquetCallback(aUnit, anIsActive, anIcon, aCurrValue, aCounter, aMaxValue, aColor, aBuffName, aBouquetName)
tQuota = (aCurrValue == 0 and aMaxValue == 0) and 0
or (aMaxValue or 0) > 1 and aCurrValue / aMaxValue
or 0;
for _, sButton in pairs(VUHDO_getUnitButtonsSafe(aUnit)) do
if tQuota > 0 then
tBar = VUHDO_getHealthBar(sButton, 7);
tBar:SetValue(tQuota);
tBar:SetVuhDoColor(aColor);
else
VUHDO_getHealthBar(sButton, 7):SetValue(0);
end
end
end
function VUHDO_threatBarTextCallback(...)
VUHDO_indicatorTextCallback(7, ...);
end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
local VUHDO_RAID = { };
local VUHDO_RAID_GUIDS = { };
local VUHDO_INTERNAL_TOGGLES = { };
local strsplit = strsplit;
local pairs = pairs;
local VUHDO_updateHealth;
local sCurrentTarget = nil;
local sCurrentFocus = nil;
--
function VUHDO_combatLogInitLocalOverrides()
VUHDO_RAID = _G["VUHDO_RAID"];
VUHDO_RAID_GUIDS = _G["VUHDO_RAID_GUIDS"];
VUHDO_INTERNAL_TOGGLES = _G["VUHDO_INTERNAL_TOGGLES"];
VUHDO_updateHealth = _G["VUHDO_updateHealth"];
end
--
local tInfo;
local tNewHealth;
local tDeadInfo = { ["dead"] = true };
local function VUHDO_addUnitHealth(aUnit, aDelta)
tInfo = VUHDO_RAID[aUnit] or tDeadInfo;
if not tInfo["dead"] then
tNewHealth = tInfo["health"] + aDelta;
if tNewHealth < 0 then tNewHealth = 0;
elseif tNewHealth > tInfo["healthmax"] then tNewHealth = tInfo["healthmax"]; end
if tInfo["health"] ~= tNewHealth then
tInfo["health"] = tNewHealth;
VUHDO_updateHealth(aUnit, 2); -- VUHDO_UPDATE_HEALTH
end
end
end
--
local tPre, tSuf, tSpec;
local function VUHDO_getTargetHealthImpact(aMsg, aMsg1, aMsg2, aMsg4)
tPre, tSuf, tSpec = strsplit("_", aMsg);
if "SPELL" == tPre then
if ("HEAL" == tSuf or "HEAL" == tSpec) and "MISSED" ~= tSpec then
return aMsg4;
elseif "DAMAGE" == tSuf or "DAMAGE" == tSpec then
return -aMsg4;
end
elseif "DAMAGE" == tSuf then
if "SWING" == tPre then
return -aMsg1;
elseif "RANGE" == tPre then
return -aMsg4;
elseif "ENVIRONMENTAL" == tPre then
return -aMsg2;
end
elseif "DAMAGE" == tPre and "MISSED" ~= tSpec and "RESISTED" ~= tSpec then
return -aMsg4;
end
return 0;
end
--
function VUHDO_clParserSetCurrentTarget(aUnit)
sCurrentTarget = VUHDO_INTERNAL_TOGGLES[27] and aUnit or "*"; -- VUHDO_UPDATE_PLAYER_TARGET
end
--
function VUHDO_clParserSetCurrentFocus()
sCurrentFocus = nil;
for tUnit, tInfo in pairs(VUHDO_RAID) do
if UnitIsUnit("focus", tUnit) and tUnit ~= "focus" and tUnit ~= "target" then
if tInfo["isPet"] and (VUHDO_RAID[tInfo["ownerUnit"]] or {})["isVehicle"] then
sCurrentFocus = tInfo["ownerUnit"];
else
sCurrentFocus = tUnit;
end
break;
end
end
end
--
local tUnit;
local tImpact;
function VUHDO_parseCombatLogEvent(aMsg, aDstGUID, aMsg1, aMsg2, aMsg4)
tUnit = VUHDO_RAID_GUIDS[aDstGUID];
if not tUnit then return; end
-- as of patch 7.1 we are seeing empty values on health related events
tImpact = tonumber(VUHDO_getTargetHealthImpact(aMsg, aMsg1, aMsg2, aMsg4)) or 0;
if tImpact ~= 0 then
VUHDO_addUnitHealth(tUnit, tImpact);
if tUnit == sCurrentTarget then VUHDO_addUnitHealth("target", tImpact); end
if tUnit == sCurrentFocus then VUHDO_addUnitHealth("focus", tImpact); end
end
end
--
function VUHDO_getCurrentPlayerFocus()
return sCurrentFocus;
end
--
function VUHDO_isShowGcd()
return VUHDO_CONFIG["IS_SHOW_GCD"];
end
--
function VUHDO_isShowDirectionArrow()
return VUHDO_CONFIG["DIRECTION"]["enable"];
end
--
function VUHDO_getPlayerClassBuffs()
return VUHDO_CLASS_BUFFS[VUHDO_PLAYER_CLASS];
end
\ No newline at end of file
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