Several bug fixes, visual updates on m+ panel, fixed m+ chart again, more updates for Breakdown Wndow

This commit is contained in:
Tercio Jose
2024-08-17 00:03:03 -03:00
committed by andrew6180
parent dc2758ccbe
commit 97e83c95e3
17 changed files with 122 additions and 57 deletions
@@ -324,7 +324,7 @@ local createGenericBar = function(self, index) --~create ~generic ~creategeneric
---@type texture this is the statusbar texture
local statusBarTexture = statusBar:CreateTexture("$parentTexture", "artwork")
statusBarTexture:SetTexture(SharedMedia:Fetch("statusbar", "Details Hyanda"))
statusBarTexture:SetTexture(SharedMedia:Fetch("statusbar", Details.breakdown_general.bar_texture))
statusBar:SetStatusBarTexture(statusBarTexture)
statusBar:SetStatusBarColor(1, 1, 1, 1)
@@ -61,7 +61,7 @@ function spellsTab.CreatePhaseBar(self, index) --~create ~createphase ~phasebar
---@type texture this is the statusbar texture
local statusBarTexture = statusBar:CreateTexture("$parentTexture", "artwork")
statusBarTexture:SetTexture(SharedMedia:Fetch("statusbar", "Details Hyanda"))
statusBarTexture:SetTexture(SharedMedia:Fetch("statusbar", Details.breakdown_general.bar_texture))
statusBar:SetStatusBarTexture(statusBarTexture)
statusBar:SetStatusBarColor(1, 1, 1, 1)
@@ -117,19 +117,22 @@ local onEnterSpellTarget = function(targetFrame)
---@type number the top value of targets
local topValue = math.max(targets[1] and targets[1][2] or 0, 0.001)
local cooltip = GameCooltip
cooltip:Preset(2)
local gameCooltip = GameCooltip
--cooltip:Preset(2)
Details:FormatCooltipForSpells()
gameCooltip:SetOption("FixedWidth", 260)
gameCooltip:SetOption("YSpacingMod", -8)
for targetIndex, targetTable in ipairs(targets) do
local targetName = targetTable[1]
local value = targetTable[2]
cooltip:AddLine(targetIndex .. ". " .. targetName, Details:Format(value))
GameCooltip:AddIcon(CONST_TARGET_TEXTURE, 1, 1, 14, 14)
gameCooltip:AddLine(targetIndex .. ". " .. targetName, Details:Format(value))
gameCooltip:AddIcon(CONST_TARGET_TEXTURE, 1, 1, 20, 20)
Details:AddTooltipBackgroundStatusbar(false, value / topValue * 100)
end
cooltip:SetOwner(targetFrame)
cooltip:Show()
gameCooltip:SetOwner(targetFrame)
gameCooltip:Show()
end
local onLeaveSpellTarget = function(self)
@@ -1094,7 +1097,13 @@ local updateSpellBar = function(spellBar, index, actorName, combatObject, scroll
textIndex = textIndex + 1
elseif (header.name == "uptime") then --need to get the uptime of the spell with the biggest uptime
text:SetText(string.format("%.1f", uptime / combatTime * 100) .. "%")
local uptimePercent = uptime / combatTime * 100
if (uptimePercent > 0) then
text:SetText(string.format("%.1f", uptime / combatTime * 100) .. "%")
else
text:SetText("")
end
spellBar:AddFrameToHeaderAlignment(text)
textIndex = textIndex + 1
@@ -560,7 +560,7 @@ function spellsTab.CreateTargetBar(self, index) --~create ~target ~createtarget
---@type texture this is the statusbar texture
local statusBarTexture = statusBar:CreateTexture("$parentTexture", "artwork")
statusBarTexture:SetTexture(SharedMedia:Fetch("statusbar", "Details Hyanda"))
statusBarTexture:SetTexture(SharedMedia:Fetch("statusbar", Details.breakdown_general.bar_texture))
statusBar:SetStatusBarTexture(statusBarTexture)
statusBar:SetStatusBarColor(1, 1, 1, 1)
@@ -269,7 +269,7 @@ function Details222.BreakdownWindow.RefreshPlayerScroll()
end
Details.PlayerBreakdown.RoundedCornerPreset = {
roundness = 6,
roundness = 12,
color = {.1, .1, .1, 0.834},
}
@@ -799,9 +799,13 @@ function Details:CreateBreakdownWindow()
breakdownWindowFrame.SummaryWindowWidgets:Hide()
local scaleBar = detailsFramework:CreateScaleBar(breakdownWindowFrame, Details.player_details_window)
scaleBar.label:SetPointOffset(-6, 3)
scaleBar.label:AdjustPointsOffset(-3, 1)
scaleBar.label:SetTextColor(0.8902, 0.7294, 0.0157, 1)
scaleBar.label:SetIgnoreParentAlpha(true)
breakdownWindowFrame:SetScale(Details.player_details_window.scale)
--1, 0.8235, 0, 1 - text color of the label of the scale bar | plugins text color: 0.8902, 0.7294, 0.0157, 1 | 0.8902, 0.7294, 0.0157, 1
--class icon
breakdownWindowFrame.classIcon = breakdownWindowFrame:CreateTexture(nil, "overlay", nil, 1)
breakdownWindowFrame.classIcon:SetPoint("topleft", breakdownWindowFrame, "topleft", 2, -17)
@@ -818,7 +822,7 @@ function Details:CreateBreakdownWindow()
--title
detailsFramework:NewLabel(breakdownWindowFrame, breakdownWindowFrame, nil, "titleText", Loc ["STRING_PLAYER_DETAILS"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
breakdownWindowFrame.titleText:SetPoint("center", breakdownWindowFrame, "center")
breakdownWindowFrame.titleText:SetPoint("top", breakdownWindowFrame, "top", 0, -3)
breakdownWindowFrame.titleText:SetPoint("top", breakdownWindowFrame, "top", 0, -5)
--create the texts shown on the window
do
@@ -875,7 +879,7 @@ function Details:CreateBreakdownWindow()
function breakdownWindowFrame:SetStatusbarText(text, fontSize, fontColor)
if (not text) then
breakdownWindowFrame:SetStatusbarText("Details! Damage Meter | Click 'Options' button for settings.", 10, "gray")
breakdownWindowFrame:SetStatusbarText("An AddOn by Terciob | Part of Details! Damage Meter | Click 'Options' button for settings.", 10, "gray")
return
end
statusBar.Text.text = text
@@ -884,7 +888,7 @@ function Details:CreateBreakdownWindow()
end
local rightClickToCloseLabel = Details:CreateRightClickToCloseLabel(statusBar)
rightClickToCloseLabel:SetPoint("right", -332, 4)
rightClickToCloseLabel:SetPoint("right", -283, 3)
--set default text
breakdownWindowFrame:SetStatusbarText()
@@ -338,6 +338,9 @@ local createPlayerScrollBox = function(breakdownWindowFrame, breakdownSideMenu,
totalStatusBar:SetAlpha(0.5)
totalStatusBar:SetPoint("bottomleft", specIcon, "bottomright", 0, 0)
local gradientTexture = DetailsFramework:CreateTexture(OTTFrame, {gradient = "horizontal", fromColor = {.1, .1, .1, .634}, toColor = "transparent"}, 100, 1, "border", {0, 1, 0, 1}, "segmentsGradient")
gradientTexture:SetPoint("lefts")
line.specIcon = specIcon
line.roleIcon = roleIcon
line.playerName = playerName
@@ -524,8 +527,12 @@ local createSegmentsScrollBox = function(breakdownWindowFrame, breakdownSideMenu
line.segmentText = segmentText
line.segmentIcon = segmentIcon
--create a texture gradient in horizontal with the left side starting from black and the right side ending in transparent, the width is 40 and is placed at the left side of the line
local gradientTexture = DetailsFramework:CreateTexture(line, {gradient = "horizontal", fromColor = {.1, .1, .1, .634}, toColor = "transparent"}, 100, 1, "border", {0, 1, 0, 1}, "segmentsGradient")
gradientTexture:SetPoint("lefts")
segmentIcon:SetPoint("left", line, "left", 2, 0)
segmentText:SetPoint("left", segmentIcon.widget, "right", 3, 1)
segmentText:SetPoint("left", segmentIcon.widget, "right", 5, 0)
line.UpdateLine = updateSegmentLine
@@ -548,7 +555,8 @@ local createSegmentsScrollBox = function(breakdownWindowFrame, breakdownSideMenu
breakdownWindowFrame.segmentScrollBox = segmentsScroll
--remove the standard backdrop
segmentsScroll:SetBackdrop({})
segmentsScroll:SetBackdrop(nil)
segmentsScroll.__background:Hide()
--create the scrollbox lines
for i = 1, scrollbox_lines do
@@ -207,10 +207,10 @@ local spellContainerColumnData = {
{name = "persecond", label = "ps", key = "total", width = 50, align = "left", enabled = false, canSort = true, sortKey = "ps", offset = columnOffset, order = "DESC", dataType = "number"},
{name = "percent", label = "%", key = "total", width = 50, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "casts", label = "casts", key = "casts", width = 40, align = "left", enabled = false, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "critpercent", label = "crit %", key = "critpercent", width = 40, align = "left", enabled = false, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "hits", label = "hits", key = "counter", width = 40, align = "left", enabled = false, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "critpercent", label = "crit %", key = "critpercent", width = 40, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "hits", label = "hits", key = "counter", width = 40, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "castavg", label = "cast avg", key = "castavg", width = 50, align = "left", enabled = false, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "uptime", label = "uptime", key = "uptime", width = 45, align = "left", enabled = false, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "uptime", label = "uptime", key = "uptime", width = 45, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "overheal", label = "overheal", key = "overheal", width = 70, align = "left", enabled = true, canSort = true, order = "DESC", dataType = "number", attribute = DETAILS_ATTRIBUTE_HEAL, offset = columnOffset},
{name = "absorbed", label = "absorbed", key = "healabsorbed", width = 55, align = "left", enabled = false, canSort = true, order = "DESC", dataType = "number", attribute = DETAILS_ATTRIBUTE_HEAL, offset = columnOffset},
}
@@ -130,7 +130,7 @@ local createOptionsPanel = function()
{type = "blank"},
{type = "label", get = function() return "Spell Header Options" end, text_template = subSectionTitleTextTemplate},
{type = "label", get = function() return "What to Show" end, text_template = subSectionTitleTextTemplate},
{ --per second
type = "toggle",
get = function() return Details.breakdown_spell_tab.spellcontainer_headers["persecond"].enabled end,