breakdown 2.0

This commit is contained in:
Tercio Jose
2023-04-09 22:26:05 -03:00
parent e55a818fb7
commit 50d848e1d1
21 changed files with 2847 additions and 1911 deletions
+184 -36
View File
@@ -4,6 +4,7 @@
---@field RegisterStateDriver fun(statedriver: frame, attribute: string, conditional: string)
---@field UnitGUID fun(unit: unit): string
---@field UnitName fun(unit: unit): string
---@field GetCursorPosition fun(): number, number return the position of the cursor on the screen, in pixels, relative to the bottom left corner of the screen.
---@class unixtime : number const
@@ -23,7 +24,7 @@
---@class color : table, string @table(r: red|number, g: green|number, b: blue|number, a: alpha|number) @string(color name) @hex (000000-ffffff) value representing a color, the value must be a table with the following fields: r, g, b, a. r, g, b are numbers between 0 and 1, a is a number between 0 and 1. To retrieve a color from a string or table use: local red, green, blue, alpha = DetailsFramework:ParseColors(color)
---@class scale : number @number(0.65-2.40) value representing the scale factor of the UIObject, the value must be between 0.65 and 2.40, the width and height of the UIObject will be multiplied by this value.
---@class texture : string, number is an object that represents a graphical image. Textures are used to display visual elements such as icons, backgrounds, borders, and more.
---@class frame : UIObject represents a container for other UI elements, such as textures, buttons, text, and more.
---@class frame : uiobject represents a container for other UI elements, such as textures, buttons, text, and more.
---@class width : number property that represents the horizontal size of a UI element, such as a frame or a texture.
---@class height : number property that represents the vertical size of a UI element, such as a frame or a texture.
---@class script : string, function is a piece of code that is executed in response to a specific event, such as a button click or a frame update. Scripts can be used to implement behavior and logic for UI elements.
@@ -34,30 +35,30 @@
---@class health : number amount of hit points (health) of a unit. This value can be changed by taking damage or healing.
---@class role : string @string(TANK, HEALER, DAMAGER, NONE) is a string that represents the role of a unit, such as tank, healer, or damage dealer.
---@class UIObject
---@field Show fun(self: UIObject)
---@field Hide fun(self: UIObject)
---@field SetShown fun(self: UIObject, state: boolean)
---@field IsShown fun(self: UIObject) : boolean
---@field SetAllPoints fun(self: UIObject)
---@field SetParent fun(self: UIObject, parent: frame)
---@field SetSize fun(self: UIObject, width: width|number, height: height|number)
---@field SetWidth fun(self: UIObject, width: width|number)
---@field SetHeight fun(self: UIObject, height: height|number)
---@field SetAlpha fun(self: UIObject, alpha: alpha|number)
---@field SetScale fun(self: UIObject, scale: scale|number)
---@field GetWidth fun(self: UIObject) : width|number
---@field GetHeight fun(self: UIObject) : height|number
---@field GetScale fun(self: UIObject) : scale|number
---@field GetAlpha fun(self: UIObject) : alpha|number
---@field GetSize fun(self: UIObject) : width|number, height|number
---@field GetParent fun(self: UIObject) : frame
---@field GetPoint fun(self: UIObject, index: number): string, frame, string, number, number
---@field SetPoint fun(self: UIObject, point: string, relativeFrame: frame, relativePoint: string, xOffset: number, yOffset: number)
---@field ClearAllPoints fun(self: UIObject)
---@field CreateAnimationGroup fun(self: UIObject, name: string|nil, templateName: string|nil) : animationgroup
---@class uiobject
---@field Show fun(self: uiobject)
---@field Hide fun(self: uiobject)
---@field SetShown fun(self: uiobject, state: boolean)
---@field IsShown fun(self: uiobject) : boolean
---@field SetAllPoints fun(self: uiobject)
---@field SetParent fun(self: uiobject, parent: frame)
---@field SetSize fun(self: uiobject, width: width|number, height: height|number)
---@field SetWidth fun(self: uiobject, width: width|number)
---@field SetHeight fun(self: uiobject, height: height|number)
---@field SetAlpha fun(self: uiobject, alpha: alpha|number)
---@field SetScale fun(self: uiobject, scale: scale|number)
---@field GetWidth fun(self: uiobject) : width|number
---@field GetHeight fun(self: uiobject) : height|number
---@field GetScale fun(self: uiobject) : scale|number
---@field GetAlpha fun(self: uiobject) : alpha|number
---@field GetSize fun(self: uiobject) : width|number, height|number
---@field GetParent fun(self: uiobject) : frame
---@field GetPoint fun(self: uiobject, index: number): string, frame, string, number, number
---@field SetPoint fun(self: uiobject, point: "topleft"|"topright"|"bottomleft"|"bottomright"|"top"|"bottom"|"left"|"right"|"center", relativeFrame: uiobject, relativePoint: "topleft"|"topright"|"bottomleft"|"bottomright"|"top"|"bottom"|"left"|"right"|"center", xOffset: number, yOffset: number)
---@field ClearAllPoints fun(self: uiobject)
---@field CreateAnimationGroup fun(self: uiobject, name: string|nil, templateName: string|nil) : animationgroup
---@class animationgroup : UIObject
---@class animationgroup : uiobject
---@field CreateAnimation fun(self: animationgroup, animationType: string, name: string|nil, inheritsFrom: string|nil) : animation
---@field GetAnimation fun(self: animationgroup, name: string) : animation
---@field GetAnimations fun(self: animationgroup) : table
@@ -79,7 +80,7 @@
---@field SetSmoothProgress fun(self: animationgroup, smooth: boolean)
---@field Stop fun(self: animationgroup)
---@class animation : UIObject
---@class animation : uiobject
---@field GetDuration fun(self: animation) : number
---@field GetEndDelay fun(self: animation) : number
---@field GetOrder fun(self: animation) : number
@@ -98,7 +99,7 @@
---@field SetSmoothing fun(self: animation, smoothing: string)
---@field Stop fun(self: animation)
---@class frame : UIObject
---@class frame : uiobject
---@field SetAttribute fun(self: frame, name: string, value: any)
---@field SetScript fun(self: frame, event: string, handler: function)
---@field GetScript fun(self: frame, event: string) : function
@@ -125,9 +126,10 @@
---@field GetObjectType fun(self: frame) : string
---@field GetChildren fun(self: frame) : frame[]
---@field GetRegions fun(self: frame) : region[]
---@field CreateTexture fun(self: frame, name: string|nil, layer: string, inherits: string|nil, subLayer: number|nil) : texture
---@field CreateFontString fun(self: frame, name: string|nil, layer: string, inherits: string|nil, subLayer: number|nil) : fontstring
---@field CreateTexture fun(self: frame, name: string|nil, layer: "background"|"border"|"artwork"|"overlay"|"highlight", inherits: string|nil, subLayer: number|nil) : texture
---@field CreateFontString fun(self: frame, name: string|nil, layer: "background"|"border"|"artwork"|"overlay"|"highlight", inherits: string|nil, subLayer: number|nil) : fontstring
---@field EnableMouse fun(self: frame, enable: boolean)
---@field SetResizable fun(self: frame, enable: boolean)
---@class button : frame
---@field SetNormalTexture fun(self: button, texture: texture)
@@ -150,10 +152,10 @@
---@field GetButtonState fun(self: button, state: string) : boolean
---@field RegisterForClicks fun(self: button, button1: string|nil, button2: string|nil)
---@class fontstring : UIObject
---@field SetDrawLayer fun(self: fontstring, layer: string, subLayer: number|nil)
---@class fontstring : uiobject
---@field SetDrawLayer fun(self: fontstring, layer: "background"|"border"|"artwork"|"overlay"|"highlight", subLayer: number|nil)
---@field SetFont fun(self: fontstring, font: string, size: number, flags: string)
---@field SetText fun(self: fontstring, text: string)
---@field SetText fun(self: fontstring, text: string|number)
---@field GetText fun(self: fontstring) : string
---@field GetFont fun(self: fontstring) : string, number, string
---@field SetShadowColor fun(self: fontstring, r: red|number, g: green|number, b: blue|number, a: alpha|number)
@@ -214,12 +216,12 @@
---@field GetOrientation fun(self: statusbar) : string
---@field GetReverseFill fun(self: statusbar) : boolean
---@class texture : UIObject
---@field SetDrawLayer fun(self: texture, layer: string, subLayer: number|nil)
---@class texture : uiobject
---@field SetDrawLayer fun(self: texture, layer: "background"|"border"|"artwork"|"overlay"|"highlight", subLayer: number|nil)
---@field SetTexture fun(self: texture, path: string)
---@field SetColorTexture fun(self: texture, r: red|number, g: green|number, b: blue|number, a: alpha|number)
---@field SetDesaturated fun(self: texture, desaturate: boolean)
---@field SetBlendMode fun(self: texture, mode: string)
---@field SetBlendMode fun(self: texture, mode: "ADD"|"BLEND"|"DISABLE"|"MOD"|"MOD2X"|"OVERLAY"|"REPLACE"|"SUBTRACT")
---@field SetVertexColor fun(self: texture, r: red|number, g: green|number, b: blue|number, a: alpha|number)
---@field SetAlpha fun(self: texture, alpha: number)
---@field GetAlpha fun(self: texture) : number
@@ -227,7 +229,6 @@
---@field SetHeight fun(self: texture, height: number)
---@field GetWidth fun(self: texture) : number
---@field GetHeight fun(self: texture) : number
---@field SetPoint fun(self: texture, point: string, relativeFrame: table, relativePoint: string, xOfs: number, yOfs: number)
---@field GetPoint fun(self: texture, index: number) : string, table, string, number, number
---@field SetShown fun(self: texture, state: boolean)
---@field IsShown fun(self: texture) : boolean
@@ -263,6 +264,19 @@
---@field GetBlendMode fun(self: texture) : string
---@field GetVertexColor fun(self: texture) : number, number, number, number
---@class details
---@field GetInstance fun(self: details) : instance
---@field GetCombat fun(self: details) : combat
---@field GetSpellSchoolFormatedName fun(self: details, spellschool: number) : string
---@field CommaValue fun(self: details, number: number) : string
---@field SumSpellTables fun(self: details, spellTables: spelltable[], targetTable: table)
---@class combat : table
---@field GetCombatTime fun(combat)
---@field GetDeaths fun(combat) --get the table which contains the deaths of the combat
@@ -274,6 +288,8 @@
---@field SetEndTime fun(combat: combat, time: number)
---@field CopyDeathsFrom fun(combat1: combat, combat2: combat, bMythicPlus: boolean) copy the deaths from combat2 to combat1, use true on bMythicPlus if the combat is from a mythic plus run
---@field GetContainer fun(combat: combat, containerType: number) get an actor container, containerType can be 1 for damage, 2 heal, 3 energy, 4 utility
---@field GetSpellCastAmount fun(combat: combat, actorName: string, spellId: number) get the amount of times a spell was casted
---@field GetSpellUptime fun(combat: combat, actorName: string, spellId: number, auraType: string|nil) get the uptime of a buff or debuff
---@field is_mythic_dungeon_trash boolean
---@field is_mythic_dungeon_run_id number
---@field is_mythic_dungeon_segment boolean
@@ -289,24 +305,59 @@
---@field GetActorTable fun(container: actorcontainer) get the table<actorIndex, actorObject> which contains the actors
---@field ListActors fun(container: actorcontainer) usage: for index, actorObject in container:ListActors() do
---@class spellcontainer : table
---@field GetSpell fun(container: spellcontainer, spellId: number) get a spell by its id
---@field _ActorTable table
---@class spelltable : table
---@field uptime number
---@field total number
---@field spellschool number
---@field counter number amount of hits
---@field c_amt number critical hits
---@field c_min number
---@field c_max number
---@field c_dmg number
---@field n_amt number normal hits
---@field n_dmg number total damage made by normal hits
---@field n_min number min damage made by normal hits
---@field n_max number max damage made by normal hits
---@field targets table<string, number> store the [target name] = total value
---@field id number --spellid
---@field successful_casted number successful casted times (only for enemies)
---@field g_amt number glacing hits
---@field g_dmg number
---@field r_amt number --resisted
---@field r_dmg number
---@field b_amt number --blocked
---@field b_dmg number
---@field a_amt number --absorved
---@field a_dmg number
---@class actor : table
---@field GetSpellContainer fun(actor: actor, containerType: string)
---@field Name fun(actor: actor) : string get the name of the actor
---@field Tempo fun(actor: actor) : number get the activity or effective time of the actor
---@field GetPets fun(actor: actor) : table<number, string> get a table with all pet names that belong to the player
---@field GetSpellList fun(actor: actor) : table<number, spelltable>
---@field BuildSpellTargetFromBreakdownSpellData fun(actor: actor, bkSpellData: breakdownspelldata) : table
---@field BuildSpellTargetFromSpellTable fun(actor: actor, spellTable: spelltable) : table
---@field debuff_uptime_spells table
---@field buff_uptime_spells table
---@field spells table
---@field cooldowns_defensive_spells table
---@field nome string
---@field serial string
---@field spec number
---@field grupo boolean
---@field fight_component boolean
---@field boss_fight_component boolean
---@field boss boolean
---@field last_event unixtime
---@field total_without_pet number
---@field total number
---@field spell_cast table<number, number>
---@field pets table<number, string>
---@class segmentid : number
---@class instanceid : number
@@ -344,6 +395,103 @@
---@field RefreshData fun(instance: instance, force: boolean|nil)
---@field RefreshWindow fun(instance: instance, force: boolean|nil)
---@class breakdownscrolldata : table
---@field totalValue number total done by the actor
---@field combatTime number
---@field [breakdownspelldata] breakdownspelldata indexed part of the table
---@class breakdownexpandbutton : button
---@field texture texture
---@class breakdownspellscrollframe : frame
---@class breakdownspellbar : button
---@field index number
---@field rank number
---@field spellId number
---@field name string
---@field combatTime number
---@field perSecond number
---@field percent number
---@field amountCasts number
---@field average number
---@field castAverage number
---@field onMouseUpTime number GetTime() of when the spellbar got OnMouseUp event
---@field cursorPosX number mouse position when the spellbar got OnMouseDown event
---@field cursorPosY number mouse position when the spellbar got OnMouseDown event
---@field spellTable spelltable
---@field bkSpellData breakdownspelldata
---@field statusBar statusbar
---@field expandButton breakdownexpandbutton
---@field spellIconFrame frame
---@field spellIcon texture
---@field targetsSquareFrame breakdowntargetframe
---@field targetsSquareTexture texture
---@field overlayTexture texture
---@field bIsExpandedSpell boolean
---@field ExpandedChildren breakdownspellbar[] store the spellbars which are expanded from this spellbar (spellbars shown when the expand button is pressed)
---@field InLineTexts fontstring[]
---@field AddFrameToHeaderAlignment fun(self: breakdownspellbar, frame: uiobject)
---@field AlignWithHeader fun(self: breakdownspellbar, header: table, align: string|"left")
---@class breakdownspelldata : table
---@field id number main spellId to be used on the tooltip, name and icon
---@field total number total done by the spell
---@field counter number amount of hits
---@field spellschool number the school of the spell
---@field expanded boolean if is true the show the nested spells
---@field spellTables spelltable[]
---@field spellIds number[]
---@field petNames string[]
---@field bCanExpand boolean
---@field expandedIndex number
---@field bIsExpanded boolean
---@field c_amt number critical hits
---@field c_min number
---@field c_max number
---@field c_dmg number
---@field n_amt number normal hits
---@field n_dmg number total damage made by normal hits
---@field n_min number min damage made by normal hits
---@field n_max number max damage made by normal hits
---@field successful_casted number successful casted times (only for enemies)
---@field g_amt number glacing hits
---@field g_dmg number
---@field r_amt number --resisted
---@field r_dmg number
---@field b_amt number --blocked
---@field b_dmg number
---@field a_amt number --absorved
---@field a_dmg number
---@class breakdowntargetframe : frame
---@field spellId number
---@field bkSpellData breakdownspelldata
---@field spellTable spelltable
---@field texture texture
---@field bIsMainLine boolean
---@class tabframe : frame this is the tab frame object for the breakdown window
---@class breakdownspellblockcontainer : frame container for the spellblocks in the breakdown window
---@field SpellBlocks breakdownspellblock[]
---@field UpdateBlocks fun(self: breakdownspellblockcontainer)
---@field ClearBlocks fun(self: breakdownspellblockcontainer)
---@field GetBlock fun(self: breakdownspellblockcontainer, index: number) : breakdownspellblock
---@class breakdownspellblock : statusbar breakdownspellblock object which is created inside the breakdownspellblockcontainer
---@field Lines breakdownspellblockline[]
---@field reportButton button
---@field overlay texture
---@field sparkTexture texture
---@field gradientTexture texture
---@field GetLine fun(self: breakdownspellblock, index: number) : breakdownspellblockline
---@field GetLines fun(self: breakdownspellblock) : breakdownspellblockline, breakdownspellblockline, breakdownspellblockline
---@class breakdownspellblockline : frame a line inside a breakdownspellblock, there's 3 of them in each breakdownspellblock
---@field leftText fontstring
---@field centerText fontstring
---@field rightText fontstring
+1
View File
@@ -87,6 +87,7 @@ frames\window_playerbreakdown_list.lua
frames\window_playerbreakdown_compare.lua
frames\window_playerbreakdown_avoidance.lua
frames\window_playerbreakdown_auras.lua
frames\window_playerbreakdown_spells.lua
frames\window_report.lua
frames\window_main.lua
frames\window_custom.lua
+1
View File
@@ -80,6 +80,7 @@ frames\window_playerbreakdown_list.lua
frames\window_playerbreakdown_compare.lua
frames\window_playerbreakdown_avoidance.lua
frames\window_playerbreakdown_auras.lua
frames\window_playerbreakdown_spells.lua
frames\window_report.lua
frames\window_main.lua
frames\window_custom.lua
+1 -1
View File
@@ -1,6 +1,6 @@
local dversion = 421
local dversion = 422
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)
+18 -7
View File
@@ -5084,6 +5084,15 @@ detailsFramework.HeaderFunctions = {
tinsert(self.FramesToAlign, frame)
end,
ResetFramesToHeaderAlignment = function(self)
wipe(self.FramesToAlign)
end,
SetFramesToHeaderAlignment = function(self, ...)
wipe(self.FramesToAlign)
self.FramesToAlign = {...}
end,
GetFramesFromHeaderAlignment = function(self, frame)
return self.FramesToAlign or {}
end,
@@ -5100,16 +5109,18 @@ detailsFramework.HeaderFunctions = {
frame:ClearAllPoints()
local columnHeader = columnHeaderFrames[i]
local offset = 0
if (columnHeader) then
local offset = 0
if (columnHeader.columnAlign == "right") then
offset = columnHeader:GetWidth()
if (frame:GetObjectType() == "FontString") then
frame:SetJustifyH("right")
if (columnHeader.columnAlign == "right") then
offset = columnHeader:GetWidth()
if (frame:GetObjectType() == "FontString") then
frame:SetJustifyH("right")
end
end
end
frame:SetPoint(columnHeader.columnAlign, self, anchor, columnHeader.XPosition + columnHeader.columnOffset + offset, 0)
frame:SetPoint(columnHeader.columnAlign, self, anchor, columnHeader.XPosition + columnHeader.columnOffset + offset, 0)
end
end
end,
+3 -1
View File
@@ -87,6 +87,7 @@
Details222.Perf = {}
Details222.Cooldowns = {}
Details222.GarbageCollector = {}
Details222.BreakdownWindow = {}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--initialization stuff
@@ -777,8 +778,9 @@ do
local UIParent = UIParent --api locals
--Info Window
_detalhes.playerDetailWindow = CreateFrame("Frame", "DetailsPlayerDetailsWindow", UIParent, "BackdropTemplate")
_detalhes.playerDetailWindow = CreateFrame("Frame", "DetailsBreakdownWindow", UIParent, "BackdropTemplate")
_detalhes.PlayerDetailsWindow = _detalhes.playerDetailWindow
Details.BreakdownWindow = _detalhes.playerDetailWindow
--Event Frame
_detalhes.listener = CreateFrame("Frame", nil, UIParent)
+65
View File
@@ -180,6 +180,71 @@
return self.alternate_power
end
---return the amount of casts of a spells from an actor
---@param actorName string
---@param spellId number
---@return number
function combate:GetSpellCastAmount(actorName, spellId)
---@type actorcontainer
local utilityContainer = self:GetContainer(DETAILS_ATTRIBUTE_MISC)
---@type actor
local actorObject = utilityContainer:GetActor(actorName)
if (actorObject) then
return actorObject.spell_cast[spellId] or 0
else
return 0
end
end
---return the uptime of a buff from an actor
---@param actorName string
---@param spellId number
---@param auraType string|nil if nil get 'buff'
---@return number
function combate:GetSpellUptime(actorName, spellId, auraType)
---@type actorcontainer
local utilityContainer = self:GetContainer(DETAILS_ATTRIBUTE_MISC)
---@type actor
local actorObject = utilityContainer:GetActor(actorName)
if (actorObject) then
if (auraType) then
---@type spellcontainer
local buffUptimeContainer = actorObject:GetSpellContainer(auraType)
if (buffUptimeContainer) then
---@type spelltable
local spellTable = buffUptimeContainer:GetSpell(spellId)
if (spellTable) then
return spellTable.uptime or 0
end
end
else
do --if not auraType passed, attempt to get the uptime from debuffs first, if it fails, get from buffs
---@type spellcontainer
local debuffContainer = actorObject:GetSpellContainer("debuff")
if (debuffContainer) then
---@type spelltable
local spellTable = debuffContainer:GetSpell(spellId)
if (spellTable) then
return spellTable.uptime or 0
end
end
end
do
---@type spellcontainer
local buffContainer = actorObject:GetSpellContainer("buff")
if (buffContainer) then
---@type spelltable
local spellTable = buffContainer:GetSpell(spellId)
if (spellTable) then
return spellTable.uptime or 0
end
end
end
end
end
return 0
end
--return the name of the encounter or enemy
function combate:GetCombatName(try_find)
if (self.is_pvp) then
+175 -88
View File
@@ -102,6 +102,41 @@
[73967] = true, --xuen
}
--damage mixin
local damageClassMixin = {
---check which data is shown in the instance and call a function to build the data for a broker
---@param actor actor
---@param instance instance
BuildSpellDetails = function(actor, instance, spellId)
local mainSection, subSection = instance:GetDisplay()
local combatObject = instance:GetCombat()
if (subSection == 1 or subSection == 2) then
return actor:BuildSpellDamageDoneDetails(instance, combatObject, spellId)
elseif (subSection == 3) then
return self:MontaDetalhesDamageTaken (spellid, barra, instancia)
elseif (subSection == 4) then
return self:MontaDetalhesFriendlyFire (spellid, barra, instancia)
elseif (subSection == 6) then
if (bitBand(self.flag_original, 0x00000400) ~= 0) then -- um jogador
return self:MontaDetalhesDamageDone (spellid, barra, instancia)
end
return self:MontaDetalhesEnemy (spellid, barra, instancia)
end
end,
}
---prepare data to send to a broker to show details about a spell
---@param actor actor
---@param combat combat
---@param spellId number
damageClassMixin.BuildSpellDamageDoneDetails = function(actor, combat, spellId)
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--exported functions
@@ -492,6 +527,7 @@ end
setmetatable(newDamageActor, atributo_damage)
detailsFramework:Mixin(newDamageActor, Details222.Mixins.ActorMixin)
detailsFramework:Mixin(newDamageActor, damageClassMixin)
return newDamageActor
end
@@ -3090,7 +3126,7 @@ end
end
end
--@self: actor object
---@self: actor object
function Details:SetClassIcon(texture, instance, class) --[[ exported]]
local customIcon
if (Details.immersion_unit_special_icons) then
@@ -4431,135 +4467,187 @@ local getSpellDetails = function(unitGUID, spellName)
end
end
--[=[
current: passando todas as spells para o breakdown, até mesmo as spells que não tem merge é enviado a spell total e a a spellTable logo em seguida
isso forma uma array com o dobro do tamanho e spells duplicadas
passar as spells repetidas em uma segunda array?
não passar nada e deixar o sistema aprender sozinho, como o sistema vai saber que precisa por uma arrow na linha? (para expandi-la)
--]=]
------ Damage Done & Dps
function atributo_damage:MontaInfoDamageDone()
function atributo_damage:MontaInfoDamageDone() --I guess this fills the list of spells in the topleft scrollBar in the summary tab
--the goal of this function is to build a list of spells the actor used and send the data to Details! which will delivery to the summary tab actived
--so the script only need to build the list of spells and send it to Details!
---@type actor
local actorObject = self
local allLines = info.barras1
---@type instance
local instance = info.instancia
--damage rank
local combatObject = instance:GetShowingCombat()
---@type combat
local combatObject = instance:GetCombat()
---@type number
local diff = combatObject:GetDifficulty()
local attribute, subAttribute = instance:GetDisplay()
---@type string
local playerName = actorObject:Name()
--guild ranking on a boss
--check if is a raid encounter and if is heroic or mythic
if (diff and (diff == 15 or diff == 16)) then
local db = Details.OpenStorage()
if (db) then
local bestRank, encounterTable = Details.storage:GetBestFromPlayer (diff, combatObject:GetBossInfo().id, "damage", self.nome, true)
if (bestRank) then
--discover which are the player position in the guild rank
local playerTable, onEncounter, rankPosition = Details.storage:GetPlayerGuildRank (diff, combatObject:GetBossInfo().id, "damage", self.nome, true)
local text1 = self.nome .. " Guild Rank on " .. (combatObject:GetBossInfo().name or "") .. ": |cFFFFFF00" .. (rankPosition or "x") .. "|r Best Dps: |cFFFFFF00" .. Details:ToK2((bestRank[1] or 0) / encounterTable.elapsed) .. "|r (" .. encounterTable.date:gsub(".*%s", "") .. ")"
info:SetStatusbarText (text1, 10, "gray")
do
if (diff and (diff == 15 or diff == 16)) then
local db = Details.OpenStorage()
if (db) then
local bestRank, encounterTable = Details.storage:GetBestFromPlayer(diff, combatObject:GetBossInfo().id, "damage", playerName, true)
if (bestRank) then
--discover which are the player position in the guild rank
local playerTable, onEncounter, rankPosition = Details.storage:GetPlayerGuildRank (diff, combatObject:GetBossInfo().id, "damage", playerName, true)
local text1 = playerName .. " Guild Rank on " .. (combatObject:GetBossInfo().name or "") .. ": |cFFFFFF00" .. (rankPosition or "x") .. "|r Best Dps: |cFFFFFF00" .. Details:ToK2((bestRank[1] or 0) / encounterTable.elapsed) .. "|r (" .. encounterTable.date:gsub(".*%s", "") .. ")"
info:SetStatusbarText (text1, 10, "gray")
else
info:SetStatusbarText()
end
else
info:SetStatusbarText()
end
else
info:SetStatusbarText()
end
else
info:SetStatusbarText()
end
---@type number
local totalDamageWithoutPet = actorObject.total_without_pet
---@type number
local actorTotalDamage = actorObject.total
---@type table
local actorSpellsSorted = {}
---@type table<number, spelltable>
local actorSpells = actorObject:GetSpellList()
local bShouldMergePlayerAbilities = Details.merge_player_abilities
local bShouldMergePetAbilities = Details.merge_pet_abilities
wipeSpellCache()
--get time type
--get time
local actorCombatTime
if (Details.time_type == 1 or not self.grupo) then
actorCombatTime = self:Tempo()
if (Details.time_type == 1 or not actorObject.grupo) then
actorCombatTime = actorObject:Tempo()
elseif (Details.time_type == 2) then
actorCombatTime = info.instancia.showing:GetCombatTime()
end
--actor spells
---@type {[string]: number}
local alreadyAdded = {}
for spellId, spellTable in pairs(actorSpells) do
local spellName, _, spellIcon = _GetSpellInfo(spellId)
---@cast spellId number
---@cast spellTable spelltable
spellTable.ChartData = nil
---@type string
local spellName = _GetSpellInfo(spellId)
if (spellName) then
local spellTotal = spellTable.total
local spellPercent = spellTable.total / actorTotalDamage * 100
local nameString = spellName
--problem: will show the first ability found when hovering over the spell
if (bShouldMergePlayerAbilities) then
local bAlreadyAdded = false
for i = 1, #actorSpellsSorted do
local thisSpell = actorSpellsSorted[i]
if (thisSpell[4] == nameString) then
bAlreadyAdded = true
thisSpell[2] = thisSpell[2] + spellTotal
end
end
if (not bAlreadyAdded) then
tinsert(actorSpellsSorted, {spellId, spellTotal, spellPercent, nameString, spellIcon, nil, spellTable.spellschool})
end
addToSpellCache(actorObject:GetGUID(), spellName, spellTable)
---@type number in which index the spell with the same name was stored
local index = alreadyAdded[spellName]
if (index) then
---@type breakdownspelldata
local bkSpellData = actorSpellsSorted[index]
bkSpellData.spellIds[#bkSpellData.spellIds+1] = spellId
bkSpellData.spellTables[#bkSpellData.spellTables+1] = spellTable
bkSpellData.petNames[#bkSpellData.petNames+1] = ""
bkSpellData.bCanExpand = true
else
tinsert(actorSpellsSorted, {spellId, spellTotal, spellPercent, nameString, spellIcon, nil, spellTable.spellschool})
---@type breakdownspelldata
local bkSpellData = {
id = spellId,
spellschool = spellTable.spellschool,
bIsExpanded = Details222.BreakdownWindow.IsSpellExpanded(spellId),
bCanExpand = false,
spellIds = {spellId},
spellTables = {spellTable}, --sub spell tables to show if the spell is expanded
petNames = {""},
}
actorSpellsSorted[#actorSpellsSorted+1] = bkSpellData
alreadyAdded[spellName] = #actorSpellsSorted
end
end
end
--show damage percentille within item level bracket
--add pets
local actorPets = self.pets
--local class_color = RAID_CLASS_COLORS [self.classe] and RAID_CLASS_COLORS [self.classe].colorStr
local classColor = "FFCCBBBB"
--local class_color = "FFDDDD44"
--pets spells
local actorPets = actorObject:GetPets()
for _, petName in ipairs(actorPets) do
---@type actor
local petActor = combatObject(DETAILS_ATTRIBUTE_DAMAGE, petName)
if (petActor) then
if (petActor) then --PET
local spells = petActor:GetSpellList()
for spellId, spellTable in pairs(spells) do --da foreach em cada spellid do container
local spellName, _, spellIcon = _GetSpellInfo(spellId)
--tinsert(ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome .. " |TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:33:64:96:128|t|c" .. class_color .. PetName:gsub((" <.*"), "") .. "|r", icone, PetActor, _skill.spellschool})
for spellId, spellTable in pairs(spells) do
---@cast spellId number
---@cast spellTable spelltable
spellTable.ChartData = nil
--PET
---@type string
local spellName = _GetSpellInfo(spellId)
if (spellName) then
local spellTotal = spellTable.total
local spellPercent = spellTable.total / actorTotalDamage * 100
local nameString = spellName .. " (|c" .. classColor .. petName:gsub((" <.*"), "") .. "|r)"
---@type number in which index the spell with the same name was stored
local index = alreadyAdded[spellName]
if (index) then --PET
---@type breakdownspelldata
local bkSpellData = actorSpellsSorted[index]
bkSpellData.spellIds[#bkSpellData.spellIds+1] = spellId
bkSpellData.spellTables[#bkSpellData.spellTables+1] = spellTable
bkSpellData.petNames[#bkSpellData.petNames+1] = petName
bkSpellData.bCanExpand = true
else --PET
---@type breakdownspelldata
local bkSpellData = {
id = spellId,
spellschool = spellTable.spellschool,
expanded = Details222.BreakdownWindow.IsSpellExpanded(spellId),
bCanExpand = false,
if (bShouldMergePetAbilities) then
local bAlreadyAdded = false
for i = 1, #actorSpellsSorted do
local thisPetSpellTable = actorSpellsSorted[i]
if (thisPetSpellTable[1] == spellId) then
bAlreadyAdded = true
thisPetSpellTable[2] = thisPetSpellTable[2] + spellTotal
end
end
if (not bAlreadyAdded) then
tinsert(actorSpellsSorted, {spellId, spellTotal, spellPercent, nameString, spellIcon, petActor, spellTable.spellschool})
end
addToSpellCache(actorObject:GetGUID(), spellName, spellTable) --all pet spells are added to later be combined and shown in the spell details
else
tinsert(actorSpellsSorted, {spellId, spellTotal, spellPercent, nameString, spellIcon, petActor, spellTable.spellschool})
spellIds = {spellId},
spellTables = {spellTable},
petNames = {petName},
}
actorSpellsSorted[#actorSpellsSorted+1] = bkSpellData
alreadyAdded[spellName] = #actorSpellsSorted
end
end
end
end
end
_table_sort(actorSpellsSorted, Details.Sort2)
for i = 1, #actorSpellsSorted do
---@type breakdownspelldata
local bkSpellData = actorSpellsSorted[i]
Details:SumSpellTables(bkSpellData.spellTables, bkSpellData)
end
gump:JI_AtualizaContainerBarras (#actorSpellsSorted + 1)
--table.sort(actorSpellsSorted, Details.Sort2)
table.sort(actorSpellsSorted, function(t1, t2)
return t1.total > t2.total
end)
actorSpellsSorted.totalValue = actorTotalDamage
actorSpellsSorted.combatTime = actorCombatTime
--actorSpellsSorted has the spell infomation, need to pass to the summary tab
--cleanup
table.wipe(alreadyAdded)
--send to the breakdown window
Details222.BreakdownWindow.SendSpellData(actorSpellsSorted, actorObject, combatObject, instance)
if 1 then return end
--gump:JI_AtualizaContainerBarras (#actorSpellsSorted + 1)
local max_ = actorSpellsSorted[1] and actorSpellsSorted[1][2] or 0 --dano que a primeiro magia vez
local barra
--aura bar
@@ -4752,12 +4840,9 @@ function atributo_damage:MontaInfoDamageDone()
if (barra.mouse_over) then --atualizar o tooltip
if (barra.isAlvo) then
--GameTooltip:Hide()
--GameTooltip:SetOwner(barra, "ANCHOR_TOPRIGHT")
if (not barra.minha_tabela:MontaTooltipAlvos (barra, index, instance)) then
return
end
--GameTooltip:Show()
end
end
@@ -5074,7 +5159,7 @@ local MontaDetalhesBuffProcs = function(actor, row, instance)
end
--this build p the 6 rectangle boxes in the right side of the breakdown window summary tab
function atributo_damage:MontaDetalhesDamageDone (spellId, spellLine, instance)
local spellTable
if (spellLine.other_actor) then
@@ -5477,7 +5562,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellId, spellLine, instance)
end
end
DetailsPlayerDetailsWindow_DetalheInfoBG_bg_end6:Hide()
DetailsBreakdownWindow_DetalheInfoBG_bg_end6:Hide()
thatRectangle66:SetShown(true)
end
@@ -6319,6 +6404,8 @@ end
function Details.refresh:r_atributo_damage (este_jogador, shadow)
--restaura metas do ator
detailsFramework:Mixin(este_jogador, Details222.Mixins.ActorMixin)
detailsFramework:Mixin(este_jogador, damageClassMixin)
setmetatable(este_jogador, Details.atributo_damage)
este_jogador.__index = Details.atributo_damage
--restaura as metas dos containers
+4 -1
View File
@@ -34,10 +34,13 @@
id = id, --spellid
successful_casted = 0, --successful casted times (only for enemies)
--normal hits
--min damage made by normal hits
n_min = 0,
--max damage made by normal hits
n_max = 0,
--amount normal hits
n_amt = 0,
--total damage of normal hits
n_dmg = 0,
--critical hits
+1 -1
View File
@@ -40,7 +40,7 @@ local addonName, Details222 = ...
---get the spellTable for the passed spellId
---@param spellId number
---@return table
function container_habilidades:GetSpell (spellId)
function container_habilidades:GetSpell(spellId)
return self._ActorTable[spellId]
end
+8
View File
@@ -42,6 +42,14 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--details api functions
---for a number to the current selected abbreviation
---@param number number
---@return string
function Details:Format(number)
return Details.ToKFunctions[Details.ps_abbreviation](nil, number)
end
--try to find the opponent of last fight, can be called during a fight as well
function Details:FindEnemy()
+5 -1
View File
@@ -322,8 +322,12 @@
[45284] = 188196, --shaman lightining bolt overloaded
[228361] = 228360, --shadow priest void erruption
}
--all totem
--377461 382133
--377458 377459
end
local bitfield_debuffs = {}
+10
View File
@@ -518,6 +518,7 @@
local left,num,right = _string_match (n,'^([^%d]*%d)(%d*)(.-)$')
return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right
end
function _detalhes:comma_value_raw (n)
local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$')
return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right
@@ -677,6 +678,15 @@
return _detalhes.ToKFunctions [_detalhes.ps_abbreviation]
end
--alias
---transfor an integer into a string separating thousands with a comma
---@param number number
---@return string
function Details:CommaValue(number)
return Details:comma_value(number)
end
------------------------------------------------------------------------------------------------------------
--numerical system
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -30,7 +30,7 @@
}
function breakdownWindowPlayerList.CreatePlayerListFrame()
local f = _G.DetailsPlayerDetailsWindow
local f = _G.DetailsBreakdownWindow
local refreshPlayerList = function(self, data, offset, totalLines)
--update the scroll
File diff suppressed because it is too large Load Diff
+135 -2
View File
@@ -4,7 +4,6 @@ local detailsFramework = _G.DetailsFramework
local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0", true)
local addonName, Details222 = ...
Details222.Mixins.ActorMixin = {
---return a spellContainer from an actor
---@param actor actor
@@ -39,4 +38,138 @@ Details222.Mixins.ActorMixin = {
return spellTable
end
end,
}
---return a table containing pet names
---@param actor actor
---@return table<number, string>
GetPets = function(actor)
return actor.pets
end,
---return a table containing spellTables
---@param actor actor
---@return table<number, spelltable>
GetSpellList = function(actor)
return actor.spells._ActorTable
end,
---this function sums all the targets of all spellTables conteining on a 'breakdownspelldata'
---@param actor actor
---@param bkSpellData breakdownspelldata
---@param targetTableName string
---@return table<string, number>
BuildSpellTargetFromBreakdownSpellData = function(actor, bkSpellData, targetTableName)
targetTableName = targetTableName or "targets"
local spellTables = bkSpellData.spellTables
---@type table<string, number> store the index of the target name in the result table
local cacheIndex = {}
---@type table<string, number> store the result which is returned by this function
local result = {}
for i = 1, #spellTables do
---@type spelltable
local spellTable = spellTables[i]
---@type table<string, number>
local targets = spellTable[targetTableName]
for targetName, value in pairs(targets) do
local index = cacheIndex[targetName]
if (index) then
result[index][2] = result[index][2] + value
else
result[#result+1] = {targetName, value}
cacheIndex[targetName] = #result
end
end
end
table.sort(result, function(t1, t2)
return t1[2] > t2[2]
end)
return result
end,
---this function receives a target table name and return a table containing the targets and the damage done in order of bigger to lower value
---@param actor actor
---@param spellTable spelltable
---@param targetTableName string
---@return table<string, number>
BuildSpellTargetFromSpellTable = function(actor, spellTable, targetTableName)
targetTableName = targetTableName or "targets"
---@type table<string, number>[] store the result which is returned by this function
local result = {}
---@type table<string, number>
local targets = spellTable[targetTableName]
for targetName, value in pairs(targets) do
---@cast targetName string
---@cast value number
result[#result+1] = {targetName, value}
end
table.sort(result, function(t1, t2)
return t1[2] > t2[2]
end)
return result
end,
}
--need to transfer the function bellow to another file
--this are the fields from spellTable that can be summed
local spellTable_FieldsToSum = {
["counter"] = true,
["total"] = true,
["c_amt"] = true,
["c_min"] = true,
["c_max"] = true,
["c_dmg"] = true,
["n_amt"] = true,
["n_dmg"] = true,
["n_min"] = true,
["n_max"] = true,
["successful_casted"] = true,
["g_amt"] = true,
["g_dmg"] = true,
["r_amt"] = true,
["r_dmg"] = true,
["b_amt"] = true,
["b_dmg"] = true,
["a_amt"] = true,
["a_dmg"] = true,
}
---get the array of spelltables and sum each spellTable with the first spellTable found or on targetTable
---only sum the keys found in the spellTable_FieldsToSum table
---@param spellTables table<number, spelltable>[]
---@param targetTable table
function Details:SumSpellTables(spellTables, targetTable)
local amtSpellTables = #spellTables
if (amtSpellTables == 0) then
return
end
targetTable = targetTable or spellTables[1]
for i = 1, amtSpellTables do
---@type spelltable
local spellTable = spellTables[i]
if (spellTable) then
for key, value in pairs(spellTable) do
if (spellTable_FieldsToSum[key]) then
targetTable[key] = (targetTable[key] or 0) + value
end
end
end
end
end
+12
View File
@@ -1407,6 +1407,18 @@ local default_global_data = {
},
},
--breakdown spell tab
breakdown_spell_tab = {
blockcontainer_width = 430,
blockcontainer_height = 270,
blockspell_height = 50,
blockspellline_height = 13,
blockspell_spark_offset = -2,
blockspell_spark_width = 2,
blockspell_spark_show = true,
blockspell_spark_color = {1, 1, 1, 0.7},
},
--profile by spec
profile_by_spec = {},
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

+2
View File
@@ -77,6 +77,8 @@ function Details:StartMeUp()
Details:InitializePlaterIntegrationWindow()
Details:InitializeMacrosWindow()
Details.InitializeSpellBreakdownTab()
if (Details.ocd_tracker.show_options) then
Details:InitializeCDTrackerWindow()
end