- Make sure the actor isn't a fight component before the garbage collector erases it.

- Do not do trash cleanups during mythic+ dungeon runs.
- Do not overrite a fight component or group state if the new value is false during a merge.
This commit is contained in:
Tercioo
2019-03-14 20:30:51 -03:00
parent 5b90fbbf3c
commit b7b90f6d5e
9 changed files with 217 additions and 111 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
local dversion = 143
local dversion = 144
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
+69
View File
@@ -9378,4 +9378,73 @@ f:Hide()
--]=]
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> error message box
function DF:ShowErrorMessage (errorMessage, titleText)
if (not DF.ErrorMessagePanel) then
local f = CreateFrame ("frame", "DetailsFrameworkErrorMessagePanel", UIParent)
f:SetSize (400, 120)
f:SetFrameStrata ("FULLSCREEN")
f:SetPoint ("center", UIParent, "center", 0, 100)
f:EnableMouse (true)
f:SetMovable (true)
f:RegisterForDrag ("LeftButton")
f:SetScript ("OnDragStart", function() f:StartMoving() end)
f:SetScript ("OnDragStop", function() f:StopMovingOrSizing() end)
f:SetScript ("OnMouseDown", function (self, button) if (button == "RightButton") then f:Hide() end end)
tinsert (UISpecialFrames, "DetailsFrameworkErrorMessagePanel")
DF.ErrorMessagePanel = f
DF:CreateTitleBar (f, "Details! Framework Error!")
DF:ApplyStandardBackdrop (f)
local errorLabel = f:CreateFontString (nil, "overlay", "GameFontNormal")
errorLabel:SetPoint ("top", f, "top", 0, -25)
errorLabel:SetJustifyH ("center")
errorLabel:SetSize (360, 66)
f.errorLabel = errorLabel
local button_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")
local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
local closeButton = DF:CreateButton (f, nil, 60, 20, "close", nil, nil, nil, nil, nil, nil, options_dropdown_template)
closeButton:SetPoint ("bottom", f, "bottom", 0, 5)
f.closeButton = closeButton
closeButton:SetClickFunction (function()
f:Hide()
end)
f.ShowAnimation = DF:CreateAnimationHub (f, function()
f:SetBackdropBorderColor (0, 0, 0, 0)
f.TitleBar:SetBackdropBorderColor (0, 0, 0, 0)
end, function()
f:SetBackdropBorderColor (0, 0, 0, 1)
f.TitleBar:SetBackdropBorderColor (0, 0, 0, 1)
end)
DF:CreateAnimation (f.ShowAnimation, "scale", 1, .075, .2, .2, 1.1, 1.1, "center", 0, 0)
DF:CreateAnimation (f.ShowAnimation, "scale", 2, .075, 1, 1, .90, .90, "center", 0, 0)
f.FlashTexture = f:CreateTexture (nil, "overlay")
f.FlashTexture:SetColorTexture (1, 1, 1, 1)
f.FlashTexture:SetAllPoints()
f.FlashAnimation = DF:CreateAnimationHub (f.FlashTexture, function() f.FlashTexture:Show() end, function() f.FlashTexture:Hide() end)
DF:CreateAnimation (f.FlashAnimation, "alpha", 1, .075, 0, .05)
DF:CreateAnimation (f.FlashAnimation, "alpha", 2, .075, .1, 0)
f:Hide()
end
DF.ErrorMessagePanel:Show()
DF.ErrorMessagePanel.errorLabel:SetText (errorMessage)
DF.ErrorMessagePanel.TitleLabel:SetText (titleText)
DF.ErrorMessagePanel.ShowAnimation:Play()
DF.ErrorMessagePanel.FlashAnimation:Play()
end
--functionn falsee truee breakk elsea endz
+1 -1
View File
@@ -5,7 +5,7 @@
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
_detalhes.build_counter = 6923
_detalhes.alpha_build_counter = 6968 --if this is higher than the regular counter, use it instead
_detalhes.alpha_build_counter = 6992 --if this is higher than the regular counter, use it instead
_detalhes.game_version = "v8.1.0"
_detalhes.userversion = "v8.1.0." .. _detalhes.build_counter
_detalhes.realversion = 136 --core version, this is used to check API version for scripts and plugins (see alias below)
+3 -3
View File
@@ -653,9 +653,9 @@
shadow = _detalhes.atributo_misc:r_connect_shadow (actor, true, custom_combat)
end
shadow.boss_fight_component = actor.boss_fight_component
shadow.fight_component = actor.fight_component
shadow.grupo = actor.grupo
shadow.boss_fight_component = actor.boss_fight_component or shadow.boss_fight_component
shadow.fight_component = actor.fight_component or shadow.fight_component
shadow.grupo = actor.grupo or shadow.grupo
end
end
+36 -3
View File
@@ -5048,11 +5048,19 @@ end
shadow.end_time = time()
end
shadow.boss_fight_component = actor.boss_fight_component or shadow.boss_fight_component
shadow.fight_component = actor.fight_component or shadow.fight_component
shadow.grupo = actor.grupo or shadow.grupo
--check if need to restore meta tables and indexes for this actor
if (not no_refresh) then
_detalhes.refresh:r_atributo_damage (actor, shadow)
end
--a referência do .owner pode ter sido apagada?
--os 2 segmentos foram juntados porém a referência do owner de um pet criado ali em cima deve ser nula?
--teria que analisar se o novo objecto é de um pet e colocar a referência do owner no pet novamente, ou pelo menos verificar se a referência é valida
--> tempo decorrido (captura de dados)
local end_time = actor.end_time
if (not actor.end_time) then
@@ -5063,9 +5071,19 @@ end
shadow.start_time = shadow.start_time - tempo
--> pets (add unique pet names)
for _, petName in _ipairs (actor.pets) do
DetailsFramework.table.addunique (shadow.pets, petName)
end
for _, petName in _ipairs (actor.pets) do
local hasPet = false
for i = 1, #shadow.pets do
if (shadow.pets[i] == petName) then
hasPet = true
break
end
end
if (not hasPet) then
shadow.pets [#shadow.pets+1] = petName
end
end
--> total de dano (captura de dados)
shadow.total = shadow.total + actor.total
@@ -5172,6 +5190,21 @@ atributo_damage.__add = function (tabela1, tabela2)
tabela1.damage_from [nome] = true
end
--> pets (add unique pet names)
for _, petName in _ipairs (tabela2.pets) do
local hasPet = false
for i = 1, #tabela1.pets do
if (tabela1.pets[i] == petName) then
hasPet = true
break
end
end
if (not hasPet) then
tabela1.pets [#tabela1.pets+1] = petName
end
end
--> soma os containers de alvos
for target_name, amount in _pairs (tabela2.targets) do
tabela1.targets [target_name] = (tabela1.targets [target_name] or 0) + amount
+2 -1
View File
@@ -291,6 +291,7 @@ function historico:adicionar (tabela)
local container_damage = _segundo_combate [1]
local container_heal = _segundo_combate [2]
--regular cleanup
for _, jogador in ipairs (container_damage._ActorTable) do
--> remover a tabela de last events
jogador.last_events_table = nil
@@ -312,7 +313,7 @@ function historico:adicionar (tabela)
local _terceiro_combate = self.tabelas[3]
if (_terceiro_combate) then
if (_terceiro_combate and not _terceiro_combate.is_mythic_dungeon_segment) then
if ((_terceiro_combate.is_trash and not _terceiro_combate.is_boss) or (_terceiro_combate.is_temporary)) then
--> verificar novamente a time machine
+99 -96
View File
@@ -531,16 +531,17 @@
while (_iter.data) do --search key: ~deletar ~apagar
local can_erase = true
if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component or _iter.data.pvp_component) then
if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component or _iter.data.pvp_component or _iter.data.fight_component) then
can_erase = false
else
local owner = _iter.data.owner
if (owner) then
local owner_actor = _combate [class_type]._NameIndexTable [owner.nome]
if (owner_actor) then
local owner_actor = _combate [class_type]._ActorTable [owner_actor]
if (owner_actor) then
if (owner.grupo or owner.boss or owner.boss_fight_component) then
if (owner.grupo or owner.boss or owner.boss_fight_component or owner.fight_component) then
can_erase = false
end
end
@@ -594,115 +595,117 @@
end
end
for class_type, _tabela in _ipairs (todos_atributos) do
local conteudo = _tabela._ActorTable
if (not _combate.is_mythic_dungeon_segment) then
for class_type, _tabela in _ipairs (todos_atributos) do
local conteudo = _tabela._ActorTable
--> Limpa tabelas que no estejam em grupo
if (conteudo) then
--> Limpa tabelas que no estejam em grupo
if (conteudo) then
if (_detalhes.clear_ungrouped) then
--no deleta dummies e actors de fora do grupo
--if (not _detalhes.clear_ungrouped) then
local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index
if (_detalhes.clear_ungrouped) then
--no deleta dummies e actors de fora do grupo
--if (not _detalhes.clear_ungrouped) then
local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index
while (_iter.data) do --search key: ~deletar ~apagar
local can_erase = true
if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component or IsBossEncounter or _iter.data.pvp_component) then
can_erase = false
else
local owner = _iter.data.owner
if (owner) then
local owner_actor = _combate [class_type]._NameIndexTable [owner.nome]
if (owner_actor) then
local owner_actor = _combate [class_type]._ActorTable [owner_actor]
while (_iter.data) do --search key: ~deletar ~apagar
local can_erase = true
if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component or IsBossEncounter or _iter.data.pvp_component or _iter.data.fight_component) then
can_erase = false
else
local owner = _iter.data.owner
if (owner) then
local owner_actor = _combate [class_type]._NameIndexTable [owner.nome]
if (owner_actor) then
if (owner.grupo or owner.boss or owner.boss_fight_component) then
can_erase = false
local owner_actor = _combate [class_type]._ActorTable [owner_actor]
if (owner_actor) then
if (owner.grupo or owner.boss or owner.boss_fight_component or owner.fight_component) then
can_erase = false
end
end
end
end
end
if (can_erase) then
if (not _iter.data.owner) then --> pet
local myself = _iter.data
if (myself.tipo == class_type_dano or myself.tipo == class_type_cura) then
_combate.totals [myself.tipo] = _combate.totals [myself.tipo] - myself.total
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] = _combate.totals_grupo [myself.tipo] - myself.total
end
elseif (myself.tipo == class_type_e_energy) then
_combate.totals [myself.tipo] [myself.powertype] = _combate.totals [myself.tipo] [myself.powertype] - myself.total
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] [myself.powertype] = _combate.totals_grupo [myself.tipo] [myself.powertype] - myself.total
end
elseif (myself.tipo == class_type_misc) then
if (myself.cc_break) then
_combate.totals [myself.tipo] ["cc_break"] = _combate.totals [myself.tipo] ["cc_break"] - myself.cc_break
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["cc_break"] = _combate.totals_grupo [myself.tipo] ["cc_break"] - myself.cc_break
end
end
if (myself.ress) then
_combate.totals [myself.tipo] ["ress"] = _combate.totals [myself.tipo] ["ress"] - myself.ress
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["ress"] = _combate.totals_grupo [myself.tipo] ["ress"] - myself.ress
end
end
--> no precisa diminuir o total dos buffs e debuffs
if (myself.cooldowns_defensive) then
_combate.totals [myself.tipo] ["cooldowns_defensive"] = _combate.totals [myself.tipo] ["cooldowns_defensive"] - myself.cooldowns_defensive
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["cooldowns_defensive"] = _combate.totals_grupo [myself.tipo] ["cooldowns_defensive"] - myself.cooldowns_defensive
end
end
if (myself.interrupt) then
_combate.totals [myself.tipo] ["interrupt"] = _combate.totals [myself.tipo] ["interrupt"] - myself.interrupt
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["interrupt"] = _combate.totals_grupo [myself.tipo] ["interrupt"] - myself.interrupt
end
end
if (myself.dispell) then
_combate.totals [myself.tipo] ["dispell"] = _combate.totals [myself.tipo] ["dispell"] - myself.dispell
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["dispell"] = _combate.totals_grupo [myself.tipo] ["dispell"] - myself.dispell
end
end
if (myself.dead) then
_combate.totals [myself.tipo] ["dead"] = _combate.totals [myself.tipo] ["dead"] - myself.dead
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["dead"] = _combate.totals_grupo [myself.tipo] ["dead"] - myself.dead
end
end
end
end
_table_remove (conteudo, _iter.index)
_iter.cleaned = _iter.cleaned + 1
_iter.data = conteudo [_iter.index]
else
_iter.index = _iter.index + 1
_iter.data = conteudo [_iter.index]
end
end
if (can_erase) then
if (not _iter.data.owner) then --> pet
local myself = _iter.data
if (myself.tipo == class_type_dano or myself.tipo == class_type_cura) then
_combate.totals [myself.tipo] = _combate.totals [myself.tipo] - myself.total
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] = _combate.totals_grupo [myself.tipo] - myself.total
end
elseif (myself.tipo == class_type_e_energy) then
_combate.totals [myself.tipo] [myself.powertype] = _combate.totals [myself.tipo] [myself.powertype] - myself.total
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] [myself.powertype] = _combate.totals_grupo [myself.tipo] [myself.powertype] - myself.total
end
elseif (myself.tipo == class_type_misc) then
if (myself.cc_break) then
_combate.totals [myself.tipo] ["cc_break"] = _combate.totals [myself.tipo] ["cc_break"] - myself.cc_break
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["cc_break"] = _combate.totals_grupo [myself.tipo] ["cc_break"] - myself.cc_break
end
end
if (myself.ress) then
_combate.totals [myself.tipo] ["ress"] = _combate.totals [myself.tipo] ["ress"] - myself.ress
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["ress"] = _combate.totals_grupo [myself.tipo] ["ress"] - myself.ress
end
end
--> no precisa diminuir o total dos buffs e debuffs
if (myself.cooldowns_defensive) then
_combate.totals [myself.tipo] ["cooldowns_defensive"] = _combate.totals [myself.tipo] ["cooldowns_defensive"] - myself.cooldowns_defensive
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["cooldowns_defensive"] = _combate.totals_grupo [myself.tipo] ["cooldowns_defensive"] - myself.cooldowns_defensive
end
end
if (myself.interrupt) then
_combate.totals [myself.tipo] ["interrupt"] = _combate.totals [myself.tipo] ["interrupt"] - myself.interrupt
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["interrupt"] = _combate.totals_grupo [myself.tipo] ["interrupt"] - myself.interrupt
end
end
if (myself.dispell) then
_combate.totals [myself.tipo] ["dispell"] = _combate.totals [myself.tipo] ["dispell"] - myself.dispell
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["dispell"] = _combate.totals_grupo [myself.tipo] ["dispell"] - myself.dispell
end
end
if (myself.dead) then
_combate.totals [myself.tipo] ["dead"] = _combate.totals [myself.tipo] ["dead"] - myself.dead
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["dead"] = _combate.totals_grupo [myself.tipo] ["dead"] - myself.dead
end
end
end
end
_table_remove (conteudo, _iter.index)
_iter.cleaned = _iter.cleaned + 1
_iter.data = conteudo [_iter.index]
else
_iter.index = _iter.index + 1
_iter.data = conteudo [_iter.index]
if (_iter.cleaned > 0) then
ReconstroiMapa (_tabela)
end
end
if (_iter.cleaned > 0) then
ReconstroiMapa (_tabela)
end
end
end
end
end --end is mythic dungeon segment
end
--> panic mode
+5 -5
View File
@@ -939,12 +939,12 @@
if (not este_jogador) then --> pode ser um desconhecido ou um pet
este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true)
if (meu_dono) then --> é um pet
if (meu_dono) then --> um pet
if (who_serial ~= "") then
damage_cache_pets [who_serial] = este_jogador
damage_cache_petsOwners [who_serial] = meu_dono
end
--conferir se o dono já esta no cache
--conferir se o dono j esta no cache
if (not damage_cache [meu_dono.serial] and meu_dono.serial ~= "") then
damage_cache [meu_dono.serial] = meu_dono
end
@@ -963,7 +963,7 @@
end
elseif (meu_dono) then
--> é um pet
--> um pet
who_name = who_name .. " <" .. meu_dono.nome .. ">"
end
@@ -3085,13 +3085,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true)
if (meu_dono) then --> é um pet
if (meu_dono) then --> um pet
if (who_serial ~= "") then
misc_cache_pets [who_serial] = este_jogador
misc_cache_petsOwners [who_serial] = meu_dono
end
--conferir se o dono já esta no cache
--conferir se o dono j esta no cache
if (not misc_cache [meu_dono.serial] and meu_dono.serial ~= "") then
misc_cache [meu_dono.serial] = meu_dono
end
+1 -1
View File
@@ -7531,7 +7531,7 @@ function _detalhes:SetBackdropTexture (texturename)
end
-- ~alpha (transparency of buttons on the toolbar) ~autohide ãutohide ~menuauto
-- ~alpha (transparency of buttons on the toolbar) ~autohide utohide ~menuauto
function _detalhes:SetAutoHideMenu (left, right, interacting)
--30/07/2018: the separation by left and right menu icons doesn't exists for years, but it was still active in the code making