Fixed Details! Streamer plugin on Classic versions of the game; Moved a few things in the options panel

This commit is contained in:
Tercio Jose
2023-11-14 13:42:57 -03:00
parent cf80fe5182
commit 448a31671b
5 changed files with 87 additions and 66 deletions
+2 -2
View File
@@ -13,8 +13,8 @@
local addonName, Details222 = ...
local version, build, date, tocversion = GetBuildInfo()
Details.build_counter = 12041
Details.alpha_build_counter = 12041 --if this is higher than the regular counter, use it instead
Details.build_counter = 12042
Details.alpha_build_counter = 12042 --if this is higher than the regular counter, use it instead
Details.dont_open_news = true
Details.game_version = version
Details.userversion = version .. " " .. Details.build_counter
+24 -24
View File
@@ -470,13 +470,13 @@
LibWindow.MakeDraggable(pluginContainerFrame)
LibWindow.SavePosition(pluginContainerFrame)
--menu background
local menuBackground = CreateFrame("frame", "$parentMenuFrame", pluginContainerFrame, "BackdropTemplate")
DetailsFramework:ApplyStandardBackdrop(menuBackground)
--left side bar menu
local optionsLeftSideBarMenu = CreateFrame("frame", "$parentMenuFrame", pluginContainerFrame, "BackdropTemplate")
DetailsFramework:ApplyStandardBackdrop(optionsLeftSideBarMenu)
--statusbar
local statusBar = CreateFrame("frame", nil, menuBackground, "BackdropTemplate")
statusBar:SetPoint("topleft", menuBackground, "bottomleft", 0, 1)
local statusBar = CreateFrame("frame", nil, optionsLeftSideBarMenu, "BackdropTemplate")
statusBar:SetPoint("topleft", optionsLeftSideBarMenu, "bottomleft", 0, 1)
statusBar:SetPoint("topright", pluginContainerFrame, "bottomright", 0, 1)
statusBar:SetHeight(20)
statusBar:SetAlpha(1)
@@ -492,28 +492,28 @@
rightClickToBackLabel:SetPoint("bottomright", statusBar, "bottomright", -1, 5)
rightClickToBackLabel:SetAlpha(.4)
menuBackground:SetPoint("topright", pluginContainerFrame, "topleft", -2, 0)
menuBackground:SetPoint("bottomright", pluginContainerFrame, "bottomleft", -2, 0)
menuBackground:SetWidth(pluginContainerFrame.MenuButtonWidth + 6)
optionsLeftSideBarMenu:SetPoint("topright", pluginContainerFrame, "topleft", -2, 0)
optionsLeftSideBarMenu:SetPoint("bottomright", pluginContainerFrame, "bottomleft", -2, 0)
optionsLeftSideBarMenu:SetWidth(pluginContainerFrame.MenuButtonWidth + 6)
local bigDogTexture = detailsFramework:NewImage(menuBackground, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 180*0.7, 200*0.7, "overlay", {0, 1, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog")
local bigDogTexture = detailsFramework:NewImage(optionsLeftSideBarMenu, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 180*0.7, 200*0.7, "overlay", {0, 1, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog")
bigDogTexture:SetPoint("bottomleft", custom_window, "bottomleft", 0, 1)
bigDogTexture:SetAlpha(0.3)
bigDogTexture:SetAlpha(0)
local gradientBelowTheLine = DetailsFramework:CreateTexture(menuBackground, {gradient = "vertical", fromColor = {0, 0, 0, 0.45}, toColor = "transparent"}, 1, 95, "artwork", {0, 1, 0, 1}, "dogGradient")
local gradientBelowTheLine = DetailsFramework:CreateTexture(optionsLeftSideBarMenu, {gradient = "vertical", fromColor = {0, 0, 0, 0.45}, toColor = "transparent"}, 1, 95, "artwork", {0, 1, 0, 1}, "dogGradient")
gradientBelowTheLine:SetPoint("bottoms")
local bigDogRowTexture = menuBackground:CreateTexture(nil, "artwork")
bigDogRowTexture:SetPoint("bottomleft", menuBackground, "bottomleft", 1, 1)
bigDogRowTexture:SetPoint("bottomright", menuBackground, "bottomright", -1, 1)
local bigDogRowTexture = optionsLeftSideBarMenu:CreateTexture(nil, "artwork")
bigDogRowTexture:SetPoint("bottomleft", optionsLeftSideBarMenu, "bottomleft", 1, 1)
bigDogRowTexture:SetPoint("bottomright", optionsLeftSideBarMenu, "bottomright", -1, 1)
bigDogRowTexture:SetHeight(20)
bigDogRowTexture:SetColorTexture(.5, .5, .5, .1)
bigDogRowTexture:Hide()
--plugins menu title bar
local titleBarPlugins = CreateFrame("frame", nil, menuBackground, "BackdropTemplate")
PixelUtil.SetPoint(titleBarPlugins, "topleft", menuBackground, "topleft", 2, -3)
PixelUtil.SetPoint(titleBarPlugins, "topright", menuBackground, "topright", -2, -3)
local titleBarPlugins = CreateFrame("frame", "$parentPluginsHeader", optionsLeftSideBarMenu, "BackdropTemplate")
PixelUtil.SetPoint(titleBarPlugins, "topleft", optionsLeftSideBarMenu, "topleft", 2, -3)
PixelUtil.SetPoint(titleBarPlugins, "topright", optionsLeftSideBarMenu, "topright", -2, -3)
titleBarPlugins:SetHeight(pluginContainerFrame.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)
@@ -524,8 +524,8 @@
PixelUtil.SetPoint(titleBarPlugins_TitleLabel, "center", titleBarPlugins , "center", 0, 0)
PixelUtil.SetPoint(titleBarPlugins_TitleLabel, "top", titleBarPlugins , "top", 0, -5)
--plugins menu title bar
local titleBarTools = CreateFrame("frame", nil, menuBackground, "BackdropTemplate")
--tools menu title bar
local titleBarTools = CreateFrame("frame", "$parentToolsHeader", optionsLeftSideBarMenu, "BackdropTemplate")
titleBarTools:SetHeight(pluginContainerFrame.TitleHeight)
titleBarTools:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
titleBarTools:SetBackdropColor(.5, .5, .5, 1)
@@ -750,20 +750,20 @@
local addingTools = false
for index, button in ipairs(pluginContainerFrame.MenuButtons) do
button:ClearAllPoints()
PixelUtil.SetPoint(button, "center", menuBackground, "center", 0, 0)
PixelUtil.SetPoint(button, "center", optionsLeftSideBarMenu, "center", 0, 0)
if (button.IsUtility) then
if (not addingTools) then
--add the header
addingTools = true
--add -20 to add a gap between plugins and utilities
PixelUtil.SetPoint(titleBarTools, "topleft", menuBackground, "topleft", 2, pluginContainerFrame.MenuY +((index-1) * -pluginContainerFrame.MenuButtonHeight ) - index - 20)
PixelUtil.SetPoint(titleBarTools, "topright", menuBackground, "topright", -2, pluginContainerFrame.MenuY +((index-1) * -pluginContainerFrame.MenuButtonHeight ) - index - 20)
PixelUtil.SetPoint(titleBarTools, "topleft", optionsLeftSideBarMenu, "topleft", 2, pluginContainerFrame.MenuY +((index-1) * -pluginContainerFrame.MenuButtonHeight ) - index - 20)
PixelUtil.SetPoint(titleBarTools, "topright", optionsLeftSideBarMenu, "topright", -2, pluginContainerFrame.MenuY +((index-1) * -pluginContainerFrame.MenuButtonHeight ) - index - 20)
end
PixelUtil.SetPoint(button, "top", menuBackground, "top", 0, pluginContainerFrame.MenuY +((index-1) * -pluginContainerFrame.MenuButtonHeight ) - index - 40)
PixelUtil.SetPoint(button, "top", optionsLeftSideBarMenu, "top", 0, pluginContainerFrame.MenuY +((index-1) * -pluginContainerFrame.MenuButtonHeight ) - index - 40)
else
PixelUtil.SetPoint(button, "top", menuBackground, "top", 0, pluginContainerFrame.MenuY +((index-1) * -pluginContainerFrame.MenuButtonHeight ) - index)
PixelUtil.SetPoint(button, "top", optionsLeftSideBarMenu, "top", 0, pluginContainerFrame.MenuY +((index-1) * -pluginContainerFrame.MenuButtonHeight ) - index)
end
end
+56 -35
View File
@@ -28,14 +28,20 @@ local options_button_template_selected = detailsFramework.table.copy({}, details
options_button_template_selected.backdropbordercolor = {1, .8, .2}
--options
local section_menu_button_width = 120
local section_menu_button_width = 135
local section_menu_button_height = 20
local startX = 160
--build the options window
function Details:InitializeOptionsWindow(instance)
return Details222.OptionsPanel.InitializeOptionsWindow(instance)
end
C_Timer.After(2, function()
Details:OpenOptionsWindow(Details:GetInstance(1), false, 1)
end)
function Details222.OptionsPanel.InitializeOptionsWindow(instance)
local DetailsOptionsWindow = detailsFramework:NewPanel(UIParent, _, "DetailsOptionsWindow", _, 897, 592)
local optionsFrame = DetailsOptionsWindow.frame
@@ -70,10 +76,39 @@ function Details222.OptionsPanel.InitializeOptionsWindow(instance)
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(footerFrame, {gradient = "vertical", fromColor = {0, 0, 0, 0.25}, toColor = "transparent"}, 1, 90, "artwork", {0, 1, 0, 1}, "dogGradient")
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")
--divisor shown above the tab options area
local frameBackgroundTextureTopLine = OTTFrame:CreateTexture("$parentHeaderDivisorTopLine", "artwork")
local divisorYPosition = -60
frameBackgroundTextureTopLine:SetPoint("topleft", optionsFrame, "topleft", startX-9, divisorYPosition)
frameBackgroundTextureTopLine:SetPoint("topright", optionsFrame, "topright", -1, divisorYPosition)
frameBackgroundTextureTopLine:SetHeight(1)
frameBackgroundTextureTopLine:SetColorTexture(0.1215, 0.1176, 0.1294)
--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)
local frameBackgroundTexture = optionsFrame:CreateTexture(nil, "artwork")
frameBackgroundTexture:SetPoint("topleft", optionsFrame, "topleft", startX-9, divisorYPosition-1)
frameBackgroundTexture:SetPoint("bottomright", optionsFrame, "bottomright", -1, 0)
frameBackgroundTexture:SetColorTexture (0.2317647, 0.2317647, 0.2317647)
frameBackgroundTexture:SetVertexColor (0.27, 0.27, 0.27)
frameBackgroundTexture:SetAlpha (0.3)
--select the instance to edit
local onSelectInstance = function(_, _, instanceId)
---@type instance
@@ -137,9 +172,9 @@ function Details222.OptionsPanel.InitializeOptionsWindow(instance)
return instanceList
end
local instanceSelection = detailsFramework:NewDropDown(footerFrame, _, "$parentInstanceSelectDropdown", "instanceDropdown", 200, 18, buildInstanceMenu) --, nil, options_dropdown_template
local instanceSelection = detailsFramework:NewDropDown(optionsFrame, _, "$parentInstanceSelectDropdown", "instanceDropdown", 200, 18, buildInstanceMenu) --, nil, options_dropdown_template
optionsFrame.instanceDropdown = instanceSelection
instanceSelection:SetPoint("bottomright", optionsFrame, "bottomright", -7, 09)
instanceSelection:SetPoint("topright", optionsFrame, "topright", -7, -39)
instanceSelection:SetTemplate(options_dropdown_template)
instanceSelection:SetHook("OnEnter", function()
GameCooltip:Reset()
@@ -151,28 +186,28 @@ function Details222.OptionsPanel.InitializeOptionsWindow(instance)
GameCooltip:Hide()
end)
local instances_string = detailsFramework:NewLabel(footerFrame, nil, "$parentInstanceDropdownLabel", "instancetext", Loc ["STRING_OPTIONS_EDITINSTANCE"], "GameFontNormal", 12)
instances_string:SetPoint("right", instanceSelection, "left", -2, 1)
formatFooterText(instances_string)
local instancesFontString = detailsFramework:NewLabel(optionsFrame, nil, "$parentInstanceDropdownLabel", "instancetext", Loc ["STRING_OPTIONS_EDITINSTANCE"], "GameFontNormal", 12)
instancesFontString:SetPoint("right", instanceSelection, "left", -2, 1)
formatFooterText(instancesFontString)
local bigdogImage = detailsFramework:NewImage(footerFrame, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 180*0.9, 200*0.9, nil, {1, 0, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog")
bigdogImage:SetPoint("bottomright", footerFrame, "topright", 0, 0)
local bigdogImage = detailsFramework:NewImage(optionsFrame, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 180*0.9, 200*0.9, nil, {1, 0, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog")
bigdogImage:SetPoint("bottomright", optionsFrame, "bottomright", 0, 0)
bigdogImage:SetAlpha(.25)
--editing group checkbox
local onToggleEditingGroup = function(self, fixparam, value)
Details.options_group_edit = value
end
local editingGroupCheckBox = detailsFramework:CreateSwitch(footerFrame, onToggleEditingGroup, Details.options_group_edit, _, _, _, _, _, "$parentEditGroupCheckbox", _, _, _, _, detailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"))
local editingGroupCheckBox = detailsFramework:CreateSwitch(optionsFrame, onToggleEditingGroup, Details.options_group_edit, _, _, _, _, _, "$parentEditGroupCheckbox", _, _, _, _, detailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"))
editingGroupCheckBox:SetAsCheckBox()
editingGroupCheckBox.tooltip = Loc ["STRING_MINITUTORIAL_OPTIONS_PANEL2"]
local editingGroupLabel = detailsFramework:NewLabel(footerFrame, nil, "$parentEditingGroupLabel", "editingGroupLabel", "Editing Group:", "GameFontNormal", 12) --localize-me
editingGroupLabel:SetPoint("bottomleft", instances_string, "topleft", 0, 5)
local editingGroupLabel = detailsFramework:NewLabel(optionsFrame, nil, "$parentEditingGroupLabel", "editingGroupLabel", "Editing Group:", "GameFontNormal", 12) --localize-me
editingGroupLabel:SetPoint("bottomleft", instancesFontString, "topleft", 0, 5)
editingGroupCheckBox:SetPoint("left", editingGroupLabel, "right", 2, 0)
formatFooterText(editingGroupLabel)
--create test bars
--create test bars ~test
detailsFramework:NewColor("C_OptionsButtonOrange", 0.9999, 0.8196, 0, 1)
local create_test_bars_func = function()
Details.CreateTestBars()
@@ -182,26 +217,22 @@ function Details222.OptionsPanel.InitializeOptionsWindow(instance)
Details:StopTestBarUpdate()
end
end
local fillbars = detailsFramework:NewButton(footerFrame, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1)
fillbars:SetPoint("bottomleft", optionsFrame.widget, "bottomleft", 10, 10)
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)
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 = detailsFramework:NewButton(footerFrame, _, "$parentOpenChangeLogButton", nil, 140, 20, Details.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
local changelog = detailsFramework:NewButton(optionsFrame, _, "$parentOpenChangeLogButton", nil, 140, 20, Details.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 = detailsFramework:CreateTextEntry(footerFrame, function()end, 140, 20, _, _, _, options_dropdown_template)
local searchBox = detailsFramework:CreateTextEntry(optionsFrame, function()end, 140, 20, _, _, _, options_dropdown_template)
searchBox:SetPoint("left", changelog, "right", 10, 0)
searchBox:SetAsSearchBox()
local searchLabel = detailsFramework:CreateLabel(footerFrame, "Search:") --localize-me
searchLabel:SetPoint("bottomleft", searchBox, "topleft", 0, 2)
formatFooterText(searchLabel)
searchBox:SetHook("OnChar", function()
if (searchBox.text ~= "") then
local searchSection = optionsFrame.sectionFramesContainer[19]
@@ -346,23 +377,9 @@ function Details222.OptionsPanel.InitializeOptionsWindow(instance)
local realBackdropAreaFrame = CreateFrame("frame", "$parentTab" .. sectionId .. "BackdropArea", optionsFrame, "BackdropTemplate")
realBackdropAreaFrame:SetFrameLevel(optionsFrame:GetFrameLevel()-1)
realBackdropAreaFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
realBackdropAreaFrame:SetBackdropColor(0.1215, 0.1176, 0.1294, .1)
realBackdropAreaFrame:SetBackdropBorderColor(0.2, 0.2, 0.2, .05)
realBackdropAreaFrame:SetPoint("topleft", optionsFrame, "topleft", 150, -27)
realBackdropAreaFrame:SetSize(775, 570)
local leftGradient = DetailsFramework:CreateTexture(sectionFrame, {gradient = "horizontal", fromColor = {0, 0, 0, 0}, toColor = {0, 0, 0, 0.3}}, 10, 1, "artwork", {0, 1, 0, 1}, "leftGradient")
leftGradient:SetPoint("right-left", realBackdropAreaFrame, 1)
local rightGradient = DetailsFramework:CreateTexture(sectionFrame, {gradient = "horizontal", fromColor = {0, 0, 0, 0}, toColor = {0, 0, 0, 0.25}}, 110, 1, "overlay", nil, "rightGradient")
rightGradient:SetPoint("rights", realBackdropAreaFrame, 0)
rightGradient:Hide()
local bottomGradient = DetailsFramework:CreateTexture(realBackdropAreaFrame, {gradient = "vertical", fromColor = {0, 0, 0, 1}, toColor = {0, 0, 0, 0}}, 1, 20, "artwork", {0, 1, 0, 1}, "bottomGradient")
bottomGradient.sublevel = 7
bottomGradient:SetPoint("bottoms")
sectionFrame.name = sectionsName[sectionId]
optionsFrame.sectionFramesContainer[sectionId] = sectionFrame
@@ -445,4 +462,8 @@ function Details:OpenOptionsWindow(instance, bNoReopen, section)
window.instanceDropdown:Select(instance:GetId())
window.updateMicroFrames()
end
function Details:OpenOptionsPanel(instance, bNoReopen, section) --alias
Details:OpenOptionsWindow(instance, bNoReopen, section)
end
+2 -2
View File
@@ -40,8 +40,8 @@ local unpack = _G.unpack
local tinsert = table.insert
local startX = 200
local startY = -40
local heightSize = 540
local startY = -75
local heightSize = 600
local presetVersion = 3
--templates
@@ -2358,9 +2358,9 @@ function StreamOverlay:OnEvent (_, event, ...)
local interimPlayerName, playerRealm = UnitFullName ("player")
if(select(4, GetBuildInfo()) >= 100200) then
playerName = interimPlayerName .. '-' .. playerRealm
end
--if(select(4, GetBuildInfo()) >= 100200) then
playerName = interimPlayerName .. '-' .. playerRealm --playerName is an upvalue from the file header
--end
playerName = _G.Details:Ambiguate(playerName)