-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ef5841
commit 115fe16
Showing
45 changed files
with
12,748 additions
and
12,546 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ | ||
..\FrameXML\UI.xsd"> | ||
<Script file="AceAddon-3.0.lua"/> | ||
</Ui> | ||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ | ||
..\FrameXML\UI.xsd"> | ||
<Script file="AceAddon-3.0.lua"/> | ||
</Ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +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 1202 2019-05-15 23:11:22Z nevcairiel $ | ||
|
||
--[[ | ||
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 | ||
--- 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 1335 2024-05-05 19:35:16Z nevcairiel $ | ||
|
||
--[[ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ | ||
..\FrameXML\UI.xsd"> | ||
<Include file="AceConfigRegistry-3.0\AceConfigRegistry-3.0.xml"/> | ||
<Include file="AceConfigCmd-3.0\AceConfigCmd-3.0.xml"/> | ||
<Include file="AceConfigDialog-3.0\AceConfigDialog-3.0.xml"/> | ||
<!--<Include file="AceConfigDropdown-3.0\AceConfigDropdown-3.0.xml"/>--> | ||
<Script file="AceConfig-3.0.lua"/> | ||
</Ui> | ||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ | ||
..\FrameXML\UI.xsd"> | ||
<Include file="AceConfigRegistry-3.0\AceConfigRegistry-3.0.xml"/> | ||
<Include file="AceConfigCmd-3.0\AceConfigCmd-3.0.xml"/> | ||
<Include file="AceConfigDialog-3.0\AceConfigDialog-3.0.xml"/> | ||
<!--<Include file="AceConfigDropdown-3.0\AceConfigDropdown-3.0.xml"/>--> | ||
<Script file="AceConfig-3.0.lua"/> | ||
</Ui> |
Oops, something went wrong.