Updated LibOpenRaid and DetailsFramework

This commit is contained in:
Tercio Jose
2022-10-09 19:47:56 -03:00
parent 9974a87119
commit 944178f76f
126 changed files with 15502 additions and 15495 deletions
+68 -68
View File
@@ -7,7 +7,7 @@ local Details = _G.Details
local DF = _G.DetailsFramework
local libwindow = LibStub("LibWindow-1.1")
--> this function isn't in use
--this function isn't in use
function Details.OpenDpsBenchmark()
--main frame
@@ -16,15 +16,15 @@ local libwindow = LibStub("LibWindow-1.1")
local _ = nil
--declaration
local f = CreateFrame ("frame", "DetailsBenchmark", UIParent,"BackdropTemplate")
f:SetSize (800, 600)
f:SetPoint ("left", UIParent, "left")
local f = CreateFrame("frame", "DetailsBenchmark", UIParent,"BackdropTemplate")
f:SetSize(800, 600)
f:SetPoint("left", UIParent, "left")
f:SetFrameStrata ("LOW")
f:EnableMouse (true)
f:SetMovable (true)
f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f:SetBackdropColor (0, 0, 0, 0.9)
f:SetBackdropBorderColor (0, 0, 0, 1)
f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f:SetBackdropColor(0, 0, 0, 0.9)
f:SetBackdropBorderColor(0, 0, 0, 1)
--register to libwindow
local LibWindow = LibStub ("LibWindow-1.1")
@@ -34,32 +34,32 @@ local libwindow = LibStub("LibWindow-1.1")
LibWindow.SavePosition (f)
--titlebar
f.TitleBar = CreateFrame ("frame", "$parentTitleBar", f,"BackdropTemplate")
f.TitleBar:SetPoint ("topleft", f, "topleft", 2, -3)
f.TitleBar:SetPoint ("topright", f, "topright", -2, -3)
f.TitleBar:SetHeight (20)
f.TitleBar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f.TitleBar:SetBackdropColor (.2, .2, .2, 1)
f.TitleBar:SetBackdropBorderColor (0, 0, 0, 1)
f.TitleBar = CreateFrame("frame", "$parentTitleBar", f,"BackdropTemplate")
f.TitleBar:SetPoint("topleft", f, "topleft", 2, -3)
f.TitleBar:SetPoint("topright", f, "topright", -2, -3)
f.TitleBar:SetHeight(20)
f.TitleBar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f.TitleBar:SetBackdropColor(.2, .2, .2, 1)
f.TitleBar:SetBackdropBorderColor(0, 0, 0, 1)
--close button
f.Close = CreateFrame ("button", "$parentCloseButton", f,"BackdropTemplate")
f.Close:SetPoint ("right", f.TitleBar, "right", -2, 0)
f.Close:SetSize (16, 16)
f.Close:SetNormalTexture (_detalhes.gump.folder .. "icons")
f.Close:SetHighlightTexture (_detalhes.gump.folder .. "icons")
f.Close:SetPushedTexture (_detalhes.gump.folder .. "icons")
f.Close = CreateFrame("button", "$parentCloseButton", f,"BackdropTemplate")
f.Close:SetPoint("right", f.TitleBar, "right", -2, 0)
f.Close:SetSize(16, 16)
f.Close:SetNormalTexture(_detalhes.gump.folder .. "icons")
f.Close:SetHighlightTexture(_detalhes.gump.folder .. "icons")
f.Close:SetPushedTexture(_detalhes.gump.folder .. "icons")
f.Close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1)
f.Close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1)
f.Close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1)
f.Close:SetAlpha (0.7)
f.Close:SetScript ("OnClick", function() f:Hide() end)
f.Close:SetScript("OnClick", function() f:Hide() end)
--title
f.Title = f.TitleBar:CreateFontString ("$parentTitle", "overlay", "GameFontNormal")
f.Title:SetPoint ("center", f.TitleBar, "center")
f.Title:SetPoint("center", f.TitleBar, "center")
f.Title:SetTextColor (.8, .8, .8, 1)
f.Title:SetText ("Details! Benchmark")
f.Title:SetText("Details! Benchmark")
DF:InstallTemplate ("font", "DETAILS_BENCHMARK_NORMAL", {color = "white", size = 10, font = "Friz Quadrata TT"})
@@ -89,14 +89,14 @@ local libwindow = LibStub("LibWindow-1.1")
end
end
function f.StartUpdateOnTick()
f:SetScript ("OnUpdate", f.UpdateOnTick)
f:SetScript("OnUpdate", f.UpdateOnTick)
end
--events
f:RegisterEvent ("PLAYER_REGEN_DISABLED")
f:RegisterEvent ("PLAYER_REGEN_ENABLED")
f:SetScript ("OnEvent", function(self, event, ...)
f:SetScript("OnEvent", function(self, event, ...)
if (event == "PLAYER_REGEN_DISABLED") then
f.StartNewBenchmark()
@@ -126,12 +126,12 @@ local libwindow = LibStub("LibWindow-1.1")
--summary block
--declaration
local summaryFrame = CreateFrame ("frame", "$parentSummaryFrame", f,"BackdropTemplate")
summaryFrame:SetPoint ("topleft", f, "topleft", unpack (f.FrameLocations.summary))
summaryFrame:SetSize (unpack (f.FrameSizes.default))
summaryFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
summaryFrame:SetBackdropColor (0, 0, 0, 0.9)
summaryFrame:SetBackdropBorderColor (0, 0, 0, 1)
local summaryFrame = CreateFrame("frame", "$parentSummaryFrame", f,"BackdropTemplate")
summaryFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.summary))
summaryFrame:SetSize(unpack (f.FrameSizes.default))
summaryFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
summaryFrame:SetBackdropColor(0, 0, 0, 0.9)
summaryFrame:SetBackdropBorderColor(0, 0, 0, 1)
--time to test string and dropdown
local build_time_list = function()
@@ -146,18 +146,18 @@ local libwindow = LibStub("LibWindow-1.1")
return t
end
summaryFrame.TimeToTestLabel = DF:CreateLabel (summaryFrame, "Amount of Time", normal_text_template)
summaryFrame.TimeToTestLabel = DF:CreateLabel(summaryFrame, "Amount of Time", normal_text_template)
summaryFrame.TimeToTestDropdown = DF:CreateDropDown (summaryFrame, build_time_list, default, 150, 20, _, _, options_dropdown_template)
--description string and text entry
summaryFrame.DescriptionLabel = DF:CreateLabel (summaryFrame, "Description", normal_text_template)
summaryFrame.DescriptionLabel = DF:CreateLabel(summaryFrame, "Description", normal_text_template)
summaryFrame.DescriptionEntry = DF:CreateTextEntry (summaryFrame, function()end, 120, 20, nil, _, nil, options_dropdown_template)
--DPS Amount string
summaryFrame.DPSLabel = DF:CreateLabel (summaryFrame, "100K", normal_text_template)
summaryFrame.DPSLabel = DF:CreateLabel(summaryFrame, "100K", normal_text_template)
--TIME ELAPSED string
summaryFrame.TimeElapsedLabel = DF:CreateLabel (summaryFrame, "01:00", normal_text_template)
summaryFrame.TimeElapsedLabel = DF:CreateLabel(summaryFrame, "01:00", normal_text_template)
--boss simulation string and dropdown
local build_bosssimulation_list, default = function()
@@ -166,40 +166,40 @@ local libwindow = LibStub("LibWindow-1.1")
}
return t
end
summaryFrame.BossSimulationLabel = DF:CreateLabel (summaryFrame, "Boss Simulation", normal_text_template)
summaryFrame.BossSimulationLabel = DF:CreateLabel(summaryFrame, "Boss Simulation", normal_text_template)
summaryFrame.BossSimulationDropdown = DF:CreateDropDown (summaryFrame, build_bosssimulation_list, default, 150, 20, _, _, options_dropdown_template)
--boss records line with a tooltip importing data from the storage
summaryFrame.BossRecordsFrame = CreateFrame ("frame", nil, summaryFrame,"BackdropTemplate")
summaryFrame.BossRecordsFrame:SetSize (f.FrameSizes.default[1]-20, 20)
summaryFrame.BossRecordsFrame:SetBackdropColor (0, 0, 0, 0.3)
summaryFrame.BossRecordsFrame:SetScript ("OnEnter", function()
summaryFrame.BossRecordsFrame = CreateFrame("frame", nil, summaryFrame,"BackdropTemplate")
summaryFrame.BossRecordsFrame:SetSize(f.FrameSizes.default[1]-20, 20)
summaryFrame.BossRecordsFrame:SetBackdropColor(0, 0, 0, 0.3)
summaryFrame.BossRecordsFrame:SetScript("OnEnter", function()
end)
summaryFrame.BossRecordsFrame:SetScript ("OnLeave", function()
summaryFrame.BossRecordsFrame:SetScript("OnLeave", function()
end)
--set the points
do
local x, y = 10, -10
summaryFrame.TimeToTestLabel:SetPoint ("topleft", summaryFrame, "topleft", x, y)
summaryFrame.TimeToTestDropdown:SetPoint ("topleft", summaryFrame.TimeToTestLabel, "bottomleft", 0, -2)
summaryFrame.TimeToTestLabel:SetPoint("topleft", summaryFrame, "topleft", x, y)
summaryFrame.TimeToTestDropdown:SetPoint("topleft", summaryFrame.TimeToTestLabel, "bottomleft", 0, -2)
--y = y - 40
summaryFrame.DescriptionLabel:SetPoint ("topleft", summaryFrame, "topleft", x+160, y)
summaryFrame.DescriptionEntry:SetPoint ("topleft", summaryFrame.DescriptionLabel, "bottomleft", 0, -2)
summaryFrame.DescriptionLabel:SetPoint("topleft", summaryFrame, "topleft", x+160, y)
summaryFrame.DescriptionEntry:SetPoint("topleft", summaryFrame.DescriptionLabel, "bottomleft", 0, -2)
y = y - 40
summaryFrame.DPSLabel:SetPoint ("topleft", summaryFrame, "topleft", x, y)
summaryFrame.TimeElapsedLabel:SetPoint ("topleft", summaryFrame, "topleft", x + 100, y)
summaryFrame.DPSLabel:SetPoint("topleft", summaryFrame, "topleft", x, y)
summaryFrame.TimeElapsedLabel:SetPoint("topleft", summaryFrame, "topleft", x + 100, y)
y = y - 40
summaryFrame.BossSimulationLabel:SetPoint ("topleft", summaryFrame, "topleft", x, y)
summaryFrame.BossSimulationDropdown:SetPoint ("topleft", summaryFrame.BossSimulationLabel, "bottomleft", 0, -2)
summaryFrame.BossSimulationLabel:SetPoint("topleft", summaryFrame, "topleft", x, y)
summaryFrame.BossSimulationDropdown:SetPoint("topleft", summaryFrame.BossSimulationLabel, "bottomleft", 0, -2)
y = y - 40
summaryFrame.BossRecordsFrame:SetPoint ("topleft", summaryFrame, "topleft", 0, 0)
summaryFrame.BossRecordsFrame:SetPoint("topleft", summaryFrame, "topleft", 0, 0)
end
@@ -208,12 +208,12 @@ local libwindow = LibStub("LibWindow-1.1")
--spells block
--declaration
local spellsFrame = CreateFrame ("frame", "$parentSpellsFrame", f,"BackdropTemplate")
spellsFrame:SetPoint ("topleft", f, "topleft", unpack (f.FrameLocations.spells))
spellsFrame:SetSize (unpack (f.FrameSizes.default))
spellsFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
spellsFrame:SetBackdropColor (0, 0, 0, 0.9)
spellsFrame:SetBackdropBorderColor (0, 0, 0, 1)
local spellsFrame = CreateFrame("frame", "$parentSpellsFrame", f,"BackdropTemplate")
spellsFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.spells))
spellsFrame:SetSize(unpack (f.FrameSizes.default))
spellsFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
spellsFrame:SetBackdropColor(0, 0, 0, 0.9)
spellsFrame:SetBackdropBorderColor(0, 0, 0, 1)
--header with the string titles:
--Spell Icon | DPS | Damage | Casts | Criticals | Highest Damage
@@ -227,12 +227,12 @@ local libwindow = LibStub("LibWindow-1.1")
--auras block
--declaration
local aurasFrame = CreateFrame ("frame", "$parentAurasFrame", f,"BackdropTemplate")
aurasFrame:SetPoint ("topleft", f, "topleft", unpack (f.FrameLocations.auras))
aurasFrame:SetSize (unpack (f.FrameSizes.default))
aurasFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
aurasFrame:SetBackdropColor (0, 0, 0, 0.9)
aurasFrame:SetBackdropBorderColor (0, 0, 0, 1)
local aurasFrame = CreateFrame("frame", "$parentAurasFrame", f,"BackdropTemplate")
aurasFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.auras))
aurasFrame:SetSize(unpack (f.FrameSizes.default))
aurasFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
aurasFrame:SetBackdropColor(0, 0, 0, 0.9)
aurasFrame:SetBackdropBorderColor(0, 0, 0, 1)
--will be 9 blocks?
@@ -244,12 +244,12 @@ local libwindow = LibStub("LibWindow-1.1")
--history block
--declaration
local historyFrame = CreateFrame ("frame", "$parentHistoryFrame", f,"BackdropTemplate")
historyFrame:SetPoint ("topleft", f, "topleft", unpack (f.FrameLocations.history))
historyFrame:SetSize (unpack (f.FrameSizes.default))
historyFrame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
historyFrame:SetBackdropColor (0, 0, 0, 0.9)
historyFrame:SetBackdropBorderColor (0, 0, 0, 1)
local historyFrame = CreateFrame("frame", "$parentHistoryFrame", f,"BackdropTemplate")
historyFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.history))
historyFrame:SetSize(unpack (f.FrameSizes.default))
historyFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
historyFrame:SetBackdropColor(0, 0, 0, 0.9)
historyFrame:SetBackdropBorderColor(0, 0, 0, 1)
--header with the string titles:
--Spec | ILevel | DPS | Time | Talents | Crit | Haste | Versatility | Mastery | Int | Description