- Added custom display 'Dynamic Overall Damage' for mythic dungeons.

- Fix for Ticket #168: 'Auto Hide While [Not] Inside Instance is broken'.
- The bar truncate frame 'DetailsLeftTextAntiTruncate' is now created on Details! load instead on demand.
This commit is contained in:
Tercio
2017-02-07 13:20:55 -02:00
parent 183bc0bdd1
commit b12688cae2
4 changed files with 151 additions and 18 deletions
+7 -6
View File
File diff suppressed because one or more lines are too long
+120
View File
@@ -2326,6 +2326,126 @@
----------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local DynamicOverallDamage = {
name = "Dynamic Overall Damage",
icon = [[Interface\ICONS\Achievement_Quests_Completed_08]],
attribute = false,
spellid = false,
author = "Details!",
desc = "Show overall damage done on the fly.",
source = false,
target = false,
script_version = 1,
script = [[
--init:
local combat, instance_container, instance = ...
local total, top, amount = 0, 0, 0
--get the overall combat
local OverallCombat = Details:GetCombat (-1)
--get the current combat
local CurrentCombat = Details:GetCombat (0)
--get the damage actor container for overall
local damage_container_overall = combat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE )
--get the damage actor container for current
local damage_container_current = combat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE )
--do the loop:
for _, player in ipairs ( damage_container_overall ) do
--only player in group
if (player:IsGroupPlayer()) then
instance_container:AddValue (player, player.total)
end
end
for _, player in ipairs ( damage_container_current ) do
--only player in group
if (player:IsGroupPlayer()) then
instance_container:AddValue (player, player.total)
end
end
total, top = instance_container:GetTotalAndHighestValue()
amount = instance_container:GetNumActors()
--return:
return total, top, amount
]],
tooltip = [[
--get the parameters passed
local actor, combat, instance = ...
--get the cooltip object (we dont use the convencional GameTooltip here)
local GameCooltip = GameCooltip2
--Cooltip code
--get the overall combat
local OverallCombat = Details:GetCombat (-1)
--get the current combat
local CurrentCombat = Details:GetCombat (0)
local AllSpells = {}
--overall
local player = OverallCombat [1]:GetActor (actor.nome)
local playerSpells = player:GetSpellList()
for spellID, spellTable in pairs (playerSpells) do
AllSpells [spellID] = spellTable.total
end
--current
local player = CurrentCombat [1]:GetActor (actor.nome)
local playerSpells = player:GetSpellList()
for spellID, spellTable in pairs (playerSpells) do
AllSpells [spellID] = (AllSpells [spellID] or 0) + (spellTable.total or 0)
end
local sortedList = {}
for spellID, total in pairs (AllSpells) do
tinsert (sortedList, {spellID, total})
end
table.sort (sortedList, Details.Sort2)
local format_func = Details:GetCurrentToKFunction()
--build the tooltip
for i, t in ipairs (sortedList) do
local spellID, total = unpack (t)
if (total > 1) then
local spellName, _, spellIcon = Details.GetSpellInfo (spellID)
GameCooltip:AddLine (spellName, format_func (_, total))
Details:AddTooltipBackgroundStatusbar()
GameCooltip:AddIcon (spellIcon, 1, 1, 14, 14)
end
end
]],
}
local have = false
for _, custom in ipairs (self.custom) do
if (custom.name == "Dynamic Overall Damage" and (custom.script_version and custom.script_version >= DynamicOverallDamage.script_version) ) then
have = true
break
end
end
if (not have) then
for i, custom in ipairs (self.custom) do
if (custom.name == "Dynamic Overall Damage") then
table.remove (self.custom, i)
end
end
setmetatable (DynamicOverallDamage, _detalhes.atributo_custom)
DynamicOverallDamage.__index = _detalhes.atributo_custom
self.custom [#self.custom+1] = DynamicOverallDamage
end
---------------------------------------
_detalhes:ResetCustomFunctionsCache()
end
+6
View File
@@ -3422,6 +3422,12 @@ SPELL_POWER_OBSOLETE2 = 15;
if (_detalhes.last_zone_type ~= zoneType) then
_detalhes:SendEvent ("ZONE_TYPE_CHANGED", nil, zoneType)
_detalhes.last_zone_type = zoneType
for index, instancia in ipairs (_detalhes.tabela_instancias) do
if (instancia.ativa and instancia.hide_in_combat_type ~= 1) then --> 1 = none, we doesn't need to call
instancia:SetCombatAlpha (nil, nil, true)
end
end
end
_detalhes.time_type = _detalhes.time_type_original
+18 -12
View File
@@ -1868,6 +1868,14 @@ local barra_backdrop_onleave = {
insets = {left = 1, right = 1, top = 0, bottom = 1}
}
--> pre creating the truncate frame
_detalhes.left_anti_truncate = CreateFrame ("frame", "DetailsLeftTextAntiTruncate", UIParent)
_detalhes.left_anti_truncate:SetBackdrop (gump_fundo_backdrop)
_detalhes.left_anti_truncate:SetBackdropColor (0, 0, 0, 0.8)
_detalhes.left_anti_truncate:SetFrameStrata ("FULLSCREEN")
_detalhes.left_anti_truncate.text = _detalhes.left_anti_truncate:CreateFontString (nil, "overlay", "GameFontNormal")
_detalhes.left_anti_truncate.text:SetPoint ("left", _detalhes.left_anti_truncate, "left", 3, 0)
local barra_scripts_onenter = function (self)
self.mouse_over = true
OnEnterMainWindow (self._instance, self)
@@ -1888,12 +1896,7 @@ local barra_scripts_onenter = function (self)
local lefttext = self.texto_esquerdo
if (lefttext:IsTruncated()) then
if (not _detalhes.left_anti_truncate) then
_detalhes.left_anti_truncate = CreateFrame ("frame", "DetailsLeftTextAntiTruncate", UIParent)
_detalhes.left_anti_truncate:SetBackdrop (gump_fundo_backdrop)
_detalhes.left_anti_truncate:SetBackdropColor (0, 0, 0, 0.8)
_detalhes.left_anti_truncate:SetFrameStrata ("FULLSCREEN")
_detalhes.left_anti_truncate.text = _detalhes.left_anti_truncate:CreateFontString (nil, "overlay", "GameFontNormal")
_detalhes.left_anti_truncate.text:SetPoint ("left", _detalhes.left_anti_truncate, "left", 3, 0)
end
_detalhes:SetFontSize (_detalhes.left_anti_truncate.text, self._instance.row_info.font_size)
@@ -4878,6 +4881,7 @@ function _detalhes:SetWindowAlphaForInteract (alpha)
end
-- ~autohide ãutohide
function _detalhes:SetWindowAlphaForCombat (entering_in_combat, true_hide)
local amount, rowsamount, menuamount
@@ -6660,17 +6664,19 @@ function _detalhes:SetCombatAlpha (modify_type, alpha_amount, interacting)
end
elseif (self.hide_in_combat_type == 5) then --"While Not Inside Instance"
if ((_detalhes.zone_type == "raid" or _detalhes.zone_type == "party") and IsInInstance()) then
self:SetWindowAlphaForCombat (true, true) --> hida a janela
else
local isInInstance = IsInInstance()
if (isInInstance or _detalhes.zone_type == "raid" or _detalhes.zone_type == "party") then
self:SetWindowAlphaForCombat (false) --> deshida a janela
else
self:SetWindowAlphaForCombat (true, true) --> hida a janela
end
elseif (self.hide_in_combat_type == 6) then --"While Inside Instance"
if ((_detalhes.zone_type == "raid" or _detalhes.zone_type == "party") and IsInInstance()) then
self:SetWindowAlphaForCombat (false) --> deshida a janela
else
local isInInstance = IsInInstance()
if (isInInstance or _detalhes.zone_type == "raid" or _detalhes.zone_type == "party") then
self:SetWindowAlphaForCombat (true, true) --> hida a janela
else
self:SetWindowAlphaForCombat (false) --> deshida a janela
end
elseif (self.hide_in_combat_type == 7) then --"Raid Debug" = Out of Combat and Inside Raid or Dungeon