From 25e4b469854f81c149dc743b01b33c702f1931ca Mon Sep 17 00:00:00 2001 From: Jeffrey Cai Date: Sun, 15 Oct 2017 15:13:03 -0400 Subject: [PATCH] add AceDBOptions with LibDualSpec support --- embeds.xml | 4 + libs/AceConfig-3.0/AceConfig-3.0.lua | 58 + libs/AceConfig-3.0/AceConfig-3.0.xml | 8 + .../AceConfigCmd-3.0/AceConfigCmd-3.0.lua | 794 +++++++ .../AceConfigCmd-3.0/AceConfigCmd-3.0.xml | 4 + .../AceConfigDialog-3.0.lua | 1974 +++++++++++++++++ .../AceConfigDialog-3.0.xml | 4 + .../AceConfigRegistry-3.0.lua | 349 +++ .../AceConfigRegistry-3.0.xml | 4 + libs/AceDBOptions-3.0/AceDBOptions-3.0.lua | 460 ++++ libs/AceDBOptions-3.0/AceDBOptions-3.0.xml | 4 + .../BackgroundWidget.lua | 235 ++ .../BorderWidget.lua | 230 ++ .../FontWidget.lua | 216 ++ .../SoundWidget.lua | 264 +++ .../StatusbarWidget.lua | 233 ++ .../prototypes.lua | 273 +++ libs/AceGUI-3.0-SharedMediaWidgets/widget.xml | 9 + libs/AceGUI-3.0/AceGUI-3.0.lua | 813 +++++++ libs/AceGUI-3.0/AceGUI-3.0.xml | 28 + .../AceGUIContainer-BlizOptionsGroup.lua | 138 ++ .../widgets/AceGUIContainer-DropDownGroup.lua | 157 ++ .../widgets/AceGUIContainer-Frame.lua | 316 +++ .../widgets/AceGUIContainer-InlineGroup.lua | 103 + .../widgets/AceGUIContainer-ScrollFrame.lua | 204 ++ .../widgets/AceGUIContainer-SimpleGroup.lua | 69 + .../widgets/AceGUIContainer-TabGroup.lua | 350 +++ .../widgets/AceGUIContainer-TreeGroup.lua | 710 ++++++ .../widgets/AceGUIContainer-Window.lua | 336 +++ .../widgets/AceGUIWidget-Button.lua | 103 + .../widgets/AceGUIWidget-CheckBox.lua | 295 +++ .../widgets/AceGUIWidget-ColorPicker.lua | 188 ++ .../widgets/AceGUIWidget-DropDown-Items.lua | 471 ++++ .../widgets/AceGUIWidget-DropDown.lua | 737 ++++++ .../widgets/AceGUIWidget-EditBox.lua | 265 +++ .../widgets/AceGUIWidget-Heading.lua | 78 + libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua | 140 ++ .../widgets/AceGUIWidget-InteractiveLabel.lua | 101 + .../widgets/AceGUIWidget-Keybinding.lua | 249 +++ .../AceGUI-3.0/widgets/AceGUIWidget-Label.lua | 173 ++ .../widgets/AceGUIWidget-MultiLineEditBox.lua | 366 +++ .../widgets/AceGUIWidget-Slider.lua | 285 +++ panels/addonOptionsPanel.lua | 26 +- 43 files changed, 11823 insertions(+), 1 deletion(-) create mode 100644 libs/AceConfig-3.0/AceConfig-3.0.lua create mode 100644 libs/AceConfig-3.0/AceConfig-3.0.xml create mode 100644 libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua create mode 100644 libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml create mode 100644 libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua create mode 100644 libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml create mode 100644 libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua create mode 100644 libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml create mode 100644 libs/AceDBOptions-3.0/AceDBOptions-3.0.lua create mode 100644 libs/AceDBOptions-3.0/AceDBOptions-3.0.xml create mode 100644 libs/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua create mode 100644 libs/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua create mode 100644 libs/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua create mode 100644 libs/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua create mode 100644 libs/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua create mode 100644 libs/AceGUI-3.0-SharedMediaWidgets/prototypes.lua create mode 100644 libs/AceGUI-3.0-SharedMediaWidgets/widget.xml create mode 100644 libs/AceGUI-3.0/AceGUI-3.0.lua create mode 100644 libs/AceGUI-3.0/AceGUI-3.0.xml create mode 100644 libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua create mode 100644 libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua diff --git a/embeds.xml b/embeds.xml index c7eca6e..fb9680b 100644 --- a/embeds.xml +++ b/embeds.xml @@ -1,3 +1,7 @@ + + + + \ No newline at end of file diff --git a/libs/AceConfig-3.0/AceConfig-3.0.lua b/libs/AceConfig-3.0/AceConfig-3.0.lua new file mode 100644 index 0000000..a99ddf7 --- /dev/null +++ b/libs/AceConfig-3.0/AceConfig-3.0.lua @@ -0,0 +1,58 @@ +--- 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.lua 1161 2017-08-12 14:30:16Z funkydude $ + +--[[ +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, persist) +-- +-- - 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 diff --git a/libs/AceConfig-3.0/AceConfig-3.0.xml b/libs/AceConfig-3.0/AceConfig-3.0.xml new file mode 100644 index 0000000..a3569b7 --- /dev/null +++ b/libs/AceConfig-3.0/AceConfig-3.0.xml @@ -0,0 +1,8 @@ + + + + + +