Commit 13c18d58 authored by Ivaria's avatar Ivaria
Browse files

Merge branch 'tbcc' into vanilla

parents a2e93f8c da4faab3
......@@ -40,12 +40,9 @@ local VUHDO_THREAT_CFG;
local VUHDO_IN_RAID_TARGET_BUTTONS;
local VUHDO_INTERNAL_TOGGLES;
local abs = abs;
local floor = floor;
local strfind = strfind;
local strbyte = strbyte;
local GetRaidTargetIndex = GetRaidTargetIndex;
local UnitIsUnit = UnitIsUnit;
local UnitGetTotalHealAbsorbs = VUHDO_unitGetTotalHealAbsorbs;
local pairs = pairs;
local twipe = table.wipe;
local format = format;
......@@ -113,6 +110,7 @@ end
local tIncColor = { ["useBackground"] = true };
local tShieldColor = { ["useBackground"] = true };
local tOvershieldColor = { ["useBackground"] = true };
local tHealAbsorbColor = { ["useBackground"] = true };
......@@ -307,6 +305,104 @@ local VUHDO_updateShieldBar = VUHDO_updateShieldBar;
--
local tInfo;
local tAllButtons;
local tHealAbsorbRemain;
local tHealAbsorbOpacity;
local tHealthBar, tHealthBarWidth, tHealthBarHeight, tHealthDeficit;
local tHealAbsorbBar, tHealAbsorbBarSize, tHealAbsorbBarSizePercent, tHealAbsorbBarOffset, tHealAbsorbBarOffsetPercent;
local tOrientation;
function VUHDO_updateHealAbsorbBar(aUnit)
if not VUHDO_CONFIG["SHOW_HEAL_ABSORB_BAR"] then
return;
end
tInfo = VUHDO_RAID[aUnit];
tAllButtons = VUHDO_getUnitButtons(VUHDO_resolveVehicleUnit(aUnit));
if not tInfo or not tAllButtons or not tInfo["connected"] or tInfo["dead"] or tInfo["healthmax"] <= 0 then
return;
end
tOrientation = VUHDO_getStatusbarOrientationString("HEALTH_BAR");
tHealAbsorbRemain = min(UnitGetTotalHealAbsorbs(aUnit) or 0, tInfo["health"]);
tHealthDeficit = tInfo["healthmax"] - tInfo["health"];
tHealAbsorbBarSizePercent = tHealAbsorbRemain / tInfo["healthmax"];
tHealAbsorbBarOffsetPercent = tHealthDeficit / tInfo["healthmax"];
for _, tButton in pairs(tAllButtons) do
tHealthBar = VUHDO_getHealthBar(tButton, 1);
tHealAbsorbBar = VUHDO_getHealAbsorbBarTexture(tHealthBar);
if VUHDO_CONFIG["SHOW_HEAL_ABSORB_BAR"] and (tHealAbsorbRemain > 0) then
tHealAbsorbBar.tileSize = 32;
tHealAbsorbBar:SetParent(tHealthBar);
tHealAbsorbBar:ClearAllPoints();
tHealAbsorbColor["R"], tHealAbsorbColor["G"], tHealAbsorbColor["B"], tHealAbsorbOpacity = tHealthBar:GetStatusBarColor();
tHealAbsorbColor = VUHDO_getDiffColor(tHealAbsorbColor, VUHDO_PANEL_SETUP["BAR_COLORS"]["HEAL_ABSORB"]);
if tHealAbsorbColor["O"] and tHealAbsorbOpacity then
tHealAbsorbColor["O"] = tHealAbsorbColor["O"] * tHealAbsorbOpacity * (tHealthBar:GetAlpha() or 1);
end
VUHDO_setTextureColor(tHealAbsorbBar, tHealAbsorbColor);
tHealthBarWidth, tHealthBarHeight = tHealthBar:GetSize();
if (not sIsInvertGrowth and tOrientation == "HORIZONTAL") or (sIsInvertGrowth and tOrientation == "HORIZONTAL_INV") then
-- VUHDO_STATUSBAR_LEFT_TO_RIGHT
tHealAbsorbBarSize = tHealAbsorbBarSizePercent * tHealthBarWidth;
tHealAbsorbBarOffset = tHealAbsorbBarOffsetPercent * tHealthBarWidth;
tHealAbsorbBar:SetPoint("TOPRIGHT", tHealthBar, "TOPRIGHT", tHealAbsorbBarOffset * -1, 0);
tHealAbsorbBar:SetPoint("BOTTOMRIGHT", tHealthBar, "BOTTOMRIGHT", tHealAbsorbBarOffset * -1, 0);
tHealAbsorbBar:SetWidth(tHealAbsorbBarSize);
tHealAbsorbBar:SetTexCoord(0, tHealAbsorbBarSize / tHealAbsorbBar.tileSize, 0, tHealthBarHeight / tHealAbsorbBar.tileSize);
elseif (not sIsInvertGrowth and tOrientation == "HORIZONTAL_INV") or (sIsInvertGrowth and tOrientation == "HORIZONTAL") then
-- VUHDO_STATUSBAR_RIGHT_TO_LEFT
tHealAbsorbBarSize = tHealAbsorbBarSizePercent * tHealthBarWidth;
tHealAbsorbBarOffset = tHealAbsorbBarOffsetPercent * tHealthBarWidth;
tHealAbsorbBar:SetPoint("TOPLEFT", tHealthBar, "TOPLEFT", tHealAbsorbBarOffset, 0);
tHealAbsorbBar:SetPoint("BOTTOMLEFT", tHealthBar, "BOTTOMLEFT", tHealAbsorbBarOffset, 0);
tHealAbsorbBar:SetWidth(tHealAbsorbBarSize);
tHealAbsorbBar:SetTexCoord(0, tHealAbsorbBarSize / tHealAbsorbBar.tileSize, 0, tHealthBarHeight / tHealAbsorbBar.tileSize);
elseif (not sIsInvertGrowth and tOrientation == "VERTICAL") or (sIsInvertGrowth and tOrientation == "VERTICAL_INV") then
-- VUHDO_STATUSBAR_BOTTOM_TO_TOP
tHealAbsorbBarSize = tHealAbsorbBarSizePercent * tHealthBarHeight;
tHealAbsorbBarOffset = tHealAbsorbBarOffsetPercent * tHealthBarHeight;
tHealAbsorbBar:SetPoint("TOPLEFT", tHealthBar, "TOPLEFT", 0, tHealAbsorbBarOffset * -1);
tHealAbsorbBar:SetPoint("TOPRIGHT", tHealthBar, "TOPRIGHT", 0, tHealAbsorbBarOffset * -1);
tHealAbsorbBar:SetHeight(tHealAbsorbBarSize);
tHealAbsorbBar:SetTexCoord(0, tHealthBarWidth / tHealAbsorbBar.tileSize, 0, tHealAbsorbBarSize / tHealAbsorbBar.tileSize);
else -- (not sIsInvertGrowth and tOrientation == "VERTICAL_INV") or (sIsInvertGrowth and tOrientation == "VERTICAL")
-- VUHDO_STATUSBAR_TOP_TO_BOTTOM
tHealAbsorbBarSize = tHealAbsorbBarSizePercent * tHealthBarHeight;
tHealAbsorbBarOffset = tHealAbsorbBarOffsetPercent * tHealthBarHeight;
tHealAbsorbBar:SetPoint("BOTTOMLEFT", tHealthBar, "BOTTOMLEFT", 0, tHealAbsorbBarOffset);
tHealAbsorbBar:SetPoint("BOTTOMRIGHT", tHealthBar, "BOTTOMRIGHT", 0, tHealAbsorbBarOffset);
tHealAbsorbBar:SetHeight(tHealAbsorbBarSize);
tHealAbsorbBar:SetTexCoord(0, tHealthBarWidth / tHealAbsorbBar.tileSize, 0, tHealAbsorbBarSize / tHealAbsorbBar.tileSize);
end
tHealAbsorbBar:Show();
else
tHealAbsorbBar:Hide();
end
end
end
local VUHDO_updateHealAbsorbBar = VUHDO_updateHealAbsorbBar;
--
local tAllButtons;
local tHealthPlusInc;
......@@ -325,24 +421,27 @@ local function VUHDO_updateIncHeal(aUnit)
tHealthPlusInc, tAmountInc = VUHDO_getHealthPlusIncQuota(aUnit);
for _, tButton in pairs(tAllButtons) do
tIncBar = VUHDO_getHealthBar(tButton, 6);
tIncBar = VUHDO_getHealthBar(tButton, 6);
if tAmountInc > 0 and tInfo["healthmax"] > 0 then
tIncBar:SetValueRange(tInfo["health"] / tInfo["healthmax"], tHealthPlusInc);
tHealthBar = VUHDO_getHealthBar(tButton, 1);
tIncColor["R"], tIncColor["G"], tIncColor["B"], tOpacity = tHealthBar:GetStatusBarColor();
tIncColor = VUHDO_getDiffColor(tIncColor, VUHDO_PANEL_SETUP["BAR_COLORS"]["INCOMING"]);
if tIncColor["O"] and tOpacity then
if tIncColor["O"] and tOpacity then
tIncColor["O"] = tIncColor["O"] * tOpacity * (tHealthBar:GetAlpha() or 1);
end
end
VUHDO_setStatusBarColor(tIncBar, tIncColor);
VUHDO_setStatusBarColor(tIncBar, tIncColor);
else
tIncBar:SetValueRange(0,0);
tIncBar:SetValueRange(0,0);
end
end
VUHDO_updateShieldBar(aUnit, tHealthPlusInc, tAmountInc);
VUHDO_updateHealAbsorbBar(aUnit, tHealthPlusInc, tAmountInc);
end
......@@ -351,22 +450,22 @@ end
local tRatio, tBar, tScale;
function VUHDO_overhealTextCallback(aUnit, aPanelNum, aProviderName, aText, aValue)
for _, tButton in pairs(VUHDO_getUnitButtonsPanel(aUnit, aPanelNum)) do
--VUHDO_getOverhealText(VUHDO_getHealthBar(tButton, 1)):SetText(aText);
tBar = VUHDO_getHealthBar(tButton, 1);
VUHDO_getOverhealText(tBar):SetText(aText);
-- Sonderwurst Overheal wirklich ntig?
if strfind(aProviderName, "OVERHEAL", 1, true) then
tInfo = VUHDO_RAID[aUnit];
if tInfo then
if aValue > 0 and tInfo["healthmax"] > 0 then
if aValue > 0 and tInfo["healthmax"] > 0 then
tRatio = aValue / tInfo["healthmax"];
tScale = VUHDO_PANEL_SETUP[aPanelNum]["OVERHEAL_TEXT"]["scale"];
VUHDO_getOverhealPanel(tBar):SetScale(tRatio < 1 and (0.5 + tRatio) * tScale or 1.5 * tScale);
end
end
end
tScale = VUHDO_PANEL_SETUP[aPanelNum]["OVERHEAL_TEXT"]["scale"];
VUHDO_getOverhealPanel(tBar):SetScale(tRatio < 1 and (0.5 + tRatio) * tScale or 1.5 * tScale);
end
end
end
end
end
......
......@@ -543,6 +543,7 @@ local VUHDO_DEFAULT_CONFIG = {
["SHOW_LIBHEALCOMM_INCOMING"] = true,
["SHOW_SHIELD_BAR"] = true,
["SHOW_OVERSHIELD_BAR"] = false,
["SHOW_HEAL_ABSORB_BAR"] = true,
["RANGE_CHECK_DELAY"] = 260,
......@@ -1134,6 +1135,11 @@ local VUHDO_DEFAULT_PANEL_SETUP = {
["TR"] = 0.35, ["TG"] = 0.52, ["TB"] = 1, ["TO"] = 1,
["useText"] = false, ["useBackground"] = true, ["useOpacity"] = true,
},
["HEAL_ABSORB"] = {
["R"] = 1, ["G"] = 0.4, ["B"] = 0.4, ["O"] = 1,
["TR"] = 0.35, ["TG"] = 0.52, ["TB"] = 1, ["TO"] = 1,
["useText"] = false, ["useBackground"] = true, ["useOpacity"] = true,
},
["DIRECTION"] = {
["R"] = 1, ["G"] = 0.4, ["B"] = 0.4, ["O"] = 1,
["useBackground"] = true,
......
......@@ -497,7 +497,14 @@ function VUHDO_OnEvent(_, anEvent, anArg1, anArg2, anArg3, anArg4, anArg5, anArg
VUHDO_updateShield(anArg1, 114908);
end
end
elseif "UNIT_HEAL_ABSORB_AMOUNT_CHANGED" == anEvent then
if (VUHDO_RAID or tEmptyRaid)[anArg1] then
VUHDO_updateBouquetsForEvent(anArg1, 36); -- VUHDO_UPDATE_SHIELD
VUHDO_updateHealAbsorbBar(anArg1);
end
]];
elseif "UNIT_SPELLCAST_SUCCEEDED" == anEvent then
if (VUHDO_RAID or tEmptyRaid)[anArg1] then VUHDO_spellcastSucceeded(anArg1, anArg3); end
......@@ -998,10 +1005,12 @@ function VUHDO_updateGlobalToggles()
VUHDO_INTERNAL_TOGGLES[VUHDO_UPDATE_SHIELD] =
VUHDO_PANEL_SETUP["BAR_COLORS"]["HOTS"]["showShieldAbsorb"]
or VUHDO_CONFIG["SHOW_SHIELD_BAR"]
or VUHDO_CONFIG["SHOW_SHIELD_BAR"]
or VUHDO_CONFIG["SHOW_HEAL_ABSORB_BAR"]
or VUHDO_isAnyoneInterstedIn(VUHDO_UPDATE_SHIELD);
-- VUHDO_UnRegisterEvent(VUHDO_INTERNAL_TOGGLES[VUHDO_UPDATE_SHIELD], "UNIT_ABSORB_AMOUNT_CHANGED");
-- VUHDO_UnRegisterEvent(VUHDO_INTERNAL_TOGGLES[VUHDO_UPDATE_SHIELD], "UNIT_HEAL_ABSORB_AMOUNT_CHANGED");
VUHDO_INTERNAL_TOGGLES[VUHDO_UPDATE_SPELL_TRACE] = VUHDO_CONFIG["SHOW_SPELL_TRACE"]
or VUHDO_isAnyoneInterstedIn(VUHDO_UPDATE_SPELL_TRACE);
......@@ -1543,7 +1552,7 @@ local VUHDO_ALL_EVENTS = {
"INCOMING_RESURRECT_CHANGED",
"PET_BATTLE_CLOSE", "PET_BATTLE_OPENING_START",
"PLAYER_REGEN_ENABLED", "PLAYER_REGEN_DISABLED",
-- "UNIT_ABSORB_AMOUNT_CHANGED",
-- "UNIT_ABSORB_AMOUNT_CHANGED", "UNIT_HEAL_ABSORB_AMOUNT_CHANGED",
-- "INCOMING_SUMMON_CHANGED",
"UNIT_PHASE",
-- "PLAYER_SPECIALIZATION_CHANGED",
......
This diff is collapsed.
......@@ -1149,3 +1149,6 @@ VUHDO_I18N_SHOW_OVERSHIELD = "Show\nOvershield";
VUHDO_I18N_OVERSHIELD_BAR = "Overshield Bar";
VUHDO_I18N_LIBHEALCOMM = "Use Lib\nHealComm";
VUHDO_I18N_SHOW_HEAL_ABSORB = "Show\nHeal Absorb";
VUHDO_I18N_HEAL_ABSORB_BAR = "Heal Absorb Bar";
This diff is collapsed.
This diff is collapsed.
......@@ -1155,3 +1155,6 @@ VUHDO_I18N_SHOW_OVERSHIELD = "Show\nOvershield";
VUHDO_I18N_OVERSHIELD_BAR = "Overshield Bar";
VUHDO_I18N_LIBHEALCOMM = "Use Lib\nHealComm";
VUHDO_I18N_SHOW_HEAL_ABSORB = "Show\nHeal Absorb";
VUHDO_I18N_HEAL_ABSORB_BAR = "Heal Absorb Bar";
This diff is collapsed.
......@@ -1151,3 +1151,6 @@ VUHDO_I18N_SHOW_OVERSHIELD = "显示\n溢余护盾";
VUHDO_I18N_OVERSHIELD_BAR = "溢余护盾";
VUHDO_I18N_LIBHEALCOMM = "Use Lib\nHealComm";
VUHDO_I18N_SHOW_HEAL_ABSORB = "Show\nHeal Absorb";
VUHDO_I18N_HEAL_ABSORB_BAR = "Heal Absorb Bar";
This diff is collapsed.
This diff is collapsed.
......@@ -9,7 +9,7 @@
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="125" y="-180" />
<AbsDimension x="43" y="-200" />
</Offset>
</Anchor>
</Anchors>
......@@ -158,7 +158,7 @@
<Frame name="$parentShieldPanel" inherits="VuhDoPanelTemplate">
<Size>
<AbsDimension x="126" y="113" />
<AbsDimension x="126" y="152" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
......@@ -202,6 +202,23 @@
</Scripts>
</CheckButton>
<CheckButton name="$parentHealAbsorbBarCheckButton" text="VUHDO_I18N_SHOW_HEAL_ABSORB" inherits="VuhDoCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="13" y="-109" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
VUHDO_lnfSetModel(self, "VUHDO_CONFIG.SHOW_HEAL_ABSORB_BAR");
VUHDO_lnfSetTooltip(self, nil);
</OnLoad>
</Scripts>
</CheckButton>
<Frame name="$parentTitleLabel" inherits="VuhDoLabelFrameTemplate">
<Layers>
<Layer>
......
......@@ -450,9 +450,12 @@
</Frames>
<Layers>
<Layer level="OVERLAY" textureSubLevel="5">
<Layer level="OVERLAY" textureSubLevel="4">
<Texture name="$parentOvsBar" hidden="true" file="Interface\AddOns\VuhDo\Images\overshield_bar" hWrapMode="REPEAT" vWrapMode="REPEAT"> </Texture>
</Layer>
<Layer level="OVERLAY" textureSubLevel="5">
<Texture name="$parentHeAbBar" hidden="true" file="Interface\AddOns\VuhDo\Images\overshield_bar" hWrapMode="REPEAT" vWrapMode="REPEAT"> </Texture>
</Layer>
<Layer level="OVERLAY" textureSubLevel="6">
<Texture name="$parentAggro" hidden="true" file="Interface\AddOns\VuhDo\Images\aggro">
<Size>
......
......@@ -464,6 +464,15 @@ end
--
function VUHDO_getHealAbsorbBarTexture(aHealthBar)
return _G[aHealthBar:GetName() .. "HeAbBar"];
end
--
local VUHDO_STATUSBAR_LEFT_TO_RIGHT = 1;
local VUHDO_STATUSBAR_RIGHT_TO_LEFT = 2;
......
......@@ -371,4 +371,5 @@ function VUHDO_parseCombatLogShieldAbsorb(aMessage, aSrcGuid, aDstGuid, aShieldN
VUHDO_updateBouquetsForEvent(tUnit, 36); -- VUHDO_UPDATE_SHIELD
VUHDO_updateShieldBar(tUnit);
VUHDO_updateHealAbsorbBar(tUnit);
end
......@@ -1220,6 +1220,18 @@ end
function VUHDO_unitGetTotalHealAbsorbs(...)
if not UnitGetTotalHealAbsorbs then
return 0;
else
return UnitGetTotalHealAbsorbs(...);
end
end
function VUHDO_unitIsWarModePhased(...)
if not UnitIsWarModePhased then
......
......@@ -60,10 +60,10 @@ Known issues:
Bugfixes:
-- Fixed debuff absorb tracking for Sylvanas 'Veil of Darkness'
Improvements:
-- Added debuff absorb overlay bar to display healing absorption amount
--------------------------------------------------------------
......
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