Major update

-New feature: Arena DPS Bar, can be enabled at the Broadcaster Tools section, shows a bar in 'kamehameha' style showing which team is doing more damage in the latest 3 seconds.
		-Revamp on the options section for Broadcaster tools.
		-Added 'Icon Size Offset' under Options > Bars: General, this new option allow to adjust the size of the class/spec icon shown on each bar.
		-Added 'Show Faction Icon' under Options > Bars: General, with this new option, you can choose to not show the faction icon, this icon is usually shown during battlegrounds.
		-Added 'Faction Icon Size Offset' under Options > Bars: General, new option to adjust the size of the faction icon.
		-Added 'Show Arena Role Icon' under Options > Bars: General, new option to hide or show the role icon of players during an arena match.
		-Added 'Arena Role Icon Size Offset' under Options > Bars: General, new option which allow to control the size of the arena role icon.
		-Added 'Level' option to Wallpapers, the wallpaper can now be placed on different levels which solves issues where the wallpaper is too low of certain configuration.
		-Streamer! plugin got updates, now it is more clear to pick which mode to use.
		-WotLK classic compatibility (Flamanis, Daniel Henry).
		-Fixed the title bar text not showing when using the Custom Title Bar feature.
		-Role detection in classic versions got improvements.
		-New API: Details:GetTop5Actors(attributeId), return the top 5 actors from the selected attribute.
		-New API: Details:GetActorByRank(attributeId, rankIndex), return an actor from the selected attribute and rankIndex.
		-Major cleanup and code improvements on dropdowns for library Details! Framework.
		-Cleanup on NickTag library.
		-Removed LibGroupInSpecT, LibItemUpgradeInfo and LibCompress. These libraries got replaced by OpenRaidLib and LibDeflate.
This commit is contained in:
Tercio Jose
2022-08-10 17:41:06 -03:00
parent 7609a99fb4
commit 31c202c0f5
29 changed files with 1822 additions and 978 deletions
+179 -87
View File
@@ -16,12 +16,16 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
local DF = _detalhes.gump
local f = DF:CreateSimplePanel (UIParent, 700, 400, "Details! The Current Real DPS Options", "DetailsCurrentRealDPSOptions")
local f = DF:CreateSimplePanel (UIParent, 700, 400, "Details! Arena Damage Bar Options", "DetailsCurrentRealDPSOptions")
f:SetPoint ("center", UIParent, "center")
f:SetScript ("OnMouseDown", nil)
f:SetScript ("OnMouseUp", nil)
--scale bar
local scaleBar = DF:CreateScaleBar(f, _detalhes.realtime_dps_meter.options_frame)
local LibWindow = LibStub ("LibWindow-1.1")
LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.options_frame)
LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.options_frame)
LibWindow.MakeDraggable (f)
LibWindow.RestorePosition (f)
@@ -31,11 +35,25 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")
local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
--status bar
local statusBar = DF:CreateStatusBar(f)
statusBar.text = statusBar:CreateFontString(nil, "overlay", "GameFontNormal")
statusBar.text:SetPoint("left", statusBar, "left", 5, 0)
statusBar.text:SetText("By Terciob | Part of Details! Damage Meter | Built with Details! Framework")
DF:SetFontSize(statusBar.text, 11)
DF:SetFontColor(statusBar.text, "gray")
--add an extra background
local backgroundTexture = f:CreateTexture("$parentBackgroundTexture", "background")
backgroundTexture:SetColorTexture(.2, .2, .2, .2)
backgroundTexture:SetAllPoints()
local testUsing = "arena" --mythicdungeon
--> frame strata options
local set_frame_strata = function (_, _, strata)
Details.current_dps_meter.frame.strata = strata
Details.realtime_dps_meter.frame_settings.strata = strata
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end
local strataTable = {}
@@ -47,7 +65,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--> font options
local set_font_shadow= function (_, _, shadow)
Details.current_dps_meter.font_shadow = shadow
Details.realtime_dps_meter.font_shadow = shadow
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end
local fontShadowTable = {}
@@ -56,13 +74,13 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
fontShadowTable [3] = {value = "THICKOUTLINE", label = "Thick Outline", onclick = set_font_shadow}
local on_select_text_font = function (self, fixed_value, value)
Details.current_dps_meter.font_face = value
Details.realtime_dps_meter.font_face = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end
local lockCallback = function()
local f = _G.DetailsCurrentDpsMeter
if (Details.current_dps_meter.frame.locked) then
if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
f:SetBackdropColor(.2, .2, .2, 0)
@@ -80,9 +98,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--enabled
{
type = "toggle",
get = function() return Details.current_dps_meter.enabled end,
get = function() return Details.realtime_dps_meter.enabled end,
set = function (self, fixedparam, value)
Details.current_dps_meter.enabled = not Details.current_dps_meter.enabled
Details.realtime_dps_meter.enabled = not Details.realtime_dps_meter.enabled
Details:LoadFramesForBroadcastTools()
end,
desc = "Enabled",
@@ -92,9 +110,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--locked
{
type = "toggle",
get = function() return Details.current_dps_meter.frame.locked end,
get = function() return Details.realtime_dps_meter.frame_settings.locked end,
set = function (self, fixedparam, value)
Details.current_dps_meter.frame.locked = not Details.current_dps_meter.frame.locked
Details.realtime_dps_meter.frame_settings.locked = not Details.realtime_dps_meter.frame_settings.locked
Details:UpdateTheRealCurrentDPSFrame(testUsing)
lockCallback()
end,
@@ -105,9 +123,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--showtitle
{
type = "toggle",
get = function() return Details.current_dps_meter.frame.show_title end,
get = function() return Details.realtime_dps_meter.frame_settings.show_title end,
set = function (self, fixedparam, value)
Details.current_dps_meter.frame.show_title = not Details.current_dps_meter.frame.show_title
Details.realtime_dps_meter.frame_settings.show_title = not Details.realtime_dps_meter.frame_settings.show_title
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
desc = "Show Title",
@@ -118,10 +136,10 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
{
type = "color",
get = function()
return {Details.current_dps_meter.frame.backdrop_color[1], Details.current_dps_meter.frame.backdrop_color[2], Details.current_dps_meter.frame.backdrop_color[3], Details.current_dps_meter.frame.backdrop_color[4]}
return {Details.realtime_dps_meter.frame_settings.backdrop_color[1], Details.realtime_dps_meter.frame_settings.backdrop_color[2], Details.realtime_dps_meter.frame_settings.backdrop_color[3], Details.realtime_dps_meter.frame_settings.backdrop_color[4]}
end,
set = function (self, r, g, b, a)
local color = Details.current_dps_meter.frame.backdrop_color
local color = Details.realtime_dps_meter.frame_settings.backdrop_color
color[1], color[2], color[3], color[4] = r, g, b, a
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
@@ -132,16 +150,16 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--statra
{
type = "select",
get = function() return Details.current_dps_meter.frame.strata end,
get = function() return Details.realtime_dps_meter.frame_settings.strata end,
values = function() return strataTable end,
name = "Frame Strata"
},
--speed
{
type = "range",
get = function() return Details.current_dps_meter.sample_size end,
get = function() return Details.realtime_dps_meter.sample_size end,
set = function (self, fixedparam, value)
Details.current_dps_meter.sample_size = value
Details.realtime_dps_meter.sample_size = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 1,
@@ -154,13 +172,13 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--width
{
type = "range",
get = function() return Details.current_dps_meter.frame.width end,
get = function() return Details.realtime_dps_meter.frame_settings.width end,
set = function (self, fixedparam, value)
Details.current_dps_meter.frame.width = value
Details.realtime_dps_meter.frame_settings.width = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 1,
max = 300,
max = 500,
step = 1,
name = "Width",
text_template = options_text_template,
@@ -168,9 +186,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--height
{
type = "range",
get = function() return Details.current_dps_meter.frame.height end,
get = function() return Details.realtime_dps_meter.frame_settings.height end,
set = function (self, fixedparam, value)
Details.current_dps_meter.frame.height = value
Details.realtime_dps_meter.frame_settings.height = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 1,
@@ -178,16 +196,17 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
step = 1,
name = "Height",
text_template = options_text_template,
},
},
--[=[
{type = "breakline"},
{type = "label", get = function() return "Enabled On:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")},
--arenas
{
type = "toggle",
get = function() return Details.current_dps_meter.arena_enabled end,
get = function() return Details.realtime_dps_meter.arena_enabled end,
set = function (self, fixedparam, value)
Details.current_dps_meter.arena_enabled = not Details.current_dps_meter.arena_enabled
Details.realtime_dps_meter.arena_enabled = not Details.realtime_dps_meter.arena_enabled
Details:LoadFramesForBroadcastTools()
end,
name = "Arena Matches",
@@ -196,23 +215,24 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--mythic dungeon
{
type = "toggle",
get = function() return Details.current_dps_meter.mythic_dungeon_enabled end,
get = function() return Details.realtime_dps_meter.mythic_dungeon_enabled end,
set = function (self, fixedparam, value)
Details.current_dps_meter.mythic_dungeon_enabled = not Details.current_dps_meter.mythic_dungeon_enabled
Details.realtime_dps_meter.mythic_dungeon_enabled = not Details.realtime_dps_meter.mythic_dungeon_enabled
Details:LoadFramesForBroadcastTools()
end,
name = "Mythic Dungeons",
text_template = options_text_template,
},
--]=]
{type = "breakline"},
{type = "label", get = function() return "Text Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")},
--font size
{
type = "range",
get = function() return Details.current_dps_meter.font_size end,
get = function() return Details.realtime_dps_meter.font_size end,
set = function (self, fixedparam, value)
Details.current_dps_meter.font_size = value
Details.realtime_dps_meter.font_size = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 4,
@@ -225,10 +245,10 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
{
type = "color",
get = function()
return {Details.current_dps_meter.font_color[1], Details.current_dps_meter.font_color[2], Details.current_dps_meter.font_color[3], Details.current_dps_meter.font_color[4]}
return {Details.realtime_dps_meter.font_color[1], Details.realtime_dps_meter.font_color[2], Details.realtime_dps_meter.font_color[3], Details.realtime_dps_meter.font_color[4]}
end,
set = function (self, r, g, b, a)
local color = Details.current_dps_meter.font_color
local color = Details.realtime_dps_meter.font_color
color[1], color[2], color[3], color[4] = r, g, b, a
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
@@ -239,20 +259,34 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--font shadow
{
type = "select",
get = function() return Details.current_dps_meter.font_shadow end,
get = function() return Details.realtime_dps_meter.font_shadow end,
values = function() return fontShadowTable end,
name = "Font Shadow"
},
--font face
{
type = "select",
get = function() return Details.current_dps_meter.font_face end,
get = function() return Details.realtime_dps_meter.font_face end,
values = function() return DF:BuildDropDownFontList (on_select_text_font) end,
name = "Font Face",
text_template = options_text_template,
},
{
type = "range",
get = function() return _detalhes.realtime_dps_meter.text_offset end,
set = function (self, fixedparam, value)
_detalhes.realtime_dps_meter.text_offset = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 0,
max = 150,
step = 1,
name = "Text Position",
text_template = options_text_template,
},
}
DF:BuildMenu (f, options, 7, -50, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
f:SetScript ("OnHide" , function()
@@ -304,22 +338,21 @@ function Details:CreateCurrentDpsFrame(parent, name)
local spacing_vertical = -6 --vertical space between the group anchor and the group dps
--> main farame
local f = CreateFrame ("frame", name, parent or UIParent,"BackdropTemplate")
f:SetPoint ("center", UIParent, "center")
f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height)
local f = CreateFrame ("frame", name, parent or UIParent, "BackdropTemplate")
f:SetPoint ("top", UIParent, "top", 0, -110)
f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
f:SetBackdropColor (unpack (_detalhes.current_dps_meter.frame.backdrop_color))
f:SetBackdropColor (unpack (_detalhes.realtime_dps_meter.frame_settings.backdrop_color))
f:EnableMouse (true)
f:SetMovable (true)
f:SetClampedToScreen (true)
f.movemeLabel = f:CreateFontString(nil, "overlay", "GameFontNormal")
f.movemeLabel:SetPoint("center", f, "center", 0, 20)
f.movemeLabel:SetText("Move-Me")
f.lockButton = DetailsFramework:CreateButton(f, function()
Details.current_dps_meter.frame.locked = not Details.current_dps_meter.frame.locked
Details.realtime_dps_meter.frame_settings.locked = not Details.realtime_dps_meter.frame_settings.locked
Details:UpdateTheRealCurrentDPSFrame()
f.movemeLabel:Hide()
f.lockButton:Hide()
@@ -327,7 +360,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.lockButton:SetPoint("center", f, "center", 0, -20)
f.lockButton.text = "Lock"
if (Details.current_dps_meter.frame.locked) then
if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
end
@@ -335,13 +368,13 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.PlayerTeam = 0
local LibWindow = LibStub ("LibWindow-1.1")
LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.frame)
LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.frame_settings)
LibWindow.MakeDraggable (f)
LibWindow.RestorePosition (f)
local lockCallback = function()
local f = _G.DetailsCurrentDpsMeter
if (Details.current_dps_meter.frame.locked) then
if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
f:SetBackdropColor(.2, .2, .2, 0)
@@ -352,12 +385,31 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
end
C_Timer.After(10, function()
--f:SetPoint("top", UIParent, "top", 0, -110)
--LibWindow.SavePosition(f)
end)
GhostFrame:HookScript("OnShow", function(ghostFrame)
if (f:IsShown()) then
local p1, p2, p3, p4, p5 = ghostFrame:GetPoint(1)
f.GhostFrameY = f.GhostFrameY or 0
if (DF:IsNearlyEqual(p5, f.GhostFrameY, 0.1)) then
return
end
local newY = p5-45
ghostFrame:SetPoint(p1, p2, p3, p4, newY)
f.GhostFrameY = newY
end
end)
--> arena dps bars
--code for the dps bars shown in arenas
--frame to support the two bars, one for the dps and another for heal
--the dps bar is wider and taller, hps is below it and smaller
local barFrame = CreateFrame("frame", "DetailsArenaDpsBars", f)
local barFrame = CreateFrame("frame", "DetailsArenaDpsBars", f, "BackdropTemplate")
f.dpsBarFrame = barFrame
barFrame:SetSize(400, 80)
barFrame:SetPoint("center", f, "center", 0, 0)
@@ -372,26 +424,54 @@ function Details:CreateCurrentDpsFrame(parent, name)
barFrame.splitBar:SetBackgroundColor(1, 0, 0, 1)
barFrame.splitBar.SparkAlwaysShow = true
barFrame.borderFrame = CreateFrame("frame", "DetailsArenaDpsBarsBorderFrame", barFrame, "BackdropTemplate")
--barFrame.splitBar.widget.righttext:SetPoint("RIGHT", barFrame.splitBar.widget.righticon, "LEFT", -15, 0)
--barFrame.splitBar.widget.righttext:ClearAllPoints()
barFrame.borderFrame = CreateFrame("frame", "DetailsArenaDpsBarsBorderFrame", barFrame.splitBar.widget, "BackdropTemplate")
barFrame.borderFrame:SetFrameLevel(barFrame.splitBar:GetFrameLevel()-1)
barFrame.borderFrame:SetPoint("topleft", barFrame.splitBar.widget, "topleft", -1, 1)
barFrame.borderFrame:SetPoint("bottomright", barFrame.splitBar.widget, "bottomright", 1, -1)
f.movemeLabel:SetParent(barFrame.splitBar.widget)
f.movemeLabel:SetPoint("center", barFrame.splitBar.widget, "center", 0, 0)
local backgroundText = barFrame.borderFrame:CreateTexture(nil, "background")
backgroundText:SetColorTexture(0, 0, 0, 0.5)
backgroundText:SetAllPoints()
barFrame.borderFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
barFrame.borderFrame:SetBackdropBorderColor(0, 0, 0, 1)
barFrame.borderFrame:SetPoint("topleft", barFrame.splitBar.widget, "topleft", -1, 1)
barFrame.borderFrame:SetPoint("bottomright", barFrame.splitBar.widget, "bottomright", 1, -1)
local fff = CreateFrame("frame", "nopnopnopnopnop", barFrame.splitBar.widget, "BackdropTemplate")
fff:SetSize(300, 20)
fff:SetPoint("topleft", barFrame.splitBar.widget, "topleft", -1, 1)
fff:SetPoint("bottomright", barFrame.splitBar.widget, "bottomright", 1, -1)
fff:SetBackdrop({edgeFile = [[Interface\DialogFrame\UI-DialogBox-Gold-Border]], edgeSize = 10}) --, insets = {left = 1, right = 1, top = -10, bottom = -10}
fff:SetBackdropBorderColor(1, 1, 1, 1)
--fff:Hide()
local leftOrnamentTexture = fff:CreateTexture(nil, "overlay")
leftOrnamentTexture:SetTexture([[Interface\PETBATTLES\PETJOURNAL]])
leftOrnamentTexture:SetTexCoord(124/512, 161/512, 71/1024, 99/1024)
leftOrnamentTexture:SetPoint("right", fff, "left", 11, 0)
leftOrnamentTexture:SetSize(32, 32)
leftOrnamentTexture:SetAlpha(0.6)
local rightOrnamentTexture = fff:CreateTexture(nil, "overlay")
rightOrnamentTexture:SetTexture([[Interface\PETBATTLES\PETJOURNAL]])
rightOrnamentTexture:SetTexCoord(119/512, 156/512, 29/1024, 57/1024)
rightOrnamentTexture:SetPoint("left", fff, "right", -11, 0)
rightOrnamentTexture:SetSize(32, 32)
rightOrnamentTexture:SetAlpha(0.6)
--> title bar
local TitleString = f:CreateFontString (nil, "overlay", "GameFontNormal")
TitleString:SetPoint ("top", f, "top", 0, -1)
TitleString:SetText ("Dps on Last 5 Seconds")
TitleString:SetPoint ("top", f, "top", 0, -5)
TitleString:SetText ("Details! Arena Real Time DPS Tracker")
DF:SetFontSize (TitleString, 9)
local TitleBackground = f:CreateTexture (nil, "artwork")
TitleBackground:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]])
TitleBackground:SetVertexColor (.1, .1, .1, .9)
TitleBackground:SetVertexColor (.1, .1, .1, 0)
TitleBackground:SetPoint ("topleft", f, "topleft")
TitleBackground:SetPoint ("topright", f, "topright")
TitleBackground:SetHeight (header_size)
@@ -403,7 +483,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
labelYellowTeam_DPS:SetText ("0")
labelPlayerTeam_DPS:SetPoint ("left", barFrame.splitBar.widget, "left", 4, 0)
labelYellowTeam_DPS:SetPoint ("right", barFrame.splitBar.widget, "right", -4, 0)
function f.SwapArenaTeamColors()
green_team_color = Details.class_colors.ARENA_GREEN
yellow_team_color = Details.class_colors.ARENA_YELLOW
@@ -435,7 +515,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
--> update
local time_fraction = 100/1000 --one tick per 100ms
f.NextUpdate = time_fraction --when the next tick occur
f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval --when the labels on the frame receive update
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval --when the labels on the frame receive update
--> arena
f.PlayerTeamBuffer = {}
@@ -451,7 +531,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.LastTickGroupDamage = 0
--> general
f.SampleSize = _detalhes.current_dps_meter.sample_size
f.SampleSize = _detalhes.realtime_dps_meter.sample_size
f.MaxBufferIndex = 1
f.ShowingArena = false
@@ -461,36 +541,36 @@ function Details:CreateCurrentDpsFrame(parent, name)
return
end
if (not _detalhes.current_dps_meter.enabled) then
if (not _detalhes.realtime_dps_meter.enabled) then
f:Hide()
print("D! debug currentdps.lua > !current_dps_meter.enabled")
print("D! debug currentdps.lua > !realtime_dps_meter.enabled")
return
end
if (not _detalhes.current_dps_meter.arena_enabled and not _detalhes.current_dps_meter.mythic_dungeon_enabled) then
if (not _detalhes.realtime_dps_meter.arena_enabled and not _detalhes.realtime_dps_meter.mythic_dungeon_enabled) then
f:Hide()
print("D! debug currentdps.lua > not _detalhes.current_dps_meter.arena_enabled and not _detalhes.current_dps_meter.mythic_dungeon_enabled")
print("D! debug currentdps.lua > not _detalhes.realtime_dps_meter.arena_enabled and not _detalhes.realtime_dps_meter.mythic_dungeon_enabled")
return
end
--> where the player are
if (scenario == "arena") then
f.SampleSize = _detalhes.current_dps_meter.sample_size
f.SampleSize = _detalhes.realtime_dps_meter.sample_size
labelPlayerTeam_DPS:Show()
labelYellowTeam_DPS:Show()
--> update arena labels
DF:SetFontColor (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_color)
DF:SetFontFace (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_face)
DF:SetFontSize (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_size)
DF:SetFontOutline (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_shadow)
DF:SetFontColor (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_color)
DF:SetFontFace (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_face)
DF:SetFontSize (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_size)
DF:SetFontOutline (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_shadow)
DF:SetFontColor (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_color)
DF:SetFontFace (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_face)
DF:SetFontSize (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_size)
DF:SetFontOutline (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_shadow)
DF:SetFontColor (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_color)
DF:SetFontFace (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_face)
DF:SetFontSize (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_size)
DF:SetFontOutline (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_shadow)
--> wipe current data for arena
wipe (f.PlayerTeamBuffer)
@@ -509,6 +589,14 @@ function Details:CreateCurrentDpsFrame(parent, name)
DetailsArenaDpsBars.splitBar:Show()
barFrame.splitBar:EnableAnimations()
DetailsArenaDpsBars.splitBar:SetSize(Details.realtime_dps_meter.frame_settings.width, Details.realtime_dps_meter.frame_settings.height)
DetailsArenaDpsBars:EnableMouse(false)
DetailsArenaDpsBars.splitBar:EnableMouse(false)
TitleString:SetPoint("bottom", DetailsArenaDpsBars.splitBar.widget, "top", 0, 15)
TitleBackground:SetPoint("bottomleft", DetailsArenaDpsBars.splitBar.widget, "topleft", 0, 15)
TitleBackground:SetPoint("bottomright", DetailsArenaDpsBars.splitBar.widget, "topright", 0, 15)
--hide group widgets
labelGroupDamage:Hide()
labelGroupDamage_DPS:Hide()
@@ -518,10 +606,10 @@ function Details:CreateCurrentDpsFrame(parent, name)
labelGroupDamage:Show()
labelGroupDamage_DPS:Show()
DF:SetFontColor (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_color)
DF:SetFontFace (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_face)
DF:SetFontSize (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_size)
DF:SetFontOutline (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_shadow)
DF:SetFontColor (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_color)
DF:SetFontFace (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_face)
DF:SetFontSize (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_size)
DF:SetFontOutline (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_shadow)
--> wipe current data for mythic dungeon
f.GroupBuffer = {}
@@ -543,25 +631,25 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
--> frame position
f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height)
LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.frame)
f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.frame_settings)
LibWindow.RestorePosition (f)
--> backdrop color
f:SetBackdropColor (unpack (_detalhes.current_dps_meter.frame.backdrop_color))
f:SetBackdropColor (unpack (_detalhes.realtime_dps_meter.frame_settings.backdrop_color))
--> set frame size
f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height)
f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
--> frame is locked
if (_detalhes.current_dps_meter.frame.locked) then
if (_detalhes.realtime_dps_meter.frame_settings.locked) then
f:EnableMouse (false)
else
f:EnableMouse (true)
end
--> frame can show title
if (_detalhes.current_dps_meter.frame.show_title) then
if (_detalhes.realtime_dps_meter.frame_settings.show_title) then
TitleString:Show()
TitleBackground:Show()
else
@@ -570,13 +658,17 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
--> frame strata
f:SetFrameStrata (_detalhes.current_dps_meter.frame.strata)
f:SetFrameStrata (_detalhes.realtime_dps_meter.frame_settings.strata)
--> calcule buffer size
f.MaxBufferIndex = f.SampleSize * time_fraction * 100 --sample size in seconds * fraction * tick milliseconds
--> interval to update the frame
f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
labelPlayerTeam_DPS:SetPoint("left", barFrame.splitBar.widget, "left", 4 + _detalhes.realtime_dps_meter.text_offset, 0)
labelYellowTeam_DPS:SetPoint("right", barFrame.splitBar.widget, "right", -4 - _detalhes.realtime_dps_meter.text_offset, 0)
end
_detalhes:UpdateTheRealCurrentDPSFrame()
@@ -684,7 +776,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
dpsBarFrame:SetRightColor(unpack (green_team_color))
end
if (Details.current_dps_meter.frame.locked) then
if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
f:SetBackdropColor(.2, .2, .2, 0)
@@ -698,7 +790,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
labelPlayerTeam_DPS:SetText (_detalhes:ToK2 (self.YellowDamage / self.SampleSize))
labelYellowTeam_DPS:SetText (_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize))
end
f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
end
elseif (self.ShowingMythicDungeon) then
@@ -739,7 +831,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
self.NextScreenUpdate = self.NextScreenUpdate - time_fraction
if (self.NextScreenUpdate <= 0) then
labelGroupDamage_DPS:SetText (_detalhes:ToK2 (f.GroupTotalDamage / self.SampleSize))
f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
end
end
@@ -775,14 +867,14 @@ function Details:CreateCurrentDpsFrame(parent, name)
local eventListener = _detalhes:CreateEventListener()
function eventListener:ArenaStarted()
if (_detalhes.current_dps_meter.arena_enabled) then
if (_detalhes.realtime_dps_meter.arena_enabled) then
--it is working here, f:StartForArenaMatch() is called but the frame is still now shown.
f:StartForArenaMatch()
end
end
function eventListener:MythicDungeonStarted()
if (_detalhes.current_dps_meter.mythic_dungeon_enabled) then
if (_detalhes.realtime_dps_meter.mythic_dungeon_enabled) then
f:StartForMythicDungeon()
end
end
+121 -40
View File
@@ -12,6 +12,7 @@ local segmentos = _detalhes.segmentos
--lua locals
local _math_ceil = math.ceil
local _math_floor = math.floor
local floor = _math_floor
local _math_max = math.max
local _ipairs = ipairs
local _pairs = pairs
@@ -4093,37 +4094,19 @@ function gump:CreateNewLine (instancia, index)
newLine:EnableMouse (true)
newLine:RegisterForClicks ("LeftButtonDown", "RightButtonDown")
--> statusbar
--statusbar
newLine.statusbar = CreateFrame ("StatusBar", "DetailsBarra_Statusbar_"..instancia.meu_id.."_"..index, newLine)
newLine.statusbar.value = 0
--[[ Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis
--> right to left texture
newLine.statusbar.right_to_left_texture = newLine.statusbar:CreateTexture (nil, "overlay")
newLine.statusbar.right_to_left_texture:SetPoint ("topright", newLine.statusbar, "topright")
newLine.statusbar.right_to_left_texture:SetPoint ("bottomright", newLine.statusbar, "bottomright")
newLine.statusbar.right_to_left_texture:SetWidth (0.000000001)
newLine.statusbar.right_to_left_texture:Hide()
newLine.right_to_left_texture = newLine.statusbar.right_to_left_texture
]]
--> frame for hold the backdrop border
newLine.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, newLine.statusbar,"BackdropTemplate")
--frame for hold the backdrop border
newLine.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, newLine.statusbar, "BackdropTemplate")
newLine.border:SetFrameLevel (newLine.statusbar:GetFrameLevel()+2)
newLine.border:SetAllPoints (newLine)
--border
newLine.lineBorder = DetailsFramework:CreateFullBorder(newLine:GetName() .. "Border", newLine.border)
--[=[
if (DetailsFramework.IsTBCWow()) then
lineBorder = DetailsFramework:CreateFullBorder(nil, newLine)
--lineBorder = CreateFrame("frame", nil, newLine, "DFNamePlateFullBorderTemplate, BackdropTemplate")
else
lineBorder = CreateFrame("frame", nil, newLine, "NamePlateFullBorderTemplate, BackdropTemplate")
end
newLine.lineBorder = lineBorder
--]=]
-- search key: ~model
--low 3d bar
--low 3d bar --search key: ~model
newLine.modelbox_low = CreateFrame ("playermodel", "DetailsBarra_ModelBarLow_" .. instancia.meu_id .. "_" .. index, newLine) --rowframe
newLine.modelbox_low:SetFrameLevel (newLine.statusbar:GetFrameLevel()-1)
newLine.modelbox_low:SetPoint ("topleft", newLine, "topleft")
@@ -4355,10 +4338,23 @@ function Details:RefreshTitleBar()
local texturePath = SharedMedia:Fetch("statusbar", texture)
self.baseframe.titleBar:SetShown(shown)
self.baseframe.titleBar:SetHeight(height)
self.baseframe.titleBar.texture:SetTexture(texturePath)
self.baseframe.titleBar.texture:SetVertexColor(DetailsFramework:ParseColors(color))
local titleBar = self.baseframe.titleBar
titleBar:SetShown(shown)
--menu_attribute_string is nil in tbc (20 jun 2022)
if (not self.menu_attribute_string) then
return
end
if (shown) then
titleBar:SetHeight(height)
titleBar.texture:SetTexture(texturePath)
titleBar.texture:SetVertexColor(DetailsFramework:ParseColors(color))
self.menu_attribute_string:SetParent(titleBar)
else
self.menu_attribute_string:SetParent(self.baseframe)
end
end
function _detalhes:SetBarModel (upper_enabled, upper_model, upper_alpha, lower_enabled, lower_model, lower_alpha)
@@ -4430,7 +4426,41 @@ function _detalhes:SetBarSpecIconSettings (enabled, iconfile, fulltrack)
self:ReajustaGump()
end
function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart, spacement, texture_custom)
function Details:SetBarArenaRoleIconSettings(show_icon, icon_size_offset)
if (type(show_icon) ~= "boolean") then
show_icon = self.row_info.show_arena_role_icon
end
if (not icon_size_offset or type(icon_size_offset) ~= "number") then
icon_size_offset = self.row_info.arena_role_icon_size_offset
end
self.row_info.show_arena_role_icon = show_icon
self.row_info.arena_role_icon_size_offset = icon_size_offset
self:InstanceReset()
self:InstanceRefreshRows()
self:ReajustaGump()
end
function Details:SetBarFactionIconSettings(show_faction_icon, faction_icon_size_offset)
if (type(show_faction_icon) ~= "boolean") then
show_faction_icon = self.row_info.show_faction_icon
end
if (not faction_icon_size_offset or type(faction_icon_size_offset) ~= "number") then
faction_icon_size_offset = self.row_info.faction_icon_size_offset
end
self.row_info.show_faction_icon = show_faction_icon
self.row_info.faction_icon_size_offset = faction_icon_size_offset
self:InstanceReset()
self:InstanceRefreshRows()
self:ReajustaGump()
end
function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart, spacement, texture_custom, icon_size_offset)
--> bar start
if (type (barstart) == "boolean") then
@@ -4505,6 +4535,10 @@ function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, back
c [1], c [2], c [3], c [4] = red, green, blue, alpha
end
if (icon_size_offset and type(icon_size_offset) == "number") then
self.row_info.icon_size_offset = icon_size_offset
end
self:InstanceReset()
self:InstanceRefreshRows()
self:ReajustaGump()
@@ -4564,7 +4598,7 @@ end
--/script _detalhes:InstanceRefreshRows (_detalhes.tabela_instancias[1])
--> on update function
--onupdate function for 'Fast Updates' feature
local fast_ps_func = function (self)
local instance = self.instance
@@ -4572,8 +4606,16 @@ local fast_ps_func = function (self)
return
end
local combat_time = instance.showing:GetCombatTime()
local ps_type = _detalhes.ps_abbreviation
local combatTime = instance.showing:GetCombatTime()
local abbreviationType = _detalhes.ps_abbreviation
local abbreviationFunc = tok_functions[abbreviationType]
local isInLineTextEnabled = instance.use_multi_fontstrings
local instanceShowDataSettings = instance.row_info.textR_show_data
local showingAllData = instanceShowDataSettings[3] and instanceShowDataSettings[2] and instanceShowDataSettings[1]
local showingTotalAndPS = not instanceShowDataSettings[3] and instanceShowDataSettings[2] and instanceShowDataSettings[1]
local showingOnlyPS = not instanceShowDataSettings[3] and instanceShowDataSettings[2] and not instanceShowDataSettings[1]
if (instance.rows_fit_in_window) then
for i = 1, instance.rows_fit_in_window do --instance:GetNumRows()
@@ -4581,14 +4623,21 @@ local fast_ps_func = function (self)
if (row and row:IsShown()) then
local actor = row.minha_tabela
if (actor) then
local dps_text = row.ps_text
if (dps_text) then
local new_dps = _math_floor (actor.total / combat_time)
local formated_dps = tok_functions [ps_type] (_, new_dps)
--row.lineText4:SetText (row.lineText4:GetText():gsub (dps_text, formated_dps))
row.lineText4:SetText (( row.lineText4:GetText() or "" ):gsub (dps_text, formated_dps))
row.ps_text = formated_dps
local currentDps = floor(actor.total / combatTime) --can also be hps
if (isInLineTextEnabled) then
if (showingAllData) then
row.lineText3:SetText(abbreviationFunc(nil, currentDps))
elseif (showingTotalAndPS or showingOnlyPS) then
row.lineText4:SetText(abbreviationFunc(nil, currentDps))
end
else
local dpsText = row.ps_text
if (dpsText) then
local formatedDps = abbreviationFunc(nil, currentDps)
row.lineText4:SetText((row.lineText4:GetText() or ""):gsub(dpsText, formatedDps))
row.ps_text = formatedDps
end
end
end
end
@@ -5005,6 +5054,35 @@ function Details:SetBarOverlaySettings(overlayTexture, overlayColor)
self:InstanceRefreshRows()
end
--adjust to which frame the wallpaper texture is parented to
--dependind on the frame it can be shown above or below background textures
function Details:SetInstanceWallpaperLevel(wallpaperLevel)
if (type(wallpaperLevel) ~= "number") then
wallpaperLevel = self.wallpaper.level
end
self.wallpaper.level = wallpaperLevel
--refresh the wallpaper parent
local wallpaperTexture = self.baseframe.wallpaper
if (wallpaperLevel == 0) then
wallpaperTexture:SetParent(self.baseframe.titleBar) --framelevel +0 (parented to titleBar)
elseif (wallpaperLevel == 1) then
wallpaperTexture:SetParent(self.baseframe) --framelevel +0
elseif (wallpaperLevel == 2) then
wallpaperTexture:SetParent(self.rowframe) --framelevel +3
elseif (wallpaperLevel == 3) then
wallpaperTexture:SetParent(self.windowSwitchButton) --framelevel +4
end
--debug
--/run Details:GetWindow(1):SetInstanceWallpaperLevel(0)
end
-- search key: ~wallpaper
function _detalhes:InstanceWallpaper (texture, anchor, alpha, texcoord, width, height, overlay)
@@ -7306,6 +7384,9 @@ function Details:ChangeSkin(skin_name)
--> update title bar
self:RefreshTitleBar()
--> update the wallpaper level
self:SetInstanceWallpaperLevel()
--> clear any control sscript running in this instance
self.bgframe:SetScript ("OnUpdate", nil)
self.bgframe.skin_script = nil
+100 -86
View File
@@ -155,107 +155,109 @@ function Details.options.InitializeOptionsWindow(instance)
editingGroupLabel:SetPoint("bottomleft", instances_string, "topleft", 0, 5)
editingGroupCheckBox:SetPoint("left", editingGroupLabel, "right", 2, 0)
--create bars
DF:NewColor ("C_OptionsButtonOrange", 0.9999, 0.8196, 0, 1)
--> create test bars
DF:NewColor ("C_OptionsButtonOrange", 0.9999, 0.8196, 0, 1)
local create_test_bars_func = function()
_detalhes.CreateTestBars()
if (not _detalhes.test_bar_update) then
_detalhes:StartTestBarUpdate()
else
_detalhes:StopTestBarUpdate()
local create_test_bars_func = function()
_detalhes.CreateTestBars()
if (not _detalhes.test_bar_update) then
_detalhes:StartTestBarUpdate()
else
_detalhes:StopTestBarUpdate()
end
end
end
local fillbars = DF:NewButton (f, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1)
fillbars:SetPoint ("bottomleft", f.widget, "bottomleft", 10, 10)
fillbars:SetTemplate(options_button_template)
fillbars:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {323/512, 365/512, 42/512, 78/512}, {1, 1, 1, 0.6}, 4, 2)
local fillbars = DF:NewButton (f, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1)
fillbars:SetPoint ("bottomleft", f.widget, "bottomleft", 10, 10)
fillbars:SetTemplate(options_button_template)
fillbars:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {323/512, 365/512, 42/512, 78/512}, {1, 1, 1, 0.6}, 4, 2)
--change log
local changelog = DF:NewButton (f, _, "$parentOpenChangeLogButton", nil, 140, 20, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
changelog:SetPoint ("left", fillbars, "right", 10, 0)
changelog:SetTemplate (options_button_template)
changelog:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {367/512, 399/512, 43/512, 76/512}, {1, 1, 1, 0.8}, 4, 2)
--> change log
local changelog = DF:NewButton (f, _, "$parentOpenChangeLogButton", nil, 140, 20, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
changelog:SetPoint ("left", fillbars, "right", 10, 0)
changelog:SetTemplate (options_button_template)
changelog:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {367/512, 399/512, 43/512, 76/512}, {1, 1, 1, 0.8}, 4, 2)
--search field
local searchBox = DF:CreateTextEntry(f, function()end, 150, 20, _, _, _, options_dropdown_template)
searchBox:SetPoint ("topright", f, "topright", -5, -30)
--> search field
local searchBox = DF:CreateTextEntry(f, function()end, 140, 20, _, _, _, options_dropdown_template)
searchBox:SetPoint ("bottomleft", fillbars, "topleft", 0, 5)
local searchLabel = DF:CreateLabel(f, "Search:", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE"))
searchLabel:SetPoint ("right", searchBox, "left", -2, 0)
local searchLabel = DF:CreateLabel(f, "Search:", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) --localize-me
searchLabel:SetPoint ("bottomleft", searchBox, "topleft", 0, 2)
searchLabel.fontface = "GameFontNormal"
searchLabel.fontsize = 12
searchBox:SetHook("OnChar", function()
if (searchBox.text ~= "") then
local searchSection = f.sectionFramesContainer[19]
searchSection.sectionButton:Enable()
searchSection.sectionButton:Click()
searchBox:SetHook("OnChar", function()
if (searchBox.text ~= "") then
local searchSection = f.sectionFramesContainer[19]
searchSection.sectionButton:Enable()
searchSection.sectionButton:Click()
local searchingFor = searchBox.text
local allSectionFrames = f.sectionFramesContainer
local searchingFor = searchBox.text
local allSectionFrames = f.sectionFramesContainer
local allSectionNames = {}
local allSectionOptions = {}
local allSectionNames = {}
local allSectionOptions = {}
for i = 1, #allSectionFrames do
local sectionFrame = allSectionFrames[i]
local sectionOptionsTable = sectionFrame.sectionOptions
for i = 1, #allSectionFrames do
local sectionFrame = allSectionFrames[i]
local sectionOptionsTable = sectionFrame.sectionOptions
allSectionNames[#allSectionNames+1] = sectionFrame.name
allSectionOptions[#allSectionOptions+1] = sectionOptionsTable
end
--this table will hold all options
local allOptions = {}
--start the fill process filling 'allOptions' with each individual option from each tab
for i = 1, #allSectionOptions do
local sectionOptions = allSectionOptions[i]
local lastLabel = nil
for k, setting in pairs(sectionOptions) do
if (setting.type == "label") then
lastLabel = setting
end
if (setting.name) then
allOptions[#allOptions+1] = {setting = setting, label = lastLabel, header = allSectionNames[i]}
end
allSectionNames[#allSectionNames+1] = sectionFrame.name
allSectionOptions[#allSectionOptions+1] = sectionOptionsTable
end
end
local searchingText = string.lower(searchingFor)
searchBox:SetFocus()
local options = {}
local lastTab = nil
local lastLabel = nil
for i = 1, #allOptions do
local optionData = allOptions[i]
local optionName = string.lower(optionData.setting.name)
if (optionName:find(searchingText)) then
if optionData.header ~= lastTab then
if lastTab ~= nil then
options[#options+1] = {type = "label", get = function() return "" end, text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")} -- blank
--this table will hold all options
local allOptions = {}
--start the fill process filling 'allOptions' with each individual option from each tab
for i = 1, #allSectionOptions do
local sectionOptions = allSectionOptions[i]
local lastLabel = nil
for k, setting in pairs(sectionOptions) do
if (setting.type == "label") then
lastLabel = setting
end
if (setting.name) then
allOptions[#allOptions+1] = {setting = setting, label = lastLabel, header = allSectionNames[i]}
end
options[#options+1] = {type = "label", get = function() return optionData.header end, text_template = {color = "silver", size = 14, font = DF:GetBestFontForLanguage()}}
lastTab = optionData.header
lastLabel = nil
end
if optionData.label ~= lastLabel then
options[#options+1] = optionData.label
lastLabel = optionData.label
end
options[#options+1] = optionData.setting
end
local searchingText = string.lower(searchingFor)
searchBox:SetFocus()
local options = {}
local lastTab = nil
local lastLabel = nil
for i = 1, #allOptions do
local optionData = allOptions[i]
local optionName = string.lower(optionData.setting.name)
if (optionName:find(searchingText)) then
if optionData.header ~= lastTab then
if lastTab ~= nil then
options[#options+1] = {type = "label", get = function() return "" end, text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")} -- blank
end
options[#options+1] = {type = "label", get = function() return optionData.header end, text_template = {color = "silver", size = 14, font = DF:GetBestFontForLanguage()}}
lastTab = optionData.header
lastLabel = nil
end
if optionData.label ~= lastLabel then
options[#options+1] = optionData.label
lastLabel = optionData.label
end
options[#options+1] = optionData.setting
end
end
local startX = 200
local startY = -60
DF:BuildMenuVolatile(searchSection, options, startX, startY, 560, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template, globalCallback)
else
f.sectionFramesContainer[19].sectionButton:Disable()
end
local startX = 200
local startY = -40
DF:BuildMenuVolatile(searchSection, options, startX, startY, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template, globalCallback)
else
f.sectionFramesContainer[19].sectionButton:Disable()
end
end)
end)
local sectionsName = { --section names
[1] = Loc ["STRING_OPTIONSMENU_DISPLAY"],
@@ -316,8 +318,20 @@ function Details.options.InitializeOptionsWindow(instance)
if (type(sectionId) == "number") then
local sectionFrame = CreateFrame("frame", "$parentTab" .. sectionId, f, "BackdropTemplate")
sectionFrame:SetAllPoints()
--sectionFrame:SetAllPoints()
--sectionFrame:ClearAllPoints()
sectionFrame:SetPoint("topleft", f, "topleft", -40, 22)
sectionFrame:SetSize(f:GetSize())
sectionFrame:EnableMouse(false)
local realBackdropAreaFrame = CreateFrame("frame", "$parentTab" .. sectionId .. "BackdropArea", f, "BackdropTemplate")
realBackdropAreaFrame:SetFrameLevel(f:GetFrameLevel()-1)
realBackdropAreaFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
realBackdropAreaFrame:SetBackdropColor(0, 0, 0, .1)
realBackdropAreaFrame:SetBackdropBorderColor(0.2, 0.2, 0.2, .05)
realBackdropAreaFrame:SetPoint("topleft", f, "topleft", 150, -27)
realBackdropAreaFrame:SetSize(770, 570)
sectionFrame.name = sectionsName[sectionId]
--tinsert(f.sectionFramesContainer, sectionFrame)
f.sectionFramesContainer[sectionId] = sectionFrame
+322 -190
View File
@@ -1405,39 +1405,6 @@ do
},
{type = "breakline"},
{type = "label", get = function() return "Arena Team Color" end, text_template = subSectionTitleTextTemplate},
{--team 1 color
type = "color",
get = function()
local r, g, b = unpack(Details.class_colors.ARENA_GREEN)
return {r, g, b, 1}
end,
set = function (self, r, g, b, a)
Details.class_colors.ARENA_GREEN[1] = r
Details.class_colors.ARENA_GREEN[2] = g
Details.class_colors.ARENA_GREEN[3] = b
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = "Arena team color",
},
{--team 2 color
type = "color",
get = function()
local r, g, b = unpack(Details.class_colors.ARENA_YELLOW)
return {r, g, b, 1}
end,
set = function (self, r, g, b, a)
Details.class_colors.ARENA_YELLOW[1] = r
Details.class_colors.ARENA_YELLOW[2] = g
Details.class_colors.ARENA_YELLOW[3] = b
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = "Arena team color",
},
{type = "blank"},
{type = "label", get = function() return Loc ["STRING_OPTIONS_TEXT_ROWICONS_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--select icon file
@@ -1486,7 +1453,7 @@ do
desc = Loc ["STRING_CUSTOM_TEXTURE_GUIDE"],
},
{--bar start at
{--bar start after icon
type = "toggle",
get = function() return currentInstance.row_info.start_after_icon end,
set = function (self, fixedparam, value)
@@ -1497,61 +1464,83 @@ do
desc = Loc ["STRING_OPTIONS_BARSTART_DESC"],
},
{type = "blank"},
{type = "label", get = function() return Loc ["STRING_OPTIONS_BAR_BACKDROP_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--border enabled
type = "toggle",
get = function() return currentInstance.row_info.backdrop.enabled end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", value)
afterUpdate()
end,
name = Loc ["STRING_ENABLED"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_ENABLED_DESC"],
},
{--border color
type = "color",
get = function()
local r, g, b, a = unpack(currentInstance.row_info.backdrop.color)
return {r, g, b, a}
end,
set = function (self, r, g, b, a)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, {r, g, b, a})
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_COLOR_DESC"],
},
{--border size
{--icon size offset
type = "range",
get = function() return tonumber (currentInstance.row_info.backdrop.size) end,
get = function() return tonumber (currentInstance.row_info.icon_size_offset) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, value)
editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value)
afterUpdate()
end,
min = 0,
max = 10,
step = 1,
min = -20,
max = 20,
usedecimals = true,
name = Loc ["STRING_OPTIONS_SIZE"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_SIZE_DESC"],
},
{--border uses class colors
type = "toggle",
get = function() return currentInstance.row_info.backdrop.use_class_colors end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, nil, value)
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"],
desc = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"],
step = 0.5,
name = "Icon Size Offset", --localize-me
desc = "Icon Size Offset",
thumbscale = 2.2,
},
{type = "blank"},
{--show faction icon
type = "toggle",
get = function() return currentInstance.row_info.show_faction_icon end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarFactionIconSettings", value)
afterUpdate()
end,
name = "Show Faction Icon", --localize-me
desc = "When showing a player from the opposite faction, show the faction icon.",
},
{--faction icon size offset
type = "range",
get = function() return tonumber (currentInstance.row_info.faction_icon_size_offset) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarFactionIconSettings", nil, value)
afterUpdate()
end,
min = -20,
max = 20,
usedecimals = true,
step = 0.5,
name = "Faction Icon Size Offset", --localize-me
desc = "Faction Icon Size Offset",
thumbscale = 2.2,
},
{type = "blank"},
{--show role icon
type = "toggle",
get = function() return currentInstance.row_info.show_arena_role_icon end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarArenaRoleIconSettings", value)
afterUpdate()
end,
name = "Show Arena Role Icon", --localize-me
desc = "When showing a player from arena, show the role icon.",
},
{--role icon size offset
type = "range",
get = function() return tonumber (currentInstance.row_info.arena_role_icon_size_offset) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarArenaRoleIconSettings", nil, value)
afterUpdate()
end,
min = -20,
max = 20,
usedecimals = true,
step = 0.5,
name = "Arena Role Icon Size Offset", --localize-me
desc = "Arena Role Icon Size Offset",
thumbscale = 2.2,
},
{type = "blank"},
--{type = "breakline"},
{type = "label", get = function() return Loc["STRING_OPTIONS_ALIGNED_TEXT_COLUMNS"] end, text_template = subSectionTitleTextTemplate},
{--inline text enabled
@@ -1643,6 +1632,7 @@ do
},
{type = "breakline"},
{type = "label", get = function() return Loc ["STRING_OPTIONS_TOTALBAR_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--total bar enabled
@@ -1679,6 +1669,94 @@ do
name = Loc ["STRING_COLOR"],
desc = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_COLOR_DESC"],
},
{type = "blank"},
{type = "label", get = function() return "Arena Team Color" end, text_template = subSectionTitleTextTemplate}, --localize-me
{--team 1 color
type = "color",
get = function()
local r, g, b = unpack(Details.class_colors.ARENA_GREEN)
return {r, g, b, 1}
end,
set = function (self, r, g, b, a)
Details.class_colors.ARENA_GREEN[1] = r
Details.class_colors.ARENA_GREEN[2] = g
Details.class_colors.ARENA_GREEN[3] = b
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = "Arena team color", --localize-me
},
{--team 2 color
type = "color",
get = function()
local r, g, b = unpack(Details.class_colors.ARENA_YELLOW)
return {r, g, b, 1}
end,
set = function (self, r, g, b, a)
Details.class_colors.ARENA_YELLOW[1] = r
Details.class_colors.ARENA_YELLOW[2] = g
Details.class_colors.ARENA_YELLOW[3] = b
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = "Arena team color", --localize-me
},
{type = "blank"},
{type = "label", get = function() return Loc ["STRING_OPTIONS_BAR_BACKDROP_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--border enabled
type = "toggle",
get = function() return currentInstance.row_info.backdrop.enabled end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", value)
afterUpdate()
end,
name = Loc ["STRING_ENABLED"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_ENABLED_DESC"],
},
{--border color
type = "color",
get = function()
local r, g, b, a = unpack(currentInstance.row_info.backdrop.color)
return {r, g, b, a}
end,
set = function (self, r, g, b, a)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, {r, g, b, a})
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_COLOR_DESC"],
},
{--border size
type = "range",
get = function() return tonumber (currentInstance.row_info.backdrop.size) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, value)
afterUpdate()
end,
min = 0,
max = 10,
step = 1,
usedecimals = true,
name = Loc ["STRING_OPTIONS_SIZE"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_SIZE_DESC"],
thumbscale = 1.5,
},
{--border uses class colors
type = "toggle",
get = function() return currentInstance.row_info.backdrop.use_class_colors end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, nil, value)
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"],
desc = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"],
},
}
sectionFrame.sectionOptions = sectionOptions
@@ -4865,6 +4943,20 @@ do
desc = Loc ["STRING_OPTIONS_WP_ALIGN"],
},
{--wallpaper level
type = "range",
get = function() return currentInstance.wallpaper.level end, --default 2
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetInstanceWallpaperLevel", value)
afterUpdate()
end,
min = 0,
max = 3,
step = 1,
name = "Level",
desc = "Change where the wallpaper is placed.", --localize-me
},
{--edit wallpaper
type = "execute",
func = function(self)
@@ -5819,7 +5911,7 @@ do
local button_width = 160
--> streamer plugin - a.k.a. player spell tracker
--> streamer plugin - a.k.a. Action Tracker
--> title anchor
DF:NewLabel (sectionFrame, _, "$parentStreamerPluginAnchor", "streamerPluginAnchor", "Action Tracker", "GameFontNormal")
sectionFrame.streamerPluginAnchor:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 20)
@@ -5828,71 +5920,87 @@ do
streamerTitleDesc:SetSize (270, 40)
streamerTitleDesc:SetJustifyV ("top")
streamerTitleDesc:SetPoint ("topleft", sectionFrame.streamerPluginAnchor, "bottomleft", 0, -4)
local streamerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 41, "overlay", {0.5, 1, 0.49, 0.57})
local streamerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2.blp]], 268*0.75, 59*0.75, "overlay", {0, 268/512, 454/512, 1})
streamerTitleImage:SetPoint ("topleft", sectionFrame.streamerPluginAnchor, "bottomleft", 0, -40)
--> get the plugin object
local StreamerPlugin = _detalhes:GetPlugin ("DETAILS_PLUGIN_STREAM_OVERLAY")
local StreamerPlugin = Details:GetPlugin("DETAILS_PLUGIN_STREAM_OVERLAY")
if (StreamerPlugin) then
--> get the plugin settings table
local tPluginSettings = _detalhes:GetPluginSavedTable ("DETAILS_PLUGIN_STREAM_OVERLAY")
--get the plugin settings table
local tPluginSettings = Details:GetPluginSavedTable("DETAILS_PLUGIN_STREAM_OVERLAY")
if (tPluginSettings) then
local enablePluginFunc = function()
tPluginSettings.enabled = not tPluginSettings.enabled
StreamerPlugin.__enabled = tPluginSettings.enabled
if (not tPluginSettings.enabled) then
sectionFrame.enableActionTrackerButtton:SetText("Enable")
Details:SendEvent("PLUGIN_DISABLED", StreamerPlugin)
else
sectionFrame.enableActionTrackerButtton:SetText("Disable") --enableButton is nil value
Details:SendEvent("PLUGIN_ENABLED", StreamerPlugin)
end
end
local openOptions = function()
StreamerPlugin.OpenOptionsPanel(true)
C_Timer.After(0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
--create the enable, disable and options button
local enableActionTrackerButtton = DF:CreateButton(sectionFrame, enablePluginFunc, 100, 20, "Enable", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
enableActionTrackerButtton:SetPoint("topleft", streamerTitleImage, "bottomleft", 0, -7)
local actionTrackerOptionsButtton = DF:CreateButton(sectionFrame, openOptions, 100, 20, "Options", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
actionTrackerOptionsButtton:SetPoint("left", enableActionTrackerButtton, "right", 5, 0)
sectionFrame.enableActionTrackerButtton = enableActionTrackerButtton
sectionFrame.actionTrackerOptionsButtton = actionTrackerOptionsButtton
local bIsPluginEnabled = tPluginSettings.enabled
--> plugin already enabled
--plugin already enabled
if (bIsPluginEnabled) then
--> config button
local configure_streamer_plugin = function()
StreamerPlugin.OpenOptionsPanel (true)
C_Timer.After (0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
local configurePluginButton = DF:NewButton (sectionFrame, _, "$parentConfigureStreamerPluginButton", "configureStreamerPlugin", 100, 20, configure_streamer_plugin, nil, nil, nil, "Action Tracker Options", nil, options_button_template)
configurePluginButton:SetWidth (button_width)
configurePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -7)
--> text telling how to disable
local pluginAlreadyEnabled = DF:NewLabel (sectionFrame, _, "$parentStreamerAlreadyEnabledText", "StreamerAlreadyEnabledTextLabel", "Plugin is enabled. You may disable it on Plugin Management section.", "GameFontNormal", 10, "white")
pluginAlreadyEnabled:SetJustifyV ("top")
pluginAlreadyEnabled:SetSize (270, 40)
pluginAlreadyEnabled:SetPoint ("topleft", configurePluginButton, "bottomleft", 0, -7)
enableActionTrackerButtton:SetText("Disable")
else
--> plugin isnt enabled, create the enable button
local enable_streamer_plugin = function()
tPluginSettings.enabled = true
StreamerPlugin.__enabled = true
_detalhes:SendEvent ("PLUGIN_ENABLED", StreamerPlugin)
sectionFrame.enableStreamerPluginButton:Hide()
--> config button
local configure_streamer_plugin = function()
StreamerPlugin.OpenOptionsPanel()
end
local configurePluginButton = DF:NewButton (sectionFrame, _, "$parentConfigureStreamerPluginButton", "configureStreamerPlugin", 100, 20, configure_streamer_plugin, nil, nil, nil, "Action Tracker Options", nil, options_button_template)
configurePluginButton:SetWidth (button_width)
configurePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -7)
--> text telling how to disable
local pluginAlreadyEnabled = DF:NewLabel (sectionFrame, _, "$parentStreamerAlreadyEnabledText", "StreamerAlreadyEnabledTextLabel", "Plugin is enabled. You may disable it on Plugin Management section.", "GameFontNormal", 10, "white")
pluginAlreadyEnabled:SetJustifyV ("top")
pluginAlreadyEnabled:SetSize (270, 40)
pluginAlreadyEnabled:SetPoint ("topleft", configurePluginButton, "bottomleft", 0, -7)
end
local enablePluginButton = DF:NewButton (sectionFrame, _, "$parentEnableStreamerPluginButton", "enableStreamerPluginButton", 100, 20, enable_streamer_plugin, nil, nil, nil, "Enable Plugin", nil, options_button_template)
enablePluginButton:SetWidth (button_width)
enablePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -5)
enableActionTrackerButtton:SetText("Enable")
end
end
else
--> plugin is disabled at the addon control panel
local pluginDisabled = DF:NewLabel (sectionFrame, _, "$parentStreamerDisabledText", "StreamerDisabledTextLabel", "Details!: Streamer Plugin is disabled on the AddOns Control Panel.", "GameFontNormal", 10, "red")
pluginDisabled:SetSize (270, 40)
pluginDisabled:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -2)
--plugin is disabled at the addon control panel
local pluginDisabled = DF:NewLabel(sectionFrame, _, "$parentStreamerDisabledText", "StreamerDisabledTextLabel", "Enable 'Details!: Streamer' addon at the AddOns Control Panel.", "GameFontNormal", 10, "red")
pluginDisabled:SetSize(270, 40)
pluginDisabled:SetPoint("topleft", streamerTitleImage, "bottomleft", 0, -2)
end
sectionFrame:SetScript("OnShow", function()
local pluginStable = Details:GetPluginSavedTable("DETAILS_PLUGIN_STREAM_OVERLAY")
local pluginObject = Details:GetPlugin("DETAILS_PLUGIN_STREAM_OVERLAY")
if (pluginObject) then
if (pluginStable.enabled) then
sectionFrame.enableActionTrackerButtton:SetText("Disable")
else
sectionFrame.enableActionTrackerButtton:SetText("Enable")
end
end
if (Details.event_tracker.enabled) then
sectionFrame.enableEventTrackerButtton:SetText("Disable")
else
sectionFrame.enableEventTrackerButtton:SetText("Enable")
end
if (Details.realtime_dps_meter.enabled) then
sectionFrame.enableArenaDPSTrackerButtton:SetText("Disable")
else
sectionFrame.enableArenaDPSTrackerButtton:SetText("Enable")
end
end)
--> event tracker
DF:NewLabel (sectionFrame, _, "$parentEventTrackerAnchor", "eventTrackerAnchor", "Event Tracker", "GameFontNormal")
@@ -5906,72 +6014,96 @@ do
local eventTrackerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 50, "overlay", {0.5, 1, 134/512, 184/512})
eventTrackerTitleImage:SetPoint ("topleft", sectionFrame.eventTrackerAnchor, "bottomleft", 0, -40)
--> enable feature checkbox
DF:NewLabel (sectionFrame, _, "$parentEnableEventTrackerLabel", "EventTrackerLabel", "Enable Event Tracker", "GameFontHighlightLeft")
DF:NewSwitch (sectionFrame, _, "$parentEventTrackerSlider", "EventTrackerSlider", 60, 20, _, _, _detalhes.event_tracker.enabled, nil, nil, nil, nil, options_switch_template)
local enableEventTracker = function()
Details.event_tracker.enabled = not Details.event_tracker.enabled
Details:LoadFramesForBroadcastTools()
afterUpdate()
sectionFrame.EventTrackerSlider:SetPoint ("left", sectionFrame.EventTrackerLabel, "right", 2)
sectionFrame.EventTrackerSlider:SetAsCheckBox()
sectionFrame.EventTrackerSlider.OnSwitch = function (_, _, value)
_detalhes.event_tracker.enabled = not _detalhes.event_tracker.enabled
Details:LoadFramesForBroadcastTools()
afterUpdate()
end
sectionFrame.EventTrackerLabel:SetPoint ("topleft", eventTrackerTitleImage, "bottomleft", 0, -20)
sectionFrame.EventTrackerSlider:SetPoint ("left", sectionFrame.EventTrackerLabel, "right", 2, 0)
--> configure feature button
local configure_event_tracker = function()
_detalhes:OpenEventTrackerOptions (true)
C_Timer.After (0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
local configureEventTrackerButton = DF:NewButton (sectionFrame, _, "$parentConfigureEventTrackerButton", "configureEventTracker", 100, 20, configure_event_tracker, nil, nil, nil, "Event Tracker Options", nil, options_button_template)
configureEventTrackerButton:SetWidth (button_width)
configureEventTrackerButton:SetPoint ("topleft", sectionFrame.EventTrackerLabel, "bottomleft", 0, -7)
if (Details.event_tracker.enabled) then
sectionFrame.enableEventTrackerButtton:SetText("Disable")
else
sectionFrame.enableEventTrackerButtton:SetText("Enable")
end
end
local openEventTrackerOptions = function()
Details:OpenEventTrackerOptions(true)
C_Timer.After(0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
--create the enable, disable and options button
local enableEventTrackerButtton = DF:CreateButton(sectionFrame, enableEventTracker, 100, 20, "Enable", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
enableEventTrackerButtton:SetPoint("topleft", eventTrackerTitleImage, "bottomleft", 0, -7)
local actionTrackerOptionsButtton = DF:CreateButton(sectionFrame, openEventTrackerOptions, 100, 20, "Options", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
actionTrackerOptionsButtton:SetPoint("left", enableEventTrackerButtton, "right", 5, 0)
sectionFrame.enableEventTrackerButtton = enableEventTrackerButtton
sectionFrame.actionTrackerOptionsButtton = actionTrackerOptionsButtton
--> current dps
DF:NewLabel (sectionFrame, _, "$parentCurrentDPSAnchor", "currentDPSAnchor", "The Real Current DPS", "GameFontNormal")
sectionFrame.currentDPSAnchor:SetPoint("topleft", sectionFrame, "topleft", startX + 350, startY - 20)
--> arena kamehameha bar
DF:NewLabel (sectionFrame, _, "$parentCurrentDPSAnchor", "currentDPSAnchor", "Arena DPS Bar", "GameFontNormal")
sectionFrame.currentDPSAnchor:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 340)
local currentDPSTitleDesc = DF:NewLabel (sectionFrame, _, "$parentCurrentDPSTitleDescText", "CurrentDPSTitleDescTextLabel", "Show a frame with DPS done only in the last 5 seconds. Useful for arena matches and mythic dungeons.", "GameFontNormal", 10, "white")
local currentDPSTitleDesc = DF:NewLabel (sectionFrame, _, "$parentCurrentDPSTitleDescText", "CurrentDPSTitleDescTextLabel", "Show a bar which grows to the side of the team doing most damage in the last 5 seconds.", "GameFontNormal", 10, "white")
currentDPSTitleDesc:SetJustifyV ("top")
currentDPSTitleDesc:SetSize (270, 40)
currentDPSTitleDesc:SetPoint ("topleft", sectionFrame.currentDPSAnchor, "bottomleft", 0, -4)
local currentDPSTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 250, 61, "overlay", {259/512, 509/512, 186/512, 247/512})
local currentDPSTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 32, "overlay", {0/512, 256/512, 421/512, 453/512})
currentDPSTitleImage:SetPoint ("topleft", sectionFrame.currentDPSAnchor, "bottomleft", 0, -40)
--> enable feature checkbox
DF:NewLabel (sectionFrame, _, "$parentEnableCurrentDPSLabel", "CurrentDPSLabel", "Enable The Real Current Dps", "GameFontHighlightLeft")
DF:NewSwitch (sectionFrame, _, "$parentCurrentDPSSlider", "CurrentDPSSlider", 60, 20, _, _, _detalhes.current_dps_meter.enabled, nil, nil, nil, nil, options_switch_template)
sectionFrame.CurrentDPSSlider:SetPoint ("left", sectionFrame.CurrentDPSLabel, "right", 2)
sectionFrame.CurrentDPSSlider:SetAsCheckBox()
sectionFrame.CurrentDPSSlider.OnSwitch = function (_, _, value)
_detalhes.current_dps_meter.enabled = not _detalhes.current_dps_meter.enabled
Details:LoadFramesForBroadcastTools()
afterUpdate()
end
sectionFrame.CurrentDPSLabel:SetPoint ("topleft", currentDPSTitleImage, "bottomleft", 0, -10)
sectionFrame.CurrentDPSSlider:SetPoint ("left", sectionFrame.CurrentDPSLabel, "right", 2, 0)
--> configure feature button
local configure_current_dps = function()
_detalhes:OpenCurrentRealDPSOptions (true)
C_Timer.After (0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
local configureCurrentDPSButton = DF:NewButton (sectionFrame, _, "$parentConfigureCurrentDPSButton", "configureCurrentDPS", 100, 20, configure_current_dps, nil, nil, nil, "Current Real DPS Options", nil, options_button_template)
configureCurrentDPSButton:SetWidth (button_width)
configureCurrentDPSButton:SetPoint ("topleft", sectionFrame.CurrentDPSLabel, "bottomleft", 0, -7)
local enableArenaDPS = function()
Details.realtime_dps_meter.enabled = not Details.realtime_dps_meter.enabled
Details:LoadFramesForBroadcastTools()
afterUpdate()
if (Details.realtime_dps_meter.enabled) then
sectionFrame.enableArenaDPSTrackerButtton:SetText("Disable")
else
sectionFrame.enableArenaDPSTrackerButtton:SetText("Enable")
end
end
local openArenaDPSOptions = function()
Details:OpenCurrentRealDPSOptions(true)
C_Timer.After(0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
--create the enable, disable and options button
local enableArenaDPSTrackerButtton = DF:CreateButton(sectionFrame, enableArenaDPS, 100, 20, "Enable", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
enableArenaDPSTrackerButtton:SetPoint("topleft", currentDPSTitleImage, "bottomleft", 0, -7)
local arenaDPSTrackerOptionsButtton = DF:CreateButton(sectionFrame, openArenaDPSOptions, 100, 20, "Options", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
arenaDPSTrackerOptionsButtton:SetPoint("left", enableArenaDPSTrackerButtton, "right", 5, 0)
sectionFrame.enableArenaDPSTrackerButtton = enableArenaDPSTrackerButtton
sectionFrame.arenaDPSTrackerOptionsButtton = arenaDPSTrackerOptionsButtton
--create a gray texture below each plugin section
local createBackgroupTexture = function()
local texture = sectionFrame:CreateTexture(nil, "background")
texture:SetColorTexture(1, 1, 1, .1)
texture:SetSize(300, 150)
return texture
end
local backgroundTexture1 = createBackgroupTexture()
backgroundTexture1:SetPoint("topleft", sectionFrame.streamerPluginAnchor.widget, "topleft", -5, 5)
local backgroundTexture2 = createBackgroupTexture()
backgroundTexture2:SetPoint("topleft", sectionFrame.eventTrackerAnchor.widget, "topleft", -5, 5)
local backgroundTexture3 = createBackgroupTexture()
backgroundTexture3:SetPoint("topleft", sectionFrame.currentDPSAnchor.widget, "topleft", -5, 5)
--options
local sectionOptions = {
{type = "label", get = function() return Loc ["STRING_GERAL"] .. ":" end, text_template = subSectionTitleTextTemplate},
@@ -6045,7 +6177,7 @@ do
}
sectionFrame.sectionOptions = sectionOptions
DF:BuildMenu(sectionFrame, sectionOptions, startX + 350, startY - 20 - 200, heightSize + 300, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
DF:BuildMenu(sectionFrame, sectionOptions, startX + 350, startY - 20, heightSize + 300, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
end
tinsert(Details.optionsSection, buildSection)