Files
Matthew Steinhardt f19d079fb8 Feature Contribution: Minimap Button, Addon Options Menu, Hide NPC Head (#41)
* Added Libaries

- AceConfig is used to register interface options with the Blizzard Addons UI
- AceGUI is used to create the options window
- LibDataBroker registers the optionsTable
- LibDBIcon registers the optionsTable

* Added new libraries to embeds.xml

* Added function to remove all sounds from queue

- this is used for a minimap button feature

* Updated Utils

- Added a function to add color to text. This is used when creating the options menu.

* Added minimap Icon

- I made this icon using the icon for the addon (slightly modified to fit the small resolution)

* Modified db variables

- Changed ShowFrameBackground to a string value (easier when using Ace dropdown)

* Add Options Menu

- Added the framework for an options menu that hooks into the Interface options panel as well. 

- I elected to break things down into localized modules with a Module Loader utility class.

- Also added some useful debugging utility too

* Added new Options files to TOC

* Added minimap button

- Removed old settings code and redirected the settings button to open the new settings window

- Added all the settings from the old frame

- Added ability to hide the talking frame as well

- Minimap button has three actions: 
-- Left Click: Opens settings menu
-- Right Click: Stops & clears all queued audio
-- Middle Click: Pauses/Plays audio

* Added "Hide Minimap" option

* Module-less version

- Settings have been moved to an options panel
- Minimap button has a few neat functions
- Added ability to hide talking NPC head (useful for immersion addon)

* Changed path used to reach option variables
2023-04-07 17:05:53 -04: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.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