Major cleanup on breakdown main file
This commit is contained in:
+6
-2
@@ -103,7 +103,7 @@
|
||||
---@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
|
||||
---@field SetFrameStrata fun(self: frame, strata: framestrata|string)
|
||||
---@field SetFrameStrata fun(self: frame, strata: framestrata|"background"|"low"|"medium"|"high"|"dialog"|"fullscreen"|"fullscreen_dialog"|"tooltip")
|
||||
---@field SetFrameLevel fun(self: frame, level: number)
|
||||
---@field SetClampedToScreen fun(self: frame, clamped: boolean)
|
||||
---@field SetClampRectInsets fun(self: frame, left: number, right: number, top: number, bottom: number)
|
||||
@@ -116,6 +116,9 @@
|
||||
---@field SetToplevel fun(self: frame, toplevel: boolean)
|
||||
---@field SetPropagateKeyboardInput fun(self: frame, propagate: boolean)
|
||||
---@field SetPropagateGamepadInput fun(self: frame, propagate: boolean)
|
||||
---@field StartMoving fun(self: frame)
|
||||
---@field StartSizing fun(self: frame, point: string)
|
||||
---@field StopMovingOrSizing fun(self: frame)
|
||||
---@field GetAttribute fun(self: frame, name: string) : any
|
||||
---@field GetFrameLevel fun(self: frame) : number
|
||||
---@field GetFrameStrata fun(self: frame) : framestrata|string
|
||||
@@ -150,7 +153,7 @@
|
||||
---@field GetFontString fun(self: button) : fontstring
|
||||
---@field SetButtonState fun(self: button, state: string, enable: boolean)
|
||||
---@field GetButtonState fun(self: button, state: string) : boolean
|
||||
---@field RegisterForClicks fun(self: button, button1: string|nil, button2: string|nil)
|
||||
---@field RegisterForClicks fun(self: button, button1: nil|"AnyUp"|"AnyDown"|"LeftButtonDown"|"LeftButtonUp"|"MiddleButtonUp"|"MiddleButtonDown"|"RightButtonDown"|"RightButtonUp"|"Button4Up"|"Button4Down"|"Button5Up"|"Button5Down", button2: nil|"AnyUp"|"AnyDown"|"LeftButtonDown"|"LeftButtonUp"|"MiddleButtonUp"|"MiddleButtonDown"|"RightButtonDown"|"RightButtonUp"|"Button4Up"|"Button4Down"|"Button5Up"|"Button5Down")
|
||||
|
||||
---@class fontstring : uiobject
|
||||
---@field SetDrawLayer fun(self: fontstring, layer: "background"|"border"|"artwork"|"overlay"|"highlight", subLayer: number|nil)
|
||||
@@ -326,6 +329,7 @@
|
||||
---@field targets_overheal table<string, number>
|
||||
---@field targets_absorbs table<string, number>
|
||||
---@field id number --spellid
|
||||
---@field is_shield boolean --true if the spell is a shield
|
||||
---@field successful_casted number successful casted times (only for enemies)
|
||||
---@field g_amt number glacing hits
|
||||
---@field g_dmg number
|
||||
|
||||
+124
-19
@@ -5054,7 +5054,7 @@ local default_icon_row_options = {
|
||||
}
|
||||
|
||||
function detailsFramework:CreateIconRow (parent, name, options)
|
||||
local f = CreateFrame("frame", name, parent, "BackdropTemplate")
|
||||
local f = _G.CreateFrame("frame", name, parent, "BackdropTemplate")
|
||||
f.IconPool = {}
|
||||
f.NextIcon = 1
|
||||
f.AuraCache = {}
|
||||
@@ -5077,19 +5077,46 @@ end
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--~header
|
||||
|
||||
--definitions
|
||||
---@class headerframe: frame
|
||||
---@field GetColumnWidth fun(self: headerframe, columnId: number)
|
||||
---@field SetHeaderTable fun(self: headerframe, newTable)
|
||||
---@field GetSelectedColumn fun(self: headerframe)
|
||||
---@field Refresh fun(self: headerframe)
|
||||
---@field UpdateSortArrow fun(self: headerframe, columnHeader: headercolumnframe, defaultShown: boolean, defaultOrder: string)
|
||||
---@field UpdateColumnHeader fun(self: headerframe, columnHeader: headercolumnframe, headerIndex)
|
||||
---@field ResetColumnHeaderBackdrop fun(self: headerframe, columnHeader: headercolumnframe)
|
||||
---@field SetBackdropColorForSelectedColumnHeader fun(self: headerframe, columnHeader: headercolumnframe)
|
||||
---@field ClearColumnHeader fun(self: headerframe, columnHeader: headercolumnframe)
|
||||
---@field GetNextHeader fun(self: headerframe) : headercolumnframe
|
||||
---@field columnHeadersCreated headercolumnframe[]
|
||||
---@field HeaderTable table
|
||||
---@field NextHeader number
|
||||
---@field HeaderWidth number
|
||||
---@field HeaderHeight number
|
||||
---@field columnSelected number
|
||||
|
||||
---@class headercolumnframe: frame
|
||||
---@field Icon texture
|
||||
---@field Text fontstring
|
||||
---@field Arrow texture
|
||||
---@field Separator texture
|
||||
---@field resizerButton button
|
||||
|
||||
|
||||
--mixed functions
|
||||
detailsFramework.HeaderFunctions = {
|
||||
AddFrameToHeaderAlignment = function(self, frame)
|
||||
self.FramesToAlign = self.FramesToAlign or {}
|
||||
tinsert(self.FramesToAlign, frame)
|
||||
_G.tinsert(self.FramesToAlign, frame)
|
||||
end,
|
||||
|
||||
ResetFramesToHeaderAlignment = function(self)
|
||||
wipe(self.FramesToAlign)
|
||||
_G.wipe(self.FramesToAlign)
|
||||
end,
|
||||
|
||||
SetFramesToHeaderAlignment = function(self, ...)
|
||||
wipe(self.FramesToAlign)
|
||||
_G.wipe(self.FramesToAlign)
|
||||
self.FramesToAlign = {...}
|
||||
end,
|
||||
|
||||
@@ -5097,9 +5124,9 @@ detailsFramework.HeaderFunctions = {
|
||||
return self.FramesToAlign or {}
|
||||
end,
|
||||
|
||||
--@self: an object like a line
|
||||
--@headerFrame: the main header frame
|
||||
--@anchor: which side the columnHeaders are attach
|
||||
---@param self uiobject
|
||||
---@param headerFrame headerframe
|
||||
---@param anchor string
|
||||
AlignWithHeader = function(self, headerFrame, anchor)
|
||||
local columnHeaderFrames = headerFrame.columnHeadersCreated
|
||||
anchor = anchor or "topleft"
|
||||
@@ -5108,6 +5135,7 @@ detailsFramework.HeaderFunctions = {
|
||||
local frame = self.FramesToAlign[i]
|
||||
frame:ClearAllPoints()
|
||||
|
||||
---@type headercolumnframe
|
||||
local columnHeader = columnHeaderFrames[i]
|
||||
if (columnHeader) then
|
||||
local offset = 0
|
||||
@@ -5124,10 +5152,12 @@ detailsFramework.HeaderFunctions = {
|
||||
end
|
||||
end,
|
||||
|
||||
--@self: column header button
|
||||
---comment
|
||||
---@param self button
|
||||
---@param buttonClicked string
|
||||
OnClick = function(self, buttonClicked)
|
||||
|
||||
--get the header main frame
|
||||
---@type headerframe
|
||||
local headerFrame = self:GetParent()
|
||||
|
||||
--if this header does not have a clickable header, just ignore
|
||||
@@ -5136,6 +5166,7 @@ detailsFramework.HeaderFunctions = {
|
||||
end
|
||||
|
||||
--get the latest column header selected
|
||||
---@type headercolumnframe
|
||||
local previousColumnHeader = headerFrame.columnHeadersCreated[headerFrame.columnSelected]
|
||||
previousColumnHeader.Arrow:Hide()
|
||||
headerFrame:ResetColumnHeaderBackdrop(previousColumnHeader)
|
||||
@@ -5159,13 +5190,37 @@ detailsFramework.HeaderFunctions = {
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
---comment
|
||||
---@param self button
|
||||
---@param buttonClicked string
|
||||
OnMouseDown = function(self, buttonClicked)
|
||||
if (buttonClicked == "LeftButton") then
|
||||
|
||||
end
|
||||
end,
|
||||
|
||||
---comment
|
||||
---@param self button
|
||||
---@param buttonClicked string
|
||||
OnMouseUp = function(self, buttonClicked)
|
||||
if (buttonClicked == "LeftButton") then
|
||||
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
detailsFramework.HeaderCoreFunctions = {
|
||||
---@param self headerframe
|
||||
---@param columnId number
|
||||
---@return number
|
||||
GetColumnWidth = function(self, columnId)
|
||||
return self.HeaderTable[columnId].width
|
||||
end,
|
||||
|
||||
---@param self headerframe
|
||||
---@param newTable table
|
||||
SetHeaderTable = function(self, newTable)
|
||||
self.columnHeadersCreated = self.columnHeadersCreated or {}
|
||||
self.HeaderTable = newTable
|
||||
@@ -5176,12 +5231,14 @@ detailsFramework.HeaderCoreFunctions = {
|
||||
end,
|
||||
|
||||
--return which header is current selected and the the order ASC DESC
|
||||
---@param self headerframe
|
||||
GetSelectedColumn = function(self)
|
||||
return self.columnSelected, self.columnHeadersCreated[self.columnSelected or 1].order
|
||||
end,
|
||||
|
||||
--clean up and rebuild the header following the header options
|
||||
--@self: main header frame
|
||||
---@param self headerframe
|
||||
Refresh = function(self)
|
||||
--refresh background frame
|
||||
self:SetBackdrop(self.options.backdrop)
|
||||
@@ -5263,7 +5320,10 @@ detailsFramework.HeaderCoreFunctions = {
|
||||
self:SetSize(self.HeaderWidth, self.HeaderHeight)
|
||||
end,
|
||||
|
||||
--@self: main header frame
|
||||
---@param self headerframe
|
||||
---@param columnHeader headercolumnframe
|
||||
---@param defaultShown boolean
|
||||
---@param defaultOrder string
|
||||
UpdateSortArrow = function(self, columnHeader, defaultShown, defaultOrder)
|
||||
local options = self.options
|
||||
local order = defaultOrder or columnHeader.order
|
||||
@@ -5292,7 +5352,9 @@ detailsFramework.HeaderCoreFunctions = {
|
||||
end
|
||||
end,
|
||||
|
||||
--@self: main header frame
|
||||
---@param self headerframe
|
||||
---@param columnHeader headercolumnframe
|
||||
---@param headerIndex number
|
||||
UpdateColumnHeader = function(self, columnHeader, headerIndex)
|
||||
local headerData = self.HeaderTable[headerIndex]
|
||||
|
||||
@@ -5378,21 +5440,24 @@ detailsFramework.HeaderCoreFunctions = {
|
||||
columnHeader.InUse = true
|
||||
end,
|
||||
|
||||
--reset column header backdrop
|
||||
--@self: main header frame
|
||||
---reset column header backdrop
|
||||
---@param self headerframe
|
||||
---@param columnHeader headercolumnframe
|
||||
ResetColumnHeaderBackdrop = function(self, columnHeader)
|
||||
columnHeader:SetBackdrop(self.options.header_backdrop)
|
||||
columnHeader:SetBackdropColor(unpack(self.options.header_backdrop_color))
|
||||
columnHeader:SetBackdropBorderColor(unpack(self.options.header_backdrop_border_color))
|
||||
end,
|
||||
|
||||
--@self: main header frame
|
||||
---@param self headerframe
|
||||
---@param columnHeader headercolumnframe
|
||||
SetBackdropColorForSelectedColumnHeader = function(self, columnHeader)
|
||||
columnHeader:SetBackdropColor(unpack(self.options.header_backdrop_color_selected))
|
||||
end,
|
||||
|
||||
--clear the column header
|
||||
--@self: main header frame
|
||||
---clear the column header
|
||||
---@param self headerframe
|
||||
---@param columnHeader headercolumnframe
|
||||
ClearColumnHeader = function(self, columnHeader)
|
||||
columnHeader:SetSize(self.options.header_width, self.options.header_height)
|
||||
self:ResetColumnHeaderBackdrop(columnHeader)
|
||||
@@ -5405,16 +5470,27 @@ detailsFramework.HeaderCoreFunctions = {
|
||||
columnHeader.Text:Hide()
|
||||
end,
|
||||
|
||||
--get the next column header, create one if doesn't exists
|
||||
--@self: main header frame
|
||||
---get the next column header, create one if doesn't exists
|
||||
---@param self headerframe
|
||||
GetNextHeader = function(self)
|
||||
local nextHeader = self.NextHeader
|
||||
local columnHeader = self.columnHeadersCreated[nextHeader]
|
||||
|
||||
if (not columnHeader) then
|
||||
--create a new column header
|
||||
---@type headercolumnframe
|
||||
local newHeader = CreateFrame("button", "$parentHeaderIndex" .. nextHeader, self, "BackdropTemplate")
|
||||
newHeader:SetScript("OnClick", detailsFramework.HeaderFunctions.OnClick)
|
||||
newHeader:SetMovable(true)
|
||||
newHeader:SetResizable(true)
|
||||
|
||||
newHeader:SetScript("OnMouseDown", function()
|
||||
print(11)
|
||||
end)
|
||||
|
||||
newHeader:SetScript("OnMouseUp", function()
|
||||
print(22) --doesn't work either
|
||||
end)
|
||||
|
||||
--header icon
|
||||
detailsFramework:CreateImage(newHeader, "", self.options.header_height, self.options.header_height, "ARTWORK", nil, "Icon", "$parentIcon")
|
||||
@@ -5425,6 +5501,33 @@ detailsFramework.HeaderCoreFunctions = {
|
||||
--header selected and order icon
|
||||
detailsFramework:CreateImage(newHeader, self.options.arrow_up_texture, 12, 12, "ARTWORK", nil, "Arrow", "$parentArrow")
|
||||
|
||||
---rezise button
|
||||
---@type button
|
||||
local resizerButton = _G.CreateFrame("button", "$parentResizer", newHeader)
|
||||
resizerButton:SetWidth(4)
|
||||
resizerButton:SetFrameLevel(newHeader:GetFrameLevel()+2)
|
||||
resizerButton:SetPoint("topright", newHeader, "topright", -1, 0)
|
||||
resizerButton:SetPoint("bottomright", newHeader, "bottomright", -1, 0)
|
||||
resizerButton:EnableMouse(true)
|
||||
resizerButton:RegisterForClicks("LeftButtonDown", "LeftButtonUp")
|
||||
newHeader.resizerButton = resizerButton
|
||||
|
||||
resizerButton:SetScript("OnMouseDown", function()
|
||||
newHeader.bIsRezising = true
|
||||
print(1)
|
||||
--newHeader:StartSizing("right")
|
||||
end)
|
||||
|
||||
resizerButton:SetScript("OnMouseUp", function()
|
||||
newHeader.bIsRezising = false
|
||||
print(2)
|
||||
--newHeader:StopMovingOrSizing()
|
||||
end)
|
||||
|
||||
resizerButton.texture = resizerButton:CreateTexture(nil, "overlay")
|
||||
resizerButton.texture:SetAllPoints()
|
||||
resizerButton.texture:SetColorTexture(1, 1, 1, 1)
|
||||
|
||||
newHeader.Arrow:SetPoint("right", newHeader, "right", -1, 0)
|
||||
|
||||
newHeader.Separator:Hide()
|
||||
@@ -5480,8 +5583,10 @@ local default_header_options = {
|
||||
line_separator_gap_align = false,
|
||||
}
|
||||
|
||||
---@return headerframe
|
||||
function detailsFramework:CreateHeader(parent, headerTable, options, frameName)
|
||||
local newHeader = CreateFrame("frame", frameName or "$parentHeaderLine", parent, "BackdropTemplate")
|
||||
---@type headerframe
|
||||
local newHeader = _G.CreateFrame("frame", frameName or "$parentHeaderLine", parent, "BackdropTemplate")
|
||||
|
||||
detailsFramework:Mixin(newHeader, detailsFramework.OptionsFunctions)
|
||||
detailsFramework:Mixin(newHeader, detailsFramework.HeaderCoreFunctions)
|
||||
|
||||
@@ -1748,7 +1748,7 @@
|
||||
desc = Loc ["STRING_CUSTOM_MYSPELLS_DESC"],
|
||||
source = false,
|
||||
target = false,
|
||||
script_version = 8,
|
||||
script_version = 9,
|
||||
script = [[
|
||||
--get the parameters passed
|
||||
local combat, instance_container, instance = ...
|
||||
|
||||
+133
-131
@@ -5424,146 +5424,150 @@ function atributo_damage:MontaDetalhesDamageDone (spellId, spellLine, instance)
|
||||
local spellTable = spellTable
|
||||
|
||||
local blockId = 6
|
||||
local thatRectangle66 = Details222.BreakdownWindow.GetBlockIndex(blockId)
|
||||
thatRectangle66 = thatRectangle66:GetFrame()
|
||||
|
||||
--hide all textures created
|
||||
if (thatRectangle66.ChartTextures) then
|
||||
for i = 1, #thatRectangle66.ChartTextures do
|
||||
thatRectangle66.ChartTextures[i]:Hide()
|
||||
end
|
||||
end
|
||||
if false then --debug the stuff for the chart damage done in the 6th spellblock
|
||||
--GetBlockIndex doesn't exists anymore
|
||||
local thatRectangle66 = Details222.BreakdownWindow.GetBlockIndex(blockId)
|
||||
thatRectangle66 = thatRectangle66:GetFrame()
|
||||
|
||||
local chartData = Details222.TimeCapture.GetChartDataFromSpell(spellTable)
|
||||
if (chartData and instance) then
|
||||
local width, height = thatRectangle66:GetSize()
|
||||
--reset which texture is the next to be used
|
||||
thatRectangle66.nextChartTextureId = 1
|
||||
|
||||
local amountOfTimeStamps = 12
|
||||
|
||||
if (not thatRectangle66.timeStamps) then
|
||||
thatRectangle66.timeStamps = {}
|
||||
for i = 1, amountOfTimeStamps do
|
||||
thatRectangle66.timeStamps[i] = thatRectangle66:CreateFontString(nil, "overlay", "GameFontNormal")
|
||||
thatRectangle66.timeStamps[i]:SetPoint("topleft", thatRectangle66, "topleft", 2 + (i - 1) * (width / amountOfTimeStamps), -2)
|
||||
DetailsFramework:SetFontSize(thatRectangle66.timeStamps[i], 9)
|
||||
--hide all textures created
|
||||
if (thatRectangle66.ChartTextures) then
|
||||
for i = 1, #thatRectangle66.ChartTextures do
|
||||
thatRectangle66.ChartTextures[i]:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
if (not thatRectangle66.bloodLustIndicators) then
|
||||
thatRectangle66.bloodLustIndicators = {}
|
||||
for i = 1, 5 do
|
||||
local thisIndicator = thatRectangle66:CreateTexture(nil, "artwork", nil, 4)
|
||||
thisIndicator:SetColorTexture(0.0980392, 0.0980392, 0.439216)
|
||||
thatRectangle66.bloodLustIndicators[#thatRectangle66.bloodLustIndicators+1] = thisIndicator
|
||||
end
|
||||
end
|
||||
local chartData = Details222.TimeCapture.GetChartDataFromSpell(spellTable)
|
||||
if (chartData and instance) then
|
||||
local width, height = thatRectangle66:GetSize()
|
||||
--reset which texture is the next to be used
|
||||
thatRectangle66.nextChartTextureId = 1
|
||||
|
||||
for i = 1, #thatRectangle66.bloodLustIndicators do
|
||||
thatRectangle66.bloodLustIndicators[i]:Hide()
|
||||
end
|
||||
local amountOfTimeStamps = 12
|
||||
|
||||
if (not thatRectangle66.ChartTextures) then
|
||||
thatRectangle66.ChartTextures = {}
|
||||
function thatRectangle66:GetChartTexture()
|
||||
local thisTexture = thatRectangle66.ChartTextures[thatRectangle66.nextChartTextureId]
|
||||
if (not thisTexture) then
|
||||
thisTexture = thatRectangle66:CreateTexture(nil, "artwork", nil, 5)
|
||||
thisTexture:SetColorTexture(1, 1, 1, 0.65)
|
||||
thatRectangle66.ChartTextures[thatRectangle66.nextChartTextureId] = thisTexture
|
||||
if (not thatRectangle66.timeStamps) then
|
||||
thatRectangle66.timeStamps = {}
|
||||
for i = 1, amountOfTimeStamps do
|
||||
thatRectangle66.timeStamps[i] = thatRectangle66:CreateFontString(nil, "overlay", "GameFontNormal")
|
||||
thatRectangle66.timeStamps[i]:SetPoint("topleft", thatRectangle66, "topleft", 2 + (i - 1) * (width / amountOfTimeStamps), -2)
|
||||
DetailsFramework:SetFontSize(thatRectangle66.timeStamps[i], 9)
|
||||
end
|
||||
thatRectangle66.nextChartTextureId = thatRectangle66.nextChartTextureId + 1
|
||||
|
||||
return thisTexture
|
||||
end
|
||||
end
|
||||
|
||||
--elapsed combat time
|
||||
local combatObject = instance:GetShowingCombat()
|
||||
local combatTime = math.floor(combatObject:GetCombatTime())
|
||||
thatRectangle66.timeStamps[1]:SetText(DetailsFramework:IntegerToTimer(0))
|
||||
for i = 2, #thatRectangle66.timeStamps do
|
||||
local timePerSegment = combatTime / #thatRectangle66.timeStamps
|
||||
thatRectangle66.timeStamps[i]:SetText(DetailsFramework:IntegerToTimer(i * timePerSegment))
|
||||
end
|
||||
--compute the width oif each texture
|
||||
local textureWidth = width / combatTime
|
||||
--compute the max height of a texture can have
|
||||
local maxValue = 0
|
||||
local numData = 0
|
||||
|
||||
--need to put the data in order FIRST
|
||||
--each damage then need to be parsed
|
||||
|
||||
local dataInOrder = {}
|
||||
|
||||
local CONST_INDEX_TIMESTAMP = 1
|
||||
local CONST_INDEX_DAMAGEDONE = 2
|
||||
local CONST_INDEX_EVENTDAMAGE = 3
|
||||
|
||||
for timeStamp, value in pairs(chartData) do
|
||||
dataInOrder[#dataInOrder+1] = {timeStamp, value}
|
||||
dataInOrder[#dataInOrder+1] = {timeStamp, value}
|
||||
dataInOrder[#dataInOrder+1] = {timeStamp, value}
|
||||
numData = numData + 1
|
||||
end
|
||||
|
||||
table.sort(dataInOrder, function(t1, t2) return t1[CONST_INDEX_TIMESTAMP] < t2[CONST_INDEX_TIMESTAMP] end)
|
||||
local damageDoneByTime = dataInOrder
|
||||
|
||||
--parser the damage done
|
||||
local currentTotalDamage = 0
|
||||
|
||||
for i = 1, #damageDoneByTime do
|
||||
local damageEvent = damageDoneByTime[i]
|
||||
|
||||
local atTime = damageEvent[CONST_INDEX_TIMESTAMP]
|
||||
local totalDamageUntilHere = damageEvent[CONST_INDEX_DAMAGEDONE] --raw damage
|
||||
|
||||
local spellDamage = totalDamageUntilHere - currentTotalDamage
|
||||
currentTotalDamage = currentTotalDamage + spellDamage
|
||||
|
||||
damageEvent[CONST_INDEX_EVENTDAMAGE] = spellDamage
|
||||
|
||||
maxValue = math.max(spellDamage, maxValue)
|
||||
end
|
||||
|
||||
--build the chart
|
||||
for i = 1, #damageDoneByTime do
|
||||
--for timeStamp, value in pairs(chartData) do --as it is pairs the data is scattered
|
||||
local damageEvent = damageDoneByTime[i]
|
||||
local timeStamp = damageEvent[CONST_INDEX_TIMESTAMP]
|
||||
local damageDone = damageEvent[CONST_INDEX_EVENTDAMAGE]
|
||||
|
||||
local thisTexture = thatRectangle66:GetChartTexture()
|
||||
thisTexture:SetWidth(textureWidth)
|
||||
|
||||
local texturePosition = textureWidth * timeStamp
|
||||
|
||||
thisTexture:SetPoint("bottomleft", thatRectangle66, "bottomleft", 1 + texturePosition, 1)
|
||||
|
||||
local percentFromPeak = damageDone / maxValue --normalized
|
||||
thisTexture:SetHeight(math.min(percentFromPeak * height, height - 15))
|
||||
thisTexture:Show()
|
||||
|
||||
--print("DEBUG", 7 , "Peak:", percentFromPeak, "position:", texturePosition, "damage done:", damageDone) --debug
|
||||
end
|
||||
|
||||
--show bloodlust indicators, member .bloodlust is not guarantted
|
||||
if (combatObject.bloodlust) then
|
||||
--bloodlust not being added into the combat object, probably a bug on Parser
|
||||
local bloodlustDuration = 40
|
||||
for i = 1, #combatObject.bloodlust do
|
||||
thatRectangle66.bloodLustIndicators[i]:Show()
|
||||
thatRectangle66.bloodLustIndicators[i]:SetAlpha(0.46)
|
||||
thatRectangle66.bloodLustIndicators[i]:SetSize(bloodlustDuration / combatTime * width, height - 2)
|
||||
thatRectangle66.bloodLustIndicators[i]:SetPoint("bottomleft", thatRectangle66, "bottomleft", 0, 0)
|
||||
if (not thatRectangle66.bloodLustIndicators) then
|
||||
thatRectangle66.bloodLustIndicators = {}
|
||||
for i = 1, 5 do
|
||||
local thisIndicator = thatRectangle66:CreateTexture(nil, "artwork", nil, 4)
|
||||
thisIndicator:SetColorTexture(0.0980392, 0.0980392, 0.439216)
|
||||
thatRectangle66.bloodLustIndicators[#thatRectangle66.bloodLustIndicators+1] = thisIndicator
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
DetailsBreakdownWindow_DetalheInfoBG_bg_end6:Hide()
|
||||
thatRectangle66:SetShown(true)
|
||||
for i = 1, #thatRectangle66.bloodLustIndicators do
|
||||
thatRectangle66.bloodLustIndicators[i]:Hide()
|
||||
end
|
||||
|
||||
if (not thatRectangle66.ChartTextures) then
|
||||
thatRectangle66.ChartTextures = {}
|
||||
function thatRectangle66:GetChartTexture()
|
||||
local thisTexture = thatRectangle66.ChartTextures[thatRectangle66.nextChartTextureId]
|
||||
if (not thisTexture) then
|
||||
thisTexture = thatRectangle66:CreateTexture(nil, "artwork", nil, 5)
|
||||
thisTexture:SetColorTexture(1, 1, 1, 0.65)
|
||||
thatRectangle66.ChartTextures[thatRectangle66.nextChartTextureId] = thisTexture
|
||||
end
|
||||
thatRectangle66.nextChartTextureId = thatRectangle66.nextChartTextureId + 1
|
||||
|
||||
return thisTexture
|
||||
end
|
||||
end
|
||||
|
||||
--elapsed combat time
|
||||
local combatObject = instance:GetShowingCombat()
|
||||
local combatTime = math.floor(combatObject:GetCombatTime())
|
||||
thatRectangle66.timeStamps[1]:SetText(DetailsFramework:IntegerToTimer(0))
|
||||
for i = 2, #thatRectangle66.timeStamps do
|
||||
local timePerSegment = combatTime / #thatRectangle66.timeStamps
|
||||
thatRectangle66.timeStamps[i]:SetText(DetailsFramework:IntegerToTimer(i * timePerSegment))
|
||||
end
|
||||
--compute the width oif each texture
|
||||
local textureWidth = width / combatTime
|
||||
--compute the max height of a texture can have
|
||||
local maxValue = 0
|
||||
local numData = 0
|
||||
|
||||
--need to put the data in order FIRST
|
||||
--each damage then need to be parsed
|
||||
|
||||
local dataInOrder = {}
|
||||
|
||||
local CONST_INDEX_TIMESTAMP = 1
|
||||
local CONST_INDEX_DAMAGEDONE = 2
|
||||
local CONST_INDEX_EVENTDAMAGE = 3
|
||||
|
||||
for timeStamp, value in pairs(chartData) do
|
||||
dataInOrder[#dataInOrder+1] = {timeStamp, value}
|
||||
dataInOrder[#dataInOrder+1] = {timeStamp, value}
|
||||
dataInOrder[#dataInOrder+1] = {timeStamp, value}
|
||||
numData = numData + 1
|
||||
end
|
||||
|
||||
table.sort(dataInOrder, function(t1, t2) return t1[CONST_INDEX_TIMESTAMP] < t2[CONST_INDEX_TIMESTAMP] end)
|
||||
local damageDoneByTime = dataInOrder
|
||||
|
||||
--parser the damage done
|
||||
local currentTotalDamage = 0
|
||||
|
||||
for i = 1, #damageDoneByTime do
|
||||
local damageEvent = damageDoneByTime[i]
|
||||
|
||||
local atTime = damageEvent[CONST_INDEX_TIMESTAMP]
|
||||
local totalDamageUntilHere = damageEvent[CONST_INDEX_DAMAGEDONE] --raw damage
|
||||
|
||||
local spellDamage = totalDamageUntilHere - currentTotalDamage
|
||||
currentTotalDamage = currentTotalDamage + spellDamage
|
||||
|
||||
damageEvent[CONST_INDEX_EVENTDAMAGE] = spellDamage
|
||||
|
||||
maxValue = math.max(spellDamage, maxValue)
|
||||
end
|
||||
|
||||
--build the chart
|
||||
for i = 1, #damageDoneByTime do
|
||||
--for timeStamp, value in pairs(chartData) do --as it is pairs the data is scattered
|
||||
local damageEvent = damageDoneByTime[i]
|
||||
local timeStamp = damageEvent[CONST_INDEX_TIMESTAMP]
|
||||
local damageDone = damageEvent[CONST_INDEX_EVENTDAMAGE]
|
||||
|
||||
local thisTexture = thatRectangle66:GetChartTexture()
|
||||
thisTexture:SetWidth(textureWidth)
|
||||
|
||||
local texturePosition = textureWidth * timeStamp
|
||||
|
||||
thisTexture:SetPoint("bottomleft", thatRectangle66, "bottomleft", 1 + texturePosition, 1)
|
||||
|
||||
local percentFromPeak = damageDone / maxValue --normalized
|
||||
thisTexture:SetHeight(math.min(percentFromPeak * height, height - 15))
|
||||
thisTexture:Show()
|
||||
|
||||
--print("DEBUG", 7 , "Peak:", percentFromPeak, "position:", texturePosition, "damage done:", damageDone) --debug
|
||||
end
|
||||
|
||||
--show bloodlust indicators, member .bloodlust is not guarantted
|
||||
if (combatObject.bloodlust) then
|
||||
--bloodlust not being added into the combat object, probably a bug on Parser
|
||||
local bloodlustDuration = 40
|
||||
for i = 1, #combatObject.bloodlust do
|
||||
thatRectangle66.bloodLustIndicators[i]:Show()
|
||||
thatRectangle66.bloodLustIndicators[i]:SetAlpha(0.46)
|
||||
thatRectangle66.bloodLustIndicators[i]:SetSize(bloodlustDuration / combatTime * width, height - 2)
|
||||
thatRectangle66.bloodLustIndicators[i]:SetPoint("bottomleft", thatRectangle66, "bottomleft", 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
DetailsBreakdownWindow_DetalheInfoBG_bg_end6:Hide()
|
||||
thatRectangle66:SetShown(true)
|
||||
end
|
||||
end
|
||||
|
||||
_table_sort(data, Details.Sort1)
|
||||
@@ -5573,9 +5577,8 @@ function atributo_damage:MontaDetalhesDamageDone (spellId, spellLine, instance)
|
||||
end
|
||||
|
||||
for i = #data+2, 5 do
|
||||
gump:HidaDetalheInfo (i)
|
||||
gump:HidaDetalheInfo(i)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function Details:BuildPlayerDetailsSpellChart()
|
||||
@@ -5662,7 +5665,6 @@ function Details:BuildPlayerDetailsSpellChart()
|
||||
end
|
||||
|
||||
function atributo_damage:MontaTooltipDamageTaken (thisLine, index)
|
||||
|
||||
local aggressor = info.instancia.showing [1]:PegarCombatente (_, thisLine.nome_inimigo)
|
||||
local container = aggressor.spells._ActorTable
|
||||
local habilidades = {}
|
||||
|
||||
@@ -332,7 +332,7 @@ local instanceMixins = {
|
||||
--update player breakdown window if opened
|
||||
if (not bForceRefresh) then
|
||||
if (Details:IsBreakdownWindowOpen()) then
|
||||
return Details:GetPlayerObjectFromBreakdownWindow():MontaInfo()
|
||||
return Details:GetActorObjectFromBreakdownWindow():MontaInfo()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -519,9 +519,9 @@ local instanceMixins = {
|
||||
Details:CloseBreakdownWindow()
|
||||
else
|
||||
---@type actor
|
||||
local actorObject = Details:GetPlayerObjectFromBreakdownWindow()
|
||||
local actorObject = Details:GetActorObjectFromBreakdownWindow()
|
||||
if (actorObject) then
|
||||
Details:OpenPlayerBreakdown(instance, actorObject, true)
|
||||
Details:OpenBreakdownWindow(instance, actorObject, true)
|
||||
else
|
||||
Details:CloseBreakdownWindow()
|
||||
end
|
||||
@@ -2832,13 +2832,13 @@ function _detalhes:TrocaTabela(instance, segmentId, attributeId, subAttributeId,
|
||||
|
||||
if (Details.playerDetailWindow:IsShown() and instance == Details.playerDetailWindow.instancia) then
|
||||
if (not instance.showing or instance.atributo > 4) then
|
||||
Details:FechaJanelaInfo()
|
||||
Details:CloseBreakdownWindow()
|
||||
else
|
||||
local actor = instance.showing (instance.atributo, Details.playerDetailWindow.jogador.nome)
|
||||
if (actor) then
|
||||
instance:AbreJanelaInfo (actor, true)
|
||||
local actorObject = instance.showing (instance.atributo, Details.playerDetailWindow.jogador.nome)
|
||||
if (actorObject) then
|
||||
Details:OpenBreakdownWindow(instance, actorObject, true)
|
||||
else
|
||||
Details:FechaJanelaInfo()
|
||||
Details:CloseBreakdownWindow()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -451,7 +451,7 @@ function segmentClass:resetar_overall()
|
||||
-- _detalhes.schedule_remove_overall = true
|
||||
--else
|
||||
--fecha a janela de informa��es do jogador
|
||||
Details:FechaJanelaInfo()
|
||||
Details:CloseBreakdownWindow()
|
||||
|
||||
Details.tabela_overall = combatClass:NovaTabela()
|
||||
|
||||
@@ -498,7 +498,7 @@ function segmentClass:resetar()
|
||||
--_detalhes.schedule_remove_overall = nil
|
||||
|
||||
--fecha a janela de informa��es do jogador
|
||||
Details:FechaJanelaInfo()
|
||||
Details:CloseBreakdownWindow()
|
||||
|
||||
--empty temporary tables
|
||||
Details.atributo_damage:ClearTempTables()
|
||||
|
||||
+2
-2
@@ -5827,10 +5827,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
_detalhes.logoff_saving_data = true
|
||||
|
||||
--close info window
|
||||
if (_detalhes.FechaJanelaInfo) then
|
||||
if (_detalhes.CloseBreakdownWindow) then
|
||||
tinsert(_detalhes_global.exit_log, "1 - Closing Janela Info.")
|
||||
currentStep = "Fecha Janela Info"
|
||||
xpcall(_detalhes.FechaJanelaInfo, saver_error)
|
||||
xpcall(_detalhes.CloseBreakdownWindow, saver_error)
|
||||
end
|
||||
|
||||
--do not save window pos
|
||||
|
||||
+19
-16
@@ -1950,19 +1950,22 @@ local lineScript_Onmousedown = function(self, button)
|
||||
end
|
||||
|
||||
local lineScript_Onmouseup = function(self, button)
|
||||
local is_shift_down = _IsShiftKeyDown()
|
||||
local is_control_down = _IsControlKeyDown()
|
||||
local bIsShiftDown = _IsShiftKeyDown()
|
||||
local bIsControlDown = _IsControlKeyDown()
|
||||
|
||||
if (self._instance.baseframe.isMoving) then
|
||||
move_janela(self._instance.baseframe, false, self._instance)
|
||||
self._instance:SaveMainWindowPosition()
|
||||
---@type instance
|
||||
local instanceObject = self._instance
|
||||
|
||||
if (self._instance:MontaTooltip(self, self.row_id)) then
|
||||
if (instanceObject.baseframe.isMoving) then
|
||||
move_janela(instanceObject.baseframe, false, instanceObject)
|
||||
instanceObject:SaveMainWindowPosition()
|
||||
|
||||
if (instanceObject:MontaTooltip(self, self.row_id)) then
|
||||
GameCooltip:Show (self, 1)
|
||||
end
|
||||
end
|
||||
|
||||
self._instance:HandleTextsOnMouseClick (self, "up")
|
||||
instanceObject:HandleTextsOnMouseClick (self, "up")
|
||||
|
||||
local x, y = _GetCursorPosition()
|
||||
x = floor(x)
|
||||
@@ -1970,14 +1973,14 @@ local lineScript_Onmouseup = function(self, button)
|
||||
|
||||
if (self.mouse_down and (self.mouse_down+0.4 > GetTime() and (x == self.x and y == self.y)) or (x == self.x and y == self.y)) then
|
||||
if (self.button == "LeftButton" or self.button == "MiddleButton") then
|
||||
if (self._instance.atributo == 5 or is_shift_down) then
|
||||
if (instanceObject.atributo == 5 or bIsShiftDown) then
|
||||
--report
|
||||
if (self._instance.atributo == 5 and is_shift_down) then
|
||||
local custom = self._instance:GetCustomObject()
|
||||
if (instanceObject.atributo == 5 and bIsShiftDown) then
|
||||
local custom = instanceObject:GetCustomObject()
|
||||
if (custom and custom.on_shift_click) then
|
||||
local func = loadstring (custom.on_shift_click)
|
||||
local func = loadstring(custom.on_shift_click)
|
||||
if (func) then
|
||||
local successful, errortext = pcall(func, self, self.minha_tabela, self._instance)
|
||||
local successful, errortext = pcall(func, self, self.minha_tabela, instanceObject)
|
||||
if (not successful) then
|
||||
Details:Msg("error occurred custom script shift+click:", errortext)
|
||||
end
|
||||
@@ -1986,18 +1989,18 @@ local lineScript_Onmouseup = function(self, button)
|
||||
end
|
||||
end
|
||||
|
||||
if (Details.row_singleclick_overwrite [self._instance.atributo] and type(Details.row_singleclick_overwrite [self._instance.atributo][self._instance.sub_atributo]) == "function") then
|
||||
return Details.row_singleclick_overwrite [self._instance.atributo][self._instance.sub_atributo] (_, self.minha_tabela, self._instance, is_shift_down, is_control_down)
|
||||
if (Details.row_singleclick_overwrite [instanceObject.atributo] and type(Details.row_singleclick_overwrite [instanceObject.atributo][instanceObject.sub_atributo]) == "function") then
|
||||
return Details.row_singleclick_overwrite [instanceObject.atributo][instanceObject.sub_atributo] (_, self.minha_tabela, instanceObject, bIsShiftDown, bIsControlDown)
|
||||
end
|
||||
|
||||
return Details:ReportSingleLine (self._instance, self)
|
||||
return Details:ReportSingleLine (instanceObject, self)
|
||||
end
|
||||
|
||||
if (not self.minha_tabela) then
|
||||
return Details:Msg("this bar is waiting update.")
|
||||
end
|
||||
|
||||
self._instance:AbreJanelaInfo (self.minha_tabela, nil, nil, is_shift_down, is_control_down)
|
||||
Details:OpenBreakdownWindow(instanceObject, self.minha_tabela, nil, nil, bIsShiftDown, bIsControlDown)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+285
-858
File diff suppressed because it is too large
Load Diff
@@ -57,8 +57,8 @@
|
||||
end
|
||||
|
||||
local lineOnClick = function(self)
|
||||
if (self.playerObject ~= Details:GetPlayerObjectFromBreakdownWindow()) then
|
||||
Details:OpenPlayerBreakdown(Details:GetActiveWindowFromBreakdownWindow(), self.playerObject)
|
||||
if (self.playerObject ~= Details:GetActorObjectFromBreakdownWindow()) then
|
||||
Details:OpenBreakdownWindow(Details:GetActiveWindowFromBreakdownWindow(), self.playerObject)
|
||||
f.playerScrollBox:Refresh()
|
||||
end
|
||||
end
|
||||
@@ -80,7 +80,7 @@
|
||||
end
|
||||
|
||||
local updatePlayerLine = function(self, topResult, encounterId, difficultyId) --~update
|
||||
local playerSelected = Details:GetPlayerObjectFromBreakdownWindow()
|
||||
local playerSelected = Details:GetActorObjectFromBreakdownWindow()
|
||||
if (playerSelected and playerSelected == self.playerObject) then
|
||||
self:SetBackdropColor(unpack(scrollbox_line_backdrop_color_selected))
|
||||
self.isSelected = true
|
||||
|
||||
@@ -31,11 +31,6 @@ local spellBlockContainerSettings = {
|
||||
|
||||
local spellBreakdownSettings = {}
|
||||
|
||||
local row_backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
|
||||
insets = {left = 0, right = 0, top = 0, bottom = 0}}
|
||||
local row_backdrop_onleave = {bgFile = "", edgeFile = "", tile = true, tileSize = 16, edgeSize = 32,
|
||||
insets = {left = 1, right = 1, top = 0, bottom = 1}}
|
||||
|
||||
local CONST_BAR_HEIGHT = 20
|
||||
local CONST_TARGET_HEIGHT = 18
|
||||
|
||||
@@ -82,13 +77,13 @@ local columnInfo = {
|
||||
{name = "amount", label = "total", width = 50, align = "left", enabled = true},
|
||||
{name = "persecond", label = "ps", width = 50, align = "left", enabled = true},
|
||||
{name = "percent", label = "%", width = 50, align = "left", enabled = true},
|
||||
{name = "casts", label = "casts", width = 40, align = "left", enabled = true},
|
||||
{name = "critpercent", label = "crit %", width = 40, align = "left", enabled = true},
|
||||
{name = "hits", label = "hits", width = 40, align = "left", enabled = true},
|
||||
{name = "castavg", label = "cast avg", width = 50, align = "left", enabled = true},
|
||||
{name = "uptime", label = "uptime", width = 45, align = "left", enabled = true},
|
||||
{name = "overheal", label = "overheal", width = 45, align = "left", enabled = true, attribute = DETAILS_ATTRIBUTE_HEAL},
|
||||
{name = "absorbed", label = "absorbed", width = 45, align = "left", enabled = true, attribute = DETAILS_ATTRIBUTE_HEAL},
|
||||
{name = "casts", label = "casts", width = 40, align = "left", enabled = false},
|
||||
{name = "critpercent", label = "crit %", width = 40, align = "left", enabled = false},
|
||||
{name = "hits", label = "hits", width = 40, align = "left", enabled = false},
|
||||
{name = "castavg", label = "cast avg", width = 50, align = "left", enabled = false},
|
||||
{name = "uptime", label = "uptime", width = 45, align = "left", enabled = false},
|
||||
{name = "overheal", label = "overheal", width = 45, align = "left", enabled = false, attribute = DETAILS_ATTRIBUTE_HEAL},
|
||||
{name = "absorbed", label = "absorbed", width = 45, align = "left", enabled = false, attribute = DETAILS_ATTRIBUTE_HEAL},
|
||||
}
|
||||
|
||||
function spellsTab.BuildHeaderTable()
|
||||
@@ -187,6 +182,7 @@ end
|
||||
--called when the tab is getting created
|
||||
function spellsTab.OnCreateTabCallback(tabButton, tabFrame)
|
||||
spellBreakdownSettings = Details.breakdown_spell_tab
|
||||
DetailsFramework:ApplyStandardBackdrop(tabFrame)
|
||||
|
||||
--create the scrollbar to show the spells in the breakdown window
|
||||
---@type breakdownspellscrollframe
|
||||
@@ -209,13 +205,10 @@ function spellsTab.OnCreateTabCallback(tabButton, tabFrame)
|
||||
spellsTab.CreateReportButtons(tabFrame)
|
||||
|
||||
--these bars table are kinda deprecated now:
|
||||
|
||||
--store the spell bars for the spell container
|
||||
tabFrame.barras1 = {}
|
||||
--store the target bars for the target container
|
||||
tabFrame.barras2 = {}
|
||||
tabFrame.barras1 = {} --deprecated
|
||||
--store the special bars shown in the right side of the breakdown window, this is only shown when spellBlocks aren't in use
|
||||
tabFrame.barras3 = {}
|
||||
tabFrame.barras3 = {} --deprecated
|
||||
|
||||
spellsTab.TabFrame = tabFrame
|
||||
end
|
||||
@@ -332,15 +325,6 @@ do --hide bars functions - to be refactored
|
||||
for index = 1, #allBars, 1 do
|
||||
allBars[index]:Hide()
|
||||
allBars[index].textura:SetStatusBarColor(1, 1, 1, 1)
|
||||
allBars[index].on_focus = false
|
||||
end
|
||||
end
|
||||
|
||||
--hide all the bars of the player's targets
|
||||
function spellsTab.HidaAllBarrasAlvo()
|
||||
local allBars = _detalhes.playerDetailWindow.barras2
|
||||
for index = 1, #allBars, 1 do
|
||||
allBars[index]:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -604,11 +588,11 @@ local onEnterBreakdownSpellBar = function(spellBar) --parei aqui: precisa por no
|
||||
blockLine1.leftText:SetText(Loc ["STRING_CAST"] .. ": " .. spellBar.amountCasts) --total amount of casts
|
||||
blockLine1.rightText:SetText(Loc ["STRING_HITS"]..": " .. totalHits) --hits and uptime
|
||||
|
||||
blockLine2.leftText:SetText(Loc ["STRING_DAMAGE"]..": " .. Details:Format(spellTable.total)) --total damage
|
||||
blockLine2.leftText:SetText(Loc ["STRING_HEAL"]..": " .. Details:Format(spellTable.total)) --total damage
|
||||
blockLine2.rightText:SetText(Details:GetSpellSchoolFormatedName(spellTable.spellschool)) --spell school
|
||||
|
||||
blockLine3.leftText:SetText(Loc ["STRING_AVERAGE"] .. ": " .. Details:Format(spellBar.average)) --average damage
|
||||
blockLine3.rightText:SetText(Loc ["STRING_DPS"] .. ": " .. Details:CommaValue(spellBar.perSecond)) --dps
|
||||
blockLine3.rightText:SetText(Loc ["STRING_HPS"] .. ": " .. Details:CommaValue(spellBar.perSecond)) --dps
|
||||
end
|
||||
|
||||
--check if there's normal hits and build the block
|
||||
@@ -639,7 +623,7 @@ local onEnterBreakdownSpellBar = function(spellBar) --parei aqui: precisa por no
|
||||
local tempo = (elapsedTime * spellTable.n_total) / math.max(spellTable.total, 0.001)
|
||||
local normalAveragePercent = spellBar.average / normalAverage * 100
|
||||
local normalTempoPercent = normalAveragePercent * tempo / 100
|
||||
blockLine3.rightText:SetText(Loc ["STRING_DPS"] .. ": " .. Details:CommaValue(spellTable.n_total / normalTempoPercent))
|
||||
blockLine3.rightText:SetText(Loc ["STRING_HPS"] .. ": " .. Details:CommaValue(spellTable.n_total / normalTempoPercent))
|
||||
end
|
||||
|
||||
---@type number
|
||||
@@ -668,7 +652,36 @@ local onEnterBreakdownSpellBar = function(spellBar) --parei aqui: precisa por no
|
||||
local tempo = (elapsedTime * spellTable.c_total) / math.max(spellTable.total, 0.001)
|
||||
local critAveragePercent = spellBar.average / critAverage * 100
|
||||
local critTempoPercent = critAveragePercent * tempo / 100
|
||||
blockLine3.rightText:SetText(Loc ["STRING_DPS"] .. ": " .. Details:CommaValue(spellTable.c_total / critTempoPercent))
|
||||
blockLine3.rightText:SetText(Loc ["STRING_HPS"] .. ": " .. Details:CommaValue(spellTable.c_total / critTempoPercent))
|
||||
end
|
||||
|
||||
---@type number
|
||||
local overheal = spellTable.overheal
|
||||
if (overheal > 0) then
|
||||
blockIndex = blockIndex + 1 --skip one block
|
||||
---@type breakdownspellblock
|
||||
local critHitsBlock = spellBlockContainer:GetBlock(blockIndex)
|
||||
critHitsBlock:Show()
|
||||
blockIndex = blockIndex + 1
|
||||
|
||||
local blockName
|
||||
if (spellTable.is_shield) then
|
||||
blockName = Loc ["STRING_SHIELD_OVERHEAL"]
|
||||
else
|
||||
blockName = Loc ["STRING_OVERHEAL"]
|
||||
end
|
||||
|
||||
local percent = overheal / (overheal + spellTable.total) * 100
|
||||
critHitsBlock:SetValue(percent)
|
||||
critHitsBlock.sparkTexture:SetPoint("left", critHitsBlock, "left", percent / 100 * critHitsBlock:GetWidth() + spellBreakdownSettings.blockspell_spark_offset, 0)
|
||||
critHitsBlock:SetStatusBarColor(1, 1, 1, .5)
|
||||
|
||||
local blockLine1, blockLine2, blockLine3 = critHitsBlock:GetLines()
|
||||
blockLine1.leftText:SetText(blockName)
|
||||
|
||||
local overhealString = Details:CommaValue(overheal)
|
||||
local overhealText = overhealString .. " / " .. string.format("%.1f", percent) .. "%"
|
||||
blockLine1.rightText:SetText(overhealText)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -682,74 +695,56 @@ end
|
||||
---run this function when the mouse leaves a breakdownspellbar
|
||||
---@param spellBar breakdownspellbar
|
||||
local onLeaveBreakdownSpellBar = function(spellBar)
|
||||
--diminui o tamanho da barra
|
||||
--remove effects on entering the bar line
|
||||
spellBar:SetHeight(CONST_SPELLSCROLL_LINEHEIGHT)
|
||||
--volta com o alfa antigo da barra que era de 0.9
|
||||
spellBar:SetAlpha(0.9)
|
||||
|
||||
--volto o background ao normal
|
||||
spellBar:SetBackdrop(row_backdrop_onleave)
|
||||
spellBar:SetBackdropBorderColor(0, 0, 0, 0)
|
||||
spellBar:SetBackdropColor(0, 0, 0, 0)
|
||||
|
||||
GameTooltip:Hide()
|
||||
GameCooltip:Hide()
|
||||
|
||||
if (spellBar.isMain) then
|
||||
--retira o zoom no icone
|
||||
spellBar.spellIcon:SetSize(CONST_SPELLSCROLL_LINEHEIGHT, CONST_SPELLSCROLL_LINEHEIGHT)
|
||||
spellBar.spellIcon:SetAlpha(1)
|
||||
|
||||
--remover o conte�do que estava sendo mostrado na direita
|
||||
if (breakdownWindow.mostrando_mouse_over) then
|
||||
breakdownWindow.mostrando = nil
|
||||
breakdownWindow.mostrando_mouse_over = false
|
||||
breakdownWindow.showing = nil
|
||||
breakdownWindow.jogador.detalhes = nil
|
||||
spellsTab.HidaAllDetalheInfo()
|
||||
end
|
||||
|
||||
elseif (spellBar.isAlvo) then
|
||||
spellBar:SetHeight(CONST_TARGET_HEIGHT)
|
||||
|
||||
elseif (spellBar.isDetalhe) then
|
||||
spellBar:SetHeight(16)
|
||||
end
|
||||
end
|
||||
|
||||
---on mouse down a breakdownspellbar in the breakdown window
|
||||
---@param spellBar breakdownspellbar
|
||||
---@param button string
|
||||
local onMouseDownBreakdownSpellBar = function(spellBar, button)
|
||||
local x, y = _G.GetCursorPosition()
|
||||
spellBar.cursorPosX = math.floor(x)
|
||||
spellBar.cursorPosY = math.floor(y)
|
||||
Details222.PlayerBreakdown.OnMouseDown(spellBar, button)
|
||||
print(1, spellBar:GetName())
|
||||
if false then
|
||||
local x, y = _G.GetCursorPosition()
|
||||
spellBar.cursorPosX = math.floor(x)
|
||||
spellBar.cursorPosY = math.floor(y)
|
||||
Details222.PlayerBreakdown.OnMouseDown(spellBar, button)
|
||||
end
|
||||
end
|
||||
|
||||
---on mouse up a breakdownspellbar in the breakdown window
|
||||
---@param spellBar breakdownspellbar
|
||||
---@param button string
|
||||
local onMouseUpBreakdownSpellBar = function(spellBar, button)
|
||||
if (spellBar.onMouseUpTime == GetTime()) then
|
||||
return
|
||||
print(2, spellBar:GetName())
|
||||
if false then
|
||||
if (spellBar.onMouseUpTime == GetTime()) then
|
||||
return
|
||||
end
|
||||
|
||||
spellBar.onMouseUpTime = GetTime()
|
||||
|
||||
---@type number, number
|
||||
local x, y = _G.GetCursorPosition()
|
||||
x = math.floor(x)
|
||||
y = math.floor(y)
|
||||
|
||||
---@type boolean
|
||||
local bIsMouseInTheSamePosition = (x == spellBar.cursorPosX) and (y == spellBar.cursorPosY)
|
||||
|
||||
--if the mouse is in the same position, then the user clicked the bar
|
||||
--clicking the bar activate the lock mechanism
|
||||
if (bIsMouseInTheSamePosition) then
|
||||
spellsTab.SelectSpellBar(spellBar)
|
||||
end
|
||||
end
|
||||
|
||||
spellBar.onMouseUpTime = GetTime()
|
||||
|
||||
---@type number, number
|
||||
local x, y = _G.GetCursorPosition()
|
||||
x = math.floor(x)
|
||||
y = math.floor(y)
|
||||
|
||||
---@type boolean
|
||||
local bIsMouseInTheSamePosition = (x == spellBar.cursorPosX) and (y == spellBar.cursorPosY)
|
||||
|
||||
--if the mouse is in the same position, then the user clicked the bar
|
||||
--clicking the bar activate the lock mechanism
|
||||
if (bIsMouseInTheSamePosition) then
|
||||
spellsTab.SelectSpellBar(spellBar)
|
||||
end
|
||||
--print("selecting spell bar")
|
||||
--spellsTab.SelectSpellBar(spellBar)
|
||||
end
|
||||
|
||||
|
||||
@@ -1340,7 +1335,7 @@ function spellsTab.CreateSpellScrollContainer(tabFrame)
|
||||
|
||||
local headerTable = {}
|
||||
|
||||
scrollFrame.Header = DetailsFramework:CreateHeader(scrollFrame, headerTable, headerOptions)
|
||||
scrollFrame.Header = DetailsFramework:CreateHeader(tabFrame, headerTable, headerOptions)
|
||||
scrollFrame.Header:SetPoint("topleft", scrollFrame, "topleft", 0, 0)
|
||||
|
||||
--create the scroll lines
|
||||
@@ -1375,7 +1370,7 @@ local onEnterSpellTarget = function(targetFrame)
|
||||
local spellId = targetFrame.spellId
|
||||
|
||||
---@type actor
|
||||
local actorObject = Details:GetPlayerObjectFromBreakdownWindow()
|
||||
local actorObject = Details:GetActorObjectFromBreakdownWindow()
|
||||
|
||||
local targets
|
||||
if (targetFrame.bIsMainLine) then
|
||||
@@ -1549,16 +1544,45 @@ end
|
||||
---@param index number
|
||||
---@return breakdownspellbar
|
||||
function spellsTab.CreateSpellBar(self, index) --~spellbar ~spellline ~spell ~create ~createline
|
||||
|
||||
if (index == 1) then
|
||||
--on this debug the onmousedown and onmouseup are working properly because is parented to the breakdownWindow
|
||||
--but not on the spellbar which is parented to the spellscrollframe
|
||||
local b = CreateFrame("button", nil, breakdownWindow, "BackdropTemplate")
|
||||
b:SetSize(64, 64)
|
||||
b:EnableMouse(true)
|
||||
b:RegisterForClicks("AnyUp", "AnyDown")
|
||||
b:SetPoint("topleft", breakdownWindow, "topleft", 50, -30)
|
||||
b:SetScript("OnMouseDown", function() print("hi") end)
|
||||
b:SetScript("OnMouseUp", function() print("bye") end)
|
||||
DF:ApplyStandardBackdrop(b)
|
||||
end
|
||||
|
||||
local buttonTest = CreateFrame("button", self:GetName() .. "SpellBarTest" .. index, self, "BackdropTemplate")
|
||||
buttonTest:SetSize(64, 64)
|
||||
buttonTest:EnableMouse(true)
|
||||
buttonTest:RegisterForClicks("AnyUp", "AnyDown")
|
||||
buttonTest:SetFrameStrata("TOOLTIP")
|
||||
buttonTest:SetScript("OnMouseDown", function() print("hi") end)
|
||||
buttonTest:SetScript("OnMouseUp", function() print("bye") end)
|
||||
DF:ApplyStandardBackdrop(buttonTest)
|
||||
|
||||
---@type breakdownspellbar
|
||||
local spellBar = CreateFrame("button", self:GetName() .. "SpellBar" .. index, self, "BackdropTemplate")
|
||||
spellBar:SetHeight(CONST_SPELLSCROLL_LINEHEIGHT)
|
||||
spellBar.index = index
|
||||
|
||||
--size and positioning
|
||||
spellBar:SetHeight(CONST_SPELLSCROLL_LINEHEIGHT)
|
||||
local y = (index-1) * CONST_SPELLSCROLL_LINEHEIGHT * -1 + (1 * -index) - 15
|
||||
spellBar:SetPoint("topleft", self, "topleft", 0, y)
|
||||
spellBar:SetPoint("topright", self, "topright", 0, y)
|
||||
spellBar:SetFrameLevel(self:GetFrameLevel() + 1)
|
||||
|
||||
buttonTest:SetPoint("topleft", self, "topleft", 0, y)
|
||||
|
||||
spellBar:EnableMouse(true)
|
||||
spellBar:RegisterForClicks("LeftButtonDown", "RightButtonUp")
|
||||
spellBar:RegisterForClicks("AnyUp", "AnyDown")
|
||||
spellBar:SetAlpha(0.9)
|
||||
spellBar:SetFrameStrata("HIGH")
|
||||
spellBar:SetScript("OnEnter", onEnterBreakdownSpellBar)
|
||||
spellBar:SetScript("OnLeave", onLeaveBreakdownSpellBar)
|
||||
spellBar:SetScript("OnMouseDown", onMouseDownBreakdownSpellBar)
|
||||
@@ -1567,9 +1591,11 @@ function spellsTab.CreateSpellBar(self, index) --~spellbar ~spellline ~spell ~cr
|
||||
spellBar.ExpandedChildren = {}
|
||||
|
||||
DF:Mixin(spellBar, DF.HeaderFunctions)
|
||||
DF:Mixin(buttonTest, DF.HeaderFunctions)
|
||||
|
||||
---@type statusbar
|
||||
local statusBar = CreateFrame("StatusBar", "$parentStatusBar", spellBar, "BackdropTemplate")
|
||||
statusBar:EnableMouse(false)
|
||||
statusBar:SetFrameLevel(spellBar:GetFrameLevel()-1)
|
||||
statusBar:SetAllPoints()
|
||||
statusBar:SetAlpha(0.5)
|
||||
@@ -1672,91 +1698,9 @@ function spellsTab.CreateSpellBar(self, index) --~spellbar ~spellline ~spell ~cr
|
||||
end
|
||||
|
||||
spellBar:AlignWithHeader(self.Header, "left")
|
||||
|
||||
spellBar.on_focus = false
|
||||
|
||||
return spellBar
|
||||
end
|
||||
|
||||
|
||||
--[=[
|
||||
function gump:CriaNovaBarraInfo2(instance, index) --not used on this file, used on class damage, heal, etc
|
||||
if (_detalhes.playerDetailWindow.barras2[index]) then
|
||||
return
|
||||
end
|
||||
|
||||
local janela = info.container_alvos.gump
|
||||
|
||||
local newBar = CreateFrame("Button", "Details_infobox2_bar_" .. index, info.container_alvos.gump, "BackdropTemplate")
|
||||
newBar:SetHeight(CONST_TARGET_HEIGHT)
|
||||
|
||||
local y = (index-1) * (CONST_TARGET_HEIGHT + 1)
|
||||
y = y* - 1
|
||||
|
||||
newBar:SetPoint("LEFT", janela, "LEFT", CONST_TARGET_HEIGHT, 0)
|
||||
newBar:SetPoint("RIGHT", janela, "RIGHT", 0, 0)
|
||||
newBar:SetPoint("TOP", janela, "TOP", 0, y)
|
||||
newBar:SetFrameLevel(janela:GetFrameLevel() + 1)
|
||||
newBar:EnableMouse(true)
|
||||
newBar:RegisterForClicks("LeftButtonDown","RightButtonUp")
|
||||
|
||||
--icon
|
||||
newBar.icone = newBar:CreateTexture(nil, "OVERLAY")
|
||||
newBar.icone:SetWidth(CONST_TARGET_HEIGHT)
|
||||
newBar.icone:SetHeight(CONST_TARGET_HEIGHT)
|
||||
newBar.icone:SetPoint("RIGHT", newBar, "LEFT", 0, 0)
|
||||
|
||||
CriaTexturaBarra(newBar)
|
||||
|
||||
newBar:SetAlpha(ALPHA_BLEND_AMOUNT)
|
||||
newBar.icone:SetAlpha(1)
|
||||
|
||||
newBar.isAlvo = true
|
||||
|
||||
SetBarraScripts(newBar, instance, index)
|
||||
|
||||
info.barras2[index] = newBar --barra adicionada
|
||||
|
||||
return newBar
|
||||
end
|
||||
|
||||
function gump:CriaNovaBarraInfo3(instance, index) --not used on this file, used on class damage, heal, etc
|
||||
if (_detalhes.playerDetailWindow.barras3[index]) then
|
||||
return
|
||||
end
|
||||
|
||||
local janela = info.container_detalhes
|
||||
|
||||
local newBar = CreateFrame("button", "Details_infobox3_bar_" .. index, janela, "BackdropTemplate")
|
||||
newBar:SetHeight(16)
|
||||
|
||||
local y = (index-1) * 17
|
||||
y = y*-1
|
||||
|
||||
container3_bars_pointFunc(newBar, index) --what this fun does?
|
||||
newBar:EnableMouse(true)
|
||||
|
||||
--icon
|
||||
newBar.icone = newBar:CreateTexture(nil, "OVERLAY")
|
||||
newBar.icone:SetWidth(14)
|
||||
newBar.icone:SetHeight(14)
|
||||
newBar.icone:SetPoint("LEFT", newBar, "LEFT", 0, 0)
|
||||
|
||||
CriaTexturaBarra(newBar)
|
||||
|
||||
newBar:SetAlpha(0.9)
|
||||
newBar.icone:SetAlpha(1)
|
||||
|
||||
newBar.isDetalhe = true
|
||||
|
||||
SetBarraScripts(newBar, instance, index)
|
||||
|
||||
info.barras3[index] = newBar
|
||||
|
||||
return newBar
|
||||
end
|
||||
--]=]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
--> report data
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ function Details:OpenPlayerDetails(window)
|
||||
if (instance) then
|
||||
local display, subDisplay = instance:GetDisplay()
|
||||
if (display == 1) then
|
||||
instance:AbreJanelaInfo (Details:GetPlayer(false, 1))
|
||||
Details:OpenBreakdownWindow(instance, Details:GetPlayer(false, 1))
|
||||
elseif (display == 2) then
|
||||
instance:AbreJanelaInfo (Details:GetPlayer(false, 2))
|
||||
Details:OpenBreakdownWindow(instance, Details:GetPlayer(false, 2))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -146,6 +146,10 @@ local spellTable_FieldsToSum = {
|
||||
["b_dmg"] = true,
|
||||
["a_amt"] = true,
|
||||
["a_dmg"] = true,
|
||||
["totalabsorb"] = true,
|
||||
["absorbed"] = true,
|
||||
["overheal"] = true,
|
||||
["totaldenied"] = true,
|
||||
}
|
||||
|
||||
---get the array of spelltables and sum each spellTable with the first spellTable found or on targetTable
|
||||
|
||||
@@ -471,9 +471,6 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy)
|
||||
--update tooltip settings
|
||||
_detalhes:SetTooltipBackdrop()
|
||||
|
||||
--update player detail window
|
||||
_detalhes:ApplyPDWSkin()
|
||||
|
||||
--update the numerical system
|
||||
_detalhes:SelectNumericalSystem()
|
||||
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ function Details:StartMeUp()
|
||||
Details.MicroButtonAlert:Hide()
|
||||
|
||||
--actor details window
|
||||
Details.playerDetailWindow = Details.gump:CriaJanelaInfo()
|
||||
Details.playerDetailWindow = Details:CreateBreakdownWindow()
|
||||
Details.FadeHandler.Fader(Details.playerDetailWindow, 1)
|
||||
|
||||
--copy and paste window
|
||||
|
||||
Reference in New Issue
Block a user