Skip to content

Commit

Permalink
Fixed reported bugs on the new breakdown window
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed May 11, 2023
1 parent 40d89df commit bad4995
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 96 deletions.
15 changes: 10 additions & 5 deletions Definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@

---@class spellcontainer : table
---@field GetSpell fun(container: spellcontainer, spellId: number) get a spell by its id
---@field ListActors fun(container: spellcontainer) : pairs usage: for spellId, spelltable in container:ListActors() do
---@field ListActors fun(container: spellcontainer) : any, any usage: for spellId, spelltable in container:ListActors() do
---@field ListSpells fun(container: spellcontainer) : any, any usage: for spellId, spelltable in container:ListActors() do
---@field _ActorTable table

---@class spelltable : table
Expand Down Expand Up @@ -614,10 +615,14 @@
---@field SpellBlockFrame breakdownspellblockframe

---@class breakdownspellblockframe : frame container for the spellblocks in the breakdown window
---@field SpellBlocks breakdownspellblock[]
---@field UpdateBlocks fun(self: breakdownspellblockframe)
---@field ClearBlocks fun(self: breakdownspellblockframe)
---@field GetBlock fun(self: breakdownspellblockframe, index: number) : breakdownspellblock
---@field SpellBlocks breakdownspellblock[] array of spellblocks
---@field blocksInUse number number of blocks currently in use
---@field UpdateBlocks fun(self: breakdownspellblockframe) update the blocks
---@field ClearBlocks fun(self: breakdownspellblockframe) clear all blocks
---@field GetBlock fun(self: breakdownspellblockframe, index: number) : breakdownspellblock return the block at the index
---@field GetBlocksInUse fun(self: breakdownspellblockframe) : number return the number of blocks currently in use
---@field GetBlocksAmount fun(self: breakdownspellblockframe) : number return the total blocks created
---@field ShowEmptyBlock fun(self: breakdownspellblockframe, index: number) show the empty block

---@class breakdownspellblock : statusbar breakdownspellblock object which is created inside the breakdownspellblockframe
---@field Lines breakdownspellblockline[]
Expand Down
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
local addonName, Details222 = ...
local version, build, date, tocversion = GetBuildInfo()

Details.build_counter = 11001
Details.alpha_build_counter = 11001 --if this is higher than the regular counter, use it instead
Details.build_counter = 11004
Details.alpha_build_counter = 11004 --if this is higher than the regular counter, use it instead
Details.dont_open_news = true
Details.game_version = version
Details.userversion = version .. " " .. Details.build_counter
Expand Down
34 changes: 1 addition & 33 deletions classes/class_damage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,39 +103,7 @@
}

--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
local damageClassMixin = {}

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--exported functions
Expand Down
6 changes: 6 additions & 0 deletions frames/window_playerbreakdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ local PLAYER_DETAILS_STATUSBAR_ALPHA = 1
Details.player_details_tabs = {}
breakdownWindow.currentTabsInUse = {}

Details222.BreakdownWindow.BackdropSettings = {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {DetailsFramework:GetDefaultBackdropColor()},
backdropbordercolor = {0, 0, 0, 0.7},
}

------------------------------------------------------------------------------------------------------------------------------
--self = instancia
--jogador = classe_damage ou classe_heal
Expand Down
51 changes: 29 additions & 22 deletions frames/window_playerbreakdown_auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,37 +221,44 @@ local auras_tab_create = function(tab, frame)
end

local auras_tab_fill = function(tab, player, combat)
---@type actor
local miscActor = combat:GetActor(4, player:name())
---@type number
local combatTime = combat:GetCombatTime()

do --buffs
local newAuraTable = {}
if (miscActor and miscActor.buff_uptime_spells) then
for spellID, spellObject in pairs(miscActor.buff_uptime_spells._ActorTable) do
local spellName, _, spellIcon = GetSpellInfo(spellID)
if (not spellObject.uptime) then
--print(_GetSpellInfo(spellID))
--dumpt(spellObject)
if (miscActor) then
do --buffs
local newAuraTable = {}
local spellContainer = miscActor:GetSpellContainer("buff")
if (spellContainer) then
for spellId, spellTable in spellContainer:ListSpells() do
local spellName, _, spellIcon = GetSpellInfo(spellId)
if (not spellTable.uptime) then
--print(_GetSpellInfo(spellID))
--dumpt(spellObject)
end
local uptime = spellTable.uptime or 0
table.insert(newAuraTable, {spellIcon, spellName, uptime, spellTable.appliedamt, spellTable.refreshamt, uptime / combatTime * 100, spellID = spellId})
end
table.insert(newAuraTable, {spellIcon, spellName, spellObject.uptime, spellObject.appliedamt, spellObject.refreshamt, spellObject.uptime/combatTime*100, spellID = spellID})
end
table.sort(newAuraTable, Details.Sort3)
tab.BuffScroll:SetData(newAuraTable)
tab.BuffScroll:Refresh()
end
table.sort (newAuraTable, Details.Sort3)
tab.BuffScroll:SetData (newAuraTable)
tab.BuffScroll:Refresh()
end

do --debuffs
local newAuraTable = {}
if (miscActor and miscActor.debuff_uptime_spells) then
for spellID, spellObject in pairs(miscActor.debuff_uptime_spells._ActorTable) do
local spellName, _, spellIcon = GetSpellInfo(spellID)
table.insert(newAuraTable, {spellIcon, spellName, spellObject.uptime, spellObject.appliedamt, spellObject.refreshamt, spellObject.uptime/combatTime*100, spellID = spellID})
do --debuffs
local newAuraTable = {}
local spellContainer = miscActor:GetSpellContainer("debuff")
if (spellContainer) then
for spellId, spellTable in spellContainer:ListSpells() do
local spellName, _, spellIcon = GetSpellInfo(spellId)
table.insert(newAuraTable, {spellIcon, spellName, spellTable.uptime, spellTable.appliedamt, spellTable.refreshamt, spellTable.uptime / combatTime * 100, spellID = spellId})
end
end
table.sort(newAuraTable, Details.Sort3)
tab.DebuffScroll:SetData(newAuraTable)
tab.DebuffScroll:Refresh()
end
table.sort (newAuraTable, Details.Sort3)
tab.DebuffScroll:SetData (newAuraTable)
tab.DebuffScroll:Refresh()
end
end

Expand Down
Loading

0 comments on commit bad4995

Please sign in to comment.