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
+3 -3
View File
@@ -2691,9 +2691,9 @@ if (DetailsFramework.IsTBCWow()) then
ShamanEnhancement = 263,
ShamanRestoration = 264,
WarlockCurses = 265,
WarlockDestruction = 266,
WarlockSummoning = 267,
WarlockCurses = 265, --affliction
WarlockSummoning = 266, --demo
WarlockDestruction = 267, --destruction
--WarriorArm = 71,
WarriorArms = 71,
+6
View File
@@ -4053,6 +4053,10 @@ end
_detalhes.barras_criadas = 0
local getActor = function(self)
return self.minha_tabela
end
--> search key: ~row ~barra ~newbar ~createbar ~createrow
function gump:CreateNewLine (instancia, index)
@@ -4067,6 +4071,8 @@ function gump:CreateNewLine (instancia, index)
newLine.instance_id = instancia.meu_id
newLine.animacao_fim = 0
newLine.animacao_fim2 = 0
newLine.GetActor = getActor
--> set point, almost irrelevant here, it recalc this on SetBarGrowDirection()
local y = instancia.row_height * (index-1)