From f3af2b075980900f2b0b72d9c5dcc4328d47cbe0 Mon Sep 17 00:00:00 2001 From: Continuity Date: Wed, 4 Oct 2023 19:58:51 +0200 Subject: [PATCH] - Fix `extraStatusbar` showing in wrong views (non-player-dmg) --- classes/class_damage.lua | 6 ++++-- classes/class_instance.lua | 1 + core/windows.lua | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 59b8120a6..2f034536f 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -2994,8 +2994,8 @@ end ---@param onEnterFunc function? ---@param onLeaveFunc function? function Details:ShowExtraStatusbar(thisLine, amount, extraAmount, totalAmount, topAmount, instanceObject, onEnterFunc, onLeaveFunc) - if (extraAmount and extraAmount > 0) then - local extraStatusbar = thisLine.extraStatusbar + local extraStatusbar = thisLine.extraStatusbar + if (extraAmount and extraAmount > 0 and instanceObject.atributo == 1 and instanceObject.sub_atributo == 1) then local initialOffset = 0 local icon_offset_x, icon_offset_y = unpack(instanceObject.row_info.icon_offset) @@ -3034,6 +3034,8 @@ function Details:ShowExtraStatusbar(thisLine, amount, extraAmount, totalAmount, extraStatusbar.defaultAlpha = 0.1 end extraStatusbar:Show() + else + extraStatusbar:Hide() end end diff --git a/classes/class_instance.lua b/classes/class_instance.lua index 580cac310..98d7aa805 100644 --- a/classes/class_instance.lua +++ b/classes/class_instance.lua @@ -290,6 +290,7 @@ local instanceMixins = { thisBar.minha_tabela = nil thisBar.animacao_fim = 0 thisBar.animacao_fim2 = 0 + if thisBar.extraStatusbar then thisBar.extraStatusbar:Hide() end end if (instance.rolagem) then diff --git a/core/windows.lua b/core/windows.lua index 55bd9982b..297258bbb 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -624,6 +624,7 @@ esta_barra.minha_tabela = nil esta_barra.animacao_fim = 0 esta_barra.animacao_fim2 = 0 + if esta_barra.extraStatusbar then esta_barra.extraStatusbar:Hide() end end if (instancia.rolagem) then