diff --git a/Definitions.lua b/Definitions.lua index 9af365aec..90e1967f3 100644 --- a/Definitions.lua +++ b/Definitions.lua @@ -529,7 +529,7 @@ ---@field freezed boolean ---@field sub_atributo_last table ---@field row_info table ----@field +---@field show_interrupt_casts boolean ---@field ---@field ---@field GetActorBySubDisplayAndRank fun(self: instance, displayid: attributeid, subDisplay: attributeid, rank: number) : actor diff --git a/classes/class_utility.lua b/classes/class_utility.lua index c23e2c029..6ba446309 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -956,6 +956,11 @@ function atributo_misc:RefreshLine(instancia, barras_container, whichRowLine, lu local tabela_anterior = esta_barra.minha_tabela + ---@cast instancia instance + + ---@type combat + local combatObject = instancia:GetCombat() + esta_barra.minha_tabela = self esta_barra.colocacao = lugar @@ -986,6 +991,32 @@ function atributo_misc:RefreshLine(instancia, barras_container, whichRowLine, lu porcentagem = porcentagem .. "%" end + if (instancia.show_interrupt_casts) then + if (sub_atributo == DETAILS_SUBATTRIBUTE_INTERRUPT) then --interrupts + --get the interrupt spell for this actor class from libOpenRaid + if (LIB_OPEN_RAID_SPELL_INTERRUPT_BYCLASS) then + ---@type table + local classInterrupts = LIB_OPEN_RAID_SPELL_INTERRUPT_BYCLASS[self.classe] + if (classInterrupts) then + ---@type table number is the amount of casts + local spellCasts = combatObject.amountCasts[self.nome] + local amountOfInterruptsCasted = 0 + --iterating between the spells that are interrupts for this class + for spellNameOrId in pairs(classInterrupts) do + --if the actor casted this spell + if (spellCasts[spellNameOrId]) then + amountOfInterruptsCasted = amountOfInterruptsCasted + spellCasts[spellNameOrId] + end + end + + if (amountOfInterruptsCasted > 0) then + meu_total = meu_total .. " (" .. tostring(amountOfInterruptsCasted) .. ")" + end + end + end + end + end + local rightText = meu_total .. bars_brackets[1] .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then esta_barra.lineText4:SetText(_string_replace(instancia.row_info.textR_custom_text, meu_total, "", porcentagem, self, instancia.showing, instancia, rightText)) diff --git a/classes/include_instance.lua b/classes/include_instance.lua index ee8f9d853..27494225d 100644 --- a/classes/include_instance.lua +++ b/classes/include_instance.lua @@ -122,6 +122,8 @@ _detalhes.instance_defaults = { bg_g = 0.0941, bg_b = 0.0941, backdrop_texture = "Details Ground", + --show amount of interrupts the player casted + show_interrupt_casts = false, --auto current auto_current = true, --show sidebars diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index 2f002efc3..e23705af7 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -2961,7 +2961,7 @@ do usedecimals = true, step = 0.5, name = Loc ["STRING_OPTIONS_GROUPING_HORIZONTAL_GAP"], - desc = Loc ["STRING_OPTIONS_GROUPING_HORIZONTAL_GAP_DESC"], + desc = Loc ["STRING_OPTIONS_GROUPING_HORIZONTAL_GAP"], thumbscale = 2.2, },