Skip to content

Commit

Permalink
Update TOC Interface for 11.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Neogeekmo committed Nov 23, 2024
1 parent b0857ab commit dd86e34
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 39 deletions.
2 changes: 1 addition & 1 deletion APR-Recorder.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110000, 110002, 110005
## Interface: 110000, 110002, 110005, 110007

## Title: Azeroth Pilot Reloaded - [|cffeda55fRoute Recorder|r]
## Notes: A route recorder for Azeroth Pilot Reloaded
Expand Down
11 changes: 7 additions & 4 deletions libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
Original file line number Diff line number Diff line change
@@ -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 1296 2022-11-04 18:50:10Z nevcairiel $
-- @release $Id: AceConfigDialog-3.0.lua 1351 2024-07-24 18:23:24Z funkehdude $

local LibStub = LibStub
local gui = LibStub("AceGUI-3.0")
local reg = LibStub("AceConfigRegistry-3.0")

local MAJOR, MINOR = "AceConfigDialog-3.0", 86
local MAJOR, MINOR = "AceConfigDialog-3.0", 87
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)

if not AceConfigDialog then return end
Expand Down Expand Up @@ -544,6 +544,7 @@ local function GetFuncName(option)
end
end
do
local InCombatLockdown = InCombatLockdown
local frame = AceConfigDialog.popup
if not frame or oldminor < 81 then
frame = CreateFrame("Frame", nil, UIParent)
Expand All @@ -556,13 +557,15 @@ do
frame:SetFrameLevel(100) -- Lots of room to draw under it
frame:SetScript("OnKeyDown", function(self, key)
if key == "ESCAPE" then
self:SetPropagateKeyboardInput(false)
if not InCombatLockdown() then
self:SetPropagateKeyboardInput(false)
end
if self.cancel:IsShown() then
self.cancel:Click()
else -- Showing a validation error
self:Hide()
end
else
elseif not InCombatLockdown() then
self:SetPropagateKeyboardInput(true)
end
end)
Expand Down
41 changes: 39 additions & 2 deletions libs/AceDB-3.0/AceDB-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
-- end
-- @class file
-- @name AceDB-3.0.lua
-- @release $Id: AceDB-3.0.lua 1328 2024-03-20 22:36:27Z nevcairiel $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 29
-- @release $Id: AceDB-3.0.lua 1353 2024-08-27 13:37:35Z nevcairiel $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 30
local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)

if not AceDB then return end -- No upgrade needed
Expand Down Expand Up @@ -525,6 +525,17 @@ function DBObjectLib:DeleteProfile(name, silent)
end
end

-- remove from unloaded namespaces
if self.sv.namespaces then
for nsname, data in pairs(self.sv.namespaces) do
if self.children and self.children[nsname] then
-- already a mapped namespace
elseif data.profiles then
data.profiles[name] = nil
end
end
end

-- switch all characters that use this profile back to the default
if self.sv.profileKeys then
for key, profile in pairs(self.sv.profileKeys) do
Expand Down Expand Up @@ -570,6 +581,20 @@ function DBObjectLib:CopyProfile(name, silent)
end
end

-- copy unloaded namespaces
if self.sv.namespaces then
for nsname, data in pairs(self.sv.namespaces) do
if self.children and self.children[nsname] then
-- already a mapped namespace
elseif data.profiles then
-- reset the current profile
data.profiles[self.keys.profile] = {}
-- copy data
copyTable(data.profiles[name], data.profiles[self.keys.profile])
end
end
end

-- Callback: OnProfileCopied, database, sourceProfileKey
self.callbacks:Fire("OnProfileCopied", self, name)
end
Expand All @@ -596,6 +621,18 @@ function DBObjectLib:ResetProfile(noChildren, noCallbacks)
end
end

-- reset unloaded namespaces
if self.sv.namespaces and not noChildren then
for nsname, data in pairs(self.sv.namespaces) do
if self.children and self.children[nsname] then
-- already a mapped namespace
elseif data.profiles then
-- reset the current profile
data.profiles[self.keys.profile] = nil
end
end
end

-- Callback: OnProfileReset, database
if not noCallbacks then
self.callbacks:Fire("OnProfileReset", self)
Expand Down
77 changes: 45 additions & 32 deletions libs/LibDBIcon-1.0/LibDBIcon-1.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
--

local DBICON10 = "LibDBIcon-1.0"
local DBICON10_MINOR = 52 -- Bump on changes
local DBICON10_MINOR = 55 -- Bump on changes
if not LibStub then error(DBICON10 .. " requires LibStub.") end
local ldb = LibStub("LibDataBroker-1.1", true)
if not ldb then error(DBICON10 .. " requires LibDataBroker-1.1.") end
Expand All @@ -25,6 +25,15 @@ function lib:IconCallback(event, name, key, value)
if lib.objects[name] then
if key == "icon" then
lib.objects[name].icon:SetTexture(value)
if lib:IsButtonInCompartment(name) and lib:IsButtonCompartmentAvailable() then
local addonList = AddonCompartmentFrame.registeredAddons
for i =1, #addonList do
if addonList[i].text == name then
addonList[i].icon = value
return
end
end
end
elseif key == "iconCoords" then
lib.objects[name].icon:UpdateCoord()
elseif key == "iconR" then
Expand Down Expand Up @@ -94,8 +103,8 @@ local function onLeave(self)
end
end

local function onEnterCompartment(self)
local buttonName = self.value
local function onEnterCompartment(self, menu)
local buttonName = menu.text
local object = lib.objects[buttonName]
if object and object.dataObject then
if object.dataObject.OnTooltipShow then
Expand All @@ -109,10 +118,10 @@ local function onEnterCompartment(self)
end
end

local function onLeaveCompartment(self)
local function onLeaveCompartment(self, menu)
lib.tooltip:Hide()

local buttonName = self.value
local buttonName = menu.text
local object = lib.objects[buttonName]
if object and object.dataObject then
if object.dataObject.OnLeave then
Expand Down Expand Up @@ -497,39 +506,43 @@ function lib:IsButtonInCompartment(buttonName)
end

function lib:AddButtonToCompartment(buttonName, customIcon)
local object = lib.objects[buttonName]
if object and not object.compartmentData and AddonCompartmentFrame then
if object.db then
object.db.showInCompartment = true
if lib:IsButtonCompartmentAvailable() then
local object = lib.objects[buttonName]
if object and not object.compartmentData then
if object.db then
object.db.showInCompartment = true
end
object.compartmentData = {
text = buttonName,
icon = customIcon or object.dataObject.icon,
notCheckable = true,
registerForAnyClick = true,
func = function(_, menuInputData, menu)
object.dataObject.OnClick(menu, menuInputData.buttonName)
end,
funcOnEnter = onEnterCompartment,
funcOnLeave = onLeaveCompartment,
}
AddonCompartmentFrame:RegisterAddon(object.compartmentData)
end
object.compartmentData = {
text = buttonName,
icon = customIcon or object.dataObject.icon,
notCheckable = true,
registerForAnyClick = true,
func = function(frame, _, _, _, clickType)
object.dataObject.OnClick(frame, clickType)
end,
funcOnEnter = onEnterCompartment,
funcOnLeave = onLeaveCompartment,
}
AddonCompartmentFrame:RegisterAddon(object.compartmentData)
end
end

function lib:RemoveButtonFromCompartment(buttonName)
local object = lib.objects[buttonName]
if object and object.compartmentData then
for i = 1, #AddonCompartmentFrame.registeredAddons do
local entry = AddonCompartmentFrame.registeredAddons[i]
if entry == object.compartmentData then
object.compartmentData = nil
if object.db then
object.db.showInCompartment = nil
if lib:IsButtonCompartmentAvailable() then
local object = lib.objects[buttonName]
if object and object.compartmentData then
for i = 1, #AddonCompartmentFrame.registeredAddons do
local entry = AddonCompartmentFrame.registeredAddons[i]
if entry == object.compartmentData then
object.compartmentData = nil
if object.db then
object.db.showInCompartment = nil
end
table.remove(AddonCompartmentFrame.registeredAddons, i)
AddonCompartmentFrame:UpdateDisplay()
return
end
table.remove(AddonCompartmentFrame.registeredAddons, i)
AddonCompartmentFrame:UpdateDisplay()
return
end
end
end
Expand Down

0 comments on commit dd86e34

Please sign in to comment.