From b15d002c045703fa071cbd5c8ff8e4cff62d216a Mon Sep 17 00:00:00 2001 From: Flamanis Date: Fri, 27 Jan 2023 15:00:40 -0600 Subject: [PATCH 1/5] Only hide not used barras3 and add tooltip for barras3 --- classes/class_damage.lua | 38 ++++++++++++++++++++----------- classes/class_heal.lua | 13 +++++++---- classes/class_resources.lua | 14 ++++++++---- classes/class_utility.lua | 12 ++++++---- frames/window_playerbreakdown.lua | 4 ++++ 5 files changed, 56 insertions(+), 25 deletions(-) diff --git a/classes/class_damage.lua b/classes/class_damage.lua index aafa0051..a375ddb6 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -4753,10 +4753,6 @@ end ------ Detalhe Info Friendly Fire function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) - for _, barra in ipairs(info.barras3) do - barra:Hide() - end - local barras = info.barras3 local instancia = info.instancia @@ -4781,9 +4777,10 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) _table_sort(minhas_magias, Details.Sort2) local max_ = minhas_magias[1] and minhas_magias[1][2] or 0 --dano que a primeiro magia vez - + local lastIndex = 1 local barra for index, tabela in ipairs(minhas_magias) do + lastIndex = index barra = barras [index] if (not barra) then --se a barra n�o existir, criar ela ent�o @@ -4791,6 +4788,8 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o end + barra.show = tabela[1] + if (index == 1) then barra.textura:SetValue(100) else @@ -4810,15 +4809,15 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) end end + for i = lastIndex+1, #barras do + barras[i]:Hide() + end + end -- detalhes info enemies function atributo_damage:MontaDetalhesEnemy (spellid, barra) - for _, barra in ipairs(info.barras3) do - barra:Hide() - end - local container = info.instancia.showing[1] local barras = info.barras3 local instancia = info.instancia @@ -4857,8 +4856,10 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) local max_ = target_pool [1] and target_pool [1][2] or 0 + local lastIndex = 1 local barra for index, tabela in ipairs(target_pool) do + lastIndex = index barra = barras [index] if (not barra) then --se a barra n�o existir, criar ela ent�o @@ -4866,6 +4867,8 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o end + barra.show = tabela[1] + if (index == 1) then barra.textura:SetValue(100) else @@ -4903,15 +4906,16 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) end end + for i = lastIndex+1, #barras do + barras[i]:Hide() + end + + end ------ Detalhe Info Damage Taken function atributo_damage:MontaDetalhesDamageTaken (nome, barra) - for _, barra in ipairs(info.barras3) do - barra:Hide() - end - local barras = info.barras3 local instancia = info.instancia @@ -4947,8 +4951,10 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra) local max_ = minhas_magias[1] and minhas_magias[1][2] or 0 --dano que a primeiro magia vez + local lastIndex = 1 local barra for index, tabela in ipairs(minhas_magias) do + lastIndex = index barra = barras [index] if (not barra) then --se a barra n�o existir, criar ela ent�o @@ -4956,6 +4962,8 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra) barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o end + barra.show = tabela[1] + if (index == 1) then barra.textura:SetValue(100) else @@ -4977,6 +4985,10 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra) end end + for i = lastIndex+1, #barras do + barras[i]:Hide() + end + end ------ Detalhe Info Damage Done e Dps diff --git a/classes/class_heal.lua b/classes/class_heal.lua index 4eefea8a..6a9f4e2a 100644 --- a/classes/class_heal.lua +++ b/classes/class_heal.lua @@ -2130,10 +2130,6 @@ end function atributo_heal:MontaDetalhesHealingTaken (nome, barra) - for _, barra in ipairs(info.barras3) do - barra:Hide() - end - local barras = info.barras3 local instancia = info.instancia @@ -2160,8 +2156,10 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra) local max_ = minhas_magias[1] and minhas_magias[1][2] or 0 --dano que a primeiro magia vez + local lastIndex = 1 local barra for index, tabela in ipairs(minhas_magias) do + lastIndex = index barra = barras [index] if (not barra) then --se a barra n�o existir, criar ela ent�o @@ -2169,6 +2167,8 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra) barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o end + barra.show = tabela[1] + if (index == 1) then barra.textura:SetValue(100) else @@ -2186,6 +2186,11 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra) break end end + + for i = lastIndex+1, #barras do + barras[i]:Hide() + end + end local absorbed_table = {c = {1, 1, 1, 0.4}, p = 0} diff --git a/classes/class_resources.lua b/classes/class_resources.lua index 1fa0ed9a..40deae53 100644 --- a/classes/class_resources.lua +++ b/classes/class_resources.lua @@ -1211,10 +1211,6 @@ function atributo_energy:MontaInfoRegenRecebido() end function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) - - for _, barra in ipairs(info.barras3) do - barra:Hide() - end reset_tooltips_table() @@ -1262,12 +1258,15 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) local max_ = energy_tooltips_table [1][2] + local lastIndex = 1 local barra for index, tabela in ipairs(from) do if (tabela [2] < 1) then break end + + lastIndex = index barra = barras [index] @@ -1275,6 +1274,8 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) barra = gump:CriaNovaBarraInfo3 (instancia, index) barra.textura:SetStatusBarColor(1, 1, 1, 1) end + + barra.show = tabela[1] if (index == 1) then barra.textura:SetValue(100) @@ -1296,6 +1297,11 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) break end end + + for i = lastIndex+1, #barras do + barras[i]:Hide() + end + end function atributo_energy:MontaTooltipAlvos (esta_barra, index) diff --git a/classes/class_utility.lua b/classes/class_utility.lua index a048ac99..c052ee0b 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -2213,10 +2213,6 @@ end ------ Detalhe Info Interrupt function atributo_misc:MontaDetalhesInterrupt (spellid, barra) - for _, barra in ipairs(info.barras3) do - barra:Hide() - end - local esta_magia = self.interrupt_spells._ActorTable [spellid] if (not esta_magia) then return @@ -2245,8 +2241,10 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) table.sort (habilidades_alvos, _detalhes.Sort2) local max_ = habilidades_alvos[1][2] + local lastIndex = 1 local barra for index, tabela in ipairs(habilidades_alvos) do + lastIndex = index barra = barras [index] if (not barra) then --se a barra n�o existir, criar ela ent�o @@ -2254,6 +2252,8 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o end + barra.show = tabela[1] + if (index == 1) then barra.textura:SetValue(100) else @@ -2274,6 +2274,10 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) end end + for i = lastIndex+1, #barras do + barras[i]:Hide() + end + end diff --git a/frames/window_playerbreakdown.lua b/frames/window_playerbreakdown.lua index 8d7eab03..1a27930c 100644 --- a/frames/window_playerbreakdown.lua +++ b/frames/window_playerbreakdown.lua @@ -5592,6 +5592,10 @@ local row_on_enter = function(self) info.jogador.detalhes = self.show --minha tabela = jogador = jogador.detales = spellid ou nome que esta sendo mostrado na direita info.jogador:MontaDetalhes (self.show, self, info.instancia) --passa a spellid ou nome e a barra end + elseif (self.isDetalhe and type(self.show) == "number") then + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT") + Details:GameTooltipSetSpellByID(self.show) + GameTooltip:Show() end end From 47ca70bbb6c8b54ff2a5628a6e08a8bdeda16fc0 Mon Sep 17 00:00:00 2001 From: Flamanis Date: Sat, 28 Jan 2023 03:21:43 -0600 Subject: [PATCH 2/5] Don't save a SwiitchBack table when leaving combat --- classes/class_instance.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/class_instance.lua b/classes/class_instance.lua index 881efd46..244b2f85 100644 --- a/classes/class_instance.lua +++ b/classes/class_instance.lua @@ -1705,11 +1705,11 @@ function _detalhes:CheckSwitchOnCombatEnd (nowipe, warning) local got_switch = false if (role == "DAMAGER" and self.switch_damager) then - self:SwitchTo (self.switch_damager) + self:SwitchTo (self.switch_damager, true) got_switch = true elseif (role == "HEALER" and self.switch_healer) then - self:SwitchTo (self.switch_healer) + self:SwitchTo (self.switch_healer, true) got_switch = true elseif (role == "TANK" and self.switch_tank) then From d3ae474e4dd76ae369c95cd9dec36e4dbd809406 Mon Sep 17 00:00:00 2001 From: "SVENT\\Eric" Date: Mon, 30 Jan 2023 17:10:26 +0100 Subject: [PATCH 3/5] Fix edge case where player bar isn't always shown. --- classes/class_damage.lua | 4 ++-- classes/class_heal.lua | 4 ++-- classes/class_resources.lua | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/class_damage.lua b/classes/class_damage.lua index aafa0051..b048fc3e 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -2330,7 +2330,7 @@ function atributo_damage:RefreshWindow(instancia, combatObject, forcar, exportar Details.FadeHandler.Fader(row1, "out") totalBarIsShown = true - if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then + if (following and myPos and myPos+1 > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[1], iterLast-1, 1 do if (actorTableContent[i]) then actorTableContent[i]:RefreshLine(instancia, lineContainer, whichRowLine, i, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) @@ -2400,7 +2400,7 @@ function atributo_damage:RefreshWindow(instancia, combatObject, forcar, exportar Details.FadeHandler.Fader(row1, "out") totalBarIsShown = true - if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then + if (following and myPos and myPos+1 > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then actorTableContent[myPos]:RefreshLine(instancia, lineContainer, whichRowLine, myPos, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) whichRowLine = whichRowLine+1 for i = iter_last-1, instancia.barraS[1], -1 do diff --git a/classes/class_heal.lua b/classes/class_heal.lua index 4eefea8a..63dc074b 100644 --- a/classes/class_heal.lua +++ b/classes/class_heal.lua @@ -449,7 +449,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo Details.FadeHandler.Fader(row1, "out") - if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then + if (following and myPos and myPos+1 > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[1], iter_last-1, 1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then conteudo[i]:RefreshLine(instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) @@ -519,7 +519,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo Details.FadeHandler.Fader(row1, "out") - if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then + if (following and myPos and myPos+1 > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then conteudo[myPos]:RefreshLine(instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 for i = iter_last-1, instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado diff --git a/classes/class_resources.lua b/classes/class_resources.lua index 1fa0ed9a..ef0f0e04 100644 --- a/classes/class_resources.lua +++ b/classes/class_resources.lua @@ -539,7 +539,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex Details.FadeHandler.Fader(row1, "out") - if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then + if (following and myPos and myPos+1 > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[1], iter_last-1, 1 do --vai atualizar s� o range que esta sendo mostrado conteudo[i]:RefreshLine(instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 @@ -600,7 +600,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex Details.FadeHandler.Fader(row1, "out") - if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then + if (following and myPos and myPos+1 > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then conteudo[myPos]:RefreshLine(instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 for i = iter_last-1, instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado From d2a33a456beb45109f3b1ce29ff6562324e7a2d8 Mon Sep 17 00:00:00 2001 From: Flamanis Date: Tue, 31 Jan 2023 15:49:19 -0600 Subject: [PATCH 4/5] Remove Ignore Pain Spec Guessing --- functions/spells.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/functions/spells.lua b/functions/spells.lua index 5e95dce9..1d7e2b56 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -466,7 +466,6 @@ do [871] = 73, --Shield Wall [1161] = 73, --Challenging Shout [394062] = 73, --Rend - [190456] = 73, --Ignore Pain [385952] = 73, --Shield Charge [392966] = 73, --Spell Block From e4c3960de3d713a0ec59a981277f072c135c8cb8 Mon Sep 17 00:00:00 2001 From: Flamanis Date: Tue, 7 Feb 2023 06:08:52 -0600 Subject: [PATCH 5/5] Fix onAcquire dispatch for FramePools --- Libs/DF/fw.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 6a74cf2d..b10420ef 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -4915,7 +4915,7 @@ do if (newObject) then tinsert(self.inUse, newObject) if (self.onAcquire) then - DF:QuickDispatch(self.onAcquire, object) + DF:QuickDispatch(self.onAcquire, newObject) end return newObject, true end