Skip to content

Commit

Permalink
breakdown 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Apr 30, 2023
1 parent e55a818 commit 50d848e
Show file tree
Hide file tree
Showing 21 changed files with 2,849 additions and 1,913 deletions.
222 changes: 185 additions & 37 deletions Definitions.lua

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Details.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Details_Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 421
local dversion = 422
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down
25 changes: 18 additions & 7 deletions Libs/DF/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,

Expand Down
4 changes: 3 additions & 1 deletion boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
Details222.Perf = {}
Details222.Cooldowns = {}
Details222.GarbageCollector = {}
Details222.BreakdownWindow = {}

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--initialization stuff
Expand Down Expand Up @@ -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)
Expand Down
65 changes: 65 additions & 0 deletions classes/class_combat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 50d848e

Please sign in to comment.