- updated all libraries

This commit is contained in:
2026-11-01 00:07:10 +01:00
parent e077eca0bd
commit 79873b0523
17 changed files with 736 additions and 266 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ if not AceConfig then return end
local pcall, error, type, pairs = pcall, error, type, pairs
-- -------------------------------------------------------------------
-- :RegisterOptionsTable(appName, options, slashcmd, persist)
-- :RegisterOptionsTable(appName, options, slashcmd)
--
-- - appName - (string) application name
-- - options - table or function ref, see AceConfigRegistry
@@ -7,7 +7,7 @@ local LibStub = LibStub
local gui = LibStub("AceGUI-3.0")
local reg = LibStub("AceConfigRegistry-3.0")
local MAJOR, MINOR = "AceConfigDialog-3.0", 86
local MAJOR, MINOR = "AceConfigDialog-3.0", 93
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigDialog then return end
@@ -517,7 +517,7 @@ local function OptionOnMouseOver(widget, event)
if descStyle and descStyle ~= "tooltip" then return end
tooltip:SetText(name, 1, .82, 0, true)
tooltip:SetText(name, 1, .82, 0, 1, true)
if opt.type == "multiselect" then
tooltip:AddLine(user.text, 0.5, 0.5, 0.8, true)
@@ -526,7 +526,7 @@ local function OptionOnMouseOver(widget, event)
tooltip:AddLine(desc, 1, 1, 1, true)
end
if type(usage) == "string" then
tooltip:AddLine("Usage: "..usage, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, true)
tooltip:AddLine(usage, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, true)
end
tooltip:Show()
@@ -544,25 +544,28 @@ local function GetFuncName(option)
end
end
do
local InCombatLockdown = InCombatLockdown
local frame = AceConfigDialog.popup
if not frame or oldminor < 81 then
if not frame or oldminor < 93 then
frame = CreateFrame("Frame", nil, UIParent)
AceConfigDialog.popup = frame
frame:Hide()
frame:SetPoint("CENTER", UIParent, "CENTER")
frame:SetSize(320, 72)
frame:SetSize(400, 72)
frame:EnableMouse(true) -- Do not allow click-through on the frame
frame:SetFrameStrata("TOOLTIP")
frame:SetFrameLevel(100) -- Lots of room to draw under it
frame:SetScript("OnKeyDown", function(self, key)
if key == "ESCAPE" then
self:SetPropagateKeyboardInput(false)
if not InCombatLockdown() then
self:SetPropagateKeyboardInput(false)
end
if self.cancel:IsShown() then
self.cancel:Click()
else -- Showing a validation error
self:Hide()
end
else
elseif not InCombatLockdown() then
self:SetPropagateKeyboardInput(true)
end
end)
@@ -573,7 +576,7 @@ do
frame:SetFixedFrameLevel(true)
local text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
text:SetSize(290, 0)
text:SetSize(370, 0)
text:SetPoint("TOP", 0, -16)
frame.text = text
@@ -605,11 +608,7 @@ local function confirmPopup(appName, rootframe, basepath, info, message, func, .
local frame = AceConfigDialog.popup
frame:Show()
frame.text:SetText(message)
-- From StaticPopup.lua
-- local height = 32 + text:GetHeight() + 2;
-- height = height + 6 + accept:GetHeight()
-- We add 32 + 2 + 6 + 21 (button height) == 61
local height = 61 + frame.text:GetHeight()
local height = 70 + frame.text:GetHeight()
frame:SetHeight(height)
frame.accept:ClearAllPoints()
@@ -1080,6 +1079,11 @@ local function InjectInfo(control, options, option, path, rootframe, appName)
control:SetCallback("OnRelease", CleanUserData)
control:SetCallback("OnLeave", OptionOnMouseLeave)
control:SetCallback("OnEnter", OptionOnMouseOver)
-- forward custom arg data directly
if control.SetCustomData and option.arg then
safecall(control.SetCustomData, control, option.arg)
end
end
local function CreateControl(userControlType, fallbackControlType)
@@ -1433,12 +1437,15 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
if control then
if control.width ~= "fill" then
local width = GetOptionsMemberValue("width",v,options,path,appName)
local relWidth = GetOptionsMemberValue("relWidth",v,options,path,appName)
if width == "double" then
control:SetWidth(width_multiplier * 2)
elseif width == "half" then
control:SetWidth(width_multiplier / 2)
elseif (type(width) == "number") then
control:SetWidth(width_multiplier * width)
elseif width == "relative" and relWidth then
control:SetRelativeWidth(relWidth)
elseif width == "full" then
control.width = "fill"
else
@@ -1503,7 +1510,7 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button)
tooltip:SetPoint("LEFT",button,"RIGHT")
end
tooltip:SetText(name, 1, .82, 0, true)
tooltip:SetText(name, 1, .82, 0, 1, true)
if type(desc) == "string" then
tooltip:AddLine(desc, 1, 1, 1, true)
@@ -1942,6 +1949,8 @@ else
AceConfigDialog.BlizOptions = AceConfigDialog.BlizOptions or {}
end
AceConfigDialog.BlizOptionsIDMap = AceConfigDialog.BlizOptionsIDMap or {}
local function FeedToBlizPanel(widget, event)
local path = widget:GetUserData("path")
AceConfigDialog:Open(widget:GetUserData("appName"), widget, unpack(path or emptyTbl))
@@ -1963,16 +1972,17 @@ end
-- has to be a head-level note.
--
-- This function returns a reference to the container frame registered with the Interface
-- Options. You can use this reference to open the options with the API function
-- `InterfaceOptionsFrame_OpenToCategory`.
-- Options, as well as the registered ID. You can use the ID to open the options with
-- the API function `Settings.OpenToCategory`.
-- @param appName The application name as given to `:RegisterOptionsTable()`
-- @param name A descriptive name to display in the options tree (defaults to appName)
-- @param parent The parent to use in the interface options tree.
-- @param ... The path in the options table to feed into the interface options panel.
-- @return The reference to the frame registered into the Interface Options.
-- @return The category ID to pass to Settings.OpenToCategory (or InterfaceOptionsFrame_OpenToCategory)
-- @return The category ID to pass to Settings.OpenToCategory
function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
local BlizOptions = AceConfigDialog.BlizOptions
local BlizOptionsIDMap = AceConfigDialog.BlizOptionsIDMap
local key = appName
for n = 1, select("#", ...) do
@@ -1998,29 +2008,32 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
end
group:SetCallback("OnShow", FeedToBlizPanel)
group:SetCallback("OnHide", ClearBlizPanel)
if Settings and Settings.RegisterCanvasLayoutCategory then
local categoryName = name or appName
if parent then
local category = Settings.GetCategory(parent)
if not category then
error(("The parent category '%s' was not found"):format(parent), 2)
end
local subcategory = Settings.RegisterCanvasLayoutSubcategory(category, group.frame, categoryName)
-- force the generated ID to be used for subcategories, as these can have very simple names like "Profiles"
group:SetName(subcategory.ID, parent)
else
local category = Settings.RegisterCanvasLayoutCategory(group.frame, categoryName)
-- using appName here would be cleaner, but would not be 100% compatible
-- but for top-level categories it should be fine, as these are typically addon names
category.ID = categoryName
group:SetName(categoryName, parent)
Settings.RegisterAddOnCategory(category)
local categoryName = name or appName
if parent then
local parentID = BlizOptionsIDMap[parent] or parent
local category = Settings.GetCategory(parentID)
if not category then
error(("The parent category '%s' was not found"):format(parent), 2)
end
local subcategory = Settings.RegisterCanvasLayoutSubcategory(category, group.frame, categoryName)
group:SetName(subcategory.ID, parentID)
else
group:SetName(name or appName, parent)
InterfaceOptions_AddCategory(group.frame)
if BlizOptionsIDMap[categoryName] then
error(("%s has already been added to the Blizzard Options Window with the given name: %s"):format(appName, categoryName), 2)
end
local category = Settings.RegisterCanvasLayoutCategory(group.frame, categoryName)
if not (C_SettingsUtil and C_SettingsUtil.OpenSettingsPanel) then
-- override the ID so the name can be used in Settings.OpenToCategory
-- unfortunately with incoming API changes in 12.0 (and likely classic at some point) this override is no longer possible
category.ID = categoryName
end
group:SetName(category.ID)
BlizOptionsIDMap[categoryName] = category.ID
Settings.RegisterAddOnCategory(category)
end
return group.frame, group.frame.name
else
error(("%s has already been added to the Blizzard Options Window with the given path"):format(appName), 2)
@@ -11,7 +11,7 @@
-- @release $Id$
local CallbackHandler = LibStub("CallbackHandler-1.0")
local MAJOR, MINOR = "AceConfigRegistry-3.0", 21
local MAJOR, MINOR = "AceConfigRegistry-3.0", 22
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigRegistry then return end
@@ -92,6 +92,7 @@ local basekeys={
func=optmethodfalse,
arg={["*"]=true},
width=optstringnumber,
relWidth=optnumber,
}
local typedkeys={