added commentator stuff, general code cleanup and better formatting, some deprecated code removed

This commit is contained in:
Tercio Jose
2024-07-09 12:47:24 -03:00
committed by andrew6180
parent af3477354a
commit 00f04959cb
20 changed files with 1602 additions and 1596 deletions
+24 -19
View File
@@ -2586,19 +2586,20 @@ end
--space between string4 and string3 (usually dps is 4 and total value is 3)
for lineId = 1, self:GetNumLinesShown() do
local thisLine = self:GetLine(lineId)
if (thisLine) then
--check strings 3 and 4
if (thisLine.lineText4:GetText() ~= "" and thisLine.lineText3:GetText() ~= "") then
--the length of the far right string determines the space between it and the next string in the left
local stringLength = thisLine.lineText4:GetStringWidth()
maxStringLength_StringFour = stringLength > maxStringLength_StringFour and stringLength or maxStringLength_StringFour
end
--check strings 3 and 4
if (thisLine.lineText4:GetText() ~= "" and thisLine.lineText3:GetText() ~= "") then
--the length of the far right string determines the space between it and the next string in the left
local stringLength = thisLine.lineText4:GetStringWidth()
maxStringLength_StringFour = stringLength > maxStringLength_StringFour and stringLength or maxStringLength_StringFour
end
--check strings 2 and 3
if (thisLine.lineText2:GetText() ~= "" and thisLine.lineText3:GetText() ~= "") then
--the length of the middle string determines the space between it and the next string in the left
local stringLength = thisLine.lineText3:GetStringWidth()
maxStringLength_StringThree = stringLength > maxStringLength_StringThree and stringLength or maxStringLength_StringThree
--check strings 2 and 3
if (thisLine.lineText2:GetText() ~= "" and thisLine.lineText3:GetText() ~= "") then
--the length of the middle string determines the space between it and the next string in the left
local stringLength = thisLine.lineText3:GetStringWidth()
maxStringLength_StringThree = stringLength > maxStringLength_StringThree and stringLength or maxStringLength_StringThree
end
end
end
@@ -2619,7 +2620,9 @@ end
--update the lines
for lineId = 1, self:GetNumLinesShown() do
local thisLine = self:GetLine(lineId)
thisLine.lineText3:SetPoint("right", thisLine.statusbar, "right", -newOffset, profileYOffset)
if (thisLine) then
thisLine.lineText3:SetPoint("right", thisLine.statusbar, "right", -newOffset, profileYOffset)
end
end
end
@@ -2640,7 +2643,9 @@ end
--update the lines
for lineId = 1, self:GetNumLinesShown() do
local thisLine = self:GetLine(lineId)
thisLine.lineText2:SetPoint("right", thisLine.statusbar, "right", -newOffset, profileYOffset)
if (thisLine) then
thisLine.lineText2:SetPoint("right", thisLine.statusbar, "right", -newOffset, profileYOffset)
end
end
end
end
@@ -2651,7 +2656,7 @@ end
--check if there's something showing in this line
--check if the line is shown and if the text exists for sanitization
if (thisLine.minha_tabela and thisLine:IsShown() and thisLine.lineText1:GetText()) then
if (thisLine and thisLine.minha_tabela and thisLine:IsShown() and thisLine.lineText1:GetText()) then
local playerNameFontString = thisLine.lineText1
local text2 = thisLine.lineText2
local text3 = thisLine.lineText3
@@ -2663,10 +2668,10 @@ end
DetailsFramework:TruncateTextSafe(playerNameFontString, self.cached_bar_width - totalWidth) --this avoid truncated strings with ...
--these commented lines are for to create a cache and store the name already truncated there to safe performance
--local truncatedName = playerNameFontString:GetText()
--local actorObject = thisLine.minha_tabela
--actorObject.name_cached = truncatedName
--actorObject.name_cached_time = GetTime()
--local truncatedName = playerNameFontString:GetText()
--local actorObject = thisLine.minha_tabela
--actorObject.name_cached = truncatedName
--actorObject.name_cached_time = GetTime()
end
end
end
+2 -2
View File
@@ -2594,7 +2594,7 @@ function Details:AtualizaSegmentos_AfterCombat(instancia)
instancia.v_barras = true
instancia:ResetaGump()
instancia:RefreshMainWindow(true)
Details:AtualizarJanela (instancia)
Details:UpdateWindow (instancia)
elseif (segmento < Details.segments_amount and segmento > 0) then
instancia.showing = segmentsTable[segmento]
@@ -2605,7 +2605,7 @@ function Details:AtualizaSegmentos_AfterCombat(instancia)
instancia.v_barras = true
instancia:ResetaGump()
instancia:RefreshMainWindow(true)
Details:AtualizarJanela (instancia)
Details:UpdateWindow (instancia)
end
end
+3 -3
View File
@@ -306,7 +306,7 @@ end
return ipairs(self._ActorTable)
end
---return a table<actorIndex, actorObject> for all actors stored in this Container
---return a table with actor[] for all actors stored in this container
---@return table
function actorContainer:GetActorTable()
return self._ActorTable
@@ -315,8 +315,8 @@ end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--internals
---create a new actor container, can be a damage container, heal container, enemy container or utility container
---actors can be added by using newContainer.GetOrCreateActor
---create a new actor container, can be a damage container, heal container, resource container or utility container
---actors can be added by using the method newContainer:GetOrCreateActor(actorGuid, actorName, actorFlags, bShouldCreateActor)
---actors can be retrieved using the same function above
---@param containerType number
---@param combatObject table
+1 -1
View File
@@ -26,7 +26,7 @@ function Details:ResetSegmentOverallData()
return segmentClass:ResetOverallData()
end
--reset segments and overall data
--erase all combat data stored
function Details:ResetSegmentData()
return segmentClass:ResetAllCombatData()
end