Commit 48ef9258 authored by Ivaria's avatar Ivaria
Browse files

Merge branch 'master' into tbcc

parents 4588bc98 79d69e1f
......@@ -13,8 +13,6 @@ externals:
Libs/AceAddon-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceAddon-3.0
Libs/AceGUI-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceGUI-3.0
Libs/AceConfig-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConfig-3.0
Libs/AceBucket-3.0: https://repos.wowace.com/wow/ace3/trunk/AceBucket-3.0
Libs/AceEvent-3.0: https://repos.wowace.com/wow/ace3/trunk/AceEvent-3.0
Libs/AceComm-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceComm-3.0
Libs/AceLocale-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceLocale-3.0
Libs/AceTimer-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceTimer-3.0
......@@ -27,6 +25,11 @@ externals:
Libs/LibDBIcon-1.0: svn://svn.wowace.com/wow/libdbicon-1-0/mainline/trunk/LibDBIcon-1.0
Libs/LibCustomGlow-1.0:
url: https://github.com/Stanzilla/LibCustomGlow.git
Libs/NickTag-1.0:
url: https://github.com/Tercioo/NickTag-1.0
Libs/AceBucket-3.0: https://repos.wowace.com/wow/ace3/trunk/AceBucket-3.0
Libs/AceEvent-3.0: https://repos.wowace.com/wow/ace3/trunk/AceEvent-3.0
Libs/LibClassicDurations: https://repos.curseforge.com/wow/libclassicdurations
Libs/LibHealComm-4.0: https://repos.wowace.com/wow/libhealcomm-4-0
Libs/!LibTotemInfo: https://github.com/SwimmingTiger/LibTotemInfo.git
......@@ -35,4 +38,4 @@ externals:
move-folders:
VuhDo/VuhDoOptions: VuhDoOptions
\ No newline at end of file
VuhDo/VuhDoOptions: VuhDoOptions
......@@ -2,7 +2,7 @@
export CF_ID=7950
#export CF_API_KEY=
export WOWI_ID=24919
export WOWI_ID=NEEDTBCCPROJECTID
#export WOWI_ID_TEST=
#export WOWI_API_TOKEN=
#export GITHUB_SLUG=
......
......@@ -66,14 +66,14 @@ strtotime() {
exit_code=0
# Game versions for uploading
game_version="9.0.2"
game_version="9.0.5"
game_version_id=
toc_version=
classic=
# Classic version info for special handling
CLASSIC_INTERFACE="11306"
CLASSIC_VERSION="1.13.6"
CLASSIC_INTERFACE="20501"
CLASSIC_VERSION="2.5.1"
# Secrets for uploading
cf_token=$CF_API_KEY
......
File added
......@@ -20,7 +20,7 @@
<Include file="LibCompress\lib.xml"/>
<Script file="LibBase64-1.0\LibBase64-1.0.lua" />
<Include file="LibCustomGlow-1.0\LibCustomGlow-1.0.xml" />
<Include file="NickTag-1.0\NickTag-1.0.xml" />
<Include file="NickTag-1.0\NickTag-1.0.xml" />
<Include file="!LibTotemInfo\embeds.xml" />
<Include file="LibClassicDurations\LibClassicDurations.xml" />
......
MIT License
Copyright (c) 2019 Tercio Jose
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This diff is collapsed.
## Interface: 70200
## Title: NickTag-1.0
## Notes: Standalone version of the NickTag library.
NickTag-1.0.xml
<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="NickTag-1.0.lua"/>
</Ui>
NickTag is a library that allows the player to set a nickname, addons using this library can get the nickname and use it instead of the player name.
The nickname is shared among guild members and used instead of the regular player name.
Installing:
Install NickTag as you install any other library, but make sure to load NickTag after AceComm-3.0, AceSerializer-3.0, AceTimer-3.0 and CallbackHandler-1.0.
As an alternative you may use: _G.LibStub("NickTag-1.0"):Embed(YourAddonObject)
Cache Setup:
- After install, set a cache to store nicknames data received from others guild members.
- For this, call YourAddonObject:NickTagSetCache ( MyTable ), where "MyTable" is any table within your SavedVariablesPerCharacter.
- Is important to call NickTagSetCache right after your addon loads saved variables data.
Handle Player Nicknames:
- YourAddonObject:SetNickname(string), returns true if the string is a valid nickname.
The nickname must follow some rules:
- Can't be large then 12 characters.
- Isn't allowed numbers and others special characters.
- Can't repeat more then 2 times the same characters in a row.
- Can't have more then 2 spaces.
- Nickname is formated to fit title case, for instance, "SussY HArLey" is automatically formated to "Sussy Harley", "frank roger" to "Frank Roger".
- Trim.
Player Avatars:
The library also has support for player avatar and avatar background, see the example:
--this function runs when the player hit the okay button on the avatar pick frame
local avatarCallback = function (avatarTexture, avatarTextureTexCoord, avatarBackground, avatarBackgroundTexCoord, avatarBackgroundColor)
YourAddonObject:SetNicknameBackground (avatarBackground, avatarBackgroundTexCoord, avatarBackgroundColor)
YourAddonObject:SetNicknameAvatar (avatarTexture, avatarTextureTexCoord)
_G.AvatarPickFrame.callback = nil
end
--set the callback function
_G.AvatarPickFrame.callback = AvatarCallBack
--show the atatar pick frame
_G.AvatarPickFrame:Show()
Getting Nicknames and Avatars:
- @playerGUID: target player GUID.
- @default: a default if the player does not has a nickname
- @silent: show no errors if something goes wrong.
YourAddonObject:GetNickname (playerGUID, default, silent)
- @playerGUID: target player GUID.
- @default: a default texture if the player does not has an avatar, can be an empty string for no avatars.
- @silent: show no errors if something goes wrong.
YourAddonObject:GetNicknameAvatar (playerGUID, default, silent)
- @playerGUID: target player GUID.
- @defaultPath: returns this value texture path if no background is found.
- @defaultTexCoord: returns this value texture path if no background is found.
- @defaultColor: returns this value texture path if no background is found.
- @silent: show no errors if something goes wrong.
YourAddonObject:GetNicknameBackground (playerGUID, defaultPath, defaultTexCoord, defaultColor, silent)
Get [VuhDo release v3.113](https://www.curseforge.com/wow/addons/vuhdo/download/2929575) now with support for patch 8.3.0 Visions of N'Zoth!
Get [VuhDo release v3.121](https://www.curseforge.com/wow/addons/vuhdo/download/3233894) now with support for patch 9.0.5 Shadowlands Season 1 and Castle Nathria!
To get started read the updated [guide over at Icy-Veins](https://www.icy-veins.com/forums/topic/11805-vuhdo-a-comprehensive-guide/).
......
......@@ -47,6 +47,16 @@ VUHDO_PLAYER_NAME = nil;
VUHDO_PLAYER_RAID_ID = nil;
VUHDO_PLAYER_GROUP = nil;
-- Backdrops
BACKDROP_VUHDO_TOOLTIP = {
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true,
tileSize = 8,
edgeSize = 8,
insets = { left = 3, right = 3, top = 3, bottom = 3 },
};
-- BURST CACHE ---------------------------------------------------
local VUHDO_CONFIG;
local VUHDO_PET_2_OWNER;
......@@ -91,7 +101,7 @@ local UnitIsAFK = UnitIsAFK;
local UnitIsConnected = UnitIsConnected;
local UnitIsCharmed = UnitIsCharmed;
local UnitInRaid = UnitInRaid;
local VUHDO_unitHasVehicleUI = VUHDO_unitHasVehicleUI;
local UnitHasVehicleUI = VUHDO_unitHasVehicleUI;
local UnitTargetsVehicleInRaidUI = UnitTargetsVehicleInRaidUI;
local UnitCanAttack = UnitCanAttack;
local GetNumGroupMembers = GetNumGroupMembers;
......@@ -101,8 +111,7 @@ local UnitPowerMax = UnitPowerMax;
local UnitThreatSituation = UnitThreatSituation;
local UnitClass = UnitClass;
local UnitPowerType = UnitPowerType;
local VUHDO_unitHasVehicleUI = VUHDO_unitHasVehicleUI;
local VUHDO_unitGroupRolesAssigned = VUHDO_unitGroupRolesAssigned;
local UnitGroupRolesAssigned = VUHDO_unitGroupRolesAssigned;
local GetRaidRosterInfo = GetRaidRosterInfo;
local InCombatLockdown = InCombatLockdown;
local IsInRaid = IsInRaid;
......@@ -333,8 +342,6 @@ function VUHDO_setHealth(aUnit, aMode)
tName, tRealm = UnitName(aUnit);
tInfo["healthmax"] = UnitHealthMax(aUnit);
tInfo["health"] = UnitHealth(aUnit);
tInfo["loghealth"] = UnitHealth(aUnit);
tInfo["updateTime"] = GetTime();
tInfo["name"] = tName;
tInfo["number"] = VUHDO_getUnitNo(aUnit);
tInfo["unit"] = aUnit;
......@@ -353,8 +360,7 @@ function VUHDO_setHealth(aUnit, aMode)
tInfo["connected"] = tIsConnected;
tInfo["threat"] = UnitThreatSituation(aUnit) or 0;
tInfo["threatPerc"] = 0;
tInfo["isVehicle"] = VUHDO_unitHasVehicleUI(aUnit);
tInfo["className"] = tLocalClass or "";
tInfo["isVehicle"] = UnitHasVehicleUI(aUnit);
tInfo["petUnit"] = VUHDO_OWNER_2_PET[aUnit];
tInfo["targetUnit"] = VUHDO_getTargetUnit(aUnit);
tInfo["classId"] = tClassId;
......@@ -370,6 +376,12 @@ function VUHDO_setHealth(aUnit, aMode)
tInfo["mibucateg"] = nil;
tInfo["mibuvariants"] = nil;]]
if tLocalClass == tName then
tInfo["className"] = UnitCreatureType(aUnit) or "";
else
tInfo["className"] = tLocalClass or "";
end
if not VUHDO_isSpecialUnit(aUnit) then
if not tIsPet and tInfo["fullName"] == tName and VUHDO_RAID_NAMES[tName] then
VUHDO_IS_SUSPICIOUS_ROSTER = true;
......@@ -388,30 +400,15 @@ function VUHDO_setHealth(aUnit, aMode)
VUHDO_updateBouquetsForEvent(aUnit, 19); -- VUHDO_UPDATE_DC
end
if 2 == aMode or 12 == aMode then -- VUHDO_UPDATE_HEALTH -- VUHDO_UPDATE_HEALTH_COMBAT_LOG
if 12 == aMode then -- VUHDO_UPDATE_HEALTH_COMBAT_LOG
tNewHealth = tInfo["loghealth"];
end
if 2 == aMode then
-- Filter exception UNIT_HEALTH_FREQUENT event in classic
-- Sometimes there is a UNIT_HEALTH_FREQUENT event in the interim period
if tInfo["updateTime"] and abs(tonumber(tInfo["updateTime"]) - tonumber(GetTime())) < 0.4 then
return;
-- Filter exception health data from UnitHealth API
-- UnitHealth will return 0 if the hunter cast FeignDeath
-- Sometimes UnitIsDeadOrGhost return false and UnitHealth return 0 before UnitIsFeignDeath return true
elseif (UnitIsFeignDeath(aUnit) or not UnitIsDeadOrGhost(aUnit)) and UnitHealth(aUnit) == 0 then
return;
else
tNewHealth = UnitHealth(aUnit);
end
end
if 2 == aMode then -- VUHDO_UPDATE_HEALTH
tNewHealth = UnitHealth(aUnit);
if not tIsDead and tInfo["health"] > 0 then
tInfo["lifeLossPerc"] = tNewHealth / tInfo["health"];
end
tInfo["health"] = tNewHealth;
if tInfo["dead"] ~= tIsDead then
if not tIsDead then
tInfo["healthmax"] = UnitHealthMax(aUnit);
......@@ -425,11 +422,6 @@ function VUHDO_setHealth(aUnit, aMode)
tInfo["dead"] = tIsDead;
tInfo["healthmax"] = UnitHealthMax(aUnit);
tInfo["sortMaxHp"] = VUHDO_getUnitSortMaxHp(aUnit);
tInfo["loghealth"] = UnitHealth(aUnit);
if UnitHealth(aUnit) ~= 0 then
tInfo["health"] = UnitHealth(aUnit);
end
tInfo["updateTime"] = GetTime();
elseif 6 == aMode then -- VUHDO_UPDATE_AFK
tInfo["afk"] = tIsAfk;
......@@ -461,7 +453,7 @@ function VUHDO_updateHealth(aUnit, aMode)
tIsPet = VUHDO_RAID[aUnit] and VUHDO_RAID[aUnit]["isPet"];
if not tIsPet or VUHDO_INTERNAL_TOGGLES[26] then -- VUHDO_UPDATE_PETS -- Enth\84lt nur Pets als eigene Balken, vehicles werden ?ber owner dargestellt s.unten
if not tIsPet or VUHDO_INTERNAL_TOGGLES[26] then -- VUHDO_UPDATE_PETS -- Enthlt nur Pets als eigene Balken, vehicles werden ?ber owner dargestellt s.unten
VUHDO_setHealth(aUnit, aMode);
VUHDO_updateHealthBarsFor(aUnit, aMode);
end
......@@ -476,7 +468,7 @@ function VUHDO_updateHealth(aUnit, aMode)
end
if 1 ~= sCurrentMode -- VUHDO_MODE_NEUTRAL
and (2 == aMode or 3 == aMode or 12 == aMode) then -- VUHDO_UPDATE_HEALTH -- VUHDO_UPDATE_HEALTH_MAX -- VUHDO_UPDATE_HEALTH_COMBAT_LOG
and (2 == aMode or 3 == aMode) then -- VUHDO_UPDATE_HEALTH -- VUHDO_UPDATE_HEALTH_MAX
-- Remove old emergencies
VUHDO_FORCE_RESET = true;
for tUnit, _ in pairs(VUHDO_EMERGENCIES) do
......@@ -562,7 +554,7 @@ end
--
local tRole;
local function VUHDO_addUnitToSpecial(aUnit)
if VUHDO_CONFIG["OMIT_DFT_MTS"] and "TANK" == (VUHDO_unitGroupRolesAssigned(aUnit)) then
if VUHDO_CONFIG["OMIT_DFT_MTS"] and "TANK" == (UnitGroupRolesAssigned(aUnit)) then
tinsert(VUHDO_GROUPS[41], aUnit); -- VUHDO_ID_MAINTANKS
return;
end
......@@ -887,7 +879,7 @@ function VUHDO_refreshRaidMembers()
else
tInfo["group"] = VUHDO_getUnitGroup(tPlayer, false);
tInfo["isVehicle"] = VUHDO_unitHasVehicleUI(tPlayer);
tInfo["isVehicle"] = UnitHasVehicleUI(tPlayer);
if ( tInfo["isVehicle"] ) then
local tRaidId = UnitInRaid(tPlayer);
......@@ -928,7 +920,7 @@ function VUHDO_refreshRaidMembers()
VUHDO_setHealth(bossUnitId, 1); -- VUHDO_UPDATE_ALL
else
tInfo["group"] = VUHDO_getUnitGroup(bossUnitId, false);
tInfo["isVehicle"] = VUHDO_unitHasVehicleUI(bossUnitId);
tInfo["isVehicle"] = UnitHasVehicleUI(bossUnitId);
tInfo["afk"] = false;
tInfo["connected"] = true;
......
## Interface: 11306
## Interface: 20501
## Title: VuhDo ['vu:du:]
## Author: Iza@Gilneas, humfras, Ivaria@Hyjal
## Version: 3.117-classic
## Version: 3.122-tbcc
## 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
......
......@@ -101,7 +101,10 @@
</Scripts>
</Frame>
<Frame name="VuhDoTooltip" frameStrata="TOOLTIP" movable="true" parent="UIParent" hidden="true">
<Frame name="VuhDoTooltip" frameStrata="TOOLTIP" movable="true" parent="UIParent" hidden="true" inherits="BackdropTemplate" mixin="BackdropTemplateMixin">
<KeyValues>
<KeyValue key="backdropInfo" value="BACKDROP_VUHDO_TOOLTIP" type="global" />
</KeyValues>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentTextL1" inherits="GameFontNormalSmall" hidden="true">
......@@ -322,19 +325,6 @@
</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>
......
......@@ -45,11 +45,9 @@ VUHDO_LibSharedMedia:Register("statusbar", "VuhDo - Plain White", "Interface\\Ad
VUHDO_LibSharedMedia:Register("statusbar", "LiteStepLite", "Interface\\AddOns\\VuhDo\\Images\\LiteStepLite.tga");
VUHDO_LibSharedMedia:Register("statusbar", "Tukui", "Interface\\AddOns\\VuhDo\\Images\\tukuibar.tga");
--[[ unavailable media in classic?
VUHDO_LibSharedMedia:Register("sound", "Tribal Bass Drum", "Sound\\Doodad\\BellTollTribal.wav");
VUHDO_LibSharedMedia:Register("sound", "Thorns", "Sound\\Spells\\Thorns.wav ");
VUHDO_LibSharedMedia:Register("sound", "Elf Bell Toll", "Sound\\Doodad\\BellTollNightElf.wav");
]]
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");
......
--
local UnitPower = UnitPower;
local UnitGetIncomingHeals = VUHDO_unitGetIncomingHeals;
local pairs = pairs;
local ipairs = ipairs;
local floor = floor;
......@@ -227,7 +228,13 @@ function VUHDO_aoeUpdateSpellAverages()
tSpellModi = tInfo["base"] / tInfo["divisor"];
tInfo["avg"] = floor((tInfo["base"] + tBonus * tSpellModi) + 0.5);
end
tInfo["thresh"] = VUHDO_CONFIG["AOE_ADVISOR"]["config"][tName]["thresh"];
-- FIXME: as of 9.0.1 PLAYER_EQUIPMENT_CHANGED sometimes fires before VUHDO_CONFIG is loaded and available
if VUHDO_CONFIG then
tInfo["thresh"] = VUHDO_CONFIG["AOE_ADVISOR"]["config"][tName]["thresh"];
elseif not tInfo["thresh"] then
tInfo["thresh"] = 8000; -- FIXME: current lowest threshold
end
--print("VUHDO_aoeUpdateSpellAverages(): name = " .. tName .. ", avg = floor((base + bonus * spellMod) + 0.5) | " .. tInfo["avg"] .. " = floor((" .. tInfo["base"] .. " + " .. tBonus .. " * " .. tSpellModi .. ") + 0.5)");
end
end
......@@ -268,7 +275,7 @@ local function VUHDO_aoeGetIncHeals(aUnit, aCastTime)
return 0;
end
return (VUHDO_unitGetIncomingHeals(aUnit) or 0) - (VUHDO_unitGetIncomingHeals(aUnit, "player") or 0);
return (UnitGetIncomingHeals(aUnit) or 0) - (UnitGetIncomingHeals(aUnit, "player") or 0);
end
......
......@@ -2,6 +2,7 @@ VUHDO_MAY_DEBUFF_ANIM = true;
local VUHDO_DEBUFF_ICONS = { };
local sIsName;
local sIsShowOnlyForFriendly;
-- BURST CACHE ---------------------------------------------------
......@@ -48,6 +49,7 @@ function VUHDO_customDebuffIconsInitLocalOverrides()
sMaxIcons = 1;
end
sIsName = VUHDO_CONFIG["CUSTOM_DEBUFF"]["isName"];
sIsShowOnlyForFriendly = VUHDO_CONFIG["CUSTOM_DEBUFF"]["isShowOnlyForFriendly"];
sStaticConfig = {
["isStaticConfig"] = true,
......@@ -284,7 +286,7 @@ function VUHDO_updateDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDurati
end
end
if not tFound then
if not tFound and (not sIsShowOnlyForFriendly or UnitIsFriend("player", aUnit)) then
VUHDO_addDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDuration, anIsBuff, aSpellId, aCnt);
end
......
......@@ -49,6 +49,7 @@ local UnitIsUnit = UnitIsUnit;
local pairs = pairs;
local twipe = table.wipe;
local format = format;
local min = math.min;
local sIsOverhealText;
local sIsAggroText;
local sIsInvertGrowth;
......@@ -111,6 +112,7 @@ end
local tIncColor = { ["useBackground"] = true };
local tShieldColor = { ["useBackground"] = true };
local tOvershieldColor = { ["useBackground"] = true };
......@@ -134,6 +136,22 @@ end
--
local tOpacity;
local function VUHDO_setTextureColor(aTexture, aColor)
tOpacity = aColor["useOpacity"] and aColor["O"] or nil;
if aColor["useBackground"] then
aTexture:SetVertexColor(aColor["R"], aColor["G"], aColor["B"], tOpacity);
elseif tOpacity then
aTexture:SetAlpha(tOpacity);
end
end
--
local function VUHDO_getKiloText(aNumber, aMaxNumber, aSetup)
return aSetup["LIFE_TEXT"]["verbose"] and aNumber
......@@ -166,12 +184,16 @@ end
--
local tInfo;
local tAllButtons;
local tAbsorbAmount;
local tOpacity;
local tHealthBar;
local tIncBar;
function VUHDO_updateShieldBar(aUnit, aHealthPlusIncQuota)
if not VUHDO_CONFIG["SHOW_SHIELD_BAR"] then return; end
local tAbsorbAmount, tOverallShieldRemain;
local tShieldOpacity, tOvershieldOpacity;
local tHealthBar, tHealthBarWidth, tHealthBarHeight, tHealthDeficit;
local tOvershieldBar, tOvershieldBarSize, tOvershieldBarSizePercent, tOvershieldBarOffset, tOvershieldBarOffsetPercent;
local tVisibleAmountInc;
local tOrientation;
function VUHDO_updateShieldBar(aUnit, aHealthPlusIncQuota, aAmountInc)
if not VUHDO_CONFIG["SHOW_SHIELD_BAR"] then
return;
end
tInfo = VUHDO_RAID[aUnit];
tAllButtons = VUHDO_getUnitButtons(VUHDO_resolveVehicleUnit(aUnit));
......@@ -179,26 +201,107 @@ function VUHDO_updateShieldBar(aUnit, aHealthPlusIncQuota)
if not tInfo or not tAllButtons or not tInfo["connected"] or tInfo["dead"] or tInfo["healthmax"] <= 0 then
return;
end
aHealthPlusIncQuota = aHealthPlusIncQuota and aHealthPlusIncQuota or VUHDO_getHealthPlusIncQuota(aUnit);
tAbsorbAmount = VUHDO_getUnitOverallShieldRemain(aUnit) / tInfo["healthmax"];
for _, tButton in pairs(tAllButtons) do
tShieldBar = VUHDO_getHealthBar(tButton, 19);
tOrientation = VUHDO_getStatusbarOrientationString("HEALTH_BAR");
if not aHealthPlusIncQuota or not aAmountInc then
aHealthPlusIncQuota, aAmountInc = VUHDO_getHealthPlusIncQuota(aUnit);
end
tOverallShieldRemain = VUHDO_getUnitOverallShieldRemain(aUnit);
tAbsorbAmount = tOverallShieldRemain / tInfo["healthmax"];
tHealthDeficit = tInfo["healthmax"] - tInfo["health"];
tVisibleAmountInc = min(aAmountInc, tHealthDeficit);
tOverallShieldRemain = min(tOverallShieldRemain, tInfo["healthmax"]);
if tAbsorbAmount > 0 then
tOvershieldBarSizePercent = (tOverallShieldRemain - tHealthDeficit + tVisibleAmountInc) / tInfo["healthmax"];
tOvershieldBarOffsetPercent = (tHealthDeficit - tVisibleAmountInc) / tInfo["healthmax"];
for _, tButton in pairs(tAllButtons) do
tHealthBar = VUHDO_getHealthBar(tButton, 1);
tShieldBar = VUHDO_getHealthBar(tButton, 19);
if tAbsorbAmount > 0 then
tShieldBar:SetValueRange(aHealthPlusIncQuota, aHealthPlusIncQuota + tAbsorbAmount);
tHealthBar = VUHDO_getHealthBar(tButton, 1);
tShieldColor["R"], tShieldColor["G"], tShieldColor["B"], tOpacity = tHealthBar:GetStatusBarColor();
tShieldColor["R"], tShieldColor["G"], tShieldColor["B"], tShieldOpacity = tHealthBar:GetStatusBarColor();
tShieldColor = VUHDO_getDiffColor(tShieldColor, VUHDO_PANEL_SETUP["BAR_COLORS"]["SHIELD"]);
if tShieldColor["O"] and tOpacity then
tShieldColor["O"] = tShieldColor["O"] * tOpacity * (tHealthBar:GetAlpha() or 1);
end
if tShieldColor["O"] and tShieldOpacity then
tShieldColor["O"] = tShieldColor["O"] * tShieldOpacity * (tHealthBar:GetAlpha() or 1);
end
VUHDO_setStatusBarColor(tShieldBar, tShieldColor);
else
tShieldBar:SetValueRange(0,0);
end
end
VUHDO_setStatusBarColor(tShieldBar, tShieldColor);
else
tShieldBar:SetValueRange(0,0);
end
tOvershieldBar = VUHDO_getOvershieldBarTexture(tHealthBar);
if VUHDO_CONFIG["SHOW_OVERSHIELD_BAR"] and (tOverallShieldRemain > tHealthDeficit) then
tOvershieldBar.tileSize = 32;
tOvershieldBar:SetParent(tHealthBar);
tOvershieldBar:ClearAllPoints();
tOvershieldColor["R"], tOvershieldColor["G"], tOvershieldColor["B"], tOvershieldOpacity = tHealthBar:GetStatusBarColor();
tOvershieldColor = VUHDO_getDiffColor(tOvershieldColor, VUHDO_PANEL_SETUP["BAR_COLORS"]["OVERSHIELD"]);
if tOvershieldColor["O"] and tOvershieldOpacity then
tOvershieldColor["O"] = tOvershieldColor["O"] * tOvershieldOpacity * (tHealthBar:GetAlpha() or 1);
end
VUHDO_setTextureColor(tOvershieldBar, tOvershieldColor);
tHealthBarWidth, tHealthBarHeight = tHealthBar:GetSize();
if (not sIsInvertGrowth and tOrientation == "HORIZONTAL") or (sIsInvertGrowth and tOrientation == "HORIZONTAL_INV") then
-- VUHDO_STATUSBAR_LEFT_TO_RIGHT
tOvershieldBarSize = tOvershieldBarSizePercent * tHealthBarWidth;
tOvershieldBarOffset = tOvershieldBarOffsetPercent * tHealthBarWidth;
tOvershieldBar:SetPoint("TOPRIGHT", tHealthBar, "TOPRIGHT", tOvershieldBarOffset * -1, 0);
tOvershieldBar:SetPoint("BOTTOMRIGHT", tHealthBar, "BOTTOMRIGHT", tOvershieldBarOffset * -1, 0);
tOvershieldBar:SetWidth(tOvershieldBarSize);
tOvershieldBar:SetTexCoord(0, tOvershieldBarSize / tOvershieldBar.tileSize, 0, tHealthBarHeight / tOvershieldBar.tileSize);
elseif (not sIsInvertGrowth and tOrientation == "HORIZONTAL_INV") or (sIsInvertGrowth and tOrientation == "HORIZONTAL") then
-- VUHDO_STATUSBAR_RIGHT_TO_LEFT
tOvershieldBarSize = tOvershieldBarSizePercent * tHealthBarWidth;
tOvershieldBarOffset = tOvershieldBarOffsetPercent * tHealthBarWidth;
tOvershieldBar:SetPoint("TOPLEFT", tHealthBar, "TOPLEFT", tOvershieldBarOffset, 0);
tOvershieldBar:SetPoint("BOTTOMLEFT", tHealthBar, "BOTTOMLEFT", tOvershieldBarOffset, 0);
tOvershieldBar:SetWidth(tOvershieldBarSize);
tOvershieldBar:SetTexCoord(0, tOvershieldBarSize / tOvershieldBar.tileSize, 0, tHealthBarHeight / tOvershieldBar.tileSize);
elseif (not sIsInvertGrowth and tOrientation == "VERTICAL") or (sIsInvertGrowth and tOrientation == "VERTICAL_INV") then
-- VUHDO_STATUSBAR_BOTTOM_TO_TOP
tOvershieldBarSize = tOvershieldBarSizePercent * tHealthBarHeight;
tOvershieldBarOffset = tOvershieldBarOffsetPercent * tHealthBarHeight;
tOvershieldBar:SetPoint("TOPLEFT", tHealthBar, "TOPLEFT", 0, tOvershieldBarOffset * -1);
tOvershieldBar:SetPoint("TOPRIGHT", tHealthBar, "TOPRIGHT", 0, tOvershieldBarOffset * -1);
tOvershieldBar:SetHeight(tOvershieldBarSize);
tOvershieldBar:SetTexCoord(0, tHealthBarWidth / tOvershieldBar.tileSize, 0, tOvershieldBarSize / tOvershieldBar.tileSize);
else -- (not sIsInvertGrowth and tOrientation == "VERTICAL_INV") or (sIsInvertGrowth and tOrientation == "VERTICAL")
-- VUHDO_STATUSBAR_TOP_TO_BOTTOM
tOvershieldBarSize = tOvershieldBarSizePercent * tHealthBarHeight;
tOvershieldBarOffset = tOvershieldBarOffsetPercent * tHealthBarHeight;
tOvershieldBar:SetPoint("BOTTOMLEFT", tHealthBar, "BOTTOMLEFT", 0, tOvershieldBarOffset);
tOvershieldBar:SetPoint("BOTTOMRIGHT", tHealthBar, "BOTTOMRIGHT", 0, tOvershieldBarOffset);
tOvershieldBar:SetHeight(tOvershieldBarSize);
tOvershieldBar:SetTexCoord(0, tHealthBarWidth / tOvershieldBar.tileSize, 0, tOvershieldBarSize / tOvershieldBar.tileSize);
end
tOvershieldBar:Show();
else
tOvershieldBar:Hide();
end
end
end
local VUHDO_updateShieldBar = VUHDO_updateShieldBar;
......@@ -239,7 +342,7 @@ local function VUHDO_updateIncHeal(aUnit)
end
end
VUHDO_updateShieldBar(aUnit, tHealthPlusInc);
VUHDO_updateShieldBar(aUnit, tHealthPlusInc, tAmountInc);
end
......@@ -393,7 +496,7 @@ function VUHDO_customizeText(aButton, aMode, anIsTarget)
end
if tSetup["ID_TEXT"]["showName"] then
tTextString = (tSetup["ID_TEXT"]["showClass"] and not tInfo["isPet"])
tTextString = (tSetup["ID_TEXT"]["showClass"] and not tInfo["isPet"] and tInfo["className"])
and tInfo["className"] .. ": " or "";
tTextString = tTextString .. ((not tOwnerInfo or not tSetup["ID_TEXT"]["showPetOwners"])
......@@ -690,7 +793,7 @@ function VUHDO_updateHealthBarsFor(aUnit, anUpdateMode)
tAllButtons = VUHDO_getUnitButtons(aUnit);
if not tAllButtons then return; end
if 2 == anUpdateMode or 12 == anUpdateMode then -- VUHDO_UPDATE_HEALTH --VUHDO_UPDATE_HEALTH_COMBAT_LOG
if 2 == anUpdateMode then -- VUHDO_UPDATE_HEALTH
VUHDO_determineIncHeal(aUnit);
tInfo = VUHDO_RAID[aUnit];
......
......@@ -476,6 +476,7 @@ end
local VUHDO_IGNORE_HOT_IDS = {
[67358] = true, -- "Rejuvenating" proc has same name in russian and spanish as rejuvenation
[126921] = true, -- "Weakened Soul" by Shao-Tien Soul-Render
[109964] = true, -- "Spirit Shell" ability aura has the same name as the absorb aura itself
}
......@@ -555,6 +556,7 @@ local function VUHDO_updateHots(aUnit, anInfo)
if tDebuffOffset then -- Achtung kein elseif
tBuffName, tBuffIcon, tStacks, _, tDuration, tExpiry, tCaster, _, _, tSpellId = UnitDebuff(aUnit, tCnt - tDebuffOffset);
if not tBuffIcon then
break;
end
......
......@@ -13,6 +13,7 @@ VUHDO_FORCE_RESET = false;
local floor = floor;
local select = select;
local twipe = table.wipe;
local UnitGetTotalAbsorbs = VUHDO_unitGetTotalAbsorbs;
local _;
local VUHDO_RAID = { };
......@@ -46,6 +47,7 @@ local VUHDO_getRedGreenForDistance;
local VUHDO_getTexCoordsForCell;
local VUHDO_getUnitGroupPrivileges;
local VUHDO_getLatestCustomDebuff;
local VUHDO_getUnitOverallShieldRemain;
local sIsInverted;
local sBarColors;
......@@ -87,6 +89,7 @@ function VUHDO_bouquetValidatorsInitLocalOverrides()
VUHDO_getTexCoordsForCell = _G["VUHDO_getTexCoordsForCell"];
VUHDO_getUnitGroupPrivileges = _G["VUHDO_getUnitGroupPrivileges"];
VUHDO_getLatestCustomDebuff = _G["VUHDO_getLatestCustomDebuff"];
VUHDO_getUnitOverallShieldRemain = _G["VUHDO_getUnitOverallShieldRemain"];
sIsInverted = VUHDO_INDICATOR_CONFIG["CUSTOM"]["HEALTH_BAR"]["invertGrowth"];
sBarColors = VUHDO_PANEL_SETUP["BAR_COLORS"];
......@@ -192,7 +195,7 @@ end
--
local function VUHDO_isPhasedValidator(anInfo, _)
if VUHDO_unitIsWarModePhased(anInfo["unit"]) or not UnitInPhase(anInfo["unit"]) then
if VUHDO_unitPhaseReason(anInfo["unit"]) then
return true, "Interface\\TargetingFrame\\UI-PhasingIcon",
-1, -1, -1, nil, nil, 0.15625, 0.84375, 0.15625, 0.84375;
else
......@@ -204,12 +207,16 @@ end
--
local function VUHDO_isWarModePhasedValidator(anInfo, _)
if VUHDO_unitIsWarModePhased(anInfo["unit"]) then
local tPhaseReason = VUHDO_unitPhaseReason(anInfo["unit"]);
if tPhaseReason and tPhaseReason == Enum.PhaseReason.WarMode then
return true, "Interface\\TargetingFrame\\UI-PhasingIcon",
-1, -1, -1, nil, nil, 0.15625, 0.84375, 0.15625, 0.84375;
else
return false, nil, -1, -1, -1;
end
end
......@@ -709,8 +716,13 @@ end
local tHealth, tHealthMax;
local function VUHDO_statusHealthValidator(anInfo, _)
if sIsInverted then
return true, nil, anInfo["health"] + VUHDO_getIncHealOnUnit(anInfo["unit"]), -1,
anInfo["healthmax"], nil, anInfo["health"];
if VUHDO_CONFIG["SHOW_SHIELD_BAR"] then
tHealth = anInfo["health"] + VUHDO_getIncHealOnUnit(anInfo["unit"]) + VUHDO_getUnitOverallShieldRemain(anInfo["unit"]);
else
tHealth = anInfo["health"] + VUHDO_getIncHealOnUnit(anInfo["unit"]);
end
return true, nil, tHealth, -1, anInfo["healthmax"], nil, anInfo["health"];
else
return true, nil, anInfo["health"], -1,
anInfo["healthmax"], nil, anInfo["health"];
......@@ -735,6 +747,14 @@ end
--
local function VUHDO_statusPowerTankOnlyValidator(anInfo, _)
return (anInfo["powertype"] ~= 0 and anInfo["role"] == VUHDO_ID_MELEE_TANK), nil, anInfo["power"], -1,
anInfo["powermax"], VUHDO_copyColor(VUHDO_POWER_TYPE_COLORS[anInfo["powertype"] or 0]);
end
--
local function VUHDO_statusOtherPowersValidator(anInfo, _)
return anInfo["powertype"] ~= 0, nil, anInfo["power"], -1,
......@@ -766,7 +786,7 @@ end
local function VUHDO_statusExcessAbsorbValidator(anInfo, _)
local healthmax = anInfo["healthmax"];
local excessAbsorb = (VUHDO_unitGetTotalAbsorbs(anInfo["unit"]) or 0) + anInfo["health"] - healthmax;
local excessAbsorb = (UnitGetTotalAbsorbs(anInfo["unit"]) or 0) + anInfo["health"] - healthmax;
if excessAbsorb < 0 then
return true, nil, 0, -1, healthmax;
......@@ -779,7 +799,7 @@ end
--
local function VUHDO_statusTotalAbsorbValidator(anInfo, _)
return true, nil, VUHDO_unitGetTotalAbsorbs(anInfo["unit"]) or 0, -1, anInfo["healthmax"];
return true, nil, UnitGetTotalAbsorbs(anInfo["unit"]) or 0, -1, anInfo["healthmax"];
end
......@@ -1496,28 +1516,28 @@ VUHDO_BOUQUET_BUFFS_SPECIAL = {
["displayName"] = VUHDO_I18N_BOUQUET_HEALTH_BELOW,
["validator"] = VUHDO_healthBelowValidator,
["custom_type"] = VUHDO_BOUQUET_CUSTOM_TYPE_PERCENT,
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX, VUHDO_UPDATE_HEALTH_COMBAT_LOG },
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX },
},
["HEALTH_ABOVE"] = {
["displayName"] = VUHDO_I18N_BOUQUET_HEALTH_ABOVE,
["validator"] = VUHDO_healthAboveValidator,
["custom_type"] = VUHDO_BOUQUET_CUSTOM_TYPE_PERCENT,
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX, VUHDO_UPDATE_HEALTH_COMBAT_LOG },
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX },
},
["HEALTH_BELOW_ABS"] = {
["displayName"] = VUHDO_I18N_BOUQUET_HEALTH_BELOW_ABS,
["validator"] = VUHDO_healthBelowAbsValidator,
["custom_type"] = VUHDO_BOUQUET_CUSTOM_TYPE_HEALTH,
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX, VUHDO_UPDATE_HEALTH_COMBAT_LOG },
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX },
},
["HEALTH_ABOVE_ABS"] = {
["displayName"] = VUHDO_I18N_BOUQUET_HEALTH_ABOVE_ABS,
["validator"] = VUHDO_healthAboveAbsValidator,
["custom_type"] = VUHDO_BOUQUET_CUSTOM_TYPE_HEALTH,
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX, VUHDO_UPDATE_HEALTH_COMBAT_LOG },
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX },
},
["MANA_BELOW"] = {
......@@ -1655,7 +1675,7 @@ VUHDO_BOUQUET_BUFFS_SPECIAL = {
["displayName"] = VUHDO_I18N_BOUQUET_STATUS_HEALTH,
["validator"] = VUHDO_statusHealthValidator,
["custom_type"] = VUHDO_BOUQUET_CUSTOM_TYPE_STATUSBAR,
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX, VUHDO_UPDATE_INC, VUHDO_UPDATE_HEALTH_COMBAT_LOG },
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX, VUHDO_UPDATE_INC },
},
["STATUS_MANA"] = {
......@@ -1674,6 +1694,14 @@ VUHDO_BOUQUET_BUFFS_SPECIAL = {
["interests"] = { VUHDO_UPDATE_MANA, VUHDO_UPDATE_DC },
},
["STATUS_POWER_TANK_ONLY"] = {
["displayName"] = VUHDO_I18N_BOUQUET_STATUS_POWER_TANK_ONLY,
["validator"] = VUHDO_statusPowerTankOnlyValidator,
["custom_type"] = VUHDO_BOUQUET_CUSTOM_TYPE_STATUSBAR,
["no_color"] = true,
["interests"] = { VUHDO_UPDATE_OTHER_POWERS, VUHDO_UPDATE_DC },
},
["STATUS_OTHER_POWERS"] = {
["displayName"] = VUHDO_I18N_BOUQUET_STATUS_OTHER_POWERS,
["validator"] = VUHDO_statusOtherPowersValidator,
......@@ -1700,7 +1728,7 @@ VUHDO_BOUQUET_BUFFS_SPECIAL = {
["displayName"] = VUHDO_I18N_BOUQUET_STATUS_EXCESS_ABSORB,
["validator"] = VUHDO_statusExcessAbsorbValidator,
["custom_type"] = VUHDO_BOUQUET_CUSTOM_TYPE_STATUSBAR,
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX, VUHDO_UPDATE_SHIELD, VUHDO_UPDATE_HEALTH_COMBAT_LOG },
["interests"] = { VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_HEALTH_MAX, VUHDO_UPDATE_SHIELD },
},
["STATUS_TOTAL_ABSORB"] = {
......@@ -1974,7 +2002,7 @@ VUHDO_BOUQUET_BUFFS_SPECIAL = {
["validator"] = VUHDO_customFlagValidator,
["custom_type"] = VUHDO_BOUQUET_CUSTOM_TYPE_CUSTOM_FLAG,
["updateCyclic"] = true,
["interests"] = { VUHDO_UPDATE_INC, VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_RANGE, VUHDO_UPDATE_HEALTH_MAX, VUHDO_UPDATE_ALIVE, VUHDO_UPDATE_NUM_CLUSTER ,VUHDO_UPDATE_HEALTH_COMBAT_LOG}, --ignoring some for now (eg. VUHDO_UPDATE_MANA, VUHDO_UPDATE_DC, etc.)
["interests"] = { VUHDO_UPDATE_INC, VUHDO_UPDATE_HEALTH, VUHDO_UPDATE_RANGE, VUHDO_UPDATE_HEALTH_MAX, VUHDO_UPDATE_ALIVE, VUHDO_UPDATE_NUM_CLUSTER }, --ignoring some for now (eg. VUHDO_UPDATE_MANA, VUHDO_UPDATE_DC, etc.)
},
};
......
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