Update Ace-Libs and zzAddOn

This commit is contained in:
rilgamon 2021-03-23 11:39:41 +01:00
parent 856401f00c
commit c919193c0b
9 changed files with 28 additions and 14 deletions

View File

@ -5,4 +5,4 @@
<Include file="AceConfigDialog-3.0\AceConfigDialog-3.0.xml"/>
<!--<Include file="AceConfigDropdown-3.0\AceConfigDropdown-3.0.xml"/>-->
<Script file="AceConfig-3.0.lua"/>
</Ui>
</Ui>

View File

@ -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="AceConfigCmd-3.0.lua"/>
</Ui>
</Ui>

View File

@ -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 1247 2021-01-23 23:16:39Z funkehdude $
-- @release $Id: AceConfigDialog-3.0.lua 1248 2021-02-05 14:27:49Z funkehdude $
local LibStub = LibStub
local gui = LibStub("AceGUI-3.0")
local reg = LibStub("AceConfigRegistry-3.0")
local MAJOR, MINOR = "AceConfigDialog-3.0", 80
local MAJOR, MINOR = "AceConfigDialog-3.0", 81
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigDialog then return end
@ -544,12 +544,13 @@ local function GetFuncName(option)
end
do
local frame = AceConfigDialog.popup
if not frame then
if not frame or oldminor < 81 then
frame = CreateFrame("Frame", nil, UIParent)
AceConfigDialog.popup = frame
frame:Hide()
frame:SetPoint("CENTER", UIParent, "CENTER")
frame:SetSize(320, 72)
frame:EnableMouse(true) -- Do not allow click-through on the frame
frame:SetFrameStrata("TOOLTIP")
frame:SetFrameLevel(100) -- Lots of room to draw under it
frame:SetScript("OnKeyDown", function(self, key)
@ -575,7 +576,7 @@ do
insets = { left = 11, right = 11, top = 11, bottom = 11 },
})
else
local border = CreateFrame("Frame", nil, frame, "DialogBorderDarkTemplate")
local border = CreateFrame("Frame", nil, frame, "DialogBorderOpaqueTemplate")
border:SetAllPoints(frame)
frame:SetFixedFrameStrata(true)
frame:SetFixedFrameLevel(true)

View File

@ -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="AceConfigDialog-3.0.lua"/>
</Ui>
</Ui>

View File

@ -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="AceConfigRegistry-3.0.lua"/>
</Ui>
</Ui>

View File

@ -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="AceDB-3.0.lua"/>
</Ui>
</Ui>

View File

@ -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="AceDBOptions-3.0.lua"/>
</Ui>
</Ui>

View File

@ -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="AceLocale-3.0.lua"/>
</Ui>
</Ui>

View File

@ -1,9 +1,12 @@
local lib = LibStub:NewLibrary("zzAddOn", 4)
local lib = LibStub:NewLibrary("zzAddOn", 5)
if not lib then return end
local config = LibStub:GetLibrary("zzConfig")
lib['callbacks'] = lib['callbacks'] or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib)
lib['addons'] = lib['addons'] or {}
lib['events'] = lib['events'] or CreateFrame("FRAME")
local function errormsg(err)
print(format("|cffff0000Error:|r %s",err))
end
local mixins = {'NewAddOn', 'GetAddOn', 'AddChild', 'HasChild', 'IsChild', 'HasParent', 'GetParent', 'GetOptions', 'RegisterEvent','UnregisterEvent','IsClassic', 'GetSpecs', 'Fire'}
local events = lib['events']
function lib:Fire(...)
@ -71,7 +74,7 @@ function lib:RegisterEvent(event, globalfunc)
end
lib.RegisterCallback(self, event, globalfunc)
else
print("ign reg", type(event), event)
errormsg("ign reg", type(event), event)
end
end
function lib:UnregisterEvent(event)
@ -90,6 +93,16 @@ end
function lib:NewAddOn(addonName, addonTable)
local specs = self['specs']
local childName = specs['name']
if(lib['addons'][childName]) then
local oldchild = lib['addons'][childName]
local parent = oldchild:GetParent()
if(parent) then
errormsg(format("%s already loaded by %s", childName, parent['specs']['name']))
else
errormsg(format("|%s already loaded", childName))
end
return
end
if(type(childName) == 'string') then
self.GetAddOnTable = function() return addonTable end
lib['addons'][childName] = self
@ -113,7 +126,7 @@ function lib:Embed(target)
target[name] = lib[name]
end
end
for target, _ in pairs(lib['addons']) do
for _, target in pairs(lib['addons']) do
lib:Embed(target)
end
lib['events']:RegisterEvent('ADDON_LOADED')