I would like the
Code:
AddCustomMenuItem(
"Change Label Color",
function()
local color = nil
color = unpack(self.labelSettings.labelColor)
COLOR_PICKER:Show(
function(...)
self:SetLabelColor(...)
end,
color
)
end
)
method to show me a popup with two dropdowns and one slider instead of the colorpicker. Unfortunately, no matter which way I try, I always get just a popup with title, maintext and cancel and ok buttons.
What can I do to get the aforementioned controls in the window as well?
I tried both ZO_Dialogs(see example below) and libDialog.
Code:
ZO_Dialogs_RegisterCustomDialog("ExampleDialog", {
setup = function(dialog)
d("Setting up dialog controls")
local parentControl = dialog.control
local slider = CreateControlFromVirtual("$(parent)Slider", parentControl, "ZO_Slider")
if slider then
slider:SetAnchor(TOPLEFT, parentControl, TOPLEFT, 0, 20)
slider:SetMinMax(0, 100)
slider:SetValue(50)
slider:SetValueStep(1)
slider:SetHandler("OnValueChanged", function(_, value)
d("Slider value: " .. value)
end)
dialog.slider = slider
else
d("Failed to create slider.")
end
end,
title = {
text = "Example Dialog",
},
mainText = {
text = "Adjust the slider:",
},
buttons = {
{
text = "OK",
callback = function(dialog)
d("Confirmed with slider value: " .. dialog.slider:GetValue())
end,
},
{
text = "Cancel",
callback = function(dialog)
d("Dialog cancelled")
end,
},
},
})
SLASH_COMMANDS["/showdialog"] = function()
ZO_Dialogs_ShowDialog("ExampleDialog")
end