Files
coa-mapster/Mapster/Libs/AceConfig-3.0/AceConfig-3.0.lua
T
florian.berthold 4a65f00aca
release / release (push) Successful in 3s
vendor: Libs/ from coa-ace3 + LibBabble-Zone / LibWindow; pin TOC version
Upstream Mapster relies on the CurseForge packager to fetch its libs
at release time; the raw repo has no Libs/ folder, so the freshly-
imported addon failed to load (LibStub missing).

- Vendored canonical Ace3 from coa-ace3 (11 libs Mapster's TOC loads:
  LibStub, CallbackHandler-1.0, AceAddon-3.0, AceEvent-3.0, AceHook-3.0,
  AceDB-3.0, AceDBOptions-3.0, AceLocale-3.0, AceGUI-3.0, AceConsole-3.0,
  AceConfig-3.0). This brings the CoA-compat FileDataID / BlizOptionsGroup
  parent-guard / Settings.* fallback / AceDB falsy-defaults patches.
- LibBabble-Zone-3.0 and LibWindow-1.1 vendored from the working PTR
  install (not part of Ace3).
- TOC: replaced @project-version@ CurseForge placeholder with the real
  release string 1.3.9-coa.2 so the in-game About panel reads correctly.

Mapster source itself was clean against the PORTING.md checklist
(no FDID calls, no retail-only globals, no Minimap mask trap, no CLEU
arg mismatch) — expected, since 1.3.9 was the WotLK-era release.
2026-05-25 13:11:21 +02:00

59 lines
2.1 KiB
Lua

--- AceConfig-3.0 wrapper library.
-- Provides an API to register an options table with the config registry,
-- as well as associate it with a slash command.
-- @class file
-- @name AceConfig-3.0
-- @release $Id$
--[[
AceConfig-3.0
Very light wrapper library that combines all the AceConfig subcomponents into one more easily used whole.
]]
local cfgreg = LibStub("AceConfigRegistry-3.0")
local cfgcmd = LibStub("AceConfigCmd-3.0")
local MAJOR, MINOR = "AceConfig-3.0", 3
local AceConfig = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfig then return end
--TODO: local cfgdlg = LibStub("AceConfigDialog-3.0", true)
--TODO: local cfgdrp = LibStub("AceConfigDropdown-3.0", true)
-- Lua APIs
local pcall, error, type, pairs = pcall, error, type, pairs
-- -------------------------------------------------------------------
-- :RegisterOptionsTable(appName, options, slashcmd)
--
-- - appName - (string) application name
-- - options - table or function ref, see AceConfigRegistry
-- - slashcmd - slash command (string) or table with commands, or nil to NOT create a slash command
--- Register a option table with the AceConfig registry.
-- You can supply a slash command (or a table of slash commands) to register with AceConfigCmd directly.
-- @paramsig appName, options [, slashcmd]
-- @param appName The application name for the config table.
-- @param options The option table (or a function to generate one on demand). http://www.wowace.com/addons/ace3/pages/ace-config-3-0-options-tables/
-- @param slashcmd A slash command to register for the option table, or a table of slash commands.
-- @usage
-- local AceConfig = LibStub("AceConfig-3.0")
-- AceConfig:RegisterOptionsTable("MyAddon", myOptions, {"/myslash", "/my"})
function AceConfig:RegisterOptionsTable(appName, options, slashcmd)
local ok,msg = pcall(cfgreg.RegisterOptionsTable, self, appName, options)
if not ok then error(msg, 2) end
if slashcmd then
if type(slashcmd) == "table" then
for _,cmd in pairs(slashcmd) do
cfgcmd:CreateChatCommand(cmd, appName)
end
else
cfgcmd:CreateChatCommand(slashcmd, appName)
end
end
end