Skip to content

Commit

Permalink
Updating libs
Browse files Browse the repository at this point in the history
  • Loading branch information
funkjedi committed Dec 3, 2022
1 parent c9f3007 commit f017aa3
Show file tree
Hide file tree
Showing 29 changed files with 424 additions and 264 deletions.
6 changes: 1 addition & 5 deletions Libs/AceAddon-3.0/AceAddon-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
-- end
-- @class file
-- @name AceAddon-3.0.lua
-- @release $Id: AceAddon-3.0.lua 1238 2020-08-28 16:18:42Z nevcairiel $
-- @release $Id: AceAddon-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $

local MAJOR, MINOR = "AceAddon-3.0", 13
local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
Expand All @@ -49,10 +49,6 @@ local select, pairs, next, type, unpack = select, pairs, next, type, unpack
local loadstring, assert, error = loadstring, assert, error
local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget

-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub, IsLoggedIn, geterrorhandler

--[[
xpcall safecall implementation
]]
Expand Down
46 changes: 21 additions & 25 deletions Libs/AceConsole-3.0/AceConsole-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 1284 2022-09-25 09:15:30Z nevcairiel $
local MAJOR,MINOR = "AceConsole-3.0", 7

local AceConsole, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
Expand All @@ -29,10 +29,6 @@ local max = math.max
-- WoW APIs
local _G = _G

-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: DEFAULT_CHAT_FRAME, SlashCmdList, hash_SlashCmdList

local tmp={}
local function Print(self,frame,...)
local n=0
Expand Down Expand Up @@ -84,11 +80,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)
Expand Down Expand Up @@ -132,9 +128,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)
Expand All @@ -144,7 +140,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
Expand All @@ -169,41 +165,41 @@ function AceConsole:GetArgs(str, numargs, startpos)
else
delim_or_pipe="([| ])"
end

startpos = pos

while true do
-- find delimiter or hyperlink
local ch,_
local _
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
-- It's a |T....|t texture
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
Expand All @@ -214,10 +210,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
Expand Down
2 changes: 1 addition & 1 deletion Libs/AceConsole-3.0/AceConsole-3.0.xml
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="AceConsole-3.0.lua"/>
</Ui>
</Ui>
14 changes: 5 additions & 9 deletions Libs/AceDB-3.0/AceDB-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
-- end
-- @class file
-- @name AceDB-3.0.lua
-- @release $Id: AceDB-3.0.lua 1217 2019-07-11 03:06:18Z funkydude $
-- @release $Id: AceDB-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 27
local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)

Expand All @@ -53,10 +53,6 @@ local setmetatable, rawset, rawget = setmetatable, rawset, rawget
-- WoW APIs
local _G = _G

-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub

AceDB.db_registry = AceDB.db_registry or {}
AceDB.frame = AceDB.frame or CreateFrame("Frame")

Expand Down Expand Up @@ -98,11 +94,11 @@ local function copyDefaults(dest, src)
-- This is a metatable used for table defaults
local mt = {
-- This handles the lookup and creation of new subtables
__index = function(t,k)
if k == nil then return nil end
__index = function(t,k2)
if k2 == nil then return nil end
local tbl = {}
copyDefaults(tbl, v)
rawset(t, k, tbl)
rawset(t, k2, tbl)
return tbl
end,
}
Expand All @@ -115,7 +111,7 @@ local function copyDefaults(dest, src)
end
else
-- Values are not tables, so this is just a simple return
local mt = {__index = function(t,k) return k~=nil and v or nil end}
local mt = {__index = function(t,k2) return k2~=nil and v or nil end}
setmetatable(dest, mt)
end
elseif type(v) == "table" then
Expand Down
Loading

0 comments on commit f017aa3

Please sign in to comment.