Polishing the background of many Details! window, they all now share the same color, the color can be set with Details:SetWindowColor(r, g, b, a)
This commit is contained in:
+30
-31
@@ -45,46 +45,38 @@ end
|
||||
function Details222.OptionsPanel.InitializeOptionsWindow(instance)
|
||||
local DetailsOptionsWindow = detailsFramework:NewPanel(UIParent, _, "DetailsOptionsWindow", _, 897, 592)
|
||||
local optionsFrame = DetailsOptionsWindow.frame
|
||||
optionsFrame:Hide()
|
||||
|
||||
DetailsOptionsWindow:SetBackdrop({})
|
||||
detailsFramework:AddRoundedCornersToFrame(optionsFrame, Details.PlayerBreakdown.RoundedCornerPreset)
|
||||
optionsFrame:SetColor(unpack(Details.frame_background_color))
|
||||
|
||||
optionsFrame.Frame = optionsFrame
|
||||
optionsFrame.__name = "Options"
|
||||
optionsFrame.real_name = "DETAILS_OPTIONS"
|
||||
optionsFrame.__icon = [[Interface\Scenarios\ScenarioIcon-Interact]]
|
||||
_G.DetailsPluginContainerWindow.EmbedPlugin(optionsFrame, optionsFrame, true)
|
||||
|
||||
optionsFrame.sectionFramesContainer = {}
|
||||
|
||||
detailsFramework:ApplyStandardBackdrop(optionsFrame)
|
||||
local titleBar = detailsFramework:CreateTitleBar(optionsFrame, "Options Panel")
|
||||
titleBar.Text:Hide()
|
||||
local closeButton = detailsFramework:CreateCloseButton(optionsFrame, "$parentCloseButton")
|
||||
closeButton:SetScript("OnClick", function()
|
||||
DetailsPluginContainerWindow:Hide()
|
||||
end)
|
||||
closeButton:SetPoint("topright", optionsFrame, "topright", -5, -5)
|
||||
|
||||
local titleText = detailsFramework:NewLabel(titleBar, nil, "$parentTitleLabel", "title", "Details! " .. Loc ["STRING_OPTIONS_WINDOW"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
|
||||
titleText:SetPoint("center", titleBar, "center")
|
||||
local titleText = detailsFramework:NewLabel(optionsFrame, nil, "$parentTitleLabel", "title", "Details! " .. Loc ["STRING_OPTIONS_WINDOW"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
|
||||
titleText:SetPoint("top", optionsFrame, "top", 0, -5)
|
||||
|
||||
optionsFrame:Hide()
|
||||
|
||||
local formatFooterText = function(object)
|
||||
object.fontface = "GameFontNormal"
|
||||
object.fontsize = 10
|
||||
object.fontcolor = {1, 0.82, 0}
|
||||
end
|
||||
|
||||
--create a floating frame to hold footer frames
|
||||
local footerFrame = CreateFrame("frame", "$parentFooterFrame", optionsFrame, "BackdropTemplate")
|
||||
footerFrame:SetPoint("bottomleft", optionsFrame, "bottomleft", 0, 0)
|
||||
footerFrame:SetPoint("bottomright", optionsFrame, "bottomright", 0, 0)
|
||||
footerFrame:SetHeight(50)
|
||||
footerFrame:SetFrameLevel(optionsFrame:GetFrameLevel() + 10)
|
||||
detailsFramework:ApplyStandardBackdrop(footerFrame)
|
||||
footerFrame:Hide() --at the moment of this change (2023.11.14), I don't know if the footer will have further use
|
||||
--[=[
|
||||
local gradientBelowTheLine = DetailsFramework:CreateTexture(optionsFrame, {gradient = "vertical", fromColor = {0, 0, 0, 0.25}, toColor = "transparent"}, 1, 90, "artwork", {0, 1, 0, 1}, "dogGradient")
|
||||
gradientBelowTheLine:SetPoint("bottoms")
|
||||
gradientBelowTheLine:Hide()
|
||||
|
||||
local OTTFrame = CreateFrame("frame", "$parentOverTheTopFrame", optionsFrame)
|
||||
OTTFrame:SetSize(1, 1)
|
||||
OTTFrame:SetFrameLevel(999)
|
||||
OTTFrame:SetPoint("topleft", optionsFrame, "topleft", 0, 0)
|
||||
|
||||
local gradientBelowTheLine = DetailsFramework:CreateTexture(optionsFrame, {gradient = "vertical", fromColor = {0, 0, 0, 0.25}, toColor = "transparent"}, 1, 90, "artwork", {0, 1, 0, 1}, "dogGradient")
|
||||
gradientBelowTheLine:SetPoint("bottoms")
|
||||
OTTFrame:Hide()
|
||||
|
||||
--divisor shown above the tab options area
|
||||
local frameBackgroundTextureTopLine = OTTFrame:CreateTexture("$parentHeaderDivisorTopLine", "artwork")
|
||||
@@ -93,14 +85,15 @@ function Details222.OptionsPanel.InitializeOptionsWindow(instance)
|
||||
frameBackgroundTextureTopLine:SetPoint("topright", optionsFrame, "topright", -1, divisorYPosition)
|
||||
frameBackgroundTextureTopLine:SetHeight(1)
|
||||
frameBackgroundTextureTopLine:SetColorTexture(0.1215, 0.1176, 0.1294)
|
||||
frameBackgroundTextureTopLine:Hide()
|
||||
|
||||
--divisor shown in the left side of the tab options area
|
||||
local frameBackgroundTextureLeftLine = OTTFrame:CreateTexture("$parentHeaderDivisorLeftLine", "artwork")
|
||||
local divisorYPosition = -60
|
||||
frameBackgroundTextureLeftLine:SetPoint("topleft", frameBackgroundTextureTopLine, "topleft", 0, 0)
|
||||
frameBackgroundTextureLeftLine:SetPoint("bottomleft", optionsFrame, "bottomleft", startX-9, 1)
|
||||
frameBackgroundTextureLeftLine:SetHeight(1)
|
||||
frameBackgroundTextureLeftLine:SetColorTexture(0.1215, 0.1176, 0.1294)
|
||||
frameBackgroundTextureLeftLine:Hide()
|
||||
|
||||
local frameBackgroundTexture = optionsFrame:CreateTexture(nil, "artwork")
|
||||
frameBackgroundTexture:SetPoint("topleft", optionsFrame, "topleft", startX-9, divisorYPosition-1)
|
||||
@@ -108,6 +101,8 @@ function Details222.OptionsPanel.InitializeOptionsWindow(instance)
|
||||
frameBackgroundTexture:SetColorTexture (0.2317647, 0.2317647, 0.2317647)
|
||||
frameBackgroundTexture:SetVertexColor (0.27, 0.27, 0.27)
|
||||
frameBackgroundTexture:SetAlpha (0.3)
|
||||
frameBackgroundTexture:Hide()
|
||||
--]=]
|
||||
|
||||
--select the instance to edit
|
||||
local onSelectInstance = function(_, _, instanceId)
|
||||
@@ -186,6 +181,12 @@ function Details222.OptionsPanel.InitializeOptionsWindow(instance)
|
||||
GameCooltip:Hide()
|
||||
end)
|
||||
|
||||
local formatFooterText = function(object)
|
||||
object.fontface = "GameFontNormal"
|
||||
object.fontsize = 10
|
||||
object.fontcolor = {1, 0.82, 0}
|
||||
end
|
||||
|
||||
local instancesFontString = detailsFramework:NewLabel(optionsFrame, nil, "$parentInstanceDropdownLabel", "instancetext", Loc ["STRING_OPTIONS_EDITINSTANCE"], "GameFontNormal", 12)
|
||||
instancesFontString:SetPoint("right", instanceSelection, "left", -2, 1)
|
||||
formatFooterText(instancesFontString)
|
||||
@@ -217,6 +218,7 @@ function Details222.OptionsPanel.InitializeOptionsWindow(instance)
|
||||
Details:StopTestBarUpdate()
|
||||
end
|
||||
end
|
||||
|
||||
local fillbars = detailsFramework:NewButton(optionsFrame, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1)
|
||||
PixelUtil.SetPoint(fillbars, "topleft", optionsFrame.widget, "topleft", startX-8, -30)
|
||||
fillbars:SetTemplate(options_button_template)
|
||||
@@ -375,11 +377,6 @@ function Details222.OptionsPanel.InitializeOptionsWindow(instance)
|
||||
sectionFrame:SetSize(optionsFrame:GetSize())
|
||||
sectionFrame:EnableMouse(false)
|
||||
|
||||
local realBackdropAreaFrame = CreateFrame("frame", "$parentTab" .. sectionId .. "BackdropArea", optionsFrame, "BackdropTemplate")
|
||||
realBackdropAreaFrame:SetFrameLevel(optionsFrame:GetFrameLevel()-1)
|
||||
realBackdropAreaFrame:SetPoint("topleft", optionsFrame, "topleft", 150, -27)
|
||||
realBackdropAreaFrame:SetSize(775, 570)
|
||||
|
||||
sectionFrame.name = sectionsName[sectionId]
|
||||
optionsFrame.sectionFramesContainer[sectionId] = sectionFrame
|
||||
|
||||
@@ -462,6 +459,8 @@ function Details:OpenOptionsWindow(instance, bNoReopen, section)
|
||||
window.instanceDropdown:Select(instance:GetId())
|
||||
|
||||
window.updateMicroFrames()
|
||||
|
||||
DetailsPluginContainerWindowMenuFrame:SetColor(unpack(Details.frame_background_color))
|
||||
end
|
||||
|
||||
function Details:OpenOptionsPanel(instance, bNoReopen, section) --alias
|
||||
|
||||
Reference in New Issue
Block a user