Added Details:GetTop5Actors(attributeId) and Details:GetActorByRank(attributeId, rankIndex)

This commit is contained in:
Tercio Jose
2022-06-14 13:48:14 -03:00
parent 2482a06132
commit 72bd44b973
3 changed files with 51 additions and 3 deletions
+42
View File
@@ -314,6 +314,48 @@ function Details:GetNumLinesShown() --alis of _detalhes:GetNumRows()
return self.rows_fit_in_window
end
--@attributeId: DETAILS_ATTRIBUTE_DAMAGE, DETAILS_ATTRIBUTE_HEAL
function Details:GetTop5Actors(attributeId)
local combatObject = self.showing
if (combatObject) then
local container = combatObject:GetContainer(attributeId)
if (container) then
local actorTable = container._ActorTable
return actorTable[1], actorTable[2], actorTable[3], actorTable[4], actorTable[5]
end
end
end
--@attributeId: DETAILS_ATTRIBUTE_DAMAGE, DETAILS_ATTRIBUTE_HEAL
--@rankIndex: the rank id of the actor shown in the window
function Details:GetActorByRank(attributeId, rankIndex)
local combatObject = self.showing
if (combatObject) then
local container = combatObject:GetContainer(attributeId)
if (container) then
return container._ActorTable[rankIndex]
end
end
--[=[
local firstRow = window1:GetLine(1)
if (firstRow and firstRow:IsShown()) then
local actor = firstRow:GetActor()
if (actor) then
local total = actor.total
local combatTime = Details:GetCurrentCombat():GetCombatTime()
print("dps:", total/combatTime)
end
end
local actorTable = container._ActorTable
for i = 1, #actorTable do
local actor = actorTable[rankIndex]
return actor
end
--]=]
end
------------------------------------------------------------------------------------------------------------------------
--> retorna se a instncia esta ou no ativa