From 8c37d3512d48785723e675266391d4742cdab3fa Mon Sep 17 00:00:00 2001 From: Jennifer Date: Wed, 26 Jun 2019 22:16:48 +0100 Subject: [PATCH] updated for wowi --- CHANGELOG.txt | 38 +- Core/Message.lua | 8 +- EMA.toc | 4 +- GUI/AceGUIContainer-EMAWindow.lua | 2 +- Libs/AceAddon-3.0/AceAddon-3.0.lua | 118 +++--- Libs/AceBucket-3.0/AceBucket-3.0.lua | 58 +-- Libs/AceComm-3.0/AceComm-3.0.lua | 28 +- Libs/AceComm-3.0/ChatThrottleLib.lua | 10 +- Libs/AceConfig-3.0/AceConfig-3.0.lua | 4 +- .../AceConfigCmd-3.0/AceConfigCmd-3.0.lua | 134 +++---- .../AceConfigDialog-3.0/AceConfigDialog-3.0.lua | 184 ++++----- .../AceConfigRegistry-3.0.lua | 46 ++- Libs/AceConsole-3.0/AceConsole-3.0.lua | 40 +- Libs/AceDBOptions-3.0/AceDBOptions-3.0.lua | 34 +- Libs/AceEvent-3.0/AceEvent-3.0.lua | 12 +- .../AceGUI-3.0-SharedMediaWidgets.toc | 17 +- .../BackgroundWidget.lua | 2 +- .../AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua | 2 +- .../AceGUI-3.0-SharedMediaWidgets/FontWidget.lua | 2 +- .../AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua | 2 +- .../StatusbarWidget.lua | 2 +- .../AceGUI-3.0-SharedMediaWidgets/prototypes.lua | 10 +- .../AceGUI-3.0-SharedMediaWidgets/widget.xml | 2 +- Libs/AceGUI-3.0-SharedMediaWidgets/CHANGES.txt | 25 ++ Libs/AceGUI-3.0-SharedMediaWidgets/widget.xml | 2 +- Libs/AceGUI-3.0/AceGUI-3.0.lua | 160 ++++---- .../widgets/AceGUIContainer-DropDownGroup.lua | 2 +- .../widgets/AceGUIContainer-ScrollFrame.lua | 4 +- .../widgets/AceGUIContainer-TabGroup.lua | 32 +- .../widgets/AceGUIContainer-TreeGroup.lua | 45 +-- Libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua | 84 ++-- Libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua | 2 +- Libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua | 4 +- .../widgets/AceGUIWidget-ColorPicker.lua | 8 +- .../widgets/AceGUIWidget-DropDown-Items.lua | 136 +++---- Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua | 226 ++++++----- Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua | 2 +- Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua | 6 +- .../widgets/AceGUIWidget-MultiLineEditBox.lua | 14 +- Libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua | 2 +- Libs/AceHook-3.0/AceHook-3.0.lua | 82 ++-- Libs/AceSerializer-3.0/AceSerializer-3.0.lua | 38 +- Libs/AceTab-3.0/AceTab-3.0.lua | 12 +- Libs/AceTimer-3.0/AceTimer-3.0.lua | 4 +- Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua | 46 +-- Libs/Changelog-Ace3-Release-r1151.txt | 92 ----- Libs/Changelog-Ace3-r1151.txt | 92 +++++ Libs/Changelog-Ace3-r1214.txt | 417 ++++++++++++++++++++ Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua | 32 +- Libs/LibSharedMedia-3.0/lib.xml | 2 +- Libs/changelog-Ace3-r1202.txt | 408 +++++++++++++++++++ Locales/Core-Locale-enUS.lua | 4 +- Media/Sounds/Warning.ogg | Bin 0 -> 13606 bytes Media/Sounds/desktop.ini | 4 + Media/Sounds/raidwarning.ogg | Bin 0 -> 10884 bytes Modules/Interaction.lua | 4 + Modules/Toon.lua | 13 +- 57 files changed, 1840 insertions(+), 923 deletions(-) create mode 100644 Libs/AceGUI-3.0-SharedMediaWidgets/CHANGES.txt create mode 100644 Libs/AceGUI-3.0-SharedMediaWidgets/R61 updated.txt delete mode 100644 Libs/Changelog-Ace3-Release-r1151.txt create mode 100644 Libs/Changelog-Ace3-r1151.txt create mode 100644 Libs/Changelog-Ace3-r1214.txt create mode 100644 Libs/changelog-Ace3-r1202.txt create mode 100644 Media/Sounds/Warning.ogg create mode 100644 Media/Sounds/desktop.ini create mode 100644 Media/Sounds/raidwarning.ogg diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f047b27..37a88ff 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,15 +2,47 @@ ChangeLogs: --------------------------- -EMA Version: v8.1.5-Release-v2.0(0122) +EMA Version: v8.2.0-Release-v2.1(0127) +Game Version: 8.2.0 +Release Date: 26/6/2019 + +## Core + - Updated Ace3 + - Updated SharedMediaWidgets + - Updated LibSharedMedia-3.0 + + + +## Message + - Fixed 8.2 Sound changes + - Added new sound EMA Warning (from jamba-extras) + - Had to added blizzard own Riad warning Sound for libsheardmedia to work. (hacky) + + + + + + +--------------------------- + +EMA Version: v8.1.5-Release-v2.1(0126) Game Version: 8.1.5 -Release Date: 21/4/2019 +Release Date: 8/6/2019 +## Core + - Updated Ace3 + - Updated LibSharedMedia-3.0 ## Item-Use - - Will now Disaply Item count to 9999 before it * out + - Will now Disaply Item count to 9999 before it * out Issue #20 + +## Interaction + - Fixed a Bug not telling Team when you loot a Epic/Rare BoE items +## Toon + - Fixed Issue #70 + --------------------------- EMA Version: v8.1.5-Release-v2.0(0121) diff --git a/Core/Message.lua b/Core/Message.lua index a56ba3f..88a8853 100644 --- a/Core/Message.lua +++ b/Core/Message.lua @@ -28,8 +28,8 @@ local EMAHelperSettings = LibStub:GetLibrary( "EMAHelperSettings-1.0" ) local Media = LibStub("LibSharedMedia-3.0") -- Built in Sounds -Media:Register("sound", "EMA: RaidWarning", "Sound\\interface\\RaidWarning.ogg") - +Media:Register("sound", "EMA: RaidWarning", "Interface\\Addons\\EMA\\Media\\Sounds\\raidwarning.ogg" ) +Media:Register("sound", "EMA: Warning", "Interface\\Addons\\EMA\\Media\\Sounds\\Warning.ogg") -- Constants and Locale for this module. EMA.moduleName = "Message" @@ -886,6 +886,7 @@ end local function PlayMessageSound( soundToPlay ) + --EMA:Print("test", Media:Fetch( 'sound', soundToPlay ) ) PlaySoundFile( Media:Fetch( 'sound', soundToPlay ), "Ambience" ) end @@ -946,7 +947,8 @@ local function ProcessReceivedMessage( sender, areaName, message, suppressSender -- Do nothing! Mute means eat the message. end if areaType.usesSound == true and area.soundToPlay ~= "None" then - PlayMessageSound(area.soundToPlay) + --EMA:Print("test", area.soundToPlay ) + PlayMessageSound(area.soundToPlay ) end end diff --git a/EMA.toc b/EMA.toc index 754a91f..da37bbd 100644 --- a/EMA.toc +++ b/EMA.toc @@ -1,8 +1,8 @@ -## Interface: 80100 +## Interface: 80200 ## Title: EMA ## Notes: Ebony's MultiBoxing Assistant ## Author: Jennifer Calladine 'Ebony' -## Version: v8.1.5-Release-v2.0(0121) +## Version: v8.1.5-Release-v2.1(0127) ## SavedVariables: CoreProfileDB, CommunicationsProfileDB, TeamProfileDB, TagProfileDB, MessageProfileDB, CurrProfileDB, DisplayTeamProfileDB, FollowProfileDB, GuildProfileDB, InteractionProfileDB, ItemUseProfileDB, PurchaseProfileDB, QuestProfileDB, QuestWatcherProfileDB, SellProfileDB, TalkProfileDB, ToonProfileDB, TradeProfileDB, MailProfileDB, ISBoxerProfileDB #Libs diff --git a/GUI/AceGUIContainer-EMAWindow.lua b/GUI/AceGUIContainer-EMAWindow.lua index 635e7b4..4072ecf 100644 --- a/GUI/AceGUIContainer-EMAWindow.lua +++ b/GUI/AceGUIContainer-EMAWindow.lua @@ -50,7 +50,7 @@ Scripts -------------------------------------------------------------------------------]] local function Button_OnClick(frame) --7.3 PlaySound Update. - PlaySound(PlaySoundKitID and "gsTitleOptionExit" or 799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT + PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT frame.obj:Hide() end diff --git a/Libs/AceAddon-3.0/AceAddon-3.0.lua b/Libs/AceAddon-3.0/AceAddon-3.0.lua index e9d4154..2b2a00e 100644 --- a/Libs/AceAddon-3.0/AceAddon-3.0.lua +++ b/Libs/AceAddon-3.0/AceAddon-3.0.lua @@ -6,29 +6,29 @@ -- * **OnEnable** which gets called during the PLAYER_LOGIN event, when most of the data provided by the game is already present. -- * **OnDisable**, which is only called when your addon is manually being disabled. -- @usage --- -- A small (but complete) addon, that doesn't do anything, +-- -- A small (but complete) addon, that doesn't do anything, -- -- but shows usage of the callbacks. -- local MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") --- +-- -- function MyAddon:OnInitialize() --- -- do init tasks here, like loading the Saved Variables, +-- -- do init tasks here, like loading the Saved Variables, -- -- or setting up slash commands. -- end --- +-- -- function MyAddon:OnEnable() -- -- Do more initialization here, that really enables the use of your addon. --- -- Register Events, Hook functions, Create Frames, Get information from +-- -- Register Events, Hook functions, Create Frames, Get information from -- -- the game that wasn't available in OnInitialize -- end -- -- function MyAddon:OnDisable() -- -- Unhook, Unregister Events, Hide frames that you created. --- -- You would probably only use an OnDisable if you want to +-- -- You would probably only use an OnDisable if you want to -- -- build a "standby" mode, or be able to toggle modules on/off. -- end -- @class file -- @name AceAddon-3.0.lua --- @release $Id: AceAddon-3.0.lua 1184 2018-07-21 14:13:14Z nevcairiel $ +-- @release $Id: AceAddon-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ local MAJOR, MINOR = "AceAddon-3.0", 12 local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR) @@ -75,7 +75,7 @@ end local Enable, Disable, EnableModule, DisableModule, Embed, NewModule, GetModule, GetName, SetDefaultModuleState, SetDefaultModuleLibraries, SetEnabledState, SetDefaultModulePrototype -- used in the addon metatable -local function addontostring( self ) return self.name end +local function addontostring( self ) return self.name end -- Check if the addon is queued for initialization local function queuedForInitialization(addon) @@ -88,14 +88,14 @@ local function queuedForInitialization(addon) end --- Create a new AceAddon-3.0 addon. --- Any libraries you specified will be embeded, and the addon will be scheduled for +-- Any libraries you specified will be embeded, and the addon will be scheduled for -- its OnInitialize and OnEnable callbacks. -- The final addon object, with all libraries embeded, will be returned. -- @paramsig [object ,]name[, lib, ...] -- @param object Table to use as a base for the addon (optional) -- @param name Name of the addon object to create -- @param lib List of libraries to embed into the addon --- @usage +-- @usage -- -- Create a simple addon object -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceEvent-3.0") -- @@ -115,10 +115,10 @@ function AceAddon:NewAddon(objectorname, ...) if type(name)~="string" then error(("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - string expected got '%s'."):format(type(name)), 2) end - if self.addons[name] then + if self.addons[name] then error(("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - Addon '%s' already exists."):format(name), 2) end - + object = object or {} object.name = name @@ -128,7 +128,7 @@ function AceAddon:NewAddon(objectorname, ...) for k, v in pairs(oldmeta) do addonmeta[k] = v end end addonmeta.__tostring = addontostring - + setmetatable( object, addonmeta ) self.addons[name] = object object.modules = {} @@ -136,7 +136,7 @@ function AceAddon:NewAddon(objectorname, ...) object.defaultModuleLibraries = {} Embed( object ) -- embed NewModule, GetModule methods self:EmbedLibraries(object, select(i,...)) - + -- add to queue of addons to be initialized upon ADDON_LOADED tinsert(self.initializequeue, object) return object @@ -147,7 +147,7 @@ end -- Throws an error if the addon object cannot be found (except if silent is set). -- @param name unique name of the addon object -- @param silent if true, the addon is optional, silently return nil if its not found --- @usage +-- @usage -- -- Get the Addon -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") function AceAddon:GetAddon(name, silent) @@ -202,7 +202,7 @@ end -- @paramsig name[, silent] -- @param name unique name of the module -- @param silent if true, the module is optional, silently return nil if its not found (optional) --- @usage +-- @usage -- -- Get the Addon -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- -- Get the Module @@ -225,23 +225,23 @@ local function IsModuleTrue(self) return true end -- @param name unique name of the module -- @param prototype object to derive this module from, methods and values from this table will be mixed into the module (optional) -- @param lib List of libraries to embed into the addon --- @usage +-- @usage -- -- Create a module with some embeded libraries -- MyModule = MyAddon:NewModule("MyModule", "AceEvent-3.0", "AceHook-3.0") --- +-- -- -- Create a module with a prototype -- local prototype = { OnEnable = function(self) print("OnEnable called!") end } -- MyModule = MyAddon:NewModule("MyModule", prototype, "AceEvent-3.0", "AceHook-3.0") function NewModule(self, name, prototype, ...) if type(name) ~= "string" then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - string expected got '%s'."):format(type(name)), 2) end if type(prototype) ~= "string" and type(prototype) ~= "table" and type(prototype) ~= "nil" then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'prototype' - table (prototype), string (lib) or nil expected got '%s'."):format(type(prototype)), 2) end - + if self.modules[name] then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - Module '%s' already exists."):format(name), 2) end - + -- modules are basically addons. We treat them as such. They will be added to the initializequeue properly as well. -- NewModule can only be called after the parent addon is present thus the modules will be initialized after their parent is. local module = AceAddon:NewAddon(fmt("%s_%s", self.name or tostring(self), name)) - + module.IsModule = IsModuleTrue module:SetEnabledState(self.defaultModuleState) module.moduleName = name @@ -256,24 +256,24 @@ function NewModule(self, name, prototype, ...) if not prototype or type(prototype) == "string" then prototype = self.defaultModulePrototype or nil end - + if type(prototype) == "table" then local mt = getmetatable(module) mt.__index = prototype setmetatable(module, mt) -- More of a Base class type feel. end - + safecall(self.OnModuleCreated, self, module) -- Was in Ace2 and I think it could be a cool thing to have handy. self.modules[name] = module tinsert(self.orderedModules, module) - + return module end --- Returns the real name of the addon or module, without any prefix. -- @name //addon//:GetName --- @paramsig --- @usage +-- @paramsig +-- @usage -- print(MyAddon:GetName()) -- -- prints "MyAddon" function GetName(self) @@ -285,8 +285,8 @@ end -- and enabling all modules of the addon (unless explicitly disabled).\\ -- :Enable() also sets the internal `enableState` variable to true -- @name //addon//:Enable --- @paramsig --- @usage +-- @paramsig +-- @usage -- -- Enable MyModule -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyModule = MyAddon:GetModule("MyModule") @@ -306,8 +306,8 @@ end -- and disabling all modules of the addon.\\ -- :Disable() also sets the internal `enableState` variable to false -- @name //addon//:Disable --- @paramsig --- @usage +-- @paramsig +-- @usage -- -- Disable MyAddon -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyAddon:Disable() @@ -320,7 +320,7 @@ end -- Short-hand function that retrieves the module via `:GetModule` and calls `:Enable` on the module object. -- @name //addon//:EnableModule -- @paramsig name --- @usage +-- @usage -- -- Enable MyModule using :GetModule -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyModule = MyAddon:GetModule("MyModule") @@ -338,7 +338,7 @@ end -- Short-hand function that retrieves the module via `:GetModule` and calls `:Disable` on the module object. -- @name //addon//:DisableModule -- @paramsig name --- @usage +-- @usage -- -- Disable MyModule using :GetModule -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyModule = MyAddon:GetModule("MyModule") @@ -357,7 +357,7 @@ end -- @name //addon//:SetDefaultModuleLibraries -- @paramsig lib[, lib, ...] -- @param lib List of libraries to embed into the addon --- @usage +-- @usage -- -- Create the addon object -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") -- -- Configure default libraries for modules (all modules need AceEvent-3.0) @@ -376,7 +376,7 @@ end -- @name //addon//:SetDefaultModuleState -- @paramsig state -- @param state Default state for new modules, true for enabled, false for disabled --- @usage +-- @usage -- -- Create the addon object -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") -- -- Set the default state to "disabled" @@ -396,7 +396,7 @@ end -- @name //addon//:SetDefaultModulePrototype -- @paramsig prototype -- @param prototype Default prototype for the new modules (table) --- @usage +-- @usage -- -- Define a prototype -- local prototype = { OnEnable = function(self) print("OnEnable called!") end } -- -- Set the default prototype @@ -428,8 +428,8 @@ end --- Return an iterator of all modules associated to the addon. -- @name //addon//:IterateModules --- @paramsig --- @usage +-- @paramsig +-- @usage -- -- Enable all modules -- for name, module in MyAddon:IterateModules() do -- module:Enable() @@ -438,13 +438,13 @@ local function IterateModules(self) return pairs(self.modules) end -- Returns an iterator of all embeds in the addon -- @name //addon//:IterateEmbeds --- @paramsig +-- @paramsig local function IterateEmbeds(self) return pairs(AceAddon.embeds[self]) end --- Query the enabledState of an addon. -- @name //addon//:IsEnabled --- @paramsig --- @usage +-- @paramsig +-- @usage -- if MyAddon:IsEnabled() then -- MyAddon:Disable() -- end @@ -489,20 +489,20 @@ end -- - Initialize the addon after creation. -- This function is only used internally during the ADDON_LOADED event --- It will call the **OnInitialize** function on the addon object (if present), +-- It will call the **OnInitialize** function on the addon object (if present), -- and the **OnEmbedInitialize** function on all embeded libraries. --- +-- -- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. -- @param addon addon object to intialize function AceAddon:InitializeAddon(addon) safecall(addon.OnInitialize, addon) - + local embeds = self.embeds[addon] for i = 1, #embeds do local lib = LibStub:GetLibrary(embeds[i], true) if lib then safecall(lib.OnEmbedInitialize, lib, addon) end end - + -- we don't call InitializeAddon on modules specifically, this is handled -- from the event handler and only done _once_ end @@ -510,7 +510,7 @@ end -- - Enable the addon after creation. -- Note: This function is only used internally during the PLAYER_LOGIN event, or during ADDON_LOADED, -- if IsLoggedIn() already returns true at that point, e.g. for LoD Addons. --- It will call the **OnEnable** function on the addon object (if present), +-- It will call the **OnEnable** function on the addon object (if present), -- and the **OnEmbedEnable** function on all embeded libraries.\\ -- This function does not toggle the enable state of the addon itself, and will return early if the addon is disabled. -- @@ -520,12 +520,12 @@ end function AceAddon:EnableAddon(addon) if type(addon) == "string" then addon = AceAddon:GetAddon(addon) end if self.statuses[addon.name] or not addon.enabledState then return false end - + -- set the statuses first, before calling the OnEnable. this allows for Disabling of the addon in OnEnable. self.statuses[addon.name] = true - + safecall(addon.OnEnable, addon) - + -- make sure we're still enabled before continueing if self.statuses[addon.name] then local embeds = self.embeds[addon] @@ -533,7 +533,7 @@ function AceAddon:EnableAddon(addon) local lib = LibStub:GetLibrary(embeds[i], true) if lib then safecall(lib.OnEmbedEnable, lib, addon) end end - + -- enable possible modules. local modules = addon.orderedModules for i = 1, #modules do @@ -545,24 +545,24 @@ end -- - Disable the addon -- Note: This function is only used internally. --- It will call the **OnDisable** function on the addon object (if present), +-- It will call the **OnDisable** function on the addon object (if present), -- and the **OnEmbedDisable** function on all embeded libraries.\\ -- This function does not toggle the enable state of the addon itself, and will return early if the addon is still enabled. -- --- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. +-- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. -- Use :Disable on the addon itself instead. -- @param addon addon object to enable function AceAddon:DisableAddon(addon) if type(addon) == "string" then addon = AceAddon:GetAddon(addon) end if not self.statuses[addon.name] then return false end - + -- set statuses first before calling OnDisable, this allows for aborting the disable in OnDisable. self.statuses[addon.name] = false - + safecall( addon.OnDisable, addon ) - + -- make sure we're still disabling... - if not self.statuses[addon.name] then + if not self.statuses[addon.name] then local embeds = self.embeds[addon] for i = 1, #embeds do local lib = LibStub:GetLibrary(embeds[i], true) @@ -574,12 +574,12 @@ function AceAddon:DisableAddon(addon) self:DisableAddon(modules[i]) end end - + return not self.statuses[addon.name] -- return true if we're disabled end --- Get an iterator over all registered addons. --- @usage +-- @usage -- -- Print a list of all installed AceAddon's -- for name, addon in AceAddon:IterateAddons() do -- print("Addon: " .. name) @@ -587,7 +587,7 @@ end function AceAddon:IterateAddons() return pairs(self.addons) end --- Get an iterator over the internal status registry. --- @usage +-- @usage -- -- Print a list of all enabled addons -- for name, status in AceAddon:IterateAddonStatus() do -- if status then @@ -613,7 +613,7 @@ local function onEvent(this, event, arg1) AceAddon:InitializeAddon(addon) tinsert(AceAddon.enablequeue, addon) end - + if IsLoggedIn() then while(#AceAddon.enablequeue > 0) do local addon = tremove(AceAddon.enablequeue, 1) diff --git a/Libs/AceBucket-3.0/AceBucket-3.0.lua b/Libs/AceBucket-3.0/AceBucket-3.0.lua index 5d42530..514c05e 100644 --- a/Libs/AceBucket-3.0/AceBucket-3.0.lua +++ b/Libs/AceBucket-3.0/AceBucket-3.0.lua @@ -1,28 +1,28 @@ --- A bucket to catch events in. **AceBucket-3.0** provides throttling of events that fire in bursts and -- your addon only needs to know about the full burst. --- +-- -- This Bucket implementation works as follows:\\ -- Initially, no schedule is running, and its waiting for the first event to happen.\\ -- The first event will start the bucket, and get the scheduler running, which will collect all --- events in the given interval. When that interval is reached, the bucket is pushed to the --- callback and a new schedule is started. When a bucket is empty after its interval, the scheduler is +-- events in the given interval. When that interval is reached, the bucket is pushed to the +-- callback and a new schedule is started. When a bucket is empty after its interval, the scheduler is -- stopped, and the bucket is only listening for the next event to happen, basically back in its initial state. --- --- In addition, the buckets collect information about the "arg1" argument of the events that fire, and pass those as a +-- +-- In addition, the buckets collect information about the "arg1" argument of the events that fire, and pass those as a -- table to your callback. This functionality was mostly designed for the UNIT_* events.\\ -- The table will have the different values of "arg1" as keys, and the number of occurances as their value, e.g.\\ -- { ["player"] = 2, ["target"] = 1, ["party1"] = 1 } -- --- **AceBucket-3.0** can be embeded into your addon, either explicitly by calling AceBucket:Embed(MyAddon) or by +-- **AceBucket-3.0** can be embeded into your addon, either explicitly by calling AceBucket:Embed(MyAddon) or by -- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object -- and can be accessed directly, without having to explicitly call AceBucket itself.\\ -- It is recommended to embed AceBucket, otherwise you'll have to specify a custom `self` on all calls you -- make into AceBucket. -- @usage -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("BucketExample", "AceBucket-3.0") --- +-- -- function MyAddon:OnEnable() --- -- Register a bucket that listens to all the HP related events, +-- -- Register a bucket that listens to all the HP related events, -- -- and fires once per second -- self:RegisterBucketEvent({"UNIT_HEALTH", "UNIT_MAXHEALTH"}, 1, "UpdateHealth") -- end @@ -34,7 +34,7 @@ -- end -- @class file -- @name AceBucket-3.0.lua --- @release $Id: AceBucket-3.0.lua 1185 2018-07-21 14:15:16Z nevcairiel $ +-- @release $Id: AceBucket-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ local MAJOR, MINOR = "AceBucket-3.0", 4 local AceBucket, oldminor = LibStub:NewLibrary(MAJOR, MINOR) @@ -79,7 +79,7 @@ end -- send the bucket to the callback function and schedule the next FireBucket in interval seconds local function FireBucket(bucket) local received = bucket.received - + -- we dont want to fire empty buckets if next(received) ~= nil then local callback = bucket.callback @@ -88,11 +88,11 @@ local function FireBucket(bucket) else safecall(callback, received) end - + for k in pairs(received) do received[k] = nil end - + -- if the bucket was not empty, schedule another FireBucket in interval seconds bucket.timer = AceTimer.ScheduleTimer(bucket, FireBucket, bucket.interval, bucket) else -- if it was empty, clear the timer and wait for the next event @@ -101,16 +101,16 @@ local function FireBucket(bucket) end -- BucketHandler ( event, arg1 ) --- +-- -- callback func for AceEvent -- stores arg1 in the received table, and schedules the bucket if necessary local function BucketHandler(self, event, arg1) if arg1 == nil then arg1 = "nil" end - + self.received[arg1] = (self.received[arg1] or 0) + 1 - + -- if we are not scheduled yet, start a timer on the interval for our bucket to be cleared if not self.timer then self.timer = AceTimer.ScheduleTimer(self, FireBucket, self.interval, self) @@ -125,14 +125,14 @@ end -- isMessage(boolean) - register AceEvent Messages instead of game events local function RegisterBucket(self, event, interval, callback, isMessage) -- try to fetch the librarys - if not AceEvent or not AceTimer then + if not AceEvent or not AceTimer then AceEvent = LibStub:GetLibrary("AceEvent-3.0", true) AceTimer = LibStub:GetLibrary("AceTimer-3.0", true) if not AceEvent or not AceTimer then error(MAJOR .. " requires AceEvent-3.0 and AceTimer-3.0", 3) end end - + if type(event) ~= "string" and type(event) ~= "table" then error("Usage: RegisterBucket(event, interval, callback): 'event' - string or table expected.", 3) end if not callback then if type(event) == "string" then @@ -144,7 +144,7 @@ local function RegisterBucket(self, event, interval, callback, isMessage) if not tonumber(interval) then error("Usage: RegisterBucket(event, interval, callback): 'interval' - number expected.", 3) end if type(callback) ~= "string" and type(callback) ~= "function" then error("Usage: RegisterBucket(event, interval, callback): 'callback' - string or function or nil expected.", 3) end if type(callback) == "string" and type(self[callback]) ~= "function" then error("Usage: RegisterBucket(event, interval, callback): 'callback' - method not found on target object.", 3) end - + local bucket = next(bucketCache) if bucket then bucketCache[bucket] = nil @@ -152,9 +152,9 @@ local function RegisterBucket(self, event, interval, callback, isMessage) bucket = { handler = BucketHandler, received = {} } end bucket.object, bucket.callback, bucket.interval = self, callback, tonumber(interval) - + local regFunc = isMessage and AceEvent.RegisterMessage or AceEvent.RegisterEvent - + if type(event) == "table" then for _,e in pairs(event) do regFunc(bucket, e, "handler") @@ -162,10 +162,10 @@ local function RegisterBucket(self, event, interval, callback, isMessage) else regFunc(bucket, event, "handler") end - + local handle = tostring(bucket) AceBucket.buckets[handle] = bucket - + return handle end @@ -177,7 +177,7 @@ end -- @usage -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceBucket-3.0") -- MyAddon:RegisterBucketEvent("BAG_UPDATE", 0.2, "UpdateBags") --- +-- -- function MyAddon:UpdateBags() -- -- do stuff -- end @@ -193,7 +193,7 @@ end -- @usage -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceBucket-3.0") -- MyAddon:RegisterBucketEvent("SomeAddon_InformationMessage", 0.2, "ProcessData") --- +-- -- function MyAddon:ProcessData() -- -- do stuff -- end @@ -208,17 +208,17 @@ function AceBucket:UnregisterBucket(handle) if bucket then AceEvent.UnregisterAllEvents(bucket) AceEvent.UnregisterAllMessages(bucket) - + -- clear any remaining data in the bucket for k in pairs(bucket.received) do bucket.received[k] = nil end - + if bucket.timer then AceTimer.CancelTimer(bucket, bucket.timer) bucket.timer = nil end - + AceBucket.buckets[handle] = nil -- store our bucket in the cache bucketCache[bucket] = true @@ -240,10 +240,10 @@ end -- embedding and embed handling local mixins = { "RegisterBucketEvent", - "RegisterBucketMessage", + "RegisterBucketMessage", "UnregisterBucket", "UnregisterAllBuckets", -} +} -- Embeds AceBucket into the target object making the functions from the mixins list available on target:.. -- @param target target object to embed AceBucket in diff --git a/Libs/AceComm-3.0/AceComm-3.0.lua b/Libs/AceComm-3.0/AceComm-3.0.lua index 9a38979..242d92c 100644 --- a/Libs/AceComm-3.0/AceComm-3.0.lua +++ b/Libs/AceComm-3.0/AceComm-3.0.lua @@ -2,14 +2,14 @@ -- It'll automatically split the messages into multiple parts and rebuild them on the receiving end.\\ -- **ChatThrottleLib** is of course being used to avoid being disconnected by the server. -- --- **AceComm-3.0** can be embeded into your addon, either explicitly by calling AceComm:Embed(MyAddon) or by +-- **AceComm-3.0** can be embeded into your addon, either explicitly by calling AceComm:Embed(MyAddon) or by -- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object -- and can be accessed directly, without having to explicitly call AceComm itself.\\ -- It is recommended to embed AceComm, otherwise you'll have to specify a custom `self` on all calls you -- make into AceComm. -- @class file -- @name AceComm-3.0 --- @release $Id: AceComm-3.0.lua 1174 2018-05-14 17:29:49Z h.leppkes@gmail.com $ +-- @release $Id: AceComm-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ --[[ AceComm-3.0 @@ -52,7 +52,7 @@ AceComm.multipart_origprefixes = nil AceComm.multipart_reassemblers = nil -- the multipart message spool: indexed by a combination of sender+distribution+ -AceComm.multipart_spool = AceComm.multipart_spool or {} +AceComm.multipart_spool = AceComm.multipart_spool or {} --- Register for Addon Traffic on a specified prefix -- @param prefix A printable character (\032-\255) classification of the message (typically AddonName or AddonNameEvent), max 16 characters @@ -90,7 +90,7 @@ function AceComm:SendCommMessage(prefix, text, distribution, target, prio, callb type(text)=="string" and type(distribution)=="string" and (target==nil or type(target)=="string" or type(target)=="number") and - (prio=="BULK" or prio=="NORMAL" or prio=="ALERT") + (prio=="BULK" or prio=="NORMAL" or prio=="ALERT") ) then error('Usage: SendCommMessage(addon, "prefix", "text", "distribution"[, "target"[, "prio"[, callbackFn, callbackarg]]])', 2) end @@ -105,7 +105,7 @@ function AceComm:SendCommMessage(prefix, text, distribution, target, prio, callb return callbackFn(callbackArg, sent, textlen) end end - + local forceMultipart if match(text, "^[\001-\009]") then -- 4.1+: see if the first character is a control character -- we need to escape the first character with a \004 @@ -150,17 +150,17 @@ do local compost = setmetatable({}, {__mode = "k"}) local function new() local t = next(compost) - if t then + if t then compost[t]=nil for i=#t,3,-1 do -- faster than pairs loop. don't even nil out 1/2 since they'll be overwritten t[i]=nil end return t end - + return {} end - + local function lostdatawarning(prefix,sender,where) DEFAULT_CHAT_FRAME:AddMessage(MAJOR..": Warning: lost network data regarding '"..tostring(prefix).."' from '"..tostring(sender).."' (in "..where..")") end @@ -168,14 +168,14 @@ do function AceComm:OnReceiveMultipartFirst(prefix, message, distribution, sender) local key = prefix.."\t"..distribution.."\t"..sender -- a unique stream is defined by the prefix + distribution + sender local spool = AceComm.multipart_spool - + --[[ - if spool[key] then + if spool[key] then lostdatawarning(prefix,sender,"First") -- continue and overwrite end --]] - + spool[key] = message -- plain string for now end @@ -183,7 +183,7 @@ do local key = prefix.."\t"..distribution.."\t"..sender -- a unique stream is defined by the prefix + distribution + sender local spool = AceComm.multipart_spool local olddata = spool[key] - + if not olddata then --lostdatawarning(prefix,sender,"Next") return @@ -204,14 +204,14 @@ do local key = prefix.."\t"..distribution.."\t"..sender -- a unique stream is defined by the prefix + distribution + sender local spool = AceComm.multipart_spool local olddata = spool[key] - + if not olddata then --lostdatawarning(prefix,sender,"End") return end spool[key] = nil - + if type(olddata) == "table" then -- if we've received a "next", the spooled data will be a table for rapid & garbage-free tconcat tinsert(olddata, message) diff --git a/Libs/AceComm-3.0/ChatThrottleLib.lua b/Libs/AceComm-3.0/ChatThrottleLib.lua index 01088f6..ad21af4 100644 --- a/Libs/AceComm-3.0/ChatThrottleLib.lua +++ b/Libs/AceComm-3.0/ChatThrottleLib.lua @@ -3,7 +3,7 @@ -- -- Manages AddOn chat output to keep player from getting kicked off. -- --- ChatThrottleLib:SendChatMessage/:SendAddonMessage functions that accept +-- ChatThrottleLib:SendChatMessage/:SendAddonMessage functions that accept -- a Priority ("BULK", "NORMAL", "ALERT") as well as prefix for SendChatMessage. -- -- Priorities get an equal share of available bandwidth when fully loaded. @@ -118,7 +118,7 @@ end ----------------------------------------------------------------------- --- Recycling bin for pipes +-- Recycling bin for pipes -- A pipe is a plain integer-indexed queue of messages -- Pipes normally live in Rings of pipes (3 rings total, one per priority) @@ -169,7 +169,7 @@ end -- Initialize queues, set up frame for OnUpdate, etc -function ChatThrottleLib:Init() +function ChatThrottleLib:Init() -- Set up queues if not self.Prio then @@ -356,8 +356,8 @@ function ChatThrottleLib.OnUpdate(this,delay) -- See how many of our priorities have queued messages (we only have 3, don't worry about the loop) local n = 0 for prioname,Prio in pairs(self.Prio) do - if Prio.Ring.pos or Prio.avail < 0 then - n = n + 1 + if Prio.Ring.pos or Prio.avail < 0 then + n = n + 1 end end diff --git a/Libs/AceConfig-3.0/AceConfig-3.0.lua b/Libs/AceConfig-3.0/AceConfig-3.0.lua index a99ddf7..5071cdc 100644 --- a/Libs/AceConfig-3.0/AceConfig-3.0.lua +++ b/Libs/AceConfig-3.0/AceConfig-3.0.lua @@ -3,7 +3,7 @@ -- 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 $ +-- @release $Id: AceConfig-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ --[[ AceConfig-3.0 @@ -45,7 +45,7 @@ local pcall, error, type, pairs = pcall, error, type, pairs 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 diff --git a/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua b/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua index 33f9fe1..5113875 100644 --- a/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua +++ b/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua @@ -1,7 +1,7 @@ --- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames. -- @class file -- @name AceConfigCmd-3.0 --- @release $Id: AceConfigCmd-3.0.lua 1161 2017-08-12 14:30:16Z funkydude $ +-- @release $Id: AceConfigCmd-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ --[[ AceConfigCmd-3.0 @@ -63,7 +63,7 @@ local funcmsg = "expected function or member name" -- pickfirstset() - picks the first non-nil value and returns it -local function pickfirstset(...) +local function pickfirstset(...) for i=1,select("#",...) do if select(i,...)~=nil then return select(i,...) @@ -120,7 +120,7 @@ local function callfunction(info, tab, methodtype, ...) info.arg = tab.arg info.option = tab info.type = tab.type - + if type(method)=="function" then return method(info, ...) else @@ -131,7 +131,7 @@ end -- do_final() - do the final step (set/execute) along with validation and confirmation local function do_final(info, inputpos, tab, methodtype, ...) - if info.validate then + if info.validate then local res = callmethod(info,inputpos,tab,"validate",...) if type(res)=="string" then usererr(info, inputpos, "'"..strsub(info.input, inputpos).."' - "..res) @@ -139,7 +139,7 @@ local function do_final(info, inputpos, tab, methodtype, ...) end end -- console ignores .confirm - + callmethod(info,inputpos,tab,methodtype, ...) end @@ -152,8 +152,8 @@ local function getparam(info, inputpos, tab, depth, paramname, types, errormsg) if val~=nil then if val==false then val=nil - elseif not types[type(val)] then - err(info, inputpos, "'" .. paramname.. "' - "..errormsg) + elseif not types[type(val)] then + err(info, inputpos, "'" .. paramname.. "' - "..errormsg) end info[paramname] = val info[paramname.."_at"] = depth @@ -166,13 +166,13 @@ end local dummytable={} local function iterateargs(tab) - if not tab.plugins then - return pairs(tab.args) + if not tab.plugins then + return pairs(tab.args) end - + local argtabkey,argtab=next(tab.plugins) local v - + return function(_, k) while argtab do k,v = next(argtab, k) @@ -206,18 +206,18 @@ local function showhelp(info, inputpos, tab, depth, noHead) if not noHead then print("|cff33ff99"..info.appName.."|r: Arguments to |cffffff78/"..info[0].."|r "..strsub(info.input,1,inputpos-1)..":") end - + local sortTbl = {} -- [1..n]=name local refTbl = {} -- [name]=tableref - + for k,v in iterateargs(tab) do if not refTbl[k] then -- a plugin overriding something in .args tinsert(sortTbl, k) refTbl[k] = v end end - - tsort(sortTbl, function(one, two) + + tsort(sortTbl, function(one, two) local o1 = refTbl[one].order or 100 local o2 = refTbl[two].order or 100 if type(o1) == "function" or type(o1) == "string" then @@ -240,7 +240,7 @@ local function showhelp(info, inputpos, tab, depth, noHead) if o1==o2 then return tostring(one)optiontable +-- handle() - selfrecursing function that processes input->optiontable -- - depth - starts at 0 -- - retfalse - return false rather than produce error if a match is not found (used by inlined groups) @@ -346,16 +346,16 @@ local function handle(info, inputpos, tab, depth, retfalse) local oldfunc,oldfunc_at = getparam(info,inputpos,tab,depth,"func",functypes,funcmsg) local oldvalidate,oldvalidate_at = getparam(info,inputpos,tab,depth,"validate",functypes,funcmsg) --local oldconfirm,oldconfirm_at = getparam(info,inputpos,tab,depth,"confirm",functypes,funcmsg) - + ------------------------------------------------------------------- -- Act according to .type of this table - + if tab.type=="group" then ------------ group -------------------------------------------- - + if type(tab.args)~="table" then err(info, inputpos) end if tab.plugins and type(tab.plugins)~="table" then err(info,inputpos) end - + -- grab next arg from input local _,nextpos,arg = (info.input):find(" *([^ ]+) *", inputpos) if not arg then @@ -363,11 +363,11 @@ local function handle(info, inputpos, tab, depth, retfalse) return end nextpos=nextpos+1 - + -- loop .args and try to find a key with a matching name for k,v in iterateargs(tab) do if not(type(k)=="string" and type(v)=="table" and type(v.type)=="string") then err(info,inputpos, "options table child '"..tostring(k).."' is malformed") end - + -- is this child an inline group? if so, traverse into it if v.type=="group" and pickfirstset(v.cmdInline, v.inline, false) then info[depth+1] = k @@ -383,8 +383,8 @@ local function handle(info, inputpos, tab, depth, retfalse) return handle(info,nextpos,v,depth+1) end end - - -- no match + + -- no match if retfalse then -- restore old infotable members and return false to indicate failure info.handler,info.handler_at = oldhandler,oldhandler_at @@ -395,23 +395,23 @@ local function handle(info, inputpos, tab, depth, retfalse) --info.confirm,info.confirm_at = oldconfirm,oldconfirm_at return false end - + -- couldn't find the command, display error usererr(info, inputpos, "'"..arg.."' - " .. L["unknown argument"]) return end - + local str = strsub(info.input,inputpos); - + if tab.type=="execute" then ------------ execute -------------------------------------------- do_final(info, inputpos, tab, "func") - - + + elseif tab.type=="input" then ------------ input -------------------------------------------- - + local res = true if tab.pattern then if not(type(tab.pattern)=="string") then err(info, inputpos, "'pattern' - expected a string") end @@ -420,11 +420,11 @@ local function handle(info, inputpos, tab, depth, retfalse) return end end - + do_final(info, inputpos, tab, "set", str) - - + + elseif tab.type=="toggle" then ------------ toggle -------------------------------------------- local b @@ -444,7 +444,7 @@ local function handle(info, inputpos, tab, depth, retfalse) else b = not b end - + elseif str==L["on"] then b = true elseif str==L["off"] then @@ -459,9 +459,9 @@ local function handle(info, inputpos, tab, depth, retfalse) end return end - + do_final(info, inputpos, tab, "set", b) - + elseif tab.type=="range" then ------------ range -------------------------------------------- @@ -481,21 +481,21 @@ local function handle(info, inputpos, tab, depth, retfalse) usererr(info, inputpos, val.." - "..format(L["must be equal to or lower than %s"], tostring(info.max)) ) return end - + do_final(info, inputpos, tab, "set", val) - + elseif tab.type=="select" then ------------ select ------------------------------------ local str = strtrim(strlower(str)) - + local values = tab.values if type(values) == "function" or type(values) == "string" then info.values = values values = callmethod(info, inputpos, tab, "values") info.values = nil end - + if str == "" then local b = callmethod(info, inputpos, tab, "get") local fmt = "|cffffff78- [%s]|r %s" @@ -512,7 +512,7 @@ local function handle(info, inputpos, tab, depth, retfalse) end local ok - for k,v in pairs(values) do + for k,v in pairs(values) do if strlower(k)==str then str = k -- overwrite with key (in case of case mismatches) ok = true @@ -523,20 +523,20 @@ local function handle(info, inputpos, tab, depth, retfalse) usererr(info, inputpos, "'"..str.."' - "..L["unknown selection"]) return end - + do_final(info, inputpos, tab, "set", str) - + elseif tab.type=="multiselect" then ------------ multiselect ------------------------------------------- local str = strtrim(strlower(str)) - + local values = tab.values if type(values) == "function" or type(values) == "string" then info.values = values values = callmethod(info, inputpos, tab, "values") info.values = nil end - + if str == "" then local fmt = "|cffffff78- [%s]|r %s" local fmt_sel = "|cffffff78- [%s]|r %s |cffff0000*|r" @@ -550,7 +550,7 @@ local function handle(info, inputpos, tab, depth, retfalse) end return end - + --build a table of the selections, checking that they exist --parse for =on =off =default in the process --table will be key = true for options that should toggle, key = [on|off|default] for options to be set @@ -559,25 +559,25 @@ local function handle(info, inputpos, tab, depth, retfalse) --parse option=on etc local opt, val = v:match('(.+)=(.+)') --get option if toggling - if not opt then - opt = v + if not opt then + opt = v end - + --check that the opt is valid local ok - for k,v in pairs(values) do + for k,v in pairs(values) do if strlower(k)==opt then opt = k -- overwrite with key (in case of case mismatches) ok = true break end end - + if not ok then usererr(info, inputpos, "'"..opt.."' - "..L["unknown selection"]) return end - + --check that if val was supplied it is valid if val then if val == L["on"] or val == L["off"] or (tab.tristate and val == L["default"]) then @@ -596,14 +596,14 @@ local function handle(info, inputpos, tab, depth, retfalse) sels[opt] = true end end - + for opt, val in pairs(sels) do local newval - + if (val == true) then --toggle the option local b = callmethod(info, inputpos, tab, "get", opt) - + if tab.tristate then --cycle in true, nil, false order if b then @@ -627,11 +627,11 @@ local function handle(info, inputpos, tab, depth, retfalse) newval = nil end end - + do_final(info, inputpos, tab, "set", opt, newval) end - - + + elseif tab.type=="color" then ------------ color -------------------------------------------- local str = strtrim(strlower(str)) @@ -639,16 +639,16 @@ local function handle(info, inputpos, tab, depth, retfalse) --TODO: Show current value return end - + local r, g, b, a - + local hasAlpha = tab.hasAlpha if type(hasAlpha) == "function" or type(hasAlpha) == "string" then info.hasAlpha = hasAlpha hasAlpha = callmethod(info, inputpos, tab, 'hasAlpha') info.hasAlpha = nil end - + if hasAlpha then if str:len() == 8 and str:find("^%x*$") then --parse a hex string @@ -662,7 +662,7 @@ local function handle(info, inputpos, tab, depth, retfalse) usererr(info, inputpos, format(L["'%s' - expected 'RRGGBBAA' or 'r g b a'."], str)) return end - + if r >= 0.0 and r <= 1.0 and g >= 0.0 and g <= 1.0 and b >= 0.0 and b <= 1.0 and a >= 0.0 and a <= 1.0 then --values are valid elseif r >= 0 and r <= 255 and g >= 0 and g <= 255 and b >= 0 and b <= 255 and a >= 0 and a <= 255 then @@ -701,7 +701,7 @@ local function handle(info, inputpos, tab, depth, retfalse) usererr(info, inputpos, format(L["'%s' - values must all be either in the range 0-1 or 0-255."], str)) end end - + do_final(info, inputpos, tab, "set", r,g,b,a) elseif tab.type=="keybinding" then @@ -737,7 +737,7 @@ end -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceConsole-3.0") -- -- Use AceConsole-3.0 to register a Chat Command -- MyAddon:RegisterChatCommand("mychat", "ChatCommand") --- +-- -- -- Show the GUI if no input is supplied, otherwise handle the chat input. -- function MyAddon:ChatCommand(input) -- -- Assuming "MyOptions" is the appName of a valid options table @@ -754,7 +754,7 @@ function AceConfigCmd:HandleCommand(slashcmd, appName, input) error([[Usage: HandleCommand("slashcmd", "appName", "input"): 'appName' - no options table "]]..tostring(appName)..[[" has been registered]], 2) end local options = assert( optgetter("cmd", MAJOR) ) - + local info = { -- Don't try to recycle this, it gets handed off to callbacks and whatnot [0] = slashcmd, appName = appName, @@ -765,7 +765,7 @@ function AceConfigCmd:HandleCommand(slashcmd, appName, input) uiType = "cmd", uiName = MAJOR, } - + handle(info, 1, options, 0) -- (info, inputpos, table, depth) end diff --git a/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua index d5cbc45..bcfe071 100644 --- a/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua +++ b/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua @@ -1,13 +1,13 @@ --- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. -- @class file -- @name AceConfigDialog-3.0 --- @release $Id: AceConfigDialog-3.0.lua 1197 2019-01-21 23:41:10Z nevcairiel $ +-- @release $Id: AceConfigDialog-3.0.lua 1212 2019-06-26 05:53:51Z nevcairiel $ local LibStub = LibStub local gui = LibStub("AceGUI-3.0") local reg = LibStub("AceConfigRegistry-3.0") -local MAJOR, MINOR = "AceConfigDialog-3.0", 69 +local MAJOR, MINOR = "AceConfigDialog-3.0", 73 local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not AceConfigDialog then return end @@ -56,18 +56,18 @@ local width_multiplier = 170 --[[ Group Types Tree - All Descendant Groups will all become nodes on the tree, direct child options will appear above the tree - - Descendant Groups with inline=true and thier children will not become nodes + - Descendant Groups with inline=true and thier children will not become nodes Tab - Direct Child Groups will become tabs, direct child options will appear above the tab control - - Grandchild groups will default to inline unless specified otherwise + - Grandchild groups will default to inline unless specified otherwise Select- Same as Tab but with entries in a dropdown rather than tabs Inline Groups - - Will not become nodes of a select group, they will be effectivly part of thier parent group seperated by a border - - If declared on a direct child of a root node of a select group, they will appear above the group container control - - When a group is displayed inline, all descendants will also be inline members of the group + - Will not become nodes of a select group, they will be effectivly part of thier parent group seperated by a border + - If declared on a direct child of a root node of a select group, they will appear above the group container control + - When a group is displayed inline, all descendants will also be inline members of the group ]] @@ -168,11 +168,11 @@ local allIsLiteral = { local function GetOptionsMemberValue(membername, option, options, path, appName, ...) --get definition for the member local inherits = isInherited[membername] - + --get the member of the option, traversing the tree if it can be inherited local member - + if inherits then local group = options if group[membername] ~= nil then @@ -187,7 +187,7 @@ local function GetOptionsMemberValue(membername, option, options, path, appName, else member = option[membername] end - + --check if we need to call a functon, or if we have a literal value if ( not allIsLiteral[membername] ) and ( type(member) == "function" or ((not stringIsLiteral[membername]) and type(member) == "string") ) then --We have a function to call @@ -196,13 +196,13 @@ local function GetOptionsMemberValue(membername, option, options, path, appName, local handler local group = options handler = group.handler or handler - + for i = 1, #path do group = GetSubOption(group, path[i]) info[i] = path[i] handler = group.handler or handler end - + info.options = options info.appName = appName info[0] = appName @@ -212,8 +212,8 @@ local function GetOptionsMemberValue(membername, option, options, path, appName, info.type = option.type info.uiType = "dialog" info.uiName = MAJOR - - local a, b, c ,d + + local a, b, c ,d --using 4 returns for the get of a color type, increase if a type needs more if type(member) == "function" then --Call the function @@ -230,8 +230,8 @@ local function GetOptionsMemberValue(membername, option, options, path, appName, return a,b,c,d else --The value isnt a function to call, return it - return member - end + return member + end end --[[calls an options function that could be inherited, method name or function ref @@ -296,7 +296,7 @@ local function compareOptions(a,b) return NameA:upper() < NameB:upper() end if OrderA < 0 then - if OrderB > 0 then + if OrderB >= 0 then return false end else @@ -315,7 +315,7 @@ end local function BuildSortedOptionsTable(group, keySort, opts, options, path, appName) tempOrders = new() tempNames = new() - + if group.plugins then for plugin, t in pairs(group.plugins) do for k, v in pairs(t) do @@ -331,7 +331,7 @@ local function BuildSortedOptionsTable(group, keySort, opts, options, path, appN end end end - + for k, v in pairs(group.args) do if not opts[k] then tinsert(keySort, k) @@ -362,7 +362,7 @@ local function DelTree(tree) end local function CleanUserData(widget, event) - + local user = widget:GetUserDataTable() if user.path then @@ -402,7 +402,7 @@ end -- - Gets a status table for the given appname and options path. -- @param appName The application name as given to `:RegisterOptionsTable()` -- @param path The path to the options (a table with all group keys) --- @return +-- @return function AceConfigDialog:GetStatusTable(appName, path) local status = self.Status @@ -436,7 +436,7 @@ end function AceConfigDialog:SelectGroup(appName, ...) local path = new() - + local app = reg:GetOptionsTable(appName) if not app then error(("%s isn't registed with AceConfigRegistry, unable to open config"):format(appName), 2) @@ -448,9 +448,9 @@ function AceConfigDialog:SelectGroup(appName, ...) status.groups = {} end status = status.groups - local treevalue - local treestatus - + local treevalue + local treestatus + for n = 1, select("#",...) do local key = select(n, ...) @@ -477,12 +477,12 @@ function AceConfigDialog:SelectGroup(appName, ...) --the selected group will be overwritten if a child is the final target but still needs to be open treestatus.selected = treevalue treestatus.groups[treevalue] = true - + end - + --move to the next group in the path group = GetSubOption(group, key) - if not group then + if not group then break end tinsert(path, key) @@ -492,10 +492,10 @@ function AceConfigDialog:SelectGroup(appName, ...) end status = status.groups end - + del(path) reg:NotifyChange(appName) -end +end local function OptionOnMouseOver(widget, event) --show a tooltip/set the status bar to the desc text @@ -510,14 +510,14 @@ local function OptionOnMouseOver(widget, event) local desc = GetOptionsMemberValue("desc", opt, options, path, appName) local usage = GetOptionsMemberValue("usage", opt, options, path, appName) local descStyle = opt.descStyle - + if descStyle and descStyle ~= "tooltip" then return end - + GameTooltip:SetText(name, 1, .82, 0, true) - + if opt.type == "multiselect" then GameTooltip:AddLine(user.text, 0.5, 0.5, 0.8, true) - end + end if type(desc) == "string" then GameTooltip:AddLine(desc, 1, 1, 1, true) end @@ -675,7 +675,7 @@ local function ActivateControl(widget, event, ...) end end end - + local success if validated and option.type ~= "execute" then if type(validate) == "string" then @@ -690,7 +690,7 @@ local function ActivateControl(widget, event, ...) if not success then validated = false end end end - + local rootframe = user.rootframe if not validated or type(validated) == "string" then if not validated then @@ -715,7 +715,7 @@ local function ActivateControl(widget, event, ...) del(info) return true else - + local confirmText = option.confirmText --call confirm func/method if type(confirm) == "string" then @@ -756,10 +756,10 @@ local function ActivateControl(widget, event, ...) confirmText = confirmText.." - "..desc end end - + local iscustom = user.rootframe:GetUserData("iscustom") local rootframe - + if iscustom then rootframe = user.rootframe end @@ -796,7 +796,7 @@ local function ActivateControl(widget, event, ...) --full refresh of the frame, some controls dont cause this on all events if option.type == "color" then if event == "OnValueConfirmed" then - + if iscustom then AceConfigDialog:Open(user.appName, user.rootframe, unpack(basepath)) else @@ -1049,6 +1049,10 @@ local function CreateControl(userControlType, fallbackControlType) return control end +local function sortTblAsStrings(x,y) + return tostring(x) < tostring(y) -- Support numbers as keys +end + --[[ options - root of the options table being fed container - widget that controls will be placed in @@ -1079,7 +1083,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin else GroupContainer = gui:Create("SimpleGroup") end - + GroupContainer.width = "fill" GroupContainer:SetLayout("flow") container:AddChild(GroupContainer) @@ -1088,14 +1092,14 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin else --Control to feed local control - + local name = GetOptionsMemberValue("name", v, options, path, appName) - + if v.type == "execute" then - + local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName) local image, width, height = GetOptionsMemberValue("image",v, options, path, appName) - + local iconControl = type(image) == "string" or type(image) == "number" control = CreateControl(v.dialogControl or v.control, iconControl and "Icon" or "Button") if iconControl then @@ -1125,7 +1129,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin elseif v.type == "input" then control = CreateControl(v.dialogControl or v.control, v.multiline and "MultiLineEditBox" or "EditBox") - + if v.multiline and control.SetNumLines then control:SetNumLines(tonumber(v.multiline) or 4) end @@ -1144,15 +1148,15 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin local value = GetOptionsMemberValue("get",v, options, path, appName) control:SetValue(value) control:SetCallback("OnValueChanged",ActivateControl) - + if v.descStyle == "inline" then local desc = GetOptionsMemberValue("desc", v, options, path, appName) control:SetDescription(desc) end - + local image = GetOptionsMemberValue("image", v, options, path, appName) local imageCoords = GetOptionsMemberValue("imageCoords", v, options, path, appName) - + if type(image) == "string" or type(image) == "number" then if type(imageCoords) == "table" then control:SetImage(image, unpack(imageCoords)) @@ -1175,6 +1179,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin elseif v.type == "select" then local values = GetOptionsMemberValue("values", v, options, path, appName) + local sorting = GetOptionsMemberValue("sorting", v, options, path, appName) if v.style == "radio" then local disabled = CheckOptionDisabled(v, options, path, appName) local width = GetOptionsMemberValue("width",v,options,path,appName) @@ -1185,12 +1190,14 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin control:PauseLayout() local optionValue = GetOptionsMemberValue("get",v, options, path, appName) - local t = {} - for value, text in pairs(values) do - t[#t+1]=value + if not sorting then + sorting = {} + for value, text in pairs(values) do + sorting[#sorting+1]=value + end + tsort(sorting, sortTblAsStrings) end - tsort(t) - for k, value in ipairs(t) do + for k, value in ipairs(sorting) do local text = values[value] local radio = gui:Create("CheckBox") radio:SetLabel(text) @@ -1224,7 +1231,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin itemType = nil end control:SetLabel(name) - control:SetList(values, nil, itemType) + control:SetList(values, sorting, itemType) local value = GetOptionsMemberValue("get",v, options, path, appName) if not values[value] then value = nil @@ -1236,7 +1243,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin elseif v.type == "multiselect" then local values = GetOptionsMemberValue("values", v, options, path, appName) local disabled = CheckOptionDisabled(v, options, path, appName) - + local valuesort = new() if values then for value, text in pairs(values) do @@ -1244,7 +1251,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin end end tsort(valuesort) - + local controlType = v.dialogControl or v.control if controlType then control = gui:Create(controlType) @@ -1313,9 +1320,9 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin control:ResumeLayout() control:DoLayout() - + end - + del(valuesort) elseif v.type == "color" then @@ -1340,7 +1347,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin elseif v.type == "description" then control = CreateControl(v.dialogControl or v.control, "Label") control:SetText(name) - + local fontSize = GetOptionsMemberValue("fontSize",v, options, path, appName) if fontSize == "medium" then control:SetFontObject(GameFontHighlight) @@ -1349,10 +1356,10 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin else -- small or invalid control:SetFontObject(GameFontHighlightSmall) end - + local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName) local image, width, height = GetOptionsMemberValue("image",v, options, path, appName) - + if type(image) == "string" or type(image) == "number" then if not width then width = GetOptionsMemberValue("imageWidth",v, options, path, appName) @@ -1401,7 +1408,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin InjectInfo(control, options, v, path, rootframe, appName) container:AddChild(control) end - + end end tremove(path) @@ -1426,7 +1433,7 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button) local option = user.option local path = user.path local appName = user.appName - + local feedpath = new() for i = 1, #path do feedpath[i] = path[i] @@ -1441,8 +1448,9 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button) local name = GetOptionsMemberValue("name", group, options, feedpath, appName) local desc = GetOptionsMemberValue("desc", group, options, feedpath, appName) - + GameTooltip:SetOwner(button, "ANCHOR_NONE") + GameTooltip:ClearAllPoints() if widget.type == "TabGroup" then GameTooltip:SetPoint("BOTTOM",button,"TOP") else @@ -1450,11 +1458,11 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button) end GameTooltip:SetText(name, 1, .82, 0, true) - + if type(desc) == "string" then GameTooltip:AddLine(desc, 1, 1, 1, true) end - + GameTooltip:Show() end @@ -1465,25 +1473,25 @@ end local function GroupExists(appName, options, path, uniquevalue) if not uniquevalue then return false end - + local feedpath = new() local temppath = new() for i = 1, #path do feedpath[i] = path[i] end - + BuildPath(feedpath, ("\001"):split(uniquevalue)) - + local group = options for i = 1, #feedpath do local v = feedpath[i] temppath[i] = v group = GetSubOption(group, v) - - if not group or group.type ~= "group" or CheckOptionHidden(group, options, temppath, appName) then + + if not group or group.type ~= "group" or CheckOptionHidden(group, options, temppath, appName) then del(feedpath) del(temppath) - return false + return false end end del(feedpath) @@ -1602,7 +1610,7 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR tab:SetCallback("OnGroupSelected", GroupSelected) tab:SetCallback("OnTabEnter", TreeOnButtonEnter) tab:SetCallback("OnTabLeave", TreeOnButtonLeave) - + local status = AceConfigDialog:GetStatusTable(appName, path) if not status.groups then status.groups = {} @@ -1622,7 +1630,7 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR break end end - + container:AddChild(tab) elseif grouptype == "select" then @@ -1645,7 +1653,7 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR if firstgroup then select:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup) end - + select.width = "fill" select.height = "fill" @@ -1657,14 +1665,14 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR local tree = gui:Create("TreeGroup") InjectInfo(tree, options, group, path, rootframe, appName) tree:EnableButtonTooltips(false) - + tree.width = "fill" tree.height = "fill" tree:SetCallback("OnGroupSelected", GroupSelected) tree:SetCallback("OnButtonEnter", TreeOnButtonEnter) tree:SetCallback("OnButtonLeave", TreeOnButtonLeave) - + local status = AceConfigDialog:GetStatusTable(appName, path) if not status.groups then status.groups = {} @@ -1705,7 +1713,7 @@ local function RefreshOnUpdate(this) end this.closing[appName] = nil end - + if this.closeAll then for k, v in pairs(AceConfigDialog.OpenFrames) do if not this.closeAllOverride[k] then @@ -1715,7 +1723,7 @@ local function RefreshOnUpdate(this) this.closeAll = nil wipe(this.closeAllOverride) end - + for appName in pairs(this.apps) do if AceConfigDialog.OpenFrames[appName] then local user = AceConfigDialog.OpenFrames[appName]:GetUserDataTable() @@ -1800,10 +1808,10 @@ function AceConfigDialog:Open(appName, container, ...) local options = app("dialog", MAJOR) local f - + local path = new() local name = GetOptionsMemberValue("name", options, options, path, appName) - + --If an optional path is specified add it to the path table before feeding the options --as container is optional as well it may contain the first element of the path if type(container) == "string" then @@ -1813,7 +1821,7 @@ function AceConfigDialog:Open(appName, container, ...) for n = 1, select("#",...) do tinsert(path, (select(n, ...))) end - + local option = options if type(container) == "table" and container.type == "BlizOptionsGroup" and #path > 0 then for i = 1, #path do @@ -1821,7 +1829,7 @@ function AceConfigDialog:Open(appName, container, ...) end name = format("%s - %s", name, GetOptionsMemberValue("name", option, options, path, appName)) end - + --if a container is given feed into that if container then f = container @@ -1915,19 +1923,19 @@ end -- @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 reference to the frame registered into the Interface Options. function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...) local BlizOptions = AceConfigDialog.BlizOptions - + local key = appName for n = 1, select("#", ...) do key = key.."\001"..select(n, ...) end - + if not BlizOptions[appName] then BlizOptions[appName] = {} end - + if not BlizOptions[appName][key] then local group = gui:Create("BlizOptionsGroup") BlizOptions[appName][key] = group diff --git a/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua b/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua index 1e40811..f8d9225 100644 --- a/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua +++ b/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua @@ -4,14 +4,14 @@ -- * Valid **uiTypes**: "cmd", "dropdown", "dialog". This is verified by the library at call time. \\ -- * The **uiName** field is expected to contain the full name of the calling addon, including version, e.g. "FooBar-1.0". This is verified by the library at call time.\\ -- * The **appName** field is the options table name as given at registration time \\ --- +-- -- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName". -- @class file -- @name AceConfigRegistry-3.0 --- @release $Id: AceConfigRegistry-3.0.lua 1193 2018-08-02 12:24:37Z funkydude $ +-- @release $Id: AceConfigRegistry-3.0.lua 1207 2019-06-23 12:08:33Z nevcairiel $ local CallbackHandler = LibStub("CallbackHandler-1.0") -local MAJOR, MINOR = "AceConfigRegistry-3.0", 18 +local MAJOR, MINOR = "AceConfigRegistry-3.0", 20 local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR) if not AceConfigRegistry then return end @@ -33,7 +33,7 @@ local error, assert = error, assert AceConfigRegistry.validated = { - -- list of options table names ran through :ValidateOptionsTable automatically. + -- list of options table names ran through :ValidateOptionsTable automatically. -- CLEARED ON PURPOSE, since newer versions may have newer validators cmd = {}, dropdown = {}, @@ -94,13 +94,20 @@ local basekeys={ } local typedkeys={ - header={}, + header={ + control=optstring, + dialogControl=optstring, + dropdownControl=optstring, + }, description={ image=optstringnumberfunc, imageCoords=optmethodtable, imageHeight=optnumber, imageWidth=optnumber, fontSize=optstringfunc, + control=optstring, + dialogControl=optstring, + dropdownControl=optstring, }, group={ args=istable, @@ -117,6 +124,9 @@ local typedkeys={ imageCoords=optmethodtable, imageHeight=optnumber, imageWidth=optnumber, + control=optstring, + dialogControl=optstring, + dropdownControl=optstring, }, input={ pattern=optstring, @@ -130,6 +140,9 @@ local typedkeys={ tristate=optbool, image=optstringnumberfunc, imageCoords=optmethodtable, + control=optstring, + dialogControl=optstring, + dropdownControl=optstring, }, tristate={ }, @@ -141,12 +154,16 @@ local typedkeys={ step=optnumber, bigStep=optnumber, isPercent=optbool, + control=optstring, + dialogControl=optstring, + dropdownControl=optstring, }, select={ values=ismethodtable, + sorting=optmethodtable, style={ - ["nil"]=true, - ["string"]={dropdown=true,radio=true}, + ["nil"]=true, + ["string"]={dropdown=true,radio=true}, _="string: 'dropdown' or 'radio'" }, control=optstring, @@ -164,9 +181,14 @@ local typedkeys={ }, color={ hasAlpha=optmethodbool, + control=optstring, + dialogControl=optstring, + dropdownControl=optstring, }, keybinding={ - -- TODO + control=optstring, + dialogControl=optstring, + dropdownControl=optstring, }, } @@ -203,13 +225,13 @@ local function validate(options,errlvl,...) if type(options.type)~="string" then err(".type: expected a string, got a "..type(options.type), errlvl,...) end - + -- get type and 'typedkeys' member local tk = typedkeys[options.type] if not tk then err(".type: unknown type '"..options.type.."'", errlvl,...) end - + -- make sure that all options[] are known parameters for k,v in pairs(options) do if not (tk[k] or basekeys[k]) then @@ -302,7 +324,7 @@ function AceConfigRegistry:RegisterOptionsTable(appName, options, skipValidation AceConfigRegistry:ValidateOptionsTable(options, appName, errlvl) -- upgradable AceConfigRegistry.validated[uiType][appName] = true end - return options + return options end elseif type(options)=="function" then AceConfigRegistry.tables[appName] = function(uiType, uiName, errlvl) @@ -340,7 +362,7 @@ function AceConfigRegistry:GetOptionsTable(appName, uiType, uiName) if not f then return nil end - + if uiType then return f(uiType,uiName,1) -- get the table for us else diff --git a/Libs/AceConsole-3.0/AceConsole-3.0.lua b/Libs/AceConsole-3.0/AceConsole-3.0.lua index 0567a65..678fa95 100644 --- a/Libs/AceConsole-3.0/AceConsole-3.0.lua +++ b/Libs/AceConsole-3.0/AceConsole-3.0.lua @@ -2,14 +2,14 @@ -- You can register slash commands to your custom functions and use the `GetArgs` function to parse them -- to your addons individual needs. -- --- **AceConsole-3.0** can be embeded into your addon, either explicitly by calling AceConsole:Embed(MyAddon) or by +-- **AceConsole-3.0** can be embeded into your addon, either explicitly by calling AceConsole:Embed(MyAddon) or by -- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object -- and can be accessed directly, without having to explicitly call AceConsole itself.\\ -- It is recommended to embed AceConsole, otherwise you'll have to specify a custom `self` on all calls you -- make into AceConsole. -- @class file -- @name AceConsole-3.0 --- @release $Id: AceConsole-3.0.lua 1143 2016-07-11 08:52:03Z nevcairiel $ +-- @release $Id: AceConsole-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ local MAJOR,MINOR = "AceConsole-3.0", 7 local AceConsole, oldminor = LibStub:NewLibrary(MAJOR, MINOR) @@ -84,11 +84,11 @@ end -- @param persist if false, the command will be soft disabled/enabled when aceconsole is used as a mixin (default: true) function AceConsole:RegisterChatCommand( command, func, persist ) if type(command)~="string" then error([[Usage: AceConsole:RegisterChatCommand( "command", func[, persist ]): 'command' - expected a string]], 2) end - + if persist==nil then persist=true end -- I'd rather have my addon's "/addon enable" around if the author screws up. Having some extra slash regged when it shouldnt be isn't as destructive. True is a better default. /Mikk - + local name = "ACECONSOLE_"..command:upper() - + if type( func ) == "string" then SlashCmdList[name] = function(input, editBox) self[func](self, input, editBox) @@ -132,9 +132,9 @@ local function nils(n, ...) return ... end end - ---- Retreive one or more space-separated arguments from a string. + +--- Retreive one or more space-separated arguments from a string. -- Treats quoted strings and itemlinks as non-spaced. -- @param str The raw argument string -- @param numargs How many arguments to get (default 1) @@ -144,7 +144,7 @@ end function AceConsole:GetArgs(str, numargs, startpos) numargs = numargs or 1 startpos = max(startpos or 1, 1) - + local pos=startpos -- find start of new arg @@ -169,24 +169,24 @@ function AceConsole:GetArgs(str, numargs, startpos) else delim_or_pipe="([| ])" end - + startpos = pos - + while true do -- find delimiter or hyperlink local ch,_ pos,_,ch = strfind(str, delim_or_pipe, pos) - + if not pos then break end - + if ch=="|" then -- some kind of escape - + if strsub(str,pos,pos+1)=="|H" then -- It's a |H....|hhyper link!|h pos=strfind(str, "|h", pos+2) -- first |h if not pos then break end - + pos=strfind(str, "|h", pos+2) -- second |h if not pos then break end elseif strsub(str,pos, pos+1) == "|T" then @@ -194,16 +194,16 @@ function AceConsole:GetArgs(str, numargs, startpos) pos=strfind(str, "|t", pos+2) if not pos then break end end - + pos=pos+2 -- skip past this escape (last |h if it was a hyperlink) - + else -- found delimiter, done with this arg return strsub(str, startpos, pos-1), AceConsole:GetArgs(str, numargs-1, pos+1) end - + end - + -- search aborted, we hit end of string. return it all as one argument. (yes, even if it's an unterminated quote or hyperlink) return strsub(str, startpos), nils(numargs-1, 1e9) end @@ -214,10 +214,10 @@ end local mixins = { "Print", "Printf", - "RegisterChatCommand", + "RegisterChatCommand", "UnregisterChatCommand", "GetArgs", -} +} -- Embeds AceConsole into the target object making the functions from the mixins list available on target:.. -- @param target target object to embed AceBucket in diff --git a/Libs/AceDBOptions-3.0/AceDBOptions-3.0.lua b/Libs/AceDBOptions-3.0/AceDBOptions-3.0.lua index 7477698..6ed3103 100644 --- a/Libs/AceDBOptions-3.0/AceDBOptions-3.0.lua +++ b/Libs/AceDBOptions-3.0/AceDBOptions-3.0.lua @@ -1,7 +1,7 @@ --- AceDBOptions-3.0 provides a universal AceConfig options screen for managing AceDB-3.0 profiles. -- @class file -- @name AceDBOptions-3.0 --- @release $Id: AceDBOptions-3.0.lua 1193 2018-08-02 12:24:37Z funkydude $ +-- @release $Id: AceDBOptions-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ local ACEDBO_MAJOR, ACEDBO_MINOR = "AceDBOptions-3.0", 15 local AceDBOptions = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR) @@ -240,22 +240,22 @@ local tmpprofiles = {} -- @return Hashtable of all profiles with the internal name as keys and the display name as value. local function getProfileList(db, common, nocurrent) local profiles = {} - + -- copy existing profiles into the table local currentProfile = db:GetCurrentProfile() - for i,v in pairs(db:GetProfiles(tmpprofiles)) do - if not (nocurrent and v == currentProfile) then - profiles[v] = v - end + for i,v in pairs(db:GetProfiles(tmpprofiles)) do + if not (nocurrent and v == currentProfile) then + profiles[v] = v + end end - + -- add our default profiles to choose from ( or rename existing profiles) for k,v in pairs(defaultProfiles) do if (common or profiles[k]) and not (nocurrent and k == currentProfile) then profiles[k] = v end end - + return profiles end @@ -280,11 +280,11 @@ function OptionsHandlerPrototype:GetCurrentProfile() return self.db:GetCurrentProfile() end ---[[ +--[[ List all active profiles you can control the output with the .arg variable currently four modes are supported - + (empty) - return all available profiles "nocurrent" - returns all available profiles except the currently active profile "common" - returns all avaialble profiles + some commonly used profiles ("char - realm", "realm", "class", "Default") @@ -302,7 +302,7 @@ function OptionsHandlerPrototype:ListProfiles(info) else profiles = getProfileList(self.db) end - + return profiles end @@ -336,19 +336,19 @@ local function getOptionsHandler(db, noDefaultProfiles) if not defaultProfiles then generateDefaultProfiles(db) end - + local handler = AceDBOptions.handlers[db] or { db = db, noDefaultProfiles = noDefaultProfiles } - + for k,v in pairs(OptionsHandlerPrototype) do handler[k] = v end - + AceDBOptions.handlers[db] = handler return handler end --[[ - the real options table + the real options table ]] local optionsTable = { desc = { @@ -436,7 +436,7 @@ local optionsTable = { --- Get/Create a option table that you can use in your addon to control the profiles of AceDB-3.0. -- @param db The database object to create the options table for. -- @return The options table to be used in AceConfig-3.0 --- @usage +-- @usage -- -- Assuming `options` is your top-level options table and `self.db` is your database: -- options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db) function AceDBOptions:GetOptionsTable(db, noDefaultProfiles) @@ -445,7 +445,7 @@ function AceDBOptions:GetOptionsTable(db, noDefaultProfiles) name = L["profiles"], desc = L["profiles_sub"], } - + tbl.handler = getOptionsHandler(db, noDefaultProfiles) tbl.args = optionsTable diff --git a/Libs/AceEvent-3.0/AceEvent-3.0.lua b/Libs/AceEvent-3.0/AceEvent-3.0.lua index bbf55c2..7ccd880 100644 --- a/Libs/AceEvent-3.0/AceEvent-3.0.lua +++ b/Libs/AceEvent-3.0/AceEvent-3.0.lua @@ -2,14 +2,14 @@ -- All dispatching is done using **CallbackHandler-1.0**. AceEvent is a simple wrapper around -- CallbackHandler, and dispatches all game events or addon message to the registrees. -- --- **AceEvent-3.0** can be embeded into your addon, either explicitly by calling AceEvent:Embed(MyAddon) or by +-- **AceEvent-3.0** can be embeded into your addon, either explicitly by calling AceEvent:Embed(MyAddon) or by -- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object -- and can be accessed directly, without having to explicitly call AceEvent itself.\\ -- It is recommended to embed AceEvent, otherwise you'll have to specify a custom `self` on all calls you -- make into AceEvent. -- @class file -- @name AceEvent-3.0 --- @release $Id: AceEvent-3.0.lua 1161 2017-08-12 14:30:16Z funkydude $ +-- @release $Id: AceEvent-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ local CallbackHandler = LibStub("CallbackHandler-1.0") local MAJOR, MINOR = "AceEvent-3.0", 4 @@ -25,22 +25,22 @@ AceEvent.embeds = AceEvent.embeds or {} -- what objects embed this lib -- APIs and registry for blizzard events, using CallbackHandler lib if not AceEvent.events then - AceEvent.events = CallbackHandler:New(AceEvent, + AceEvent.events = CallbackHandler:New(AceEvent, "RegisterEvent", "UnregisterEvent", "UnregisterAllEvents") end -function AceEvent.events:OnUsed(target, eventname) +function AceEvent.events:OnUsed(target, eventname) AceEvent.frame:RegisterEvent(eventname) end -function AceEvent.events:OnUnused(target, eventname) +function AceEvent.events:OnUnused(target, eventname) AceEvent.frame:UnregisterEvent(eventname) end -- APIs and registry for IPC messages, using CallbackHandler lib if not AceEvent.messages then - AceEvent.messages = CallbackHandler:New(AceEvent, + AceEvent.messages = CallbackHandler:New(AceEvent, "RegisterMessage", "UnregisterMessage", "UnregisterAllMessages" ) AceEvent.SendMessage = AceEvent.messages.Fire diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc index 3644493..8592b88 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc @@ -1,19 +1,16 @@ -## Interface: 60200 -## X-Curse-Packaged-Version: r53 -## X-Curse-Project-Name: AceGUI-3.0-SharedMediaWidgets -## X-Curse-Project-ID: ace-gui-3-0-shared-media-widgets -## X-Curse-Repository-ID: wow/ace-gui-3-0-shared-media-widgets/mainline +## Interface: 80200 ## Title: Lib: AceGUI-3.0-SharedMediaWidgets ## Notes: Enables AceGUI-3.0 widgets for the 5 basic SharedMedia-3.0 types ## Author: Yssaril -## OptionalDeps: Ace3, LibSharedMedia-3.0, Libstub, CallbackHandler-1.0 +## OptionalDeps: Ace3, LibSharedMedia-3.0 ## X-Category: Library #@no-lib-strip@ -# Libs\Libstub\Libstub.lua -# Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml -# Libs\AceGUI-3.0\AceGUI-3.0.xml +Libs\Libstub\Libstub.lua +Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml +Libs\AceGUI-3.0\AceGUI-3.0.xml +Libs\LibSharedMedia-3.0\lib.xml #@end-no-lib-strip@ -widget.xml \ No newline at end of file +widget.xml diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua index 0b75952..3bb45ed 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua @@ -8,7 +8,7 @@ local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0") do local widgetType = "LSM30_Background" - local widgetVersion = 11 + local widgetVersion = 12 local contentFrameCache = {} local function ReturnSelf(self) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua index 0cd2959..2211a4c 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua @@ -8,7 +8,7 @@ local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0") do local widgetType = "LSM30_Border" - local widgetVersion = 11 + local widgetVersion = 12 local contentFrameCache = {} local function ReturnSelf(self) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua index eadf35f..723b028 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua @@ -8,7 +8,7 @@ local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0") do local widgetType = "LSM30_Font" - local widgetVersion = 11 + local widgetVersion = 12 local contentFrameCache = {} local function ReturnSelf(self) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua index 1d39c28..10c8aa4 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua @@ -8,7 +8,7 @@ local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0") do local widgetType = "LSM30_Sound" - local widgetVersion = 11 + local widgetVersion = 12 local contentFrameCache = {} local function ReturnSelf(self) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua index 2d0e32c..824ce07 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua @@ -8,7 +8,7 @@ local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0") do local widgetType = "LSM30_Statusbar" - local widgetVersion = 11 + local widgetVersion = 12 local contentFrameCache = {} local function ReturnSelf(self) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua index 1af9928..f77cfa0 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua @@ -1,17 +1,11 @@ -- Widget created by Yssaril ---[===[@debug@ -local DataVersion = 9001 -- dev version always overwrites everything else :) ---@end-debug@]===] ---@non-debug@ -local DataVersion = 53 ---@end-non-debug@ +local DataVersion = 9003 local AGSMW = LibStub:NewLibrary("AceGUISharedMediaWidgets-1.0", DataVersion) if not AGSMW then return -- already loaded and no upgrade necessary end -LoadAddOn("LibSharedMedia-3.0") local AceGUI = LibStub("AceGUI-3.0") local Media = LibStub("LibSharedMedia-3.0") @@ -183,14 +177,12 @@ do self:SetHeight(UIParent:GetHeight()*2/5) self.slider:Show() self:SetScript("OnMouseWheel", OnMouseWheel) - self.scrollframe:UpdateScrollChildRect() self.slider:SetMinMaxValues(0, self.contentframe:GetHeight()-self.scrollframe:GetHeight()) else self.scrollframe:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -14, 12) self:SetHeight(self.contentframe:GetHeight()+25) self.slider:Hide() self:SetScript("OnMouseWheel", nil) - self.scrollframe:UpdateScrollChildRect() self.slider:SetMinMaxValues(0, 0) end self.contentframe:SetWidth(self.scrollframe:GetWidth()) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/widget.xml b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/widget.xml index 15cd102..43c46a1 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/widget.xml +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/widget.xml @@ -6,4 +6,4 @@