diff --git a/classes/class_custom.lua b/classes/class_custom.lua index 3fb49608..8095db11 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -536,9 +536,9 @@ if (instance.use_multi_fontstrings) then if (type(value) == "string") then - instance:SetTextsOnLine(row, "", value, percent) --usando essa linha + instance:SetInLineTexts(row, "", value, percent) --usando essa linha else - instance:SetTextsOnLine(row, "", SelectedToKFunction(_, value), percent) + instance:SetInLineTexts(row, "", SelectedToKFunction(_, value), percent) end else @@ -558,7 +558,7 @@ row.lineText4:SetText (_string_replace (instance.row_info.textR_custom_text, formated_value, "", percent, self, combat, instance, rightText)) else if (instance.use_multi_fontstrings) then - instance:SetTextsOnLine(row, "", formated_value, percent) + instance:SetInLineTexts(row, "", formated_value, percent) else row.lineText4:SetText (rightText) row.lineText3:SetText("") diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 16fdf93e..6490aa3b 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -968,7 +968,7 @@ local bars_brackets = instance:GetBarBracket() -- if (instance.use_multi_fontstrings) then - instance:SetTextsOnLine(thisLine, "", (spell_damage and SelectedToKFunction (_, spell_damage) or ""), porcentagem) + instance:SetInLineTexts(thisLine, "", (spell_damage and SelectedToKFunction (_, spell_damage) or ""), porcentagem) else thisLine.lineText4:SetText ((spell_damage and SelectedToKFunction (_, spell_damage) or "") .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) end @@ -1157,7 +1157,7 @@ -- if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(thisLine, "", total_frags, porcentagem) + instancia:SetInLineTexts(thisLine, "", total_frags, porcentagem) else thisLine.lineText4:SetText (total_frags .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) end @@ -1576,7 +1576,7 @@ thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_damage, formated_dps, porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(thisLine, formated_damage, formated_dps, porcentagem) + instancia:SetInLineTexts(thisLine, formated_damage, formated_dps, porcentagem) else thisLine.lineText4:SetText (rightText) end @@ -2402,7 +2402,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex return Details:EndRefresh(instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh end -function Details:AutoAlignInLineFontStrings() +--[[exported]] function Details:AutoAlignInLineFontStrings() --if this instance is using in line texts, check the min distance and the length of strings to make them more spread appart if (self.use_multi_fontstrings and self.use_auto_align_multi_fontstrings) then @@ -2511,7 +2511,7 @@ end) local actor_class_color_r, actor_class_color_g, actor_class_color_b -- ~texts -function Details:SetTextsOnLine(thisLine, valueText, perSecondText, percentText) +--[[exported]] function Details:SetInLineTexts(thisLine, valueText, perSecondText, percentText) --set defaults local instance = self valueText = valueText or "" @@ -2637,7 +2637,7 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran thisLine.lineText4:SetText(_string_replace (instance.row_info.textR_custom_text, formated_damage, formated_dps, porcentagem, self, instance.showing, instance, rightText)) else if (instance.use_multi_fontstrings) then - instance:SetTextsOnLine(thisLine, formated_damage, formated_dps, porcentagem) + instance:SetInLineTexts(thisLine, formated_damage, formated_dps, porcentagem) else thisLine.lineText4:SetText(rightText) end @@ -2701,8 +2701,8 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran thisLine.lineText4:SetText (_string_replace (instance.row_info.textR_custom_text, formated_dps, formated_damage, porcentagem, self, instance.showing, instance, rightText)) else if (instance.use_multi_fontstrings) then - --instance:SetTextsOnLine(thisLine, formated_damage, formated_dps, porcentagem) - instance:SetTextsOnLine(thisLine, rightText) + --instance:SetInLineTexts(thisLine, formated_damage, formated_dps, porcentagem) + instance:SetInLineTexts(thisLine, rightText) else thisLine.lineText4:SetText(rightText) end @@ -2735,7 +2735,7 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran thisLine.lineText4:SetText (_string_replace (instance.row_info.textR_custom_text, formated_damage_taken, formated_dtps, porcentagem, self, instance.showing, instance, rightText)) else if (instance.use_multi_fontstrings) then - instance:SetTextsOnLine(thisLine, formated_damage_taken, formated_dtps, porcentagem) + instance:SetInLineTexts(thisLine, formated_damage_taken, formated_dtps, porcentagem) else thisLine.lineText4:SetText(rightText) end @@ -2761,7 +2761,7 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran thisLine.lineText4:SetText (_string_replace (instance.row_info.textR_custom_text, formated_friendly_fire, "", porcentagem, self, instance.showing, instance, rightText)) else if (instance.use_multi_fontstrings) then - instance:SetTextsOnLine(thisLine, "", formated_friendly_fire, porcentagem) + instance:SetInLineTexts(thisLine, "", formated_friendly_fire, porcentagem) else thisLine.lineText4:SetText(rightText) end @@ -2793,7 +2793,7 @@ function atributo_damage:RefreshLine (instance, lineContainer, whichRowLine, ran thisLine.lineText4:SetText (_string_replace (instance.row_info.textR_custom_text, formated_damage_taken, formated_dtps, porcentagem, self, instance.showing, instance, rightText)) else if (instance.use_multi_fontstrings) then - instance:SetTextsOnLine(thisLine, formated_damage_taken, formated_dtps, porcentagem) + instance:SetInLineTexts(thisLine, formated_damage_taken, formated_dtps, porcentagem) else thisLine.lineText4:SetText(rightText) end @@ -2985,7 +2985,10 @@ end bar.lineText3:SetTextColor(r, g, b, a) bar.lineText4:SetTextColor(r, g, b, a) end - + + if (instance.row_info.backdrop.use_class_colors) then + bar.lineBorder:SetVertexColor(r, g, b, a) + end end --[[ exported]] function Details:SetClassIcon (texture, instance, classe) --self is the actorObject diff --git a/classes/class_heal.lua b/classes/class_heal.lua index 38b1ba7d..fb15cf4e 100644 --- a/classes/class_heal.lua +++ b/classes/class_heal.lua @@ -438,7 +438,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo row1.minha_tabela = nil row1.lineText1:SetText (Loc ["STRING_TOTAL"]) if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time)) + instancia:SetInLineTexts(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time)) else row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") end @@ -508,7 +508,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo row1.lineText1:SetText (Loc ["STRING_TOTAL"]) -- if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(row1, "", _detalhes:ToK2(total), _detalhes:ToK(total / combat_time)) + instancia:SetInLineTexts(row1, "", _detalhes:ToK2(total), _detalhes:ToK(total / combat_time)) else row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") end @@ -659,7 +659,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu if (instancia.atributo == 5) then --> custom -- if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(thisLine, "", _detalhes:ToK (self.custom), porcentagem .. "%") + instancia:SetInLineTexts(thisLine, "", _detalhes:ToK (self.custom), porcentagem .. "%") else thisLine.lineText4:SetText (_detalhes:ToK (self.custom) .. " (" .. porcentagem .. "%)") end @@ -690,7 +690,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_heal, formated_hps, porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(thisLine, formated_heal, formated_hps, porcentagem) + instancia:SetInLineTexts(thisLine, formated_heal, formated_hps, porcentagem) else thisLine.lineText4:SetText(rightText) end @@ -721,7 +721,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_hps, formated_heal, porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(thisLine, formated_hps, formated_heal, porcentagem) + instancia:SetInLineTexts(thisLine, formated_hps, formated_heal, porcentagem) else thisLine.lineText4:SetText(rightText) end @@ -754,7 +754,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_overheal, "", overheal_percent, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(thisLine, "", formated_overheal, overheal_percent) + instancia:SetInLineTexts(thisLine, "", formated_overheal, overheal_percent) else thisLine.lineText4:SetText(rightText) end @@ -780,7 +780,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_healtaken, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(thisLine, "", formated_healtaken, porcentagem) + instancia:SetInLineTexts(thisLine, "", formated_healtaken, porcentagem) else thisLine.lineText4:SetText(rightText) end @@ -806,7 +806,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_enemyheal, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(thisLine, "", formated_enemyheal, porcentagem) + instancia:SetInLineTexts(thisLine, "", formated_enemyheal, porcentagem) else thisLine.lineText4:SetText(rightText) end @@ -831,7 +831,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_absorbs, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(thisLine, "", formated_absorbs, porcentagem) + instancia:SetInLineTexts(thisLine, "", formated_absorbs, porcentagem) else thisLine.lineText4:SetText(rightText) end @@ -856,7 +856,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu thisLine.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_absorbs, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(thisLine, "", formated_absorbs, porcentagem) + instancia:SetInLineTexts(thisLine, "", formated_absorbs, porcentagem) else thisLine.lineText4:SetText(rightText) end diff --git a/classes/class_resources.lua b/classes/class_resources.lua index a2b62819..803e4977 100644 --- a/classes/class_resources.lua +++ b/classes/class_resources.lua @@ -248,7 +248,7 @@ function atributo_energy:AtualizarResources (whichRowLine, colocacao, instancia) esta_barra.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_resource, formated_rps, porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(esta_barra, formated_resource, formated_rps .. " r/s", porcentagem .. "%") + instancia:SetInLineTexts(esta_barra, formated_resource, formated_rps .. " r/s", porcentagem .. "%") else esta_barra.lineText4:SetText (rightText) end @@ -526,7 +526,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex row1.minha_tabela = nil row1.lineText1:SetText (Loc ["STRING_TOTAL"]) if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(row1, "", _detalhes:ToK2 (total, _detalhes:ToK (total / combat_time))) + instancia:SetInLineTexts(row1, "", _detalhes:ToK2 (total, _detalhes:ToK (total / combat_time))) else row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") end @@ -587,7 +587,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex row1.lineText1:SetText (Loc ["STRING_TOTAL"]) if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time)) + instancia:SetInLineTexts(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time)) else row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") end @@ -693,7 +693,7 @@ function atributo_energy:RefreshLine (instancia, barras_container, whichRowLine, esta_barra.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_energy, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(esta_barra, "", formated_energy, porcentagem) + instancia:SetInLineTexts(esta_barra, "", formated_energy, porcentagem) else esta_barra.lineText4:SetText (rightText) end diff --git a/classes/class_utility.lua b/classes/class_utility.lua index badb64bc..c4c165e0 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -931,7 +931,7 @@ function atributo_misc:RefreshLine (instancia, barras_container, whichRowLine, l esta_barra.lineText4:SetText (_string_replace (instancia.row_info.textR_custom_text, meu_total, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then - instancia:SetTextsOnLine(esta_barra, "", meu_total, porcentagem) + instancia:SetInLineTexts(esta_barra, "", meu_total, porcentagem) else esta_barra.lineText4:SetText(rightText) end diff --git a/classes/include_instance.lua b/classes/include_instance.lua index 8ddb9e27..c0258ea0 100644 --- a/classes/include_instance.lua +++ b/classes/include_instance.lua @@ -282,7 +282,12 @@ _detalhes.instance_defaults = { --percent type percent_type = 1, --backdrop - backdrop = {enabled = false, size = 12, color = {1, 1, 1, 1}, texture = "Details BarBorder 2"}, --texture is deprecated + backdrop = { + enabled = false, + size = 12, + color = {1, 1, 1, 1}, + use_class_colors = false, + }, --model models = { upper_enabled = false, diff --git a/frames/window_main.lua b/frames/window_main.lua index 7a487d79..802cad57 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -4041,7 +4041,7 @@ end _detalhes.barras_criadas = 0 ---> search key: ~row ~barra +--> search key: ~row ~barra ~newbar ~createbar ~createrow function gump:CreateNewLine (instancia, index) --> instancia = window object, index = row number @@ -4092,7 +4092,8 @@ function gump:CreateNewLine (instancia, index) newLine.border:SetAllPoints (newLine) --border - local lineBorder + newLine.lineBorder = DetailsFramework:CreateFullBorder(newLine:GetName() .. "Border", newLine.border) + --[=[ if (DetailsFramework.IsTBCWow()) then lineBorder = DetailsFramework:CreateFullBorder(nil, newLine) --lineBorder = CreateFrame("frame", nil, newLine, "DFNamePlateFullBorderTemplate, BackdropTemplate") @@ -4100,7 +4101,7 @@ function gump:CreateNewLine (instancia, index) lineBorder = CreateFrame("frame", nil, newLine, "NamePlateFullBorderTemplate, BackdropTemplate") end newLine.lineBorder = lineBorder - + --]=] -- search key: ~model --low 3d bar @@ -4277,20 +4278,27 @@ function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, self:InstanceRefreshRows() end -function _detalhes:SetBarBackdropSettings (enabled, size, color) --argumente texture removed on shadowlands beta - if (type (enabled) ~= "boolean") then +function _detalhes:SetBarBackdropSettings (enabled, size, color, use_class_colors) + if (type(enabled) ~= "boolean") then enabled = self.row_info.backdrop.enabled end + if (not size) then size = self.row_info.backdrop.size end + if (not color) then color = self.row_info.backdrop.color end + + if (type(use_class_colors) ~= "boolean") then + use_class_colors = self.row_info.backdrop.use_class_colors + end self.row_info.backdrop.enabled = enabled self.row_info.backdrop.size = size self.row_info.backdrop.color = color + self.row_info.backdrop.use_class_colors = use_class_colors self:InstanceReset() self:InstanceRefreshRows() diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index 6ec61ce5..2261c46b 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -1540,6 +1540,17 @@ do desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_SIZE_DESC"], }, + {--border uses class colors + type = "toggle", + get = function() return currentInstance.row_info.backdrop.use_class_colors end, + set = function (self, fixedparam, value) + editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, nil, value) + afterUpdate() + end, + name = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"], + desc = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"], + }, + {type = "blank"}, {type = "label", get = function() return Loc["STRING_OPTIONS_ALIGNED_TEXT_COLUMNS"] end, text_template = subSectionTitleTextTemplate},