Skip to content

Commit

Permalink
Fixes for the Aligned Text Column feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Feb 24, 2022
1 parent 27f6967 commit e9b27b6
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 49 deletions.
8 changes: 6 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

local version, build, date, tocversion = GetBuildInfo()

_detalhes.build_counter = 9694
_detalhes.alpha_build_counter = 9694 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 9696
_detalhes.alpha_build_counter = 9696 --if this is higher than the regular counter, use it instead
_detalhes.bcc_counter = 31
_detalhes.dont_open_news = true
_detalhes.game_version = version
Expand All @@ -33,6 +33,10 @@ do
local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" )

local news = {
{"v9.2.0.9696.146", "February 24th, 2022"},
"Fixed DPS display when using Aligned Text Columns.",
"Fixed percent showing even it's disabled when using Aligned Text Columns.",

{"v9.2.0.9255.146", "February 22th, 2022"},
"Added Cosmic Healing Potion to script 'Health Potion & Stone'.",

Expand Down
6 changes: 3 additions & 3 deletions classes/class_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,9 @@

if (instance.use_multi_fontstrings) then
if (type(value) == "string") then
Details:SetTextsOnLine(row, "", value, percent) --usando essa linha
instance:SetTextsOnLine(row, "", value, percent) --usando essa linha
else
Details:SetTextsOnLine(row, "", SelectedToKFunction(_, value), percent)
instance:SetTextsOnLine(row, "", SelectedToKFunction(_, value), percent)
end

else
Expand All @@ -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
Details:SetTextsOnLine(row, "", formated_value, percent)
instance:SetTextsOnLine(row, "", formated_value, percent)
else
row.lineText4:SetText (rightText)
row.lineText3:SetText("")
Expand Down
69 changes: 40 additions & 29 deletions classes/class_damage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -920,41 +920,41 @@
return Details:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true})
end

function atributo_damage:AtualizarBySpell (tabela, whichRowLine, colocacao, instancia)
function atributo_damage:AtualizarBySpell (tabela, whichRowLine, colocacao, instance)
tabela ["byspell"] = true --> marca que esta tabela � uma tabela de frags, usado no controla na hora de montar o tooltip
local thisLine = instancia.barras [whichRowLine] --> pega a refer�ncia da barra na janela
local thisLine = instance.barras [whichRowLine] --> pega a refer�ncia da barra na janela

if (not thisLine) then
print ("DEBUG: problema com <instancia.thisLine> "..whichRowLine .. " " .. colocacao)
print ("DEBUG: problema com <instance.thisLine> "..whichRowLine .. " " .. colocacao)
return
end

thisLine.minha_tabela = tabela

local spellname, _, spellicon = _GetSpellInfo (tabela [1])

tabela.nome = spellname --> evita dar erro ao redimencionar a janela
tabela.minha_barra = whichRowLine
thisLine.colocacao = colocacao

if (not _getmetatable (tabela)) then
_setmetatable (tabela, {__call = RefreshBarraBySpell})
tabela._custom = true
end

local total = instancia.showing.totals.by_spell
local total = instance.showing.totals.by_spell
local porcentagem
if (instancia.row_info.percent_type == 1) then

if (instance.row_info.percent_type == 1) then
porcentagem = _cstr ("%.1f", tabela [2] / total * 100)
elseif (instancia.row_info.percent_type == 2) then
porcentagem = _cstr ("%.1f", tabela [2] / instancia.top * 100)
elseif (instance.row_info.percent_type == 2) then
porcentagem = _cstr ("%.1f", tabela [2] / instance.top * 100)
end

thisLine.lineText1:SetText (colocacao .. ". " .. spellname)

local bars_show_data = instancia.row_info.textR_show_data

thisLine.lineText1:SetText(colocacao .. ". " .. spellname)

local bars_show_data = instance.row_info.textR_show_data

local spell_damage = tabela [2] -- spell_damage passar por uma ToK function, precisa ser number
if (not bars_show_data [1]) then
spell_damage = tabela [2] --damage taken by spell n�o tem PS, ent�o � obrigado a passar o dano total
Expand All @@ -965,10 +965,10 @@
porcentagem = porcentagem .. "%"
end

local bars_brackets = instancia:GetBarBracket()
local bars_brackets = instance:GetBarBracket()
--
if (instancia.use_multi_fontstrings) then
Details:SetTextsOnLine(thisLine, "", (spell_damage and SelectedToKFunction (_, spell_damage) or ""), porcentagem)
if (instance.use_multi_fontstrings) then
instance:SetTextsOnLine(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
Expand All @@ -983,14 +983,14 @@
if (colocacao == 1) then
thisLine:SetValue (100)
else
thisLine:SetValue (tabela [2] / instancia.top * 100)
thisLine:SetValue (tabela [2] / instance.top * 100)
end

if (thisLine.hidden or thisLine.fading_in or thisLine.faded) then
Details.FadeHandler.Fader (thisLine, "out")
end

if (instancia.row_info.texture_class_colors) then
if (instance.row_info.texture_class_colors) then
if (tabela [3] > 1) then
local r, g, b = Details:GetSpellSchoolColor (tabela [3])
thisLine.textura:SetVertexColor (r, g, b)
Expand Down Expand Up @@ -1157,7 +1157,7 @@

--
if (instancia.use_multi_fontstrings) then
Details:SetTextsOnLine(thisLine, "", total_frags, porcentagem)
instancia:SetTextsOnLine(thisLine, "", total_frags, porcentagem)
else
thisLine.lineText4:SetText (total_frags .. bars_brackets[1] .. porcentagem .. bars_brackets[2])
end
Expand Down Expand Up @@ -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
Details:SetTextsOnLine(thisLine, formated_damage, formated_dps, porcentagem)
instancia:SetTextsOnLine(thisLine, formated_damage, formated_dps, porcentagem)
else
thisLine.lineText4:SetText (rightText)
end
Expand Down Expand Up @@ -2405,10 +2405,20 @@ local actor_class_color_r, actor_class_color_g, actor_class_color_b
-- ~texts
function Details:SetTextsOnLine(thisLine, valueText, perSecondText, percentText)
--set defaults
local instance = self
valueText = valueText or ""
perSecondText = perSecondText or ""
percentText = percentText or ""

--check if the instance is showing total, dps and percent
local instanceSettings = instance.row_info
if (not instanceSettings.textR_show_data[3]) then --percent text disabled on options panel
local attributeId = instance:GetDisplay()
if (attributeId ~= 5) then --not custom
percentText = ""
end
end

--parse information
if (percentText ~= "") then --has percent text
thisLine.lineText4:SetText(percentText)
Expand Down Expand Up @@ -2519,7 +2529,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
Details:SetTextsOnLine(thisLine, formated_damage, formated_dps, porcentagem)
instance:SetTextsOnLine(thisLine, formated_damage, formated_dps, porcentagem)
else
thisLine.lineText4:SetText(rightText)
end
Expand Down Expand Up @@ -2583,7 +2593,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
Details:SetTextsOnLine(thisLine, formated_damage, formated_dps, porcentagem)
--instance:SetTextsOnLine(thisLine, formated_damage, formated_dps, porcentagem)
instance:SetTextsOnLine(thisLine, rightText)
else
thisLine.lineText4:SetText(rightText)
end
Expand Down Expand Up @@ -2616,7 +2627,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
Details:SetTextsOnLine(thisLine, formated_damage_taken, formated_dtps, porcentagem)
instance:SetTextsOnLine(thisLine, formated_damage_taken, formated_dtps, porcentagem)
else
thisLine.lineText4:SetText(rightText)
end
Expand All @@ -2642,7 +2653,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
Details:SetTextsOnLine(thisLine, "", formated_friendly_fire, porcentagem)
instance:SetTextsOnLine(thisLine, "", formated_friendly_fire, porcentagem)
else
thisLine.lineText4:SetText(rightText)
end
Expand Down Expand Up @@ -2674,7 +2685,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
Details:SetTextsOnLine(thisLine, formated_damage_taken, formated_dtps, porcentagem)
instance:SetTextsOnLine(thisLine, formated_damage_taken, formated_dtps, porcentagem)
else
thisLine.lineText4:SetText(rightText)
end
Expand Down
20 changes: 10 additions & 10 deletions classes/class_heal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Details:SetTextsOnLine(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time))
instancia:SetTextsOnLine(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time))
else
row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")")
end
Expand Down Expand Up @@ -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
Details:SetTextsOnLine(row1, "", _detalhes:ToK2(total), _detalhes:ToK(total / combat_time))
instancia:SetTextsOnLine(row1, "", _detalhes:ToK2(total), _detalhes:ToK(total / combat_time))
else
row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")")
end
Expand Down Expand Up @@ -657,7 +657,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu
if (instancia.atributo == 5) then --> custom
--
if (instancia.use_multi_fontstrings) then
Details:SetTextsOnLine(thisLine, "", _detalhes:ToK (self.custom), porcentagem .. "%")
instancia:SetTextsOnLine(thisLine, "", _detalhes:ToK (self.custom), porcentagem .. "%")
else
thisLine.lineText4:SetText (_detalhes:ToK (self.custom) .. " (" .. porcentagem .. "%)")
end
Expand Down Expand Up @@ -688,7 +688,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
Details:SetTextsOnLine(thisLine, formated_heal, formated_hps, porcentagem)
instancia:SetTextsOnLine(thisLine, formated_heal, formated_hps, porcentagem)
else
thisLine.lineText4:SetText(rightText)
end
Expand Down Expand Up @@ -719,7 +719,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
Details:SetTextsOnLine(thisLine, formated_hps, formated_heal, porcentagem)
instancia:SetTextsOnLine(thisLine, formated_hps, formated_heal, porcentagem)
else
thisLine.lineText4:SetText(rightText)
end
Expand Down Expand Up @@ -752,7 +752,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
Details:SetTextsOnLine(thisLine, "", formated_overheal, overheal_percent)
instancia:SetTextsOnLine(thisLine, "", formated_overheal, overheal_percent)
else
thisLine.lineText4:SetText(rightText)
end
Expand All @@ -778,7 +778,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
Details:SetTextsOnLine(thisLine, "", formated_healtaken, porcentagem)
instancia:SetTextsOnLine(thisLine, "", formated_healtaken, porcentagem)
else
thisLine.lineText4:SetText(rightText)
end
Expand All @@ -804,7 +804,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
Details:SetTextsOnLine(thisLine, "", formated_enemyheal, porcentagem)
instancia:SetTextsOnLine(thisLine, "", formated_enemyheal, porcentagem)
else
thisLine.lineText4:SetText(rightText)
end
Expand All @@ -829,7 +829,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
Details:SetTextsOnLine(thisLine, "", formated_absorbs, porcentagem)
instancia:SetTextsOnLine(thisLine, "", formated_absorbs, porcentagem)
else
thisLine.lineText4:SetText(rightText)
end
Expand All @@ -854,7 +854,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
Details:SetTextsOnLine(thisLine, "", formated_absorbs, porcentagem)
instancia:SetTextsOnLine(thisLine, "", formated_absorbs, porcentagem)
else
thisLine.lineText4:SetText(rightText)
end
Expand Down
8 changes: 4 additions & 4 deletions classes/class_resources.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Details:SetTextsOnLine(esta_barra, formated_resource, formated_rps .. " r/s", porcentagem .. "%")
instancia:SetTextsOnLine(esta_barra, formated_resource, formated_rps .. " r/s", porcentagem .. "%")
else
esta_barra.lineText4:SetText (rightText)
end
Expand Down Expand Up @@ -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
Details:SetTextsOnLine(row1, "", _detalhes:ToK2 (total, _detalhes:ToK (total / combat_time)))
instancia:SetTextsOnLine(row1, "", _detalhes:ToK2 (total, _detalhes:ToK (total / combat_time)))
else
row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")")
end
Expand Down Expand Up @@ -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
Details:SetTextsOnLine(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time))
instancia:SetTextsOnLine(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time))
else
row1.lineText4:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")")
end
Expand Down Expand Up @@ -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
Details:SetTextsOnLine(esta_barra, "", formated_energy, porcentagem)
instancia:SetTextsOnLine(esta_barra, "", formated_energy, porcentagem)
else
esta_barra.lineText4:SetText (rightText)
end
Expand Down
2 changes: 1 addition & 1 deletion classes/class_utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Details:SetTextsOnLine(esta_barra, "", meu_total, porcentagem)
instancia:SetTextsOnLine(esta_barra, "", meu_total, porcentagem)
else
esta_barra.lineText4:SetText(rightText)
end
Expand Down

0 comments on commit e9b27b6

Please sign in to comment.