Skip to content

Commit

Permalink
Several bug fixes, visual updates on m+ panel, fixed m+ chart again, …
Browse files Browse the repository at this point in the history
…more updates for Breakdown Wndow
  • Loading branch information
Tercioo committed Aug 17, 2024
1 parent 5a110cc commit cd9a11d
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 90 deletions.
8 changes: 8 additions & 0 deletions Libs/DF/charts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ local lazyChartUpdate = function(payload, iterationCount, maxIterations)
fillLine:SetEndPoint("bottomleft", endX, 0)
fillLine:SetDrawLayer("overlay", self.depth)
fillLine:SetColorTexture(r, g, b, 0.15 + (self.depth/10))

fillLine:Show()
end
end
end
Expand Down Expand Up @@ -966,6 +968,12 @@ detailsFramework.ChartFrameMixin = {
fillLineThickness = fillLineThickness,
}

for i = #fillerLines_InUse, 1, -1 do
local line = table.remove(fillerLines_InUse, i)
fillerLines_InAvailable[#fillerLines_InAvailable+1] = line
line:Hide()
end

detailsFramework.Schedules.LazyExecute(lazyChartUpdate, payload)

self:ShowBackdropIndicators()
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 = 562
local dversion = 563
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down
35 changes: 2 additions & 33 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,8 @@ do
---@type table
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
--default bars
SharedMedia:Register("statusbar", "Details Hyanda Reverse", [[Interface\AddOns\Details\images\bar_textures\bar_hyanda_reverse.png]])
SharedMedia:Register("statusbar", "You Are the Best!", [[Interface\AddOns\Details\images\bar_textures\bar_best.png]])
SharedMedia:Register("statusbar", "Details Hyanda", [[Interface\AddOns\Details\images\bar_hyanda]])

SharedMedia:Register("statusbar", "Details D'ictum", [[Interface\AddOns\Details\images\bar4]])
Expand Down Expand Up @@ -1859,39 +1861,6 @@ function Details:DestroyActor(actorObject, actorContainer, combatObject, callSta
actorObject.__destroyedBy = debugstack(callStackDepth or 2, 1, 0)
end

local restrictedAddons = {
'!!WWAddOnsFix',
}

local restrictedAddonFrame = CreateFrame('frame')
restrictedAddonFrame:RegisterEvent('PLAYER_ENTERING_WORLD')

local function disableRestrictedAddons()
for _, addonName in pairs(restrictedAddons) do
if C_AddOns.GetAddOnEnableState(addonName) ~= 0 then
StaticPopupDialogs["DETAILS_RESTRICTED_ADDON"] = {
text = "You are running " .. addonName .. " which is incompatible with Details! Damage Meter. It must be disabled for Details to function properly.",
button1 = "Disable " .. addonName,
button2 = "Disable Details!",
OnAccept = function()
C_AddOns.DisableAddOn(addonName)
ReloadUI()
end,
OnCancel = function()
C_AddOns.DisableAddOn('Details')
ReloadUI()
end,
timeout = 0,
whileDead = true,
}
StaticPopup_Show("DETAILS_RESTRICTED_ADDON")
break
end
end
end

restrictedAddonFrame:SetScript('OnEvent', function() C_Timer.After(2, disableRestrictedAddons) end )

C_Timer.After(5, function()
--TutorialPointerFrame_1:HookScript("OnShow", function(self) self:Hide() end) --remove on v11 launch
end)
10 changes: 6 additions & 4 deletions core/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1385,10 +1385,12 @@
if (frame.GetActor) then
local actor = frame:GetActor()
if (actor) then
local class = actor:Class()
local classColor = RAID_CLASS_COLORS[class]
GameCooltip:SetBackdrop(1, backdrop, classColor, borderColor)
GameCooltip:SetColor(1, 0, 0, 0, 0.7)
local class = actor.classe
if (class) then
local classColor = RAID_CLASS_COLORS[class]
GameCooltip:SetBackdrop(1, backdrop, classColor, borderColor)
GameCooltip:SetColor(1, 0, 0, 0, 0.7)
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion frames/window_breakdown/breakdown_spells_genericframes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion frames/window_breakdown/breakdown_spells_phaseframes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
23 changes: 16 additions & 7 deletions frames/window_breakdown/breakdown_spells_spellframes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion frames/window_breakdown/breakdown_spells_targetframes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
14 changes: 9 additions & 5 deletions frames/window_breakdown/window_playerbreakdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ function Details222.BreakdownWindow.RefreshPlayerScroll()
end

Details.PlayerBreakdown.RoundedCornerPreset = {
roundness = 6,
roundness = 12,
color = {.1, .1, .1, 0.834},
}

Expand Down Expand Up @@ -799,9 +799,13 @@ function Details:CreateBreakdownWindow()
breakdownWindowFrame.SummaryWindowWidgets:Hide()

local scaleBar = detailsFramework:CreateScaleBar(breakdownWindowFrame, Details.player_details_window)
scaleBar.label:AdjustPointsOffset(-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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down
12 changes: 10 additions & 2 deletions frames/window_breakdown/window_playerbreakdown_list.lua
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,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
Expand Down Expand Up @@ -558,8 +561,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

Expand All @@ -582,7 +589,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
Expand Down
6 changes: 3 additions & 3 deletions frames/window_breakdown/window_playerbreakdown_spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions frames/window_mythicplus/window_chart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,16 @@ function mythicDungeonCharts.ShowChart()
local combatTime = mythicDungeonCharts.ChartTable.ElapsedTime

local opacity = 1
local smoothnessLevel = 50
--local smoothnessLevel = 50
--local smoothMethod = "loess"
local smoothnessLevel = 20
local smoothMethod = "loess"
local smoothMethod = "sma"

local chartSize = #chartData

local shrinkBy = 1
if (chartSize >= 600) then
shrinkBy = math.max(2, math.floor(chartSize/400))
if (chartSize >= 800) then
shrinkBy = math.max(2, math.floor(chartSize/800))
end

local reducedData = chartFrame:ShrinkData(chartData, shrinkBy)
Expand Down
Loading

0 comments on commit cd9a11d

Please sign in to comment.