Better options for Real Time DPS
- Removed 'Real Time DPS' from the time measure dropdown. - Added "Show 'Real Time' DPS" toggle to show real time dps while in combat. - Added "Order Bars By Real Time DPS" toggle to order bars by the amount of real time dps. - Added "Always Use Real Time in Arenas" toggle to always use real time dps in Arenas. - Added .last_dps_realtime to player actors, caches the latest real time dps calculated.
This commit is contained in:
@@ -243,6 +243,12 @@ function Details222.BreakdownWindow.RefreshPlayerScroll()
|
||||
end
|
||||
end
|
||||
|
||||
Details.PlayerBreakdown.RoundedCornerPreset = {
|
||||
roundness = 6,
|
||||
color = {.1, .1, .1, 0.98},
|
||||
border_color = {.05, .05, .05, 0.834},
|
||||
}
|
||||
|
||||
---open the breakdown window
|
||||
---@param self details
|
||||
---@param instanceObject instance
|
||||
@@ -255,6 +261,13 @@ function Details:OpenBreakdownWindow(instanceObject, actorObject, bFromAttribute
|
||||
---@type number, number
|
||||
local mainAttribute, subAttribute = instanceObject:GetDisplay()
|
||||
|
||||
if (not breakdownWindowFrame.__rcorners) then
|
||||
breakdownWindowFrame:SetBackdropColor(.1, .1, .1, 0)
|
||||
breakdownWindowFrame:SetBackdropBorderColor(.1, .1, .1, 0)
|
||||
breakdownWindowFrame.__background:Hide()
|
||||
detailsFramework:AddRoundedCornersToFrame(breakdownWindowFrame, Details.PlayerBreakdown.RoundedCornerPreset)
|
||||
end
|
||||
|
||||
if (not Details.row_singleclick_overwrite[mainAttribute] or not Details.row_singleclick_overwrite[mainAttribute][subAttribute]) then
|
||||
Details:CloseBreakdownWindow()
|
||||
return
|
||||
@@ -711,7 +724,8 @@ function Details:CreateBreakdownWindow()
|
||||
table.insert(summaryWidgets, SWW) --where SummaryWidgets is declared: at the header of the file, what is the purpose of this table?
|
||||
breakdownWindowFrame.SummaryWindowWidgets:Hide()
|
||||
|
||||
detailsFramework:CreateScaleBar(breakdownWindowFrame, Details.player_details_window)
|
||||
local scaleBar = detailsFramework:CreateScaleBar(breakdownWindowFrame, Details.player_details_window)
|
||||
scaleBar.label:AdjustPointsOffset(-6, 3)
|
||||
breakdownWindowFrame:SetScale(Details.player_details_window.scale)
|
||||
|
||||
--class icon
|
||||
@@ -720,21 +734,17 @@ function Details:CreateBreakdownWindow()
|
||||
breakdownWindowFrame.classIcon:SetSize(54, 54)
|
||||
breakdownWindowFrame.classIcon:SetAlpha(0.7)
|
||||
|
||||
--close button
|
||||
breakdownWindowFrame.closeButton = CreateFrame("Button", nil, breakdownWindowFrame, "UIPanelCloseButton")
|
||||
breakdownWindowFrame.closeButton:SetSize(20, 20)
|
||||
breakdownWindowFrame.closeButton:SetPoint("TOPRIGHT", breakdownWindowFrame, "TOPRIGHT", -5, -4)
|
||||
breakdownWindowFrame.closeButton:SetFrameLevel(breakdownWindowFrame:GetFrameLevel()+5)
|
||||
breakdownWindowFrame.closeButton:GetNormalTexture():SetDesaturated(true)
|
||||
breakdownWindowFrame.closeButton:GetNormalTexture():SetVertexColor(.6, .6, .6)
|
||||
breakdownWindowFrame.closeButton:SetScript("OnClick", function(self)
|
||||
local closeButton = detailsFramework:CreateCloseButton(breakdownWindowFrame)
|
||||
closeButton:SetPoint("topright", breakdownWindowFrame, "topright", -2, -2)
|
||||
closeButton:SetScript("OnClick", function(self)
|
||||
Details:CloseBreakdownWindow()
|
||||
end)
|
||||
breakdownWindowFrame.closeButton = closeButton
|
||||
|
||||
--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, -6)
|
||||
breakdownWindowFrame.titleText:SetPoint("top", breakdownWindowFrame, "top", 0, -3)
|
||||
|
||||
--create the texts shown on the window
|
||||
do
|
||||
@@ -766,17 +776,18 @@ function Details:CreateBreakdownWindow()
|
||||
statusBar:SetPoint("bottomleft", breakdownWindowFrame, "bottomleft")
|
||||
statusBar:SetPoint("bottomright", breakdownWindowFrame, "bottomright")
|
||||
statusBar:SetHeight(PLAYER_DETAILS_STATUSBAR_HEIGHT)
|
||||
detailsFramework:ApplyStandardBackdrop(statusBar)
|
||||
--detailsFramework:ApplyStandardBackdrop(statusBar)
|
||||
statusBar:SetAlpha(PLAYER_DETAILS_STATUSBAR_ALPHA)
|
||||
breakdownWindowFrame.statusBar = statusBar
|
||||
|
||||
statusBar.Text = detailsFramework:CreateLabel(statusBar)
|
||||
statusBar.Text:SetPoint("left", 2, 0)
|
||||
statusBar.Text:SetPoint("left", 12, 0)
|
||||
|
||||
--create the gradients in the top and bottom side of the breakdown window
|
||||
local gradientStartColor = Details222.ColorScheme.GetColorFor("gradient-background")
|
||||
local gradientUp = detailsFramework:CreateTexture(breakdownWindowFrame, {gradient = "vertical", fromColor = gradientStartColor, toColor = {0, 0, 0, 0.2}}, 1, 68, "artwork", {0, 1, 0, 1})
|
||||
gradientUp:SetPoint("tops", 1, 1)
|
||||
gradientUp:SetPoint("tops", 1, 18)
|
||||
--gradientUp:Hide()
|
||||
|
||||
local gradientHeight = 481
|
||||
local gradientDown = detailsFramework:CreateTexture(breakdownWindowFrame, {gradient = "vertical", fromColor = "transparent", toColor = {0, 0, 0, 0.7}}, 1, gradientHeight, "border", {0, 1, 0, 1})
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
|
||||
local Details = _G.Details
|
||||
|
||||
---@class detailsframework
|
||||
local detailsFramework = _G.DetailsFramework
|
||||
|
||||
local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0", true)
|
||||
local addonName, Details222 = ...
|
||||
|
||||
@@ -11,6 +14,7 @@ local C_Timer = _G.C_Timer
|
||||
local tinsert = table.insert
|
||||
local CreateFrame = CreateFrame
|
||||
local GetSpecializationInfoByID = GetSpecializationInfoByID
|
||||
local PixelUtil = PixelUtil
|
||||
|
||||
local scrollbox_size = {215, 405}
|
||||
local scrollbox_lines = 19
|
||||
@@ -30,20 +34,30 @@ function breakdownWindowPlayerList.CreatePlayerListFrame()
|
||||
local pluginsFrame = breakdownWindowFrame.BreakdownPluginSelectionFrame
|
||||
|
||||
breakdownSideMenu:SetSize(scrollbox_size[1], scrollbox_size[2])
|
||||
breakdownSideMenu:SetPoint("topright", breakdownWindowFrame, "topleft", 0, 0)
|
||||
breakdownSideMenu:SetPoint("bottomright", breakdownWindowFrame, "bottomleft", 0, 0)
|
||||
detailsFramework:ApplyStandardBackdrop(breakdownSideMenu)
|
||||
breakdownSideMenu.RightEdge:Hide()
|
||||
PixelUtil.SetPoint(breakdownSideMenu, "topright", breakdownWindowFrame, "topleft", -2, 0)
|
||||
PixelUtil.SetPoint(breakdownSideMenu, "bottomright", breakdownWindowFrame, "bottomleft", -2, 0)
|
||||
--detailsFramework:ApplyStandardBackdrop(breakdownSideMenu)
|
||||
--breakdownSideMenu.RightEdge:Hide()
|
||||
|
||||
detailsFramework:AddRoundedCornersToFrame(breakdownSideMenu, Details.PlayerBreakdown.RoundedCornerPreset)
|
||||
|
||||
local titleHeight = 20
|
||||
--plugins menu title bar
|
||||
local titleBarPlugins = CreateFrame("frame", nil, breakdownSideMenu, "BackdropTemplate")
|
||||
PixelUtil.SetPoint(titleBarPlugins, "topleft", breakdownSideMenu, "topleft", 2, -3)
|
||||
PixelUtil.SetPoint(titleBarPlugins, "topright", breakdownSideMenu, "topright", -2, -3)
|
||||
PixelUtil.SetPoint(titleBarPlugins, "topleft", breakdownSideMenu, "topleft", 2, -0)
|
||||
PixelUtil.SetPoint(titleBarPlugins, "topright", breakdownSideMenu, "topright", -2, -0)
|
||||
titleBarPlugins:SetHeight(titleHeight)
|
||||
titleBarPlugins:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
|
||||
titleBarPlugins:SetBackdropColor(.5, .5, .5, 1)
|
||||
titleBarPlugins:SetBackdropBorderColor(0, 0, 0, 1)
|
||||
--titleBarPlugins:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
|
||||
--titleBarPlugins:SetBackdropColor(.5, .5, .5, 1)
|
||||
--titleBarPlugins:SetBackdropBorderColor(0, 0, 0, 1)
|
||||
|
||||
---@type df_roundedpanel_preset
|
||||
--local titleBarRoundedCornerPreset = {
|
||||
-- roundness = 5,
|
||||
-- color = {.05, .05, .05, 1},
|
||||
-- border_color = "transparent",
|
||||
--}
|
||||
--detailsFramework:AddRoundedCornersToFrame(titleBarPlugins, titleBarRoundedCornerPreset)
|
||||
|
||||
--title label
|
||||
local titleBarPlugins_TitleLabel = detailsFramework:NewLabel(titleBarPlugins, titleBarPlugins, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
|
||||
@@ -53,9 +67,9 @@ function breakdownWindowPlayerList.CreatePlayerListFrame()
|
||||
--plugins menu title bar
|
||||
local titleBarPlayerSeparator = CreateFrame("frame", nil, breakdownSideMenu, "BackdropTemplate")
|
||||
titleBarPlayerSeparator:SetHeight(titleHeight)
|
||||
titleBarPlayerSeparator:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
|
||||
titleBarPlayerSeparator:SetBackdropColor(.5, .5, .5, 1)
|
||||
titleBarPlayerSeparator:SetBackdropBorderColor(0, 0, 0, 1)
|
||||
--titleBarPlayerSeparator:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
|
||||
--titleBarPlayerSeparator:SetBackdropColor(.5, .5, .5, 1)
|
||||
--titleBarPlayerSeparator:SetBackdropBorderColor(0, 0, 0, 1)
|
||||
|
||||
--title label
|
||||
local titleBarTools_TitleLabel = detailsFramework:NewLabel(titleBarPlayerSeparator, titleBarPlayerSeparator, nil, "titulo", "Players", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
|
||||
@@ -349,12 +363,6 @@ function breakdownWindowPlayerList.CreatePlayerListFrame()
|
||||
totalStatusBar:SetFrameLevel(line:GetFrameLevel()+1)
|
||||
totalStatusBar:SetAlpha(0.5)
|
||||
|
||||
--setup anchors
|
||||
--specIcon:SetPoint("topleft", line, "topleft", 0, 0)
|
||||
--roleIcon:SetPoint("topleft", specIcon, "topright", 2, 0)
|
||||
--playerName:SetPoint("topleft", specIcon, "topright", 2, -3)
|
||||
--className:SetPoint("topleft", roleIcon, "bottomleft", 0, -2)
|
||||
--rankText:SetPoint("right", line, "right", -2, 0)
|
||||
totalStatusBar:SetPoint("bottomleft", specIcon, "bottomright", 0, 0)
|
||||
|
||||
line.specIcon = specIcon
|
||||
@@ -388,12 +396,14 @@ function breakdownWindowPlayerList.CreatePlayerListFrame()
|
||||
playerScroll.ScrollBar:ClearAllPoints()
|
||||
playerScroll.ScrollBar:SetPoint("topright", playerScroll, "topright", -2, -37)
|
||||
playerScroll.ScrollBar:SetPoint("bottomright", playerScroll, "bottomright", -2, 17)
|
||||
breakdownWindowFrame.playerScrollBox = playerScroll
|
||||
playerScroll.ScrollBar:Hide()
|
||||
|
||||
--remove the standard backdrop
|
||||
playerScroll:SetBackdrop({})
|
||||
playerScroll:SetBackdropColor(0, 0, 0, 0)
|
||||
playerScroll:SetBackdropBorderColor(0, 0, 0, 0)
|
||||
breakdownWindowFrame.playerScrollBox = playerScroll
|
||||
playerScroll.__background:Hide()
|
||||
|
||||
--need to be created before
|
||||
breakdownWindowFrame.Header = DetailsFramework:CreateHeader(playerScroll, headerTable, headerOptions)
|
||||
@@ -500,10 +510,10 @@ function breakdownWindowPlayerList.CreatePlayerListFrame()
|
||||
end
|
||||
end)
|
||||
|
||||
local gradientStartColor = Details222.ColorScheme.GetColorFor("gradient-background")
|
||||
local gradientBelow = DetailsFramework:CreateTexture(breakdownWindowFrame.playerScrollBox,
|
||||
{gradient = "vertical", fromColor = gradientStartColor, toColor = "transparent"}, 1, 90, "artwork", {0, 1, 0, 1})
|
||||
gradientBelow:SetPoint("bottoms", 1, 1)
|
||||
--local gradientStartColor = Details222.ColorScheme.GetColorFor("gradient-background")
|
||||
--local gradientBelow = DetailsFramework:CreateTexture(breakdownWindowFrame.playerScrollBox,
|
||||
--{gradient = "vertical", fromColor = gradientStartColor, toColor = "transparent"}, 1, 90, "artwork", {0, 1, 0, 1})
|
||||
--gradientBelow:SetPoint("bottoms", 1, 1)
|
||||
end
|
||||
|
||||
function Details.PlayerBreakdown.CreatePlayerListFrame()
|
||||
|
||||
@@ -547,13 +547,22 @@ function spellsTab.OnCreateTabCallback(tabButton, tabFrame) --~init
|
||||
--spellsTab.CreateReportButtons(tabFrame)
|
||||
|
||||
--create a button in the breakdown window to open the options for this tab
|
||||
local optionsButton = DF:CreateButton(tabFrame, Details.OpenSpellBreakdownOptions, 130, 20, "options", 14, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
|
||||
optionsButton:SetPoint("bottomright", tabFrame, "bottomright", -5, 5)
|
||||
optionsButton.textsize = 16
|
||||
optionsButton.textcolor = "yellow"
|
||||
local optionsButton = DF:CreateButton(tabFrame, Details.OpenSpellBreakdownOptions, 130, 18, "options", 14)
|
||||
--optionsButton:SetTemplate(DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
|
||||
optionsButton:SetPoint("bottomright", tabFrame, "bottomright", -10, -19)
|
||||
optionsButton.textsize = 12
|
||||
optionsButton.textcolor = "orange"
|
||||
|
||||
---@type df_roundedpanel_preset
|
||||
local preset = {
|
||||
roundness = 5,
|
||||
color = {.2, .2, .2, 0.98},
|
||||
border_color = {.1, .1, .1, 0.834},
|
||||
}
|
||||
DF:AddRoundedCornersToFrame(optionsButton, preset)
|
||||
|
||||
--open the breakdown window at startup for testing
|
||||
--[=[ debug
|
||||
--[= debug
|
||||
C_Timer.After(1, function()
|
||||
Details:OpenPlayerDetails(1)
|
||||
C_Timer.After(1, function()
|
||||
|
||||
@@ -148,7 +148,7 @@ function Details:RefreshScrollBar(x) --x = amount of bars being refreshed
|
||||
if (self.update) then
|
||||
self.update = false
|
||||
self.v_barras = true
|
||||
return Details:EsconderBarrasNaoUsadas(self)
|
||||
return Details:HideBarsNotInUse(self)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -200,11 +200,12 @@ do
|
||||
Details:RefreshMainWindow(-1, true)
|
||||
afterUpdate()
|
||||
end
|
||||
|
||||
local timetypeOptions = {
|
||||
--localize-me
|
||||
{value = 1, label = "Activity Time", onclick = onSelectTimeType, icon = "Interface\\Icons\\Achievement_Quests_Completed_Daily_08", iconcolor = {1, .9, .9}, texcoord = {0.078125, 0.921875, 0.078125, 0.921875}},
|
||||
{value = 2, label = "Effective Time", onclick = onSelectTimeType, icon = "Interface\\Icons\\Achievement_Quests_Completed_08"},
|
||||
{value = 3, label = "Real Time", onclick = onSelectTimeType, icon = "Interface\\Icons\\Ability_Evoker_TipTheScales"},
|
||||
--{value = 3, label = "Real Time", onclick = onSelectTimeType, icon = "Interface\\Icons\\Ability_Evoker_TipTheScales"},
|
||||
}
|
||||
local buildTimeTypeMenu = function()
|
||||
return timetypeOptions
|
||||
@@ -304,6 +305,39 @@ do
|
||||
desc = Loc ["STRING_OPTIONS_TIMEMEASURE_DESC"],
|
||||
},
|
||||
|
||||
{--use real time
|
||||
type = "toggle",
|
||||
get = function() return Details.use_realtimedps end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.use_realtimedps = value
|
||||
end,
|
||||
name = "Show 'Real Time' DPS",
|
||||
desc = "If Enabled and while in combat, show the damage done of the latest 5 seconds divided by 5.",
|
||||
boxfirst = true,
|
||||
},
|
||||
|
||||
{--real time dps order bars
|
||||
type = "toggle",
|
||||
get = function() return Details.realtimedps_order_bars end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.realtimedps_order_bars = value
|
||||
end,
|
||||
name = "Order Bars By Real Time DPS",
|
||||
desc = "If Enabled, players dealing more real time DPS are place above other players in the window.",
|
||||
boxfirst = true,
|
||||
},
|
||||
|
||||
{--always use real time in arenas
|
||||
type = "toggle",
|
||||
get = function() return Details.realtimedps_always_arena end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.realtimedps_always_arena = value
|
||||
end,
|
||||
name = "Always Use Real Time in Arenas",
|
||||
desc = "If Enabled, real time DPS is always used in arenas, even if the option above is disabled.",
|
||||
boxfirst = true,
|
||||
},
|
||||
|
||||
{type = "blank"},
|
||||
{type = "label", get = function() return "Segments:" end, text_template = subSectionTitleTextTemplate},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user