diff --git a/Broker2FuBar/Broker2FuBar.toc b/Broker2FuBar/Broker2FuBar.toc index eb92a2a..d096e8e 100644 --- a/Broker2FuBar/Broker2FuBar.toc +++ b/Broker2FuBar/Broker2FuBar.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## Title: Broker2FuBar ## Notes: Shows your LDB sources in FuBar. ## Author: Kemayo, Adirelle, Arrowmaster diff --git a/Broker2FuBar/core.lua b/Broker2FuBar/core.lua index 56b5006..42f34bb 100644 --- a/Broker2FuBar/core.lua +++ b/Broker2FuBar/core.lua @@ -8,7 +8,7 @@ addon.registry = {} addon.fubared = {} function addon:OnInitialize() - if IsAddOnLoaded('FuBar2Broker') then + if C_AddOns.IsAddOnLoaded('FuBar2Broker') then self:Print(self.name..' disabled itself because FuBar2Broker is loaded. Running these two addons at the same time is a very bad idea.') self:SetEnabledState(false) return diff --git a/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.lua b/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.lua index 722888a..3de267d 100644 --- a/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.lua +++ b/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.lua @@ -1240,7 +1240,7 @@ function FuBarPlugin:SetFontSize(size) end local function IsLoadOnDemand(plugin) - return IsAddOnLoadOnDemand(folderNames[plugin] or "") + return C_AddOns.IsAddOnLoadOnDemand(folderNames[plugin] or "") end -- #NODOC @@ -1256,8 +1256,8 @@ function FuBarPlugin:Embed(target) local partFolder = stack:match("...([^/]+)/") if partFolder then local partFolder_len = #partFolder - for i = 1, GetNumAddOns() do - local name = GetAddOnInfo(i) + for i = 1, C_AddOns.GetNumAddOns() do + local name = C_AddOns.GetAddOnInfo(i) if #name >= partFolder_len then local partName = name:sub(-partFolder_len) if partName == partFolder then diff --git a/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.toc b/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.toc index 7545574..e9f423d 100644 --- a/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.toc +++ b/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## Title: Lib: FuBarPlugin-3.0 ## Notes: A library to provide a means create a FuBar-compatible plugin. ## Notes-zhTW: 一個提供支援FuBar所需功能的插件。 diff --git a/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibStub/LibStub.toc b/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibStub/LibStub.toc index fd93b15..8a38012 100644 --- a/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibStub/LibStub.toc +++ b/Broker2FuBar/libs/LibFuBarPlugin-3.0/LibStub/LibStub.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## Title: Lib: LibStub ## Notes: Universal Library Stub ## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel diff --git a/FuBar/FuBar.lua b/FuBar/FuBar.lua index 22447f0..ea73d70 100644 --- a/FuBar/FuBar.lua +++ b/FuBar/FuBar.lua @@ -1025,7 +1025,7 @@ function FuBar:OnEnable() self:AddEventListener("CVAR_UPDATE", "OnCVarUpdate") - DisableAddOn("FuBar-compat-1.2") + C_AddOns.DisableAddOn("FuBar-compat-1.2") self:AddSecureHook("RestartGx") @@ -1069,18 +1069,18 @@ local function findFuBarDep(...) end local function isFuBarDependent(name) - local data = GetAddOnMetadata(name, "X-FuBar-Dependent") + local data = C_AddOns.GetAddOnMetadata(name, "X-FuBar-Dependent") data = tonumber(data) or data if data and data ~= 0 then return true end - return findFuBarDep(GetAddOnDependencies(name)) + return findFuBarDep(C_AddOns.GetAddOnDependencies(name)) end function FuBar:LoadLoadOnDemandPlugins() - for i = 1, GetNumAddOns() do - local name, _, notes, enabled, loadable = GetAddOnInfo(i) - if IsAddOnLoadOnDemand(i) and enabled and loadable and not IsAddOnLoaded(i) then + for i = 1, C_AddOns.GetNumAddOns() do + local name, _, notes, enabled, loadable = C_AddOns.GetAddOnInfo(i) + if C_AddOns.IsAddOnLoadOnDemand(i) and enabled and loadable and not C_AddOns.IsAddOnLoaded(i) then if isFuBarDependent(name) then if not self.db.profile.loadOnDemand[name] then self:LoadPlugin(name) @@ -1553,10 +1553,10 @@ function FuBar:OnProfileEnable(oldName, _, copyFrom) self:CheckResolution() - for i = 1, GetNumAddOns() do - local name, _, notes, enabled, loadable = GetAddOnInfo(i) - if IsAddOnLoadOnDemand(i) and enabled and loadable and not IsAddOnLoaded(i) then - if findFuBarDep(GetAddOnDependencies(name)) then + for i = 1, C_AddOns.GetNumAddOns() do + local name, _, notes, enabled, loadable = C_AddOns.GetAddOnInfo(i) + if C_AddOns.IsAddOnLoadOnDemand(i) and enabled and loadable and not C_AddOns.IsAddOnLoaded(i) then + if findFuBarDep(C_AddOns.GetAddOnDependencies(name)) then if not self.db.profile.loadOnDemand[name] then self:LoadPlugin(name) elseif not self.db.profile.loadOnDemand[name].disabled and (not self.db.profile.loadOnDemand[name].condition or CheckLoadCondition(self.db.profile.loadOnDemand[name].condition)) then diff --git a/FuBar/FuBar.toc b/FuBar/FuBar.toc index 8f6eeb2..612772d 100644 --- a/FuBar/FuBar.toc +++ b/FuBar/FuBar.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## Title: FuBar 4.0 ## Notes: A panel that modules can plug into. ## Notes-ruRU: Панели для отображения различных плагинов. diff --git a/FuBar/libs/AceLibrary/AceLibrary.lua b/FuBar/libs/AceLibrary/AceLibrary.lua index 961cc68..e040551 100644 --- a/FuBar/libs/AceLibrary/AceLibrary.lua +++ b/FuBar/libs/AceLibrary/AceLibrary.lua @@ -357,13 +357,13 @@ end local function TryToEnable(addon) if DONT_ENABLE_LIBRARIES then return end - local isondemand = IsAddOnLoadOnDemand(addon) + local isondemand = C_AddOns.IsAddOnLoadOnDemand(addon) if isondemand then - local _, _, _, enabled = GetAddOnInfo(addon) - EnableAddOn(addon) - local _, _, _, _, loadable = GetAddOnInfo(addon) + local _, _, _, enabled = C_AddOns.GetAddOnInfo(addon) + C_AddOns.EnableAddOn(addon) + local _, _, _, _, loadable = C_AddOns.GetAddOnInfo(addon) if not loadable and not enabled then - DisableAddOn(addon) + C_AddOns.DisableAddOn(addon) end return loadable @@ -381,7 +381,7 @@ local function TryToLoadStandalone(major) AceLibrary.scannedlibs[major] = true - local name, _, _, enabled, loadable = GetAddOnInfo(major) + local name, _, _, enabled, loadable = C_AddOns.GetAddOnInfo(major) loadable = (enabled and loadable) or TryToEnable(name) @@ -392,9 +392,9 @@ local function TryToLoadStandalone(major) end local field = "X-AceLibrary-" .. major - for i = 1, GetNumAddOns() do - if GetAddOnMetadata(i, field) then - name, _, _, enabled, loadable = GetAddOnInfo(i) + for i = 1, C_AddOns.GetNumAddOns() do + if C_AddOns.GetAddOnMetadata(i, field) then + name, _, _, enabled, loadable = C_AddOns.GetAddOnInfo(i) loadable = (enabled and loadable) or TryToEnable(name) if loadable then diff --git a/FuBar/libs/AceLibrary/AceLibrary.toc b/FuBar/libs/AceLibrary/AceLibrary.toc index 42a63f1..7594b1e 100644 --- a/FuBar/libs/AceLibrary/AceLibrary.toc +++ b/FuBar/libs/AceLibrary/AceLibrary.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## X-Curse-Packaged-Version: r1101 ## X-Curse-Project-Name: Ace2 ## X-Curse-Project-ID: ace2 diff --git a/FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.lua b/FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.lua index 722888a..3de267d 100644 --- a/FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.lua +++ b/FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.lua @@ -1240,7 +1240,7 @@ function FuBarPlugin:SetFontSize(size) end local function IsLoadOnDemand(plugin) - return IsAddOnLoadOnDemand(folderNames[plugin] or "") + return C_AddOns.IsAddOnLoadOnDemand(folderNames[plugin] or "") end -- #NODOC @@ -1256,8 +1256,8 @@ function FuBarPlugin:Embed(target) local partFolder = stack:match("...([^/]+)/") if partFolder then local partFolder_len = #partFolder - for i = 1, GetNumAddOns() do - local name = GetAddOnInfo(i) + for i = 1, C_AddOns.GetNumAddOns() do + local name = C_AddOns.GetAddOnInfo(i) if #name >= partFolder_len then local partName = name:sub(-partFolder_len) if partName == partFolder then diff --git a/FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.toc b/FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.toc index 2c6ed5d..bec1d21 100644 --- a/FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.toc +++ b/FuBar/libs/LibFuBarPlugin-3.0/LibFuBarPlugin-3.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## LoadOnDemand: 1 ## Title: Lib: FuBarPlugin-3.0 ## Notes: A library to provide a means create a FuBar-compatible plugin. diff --git a/FuBar/libs/LibJostle-3.0/LibJostle-3.0.lua b/FuBar/libs/LibJostle-3.0/LibJostle-3.0.lua index 9e953d5..062340e 100644 --- a/FuBar/libs/LibJostle-3.0/LibJostle-3.0.lua +++ b/FuBar/libs/LibJostle-3.0/LibJostle-3.0.lua @@ -24,25 +24,25 @@ local blizzardFrames = { 'PlayerFrame', 'TargetFrame', 'MinimapCluster', - 'PartyMemberFrame1', + -- 'PartyMemberFrame1', 'TicketStatusFrame', - 'WorldStateAlwaysUpFrame', + -- 'WorldStateAlwaysUpFrame', 'MainMenuBar', 'MultiBarRight', - 'CT_PlayerFrame_Drag', - 'CT_TargetFrame_Drag', - 'Gypsy_PlayerFrameCapsule', - 'Gypsy_TargetFrameCapsule', - 'ConsolidatedBuffs', + -- 'CT_PlayerFrame_Drag', + -- 'CT_TargetFrame_Drag', + -- 'Gypsy_PlayerFrameCapsule', + -- 'Gypsy_TargetFrameCapsule', + -- 'ConsolidatedBuffs', 'BuffFrame', -- 'DEFAULT_CHAT_FRAME', -- 'ChatFrame2', 'GroupLootFrame1', - 'TutorialFrameParent', - 'FramerateLabel', + -- 'TutorialFrameParent', + -- 'FramerateLabel', 'DurabilityFrame', - 'CastingBarFrame', - 'OrderHallCommandBar', + -- 'CastingBarFrame', + -- 'OrderHallCommandBar', 'MicroButtonAndBagsBar', 'UIWidgetTopCenterContainerFrame', 'StatusTrackingBarManager', @@ -364,16 +364,19 @@ function Jostle:Refresh(...) end end - for _,frame in ipairs(frames) do + for _, frame in ipairs(frames) do if type(frame) == "string" then + -- print(frame, _G[frame]) frame = _G[frame] end local framescale = frame and frame.GetScale and frame:GetScale() or 1 - if ((frame and frame.IsUserPlaced and not frame:IsUserPlaced()) or ((frame == DEFAULT_CHAT_FRAME or frame == ChatFrame2) and SIMPLE_CHAT == "1") or frame == FramerateLabel) and (frame ~= ChatFrame2 or SIMPLE_CHAT == "1") then + if ((frame.IsUserPlaced and not frame:IsUserPlaced()) or ((frame == DEFAULT_CHAT_FRAME or frame == ChatFrame2) and SIMPLE_CHAT == "1") or frame == FramerateLabel) and (frame ~= ChatFrame2 or SIMPLE_CHAT == "1") then local frameData = blizzardFramesData[frame] - if (select(2, frame:GetPoint(1)) ~= UIParent and select(2, frame:GetPoint(1)) ~= WorldFrame) then + local _, relativeTo, relativePoint = frame:GetPoint(1) + + if relativeTo ~= UIParent and relativeTo ~= WorldFrame then -- do nothing elseif frame == PlayerFrame and (CT_PlayerFrame_Drag or Gypsy_PlayerFrameCapsule) then -- do nothing @@ -383,7 +386,7 @@ function Jostle:Refresh(...) -- do nothing elseif frame == MainMenuBar and Gypsy_HotBarCapsule then -- do nothing - elseif frame == MinimapCluster and select(3, frame:GetPoint(1)) ~= "TOPRIGHT" then + elseif frame == MinimapCluster and relativePoint ~= "TOPRIGHT" then -- do nothing elseif frame == DurabilityFrame and DurabilityFrame:IsShown() and (DurabilityFrame:GetLeft() > GetScreenWidth() or DurabilityFrame:GetRight() < 0 or DurabilityFrame:GetBottom() > GetScreenHeight() or DurabilityFrame:GetTop() < 0) then DurabilityFrame:Hide() diff --git a/FuBar/libs/LibJostle-3.0/LibJostle-3.0.toc b/FuBar/libs/LibJostle-3.0/LibJostle-3.0.toc index 6251b98..f44f7da 100644 --- a/FuBar/libs/LibJostle-3.0/LibJostle-3.0.toc +++ b/FuBar/libs/LibJostle-3.0/LibJostle-3.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## LoadOnDemand: 1 ## Title: Lib: Jostle-3.0 ## Notes: A library to handle rearrangement of blizzard's frames when bars are added to the sides of the screen. diff --git a/FuBar/libs/LibJostle-3.0/LibStub/LibStub.toc b/FuBar/libs/LibJostle-3.0/LibStub/LibStub.toc index 4dcb91d..071cb71 100644 --- a/FuBar/libs/LibJostle-3.0/LibStub/LibStub.toc +++ b/FuBar/libs/LibJostle-3.0/LibStub/LibStub.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## Title: Lib: LibStub ## Notes: Universal Library Stub ## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel diff --git a/FuBar/libs/LibRock-1.0/LibRock-1.0.lua b/FuBar/libs/LibRock-1.0/LibRock-1.0.lua index d46d185..b5b34ac 100644 --- a/FuBar/libs/LibRock-1.0/LibRock-1.0.lua +++ b/FuBar/libs/LibRock-1.0/LibRock-1.0.lua @@ -288,13 +288,13 @@ local tonumber = _G.tonumber local strmatch = _G.strmatch local table_remove = _G.table.remove local debugstack = _G.debugstack -local LoadAddOn = _G.LoadAddOn -local GetAddOnInfo = _G.GetAddOnInfo -local GetAddOnMetadata = _G.GetAddOnMetadata -local GetNumAddOns = _G.GetNumAddOns -local DisableAddOn = _G.DisableAddOn -local EnableAddOn = _G.EnableAddOn -local IsAddOnLoadOnDemand = _G.IsAddOnLoadOnDemand +local LoadAddOn = C_AddOns.LoadAddOn +local GetAddOnInfo = C_AddOns.GetAddOnInfo +local GetAddOnMetadata = C_AddOns.GetAddOnMetadata +local GetNumAddOns = C_AddOns.GetNumAddOns +local DisableAddOn = C_AddOns.DisableAddOn +local EnableAddOn = C_AddOns.EnableAddOn +local IsAddOnLoadOnDemand = C_AddOns.IsAddOnLoadOnDemand local IsLoggedIn = _G.IsLoggedIn local geterrorhandler = _G.geterrorhandler local assert = _G.assert diff --git a/FuBar/libs/LibRock-1.0/LibRock-1.0.toc b/FuBar/libs/LibRock-1.0/LibRock-1.0.toc index 7b10de7..ab663e1 100644 --- a/FuBar/libs/LibRock-1.0/LibRock-1.0.toc +++ b/FuBar/libs/LibRock-1.0/LibRock-1.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## X-Curse-Packaged-Version: r298 ## X-Curse-Project-Name: LibRock-1.0 ## X-Curse-Project-ID: librock-1-0 diff --git a/FuBar/libs/LibRockConfig-1.0/LibRockConfig-1.0.lua b/FuBar/libs/LibRockConfig-1.0/LibRockConfig-1.0.lua index 9ad23d1..f4b3ac7 100644 --- a/FuBar/libs/LibRockConfig-1.0/LibRockConfig-1.0.lua +++ b/FuBar/libs/LibRockConfig-1.0/LibRockConfig-1.0.lua @@ -642,7 +642,7 @@ local GRAY_FONT_COLOR = _G.GRAY_FONT_COLOR local HIGHLIGHT_FONT_COLOR = _G.HIGHLIGHT_FONT_COLOR local NORMAL_FONT_COLOR = _G.NORMAL_FONT_COLOR local SetDesaturation = _G.SetDesaturation -local GetMouseFocus = _G.GetMouseFocus +local GetMouseFoci = _G.GetMouseFoci local newList, newDict, newSet, del, unpackListAndDel = Rock:GetRecyclingFunctions(MAJOR_VERSION, "newList", "newDict", "newSet", "del", "unpackListAndDel") @@ -2582,7 +2582,7 @@ function createBase() local hasEntered = false local isDragging = false local function inFocus() - local frame = GetMouseFocus() + local frame = GetMouseFoci()[1] if frame == WorldFrame or frame == UIParent or not frame or frame == base then return true end @@ -3610,7 +3610,7 @@ do end selectedTreeLine = this - if GetMouseFocus() == this then + if GetMouseFoci()[1] == this then this.highlight:SetAlpha(1) else this.highlight:SetAlpha(0.7) diff --git a/FuBar/libs/LibRockConfig-1.0/LibRockConfig-1.0.toc b/FuBar/libs/LibRockConfig-1.0/LibRockConfig-1.0.toc index 22988bb..0d2e633 100644 --- a/FuBar/libs/LibRockConfig-1.0/LibRockConfig-1.0.toc +++ b/FuBar/libs/LibRockConfig-1.0/LibRockConfig-1.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## X-Curse-Packaged-Version: r401 ## X-Curse-Project-Name: LibRockConfig-1.0 ## X-Curse-Project-ID: librockconfig-1-0 diff --git a/FuBar/libs/LibRockDB-1.0/LibRockDB-1.0.lua b/FuBar/libs/LibRockDB-1.0/LibRockDB-1.0.lua index 18f0bca..b08a75d 100644 --- a/FuBar/libs/LibRockDB-1.0/LibRockDB-1.0.lua +++ b/FuBar/libs/LibRockDB-1.0/LibRockDB-1.0.lua @@ -32,8 +32,8 @@ local type = _G.type local tostring = _G.tostring local rawget = _G.rawget local setmetatable = _G.setmetatable -local GetAddOnInfo = _G.GetAddOnInfo -local GetNumAddOns = _G.GetNumAddOns +local GetAddOnInfo = C_AddOns.GetAddOnInfo +local GetNumAddOns = C_AddOns.GetNumAddOns local debugstack = _G.debugstack local assert = _G.assert local select = _G.select diff --git a/FuBar/libs/LibRockDB-1.0/LibRockDB-1.0.toc b/FuBar/libs/LibRockDB-1.0/LibRockDB-1.0.toc index 769839e..ef8bd5b 100644 --- a/FuBar/libs/LibRockDB-1.0/LibRockDB-1.0.toc +++ b/FuBar/libs/LibRockDB-1.0/LibRockDB-1.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## X-Curse-Packaged-Version: r241 ## X-Curse-Project-Name: LibRockDB-1.0 ## X-Curse-Project-ID: librockdb-1-0 diff --git a/FuBar/libs/LibRockEvent-1.0/LibRockEvent-1.0.toc b/FuBar/libs/LibRockEvent-1.0/LibRockEvent-1.0.toc index 1a5a543..971ebca 100644 --- a/FuBar/libs/LibRockEvent-1.0/LibRockEvent-1.0.toc +++ b/FuBar/libs/LibRockEvent-1.0/LibRockEvent-1.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## X-Curse-Packaged-Version: r236 ## X-Curse-Project-Name: LibRockEvent-1.0 ## X-Curse-Project-ID: librockevent-1-0 diff --git a/FuBar/libs/LibRockHook-1.0/LibRockHook-1.0.toc b/FuBar/libs/LibRockHook-1.0/LibRockHook-1.0.toc index ecd29ae..5dfa4b7 100644 --- a/FuBar/libs/LibRockHook-1.0/LibRockHook-1.0.toc +++ b/FuBar/libs/LibRockHook-1.0/LibRockHook-1.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## X-Curse-Packaged-Version: r229 ## X-Curse-Project-Name: LibRockHook-1.0 ## X-Curse-Project-ID: librockhook-1-0 diff --git a/FuBar/libs/LibRockLocale-1.0/LibRockLocale-1.0.toc b/FuBar/libs/LibRockLocale-1.0/LibRockLocale-1.0.toc index 9db3b1f..7548828 100644 --- a/FuBar/libs/LibRockLocale-1.0/LibRockLocale-1.0.toc +++ b/FuBar/libs/LibRockLocale-1.0/LibRockLocale-1.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## X-Curse-Packaged-Version: r237 ## X-Curse-Project-Name: LibRockLocale-1.0 ## X-Curse-Project-ID: librocklocale-1-0 diff --git a/FuBar/libs/LibRockTimer-1.0/LibRockTimer-1.0.toc b/FuBar/libs/LibRockTimer-1.0/LibRockTimer-1.0.toc index 1de7596..6937fa7 100644 --- a/FuBar/libs/LibRockTimer-1.0/LibRockTimer-1.0.toc +++ b/FuBar/libs/LibRockTimer-1.0/LibRockTimer-1.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## X-Curse-Packaged-Version: r233 ## X-Curse-Project-Name: LibRockTimer-1.0 ## X-Curse-Project-ID: librocktimer-1-0 diff --git a/FuBar/libs/LibSharedMedia-3.0/LibSharedMedia-3.0.toc b/FuBar/libs/LibSharedMedia-3.0/LibSharedMedia-3.0.toc index d35af7e..c53f9aa 100644 --- a/FuBar/libs/LibSharedMedia-3.0/LibSharedMedia-3.0.toc +++ b/FuBar/libs/LibSharedMedia-3.0/LibSharedMedia-3.0.toc @@ -1,4 +1,4 @@ -## Interface: 100002 +## Interface: 110002 ## LoadOnDemand: 1 ## Title: Lib: SharedMedia-3.0 diff --git a/FuBar/libs/Tablet-2.0/Tablet-2.0.lua b/FuBar/libs/Tablet-2.0/Tablet-2.0.lua index 05a97d7..0410694 100644 --- a/FuBar/libs/Tablet-2.0/Tablet-2.0.lua +++ b/FuBar/libs/Tablet-2.0/Tablet-2.0.lua @@ -2510,7 +2510,7 @@ function Tablet:Open(fakeParent, parent) detachedData.detached = false frame:Detach() end - if (not detachedData or not detachedData.detached) and GetMouseFocus() == fakeParent then + if (not detachedData or not detachedData.detached) and GetMouseFoci()[1] == fakeParent then self.tooltip.enteredFrame = true end overFrame = type(fakeParent) == "table" and MouseIsOver(fakeParent) and fakeParent @@ -2583,7 +2583,7 @@ function Tablet:Register(parent, ...) end end self.onceRegistered[parent] = true - if GetMouseFocus() == parent then + if GetMouseFoci()[1] == parent then self:Open(parent) end end diff --git a/FuBar_FuXPFu/FuBar_FuXPFu.lua b/FuBar_FuXPFu/FuBar_FuXPFu.lua index a562eb4..f0812b9 100644 --- a/FuBar_FuXPFu/FuBar_FuXPFu.lua +++ b/FuBar_FuXPFu/FuBar_FuXPFu.lua @@ -98,17 +98,17 @@ function FuXP:UpdateFactionMenu() if queryFactions then local factionTable = {} - local watchedFactionID = select(6, GetWatchedFactionInfo()) + local watchedFactionID = C_Reputation.GetWatchedFactionData().factionID - for factionIndex = 1, GetNumFactions() do - local name, _, _, _, _, _, _, _, isHeader, _, hasRep, _, _, factionID = GetFactionInfo(factionIndex) + for factionIndex = 1, C_Reputation.GetNumFactions() do + local factionData = C_Reputation.GetFactionDataByIndex(factionIndex) - if not isHeader or hasRep then - if watchedFactionID == factionID then + if not factionData.isHeader or factionData.isHeaderWithRep then + if watchedFactionID == factionData.factionID then watchedFactionIndex = tostring(factionIndex) end - factionTable[tostring(factionIndex)] = name + factionTable[tostring(factionIndex)] = factionData.name end end @@ -132,7 +132,7 @@ function FuXP:SetupMenu() return watchedFactionIndex end, set = function(v) - SetWatchedFactionIndex(tonumber(v)); + C_Reputation.SetWatchedFactionByIndex(tonumber(v)); end, validate = {}, order = 120, @@ -405,7 +405,7 @@ function FuXP:OnEnable() self:RegisterEvent("MAJOR_FACTION_RENOWN_LEVEL_CHANGED", "OnTextUpdate") self:RegisterEvent("UPDATE_FACTION", "OnUpdateFaction") - self:SecureHook("SetWatchedFactionIndex"); + self:SecureHook(C_Reputation, "SetWatchedFactionByIndex"); self:ScheduleRepeatingEvent("XPFuBar", self.Reanchor, 1, self) self:SetupMenu() @@ -416,7 +416,7 @@ function FuXP:OnUpdateFaction() self:OnTextUpdate() end -function FuXP:SetWatchedFactionIndex(index) +function FuXP:SetWatchedFactionByIndex(index) queryFactions = false if not index then index = 0 end @@ -641,11 +641,14 @@ function FuXP:OnDataUpdate() local total = self.Panel.frame:GetWidth() if self.db.profile.ShowRep == true and watchedFactionID ~= 0 then - local name, standing, minRep, maxRep, currentRep, factionID = GetWatchedFactionInfo() + local watchedFactionData = C_Reputation.GetWatchedFactionData() + local minRep = watchedFactionData.currentReactionThreshold + local maxRep = watchedFactionData.nextReactionThreshold + local currentRep = watchedFactionData.reaction - local renownReputationData = C_MajorFactions.GetMajorFactionData(factionID) - local currentRepParagon, maxRepParagon = C_Reputation.GetFactionParagonInfo(factionID) - local friendshipReputationInfo = C_GossipInfo.GetFriendshipReputation(factionID) + local renownReputationData = C_MajorFactions.GetMajorFactionData(watchedFactionData.factionID) + local currentRepParagon, maxRepParagon = C_Reputation.GetFactionParagonInfo(watchedFactionData.factionID) + local friendshipReputationInfo = C_GossipInfo.GetFriendshipReputation(watchedFactionData.factionID) if renownReputationData ~= nil then --Renown minRep = 0 @@ -666,7 +669,7 @@ function FuXP:OnDataUpdate() self.RepBarTex:SetVertexColor(self.db.profile.ParagonRep[1], self.db.profile.ParagonRep[2], self.db.profile.ParagonRep[3], self.db.profile.ParagonRep[4]) self.RepSpark:SetVertexColor(self.db.profile.ParagonRep[1], self.db.profile.ParagonRep[2], self.db.profile.ParagonRep[3], self.db.profile.Spark) - elseif friendshipReputationInfo and friendshipReputationInfo.friendshipFactionID == factionID then --Friendship + elseif friendshipReputationInfo and friendshipReputationInfo.friendshipFactionID == watchedFactionData.factionID then --Friendship minRep = 0 maxRep = friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.reactionThreshold or friendshipReputationInfo.maxRep currentRep = maxRep - (friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.standing or 0) @@ -719,33 +722,37 @@ local function numWithCommas(n) end function FuXP:OnTextUpdate() - local name, standing, minRep, maxRep, currentRep, factionID = GetWatchedFactionInfo() + local watchedFactionData = C_Reputation.GetWatchedFactionData() - watchedFactionID = factionID + watchedFactionID = watchedFactionData and watchedFactionData.factionID or 0 self:OnDataUpdate() self:Reanchor() -- Setup watched factions - if factionID ~= 0 then -- 'Unknown' usually means that the player just started their character and aren't tracking any faction + if watchedFactionData then -- nil usually means that the player just started their character and aren't tracking any faction + local minRep = watchedFactionData.currentReactionThreshold + local maxRep = watchedFactionData.nextReactionThreshold + local currentRep = watchedFactionData.currentStanding + -- Renown Reputation introduced in Dragonflight: -- https://wowpedia.fandom.com/wiki/API_C_MajorFactions.GetMajorFactionData - local renownReputationData = C_MajorFactions.GetMajorFactionData(factionID) + local renownReputationData = C_MajorFactions.GetMajorFactionData(watchedFactionData.factionID) -- Paragon Reputation introduced in Legion: -- https://wow.gamepedia.com/Reputation#Paragon -- https://wow.gamepedia.com/API_C_Reputation.GetFactionParagonInfo - local currentRepParagon, maxRepParagon = C_Reputation.GetFactionParagonInfo(factionID) + local currentRepParagon, maxRepParagon = C_Reputation.GetFactionParagonInfo(watchedFactionData.factionID) -- Friendship Reputation introduced in Mists of Pandaria: -- https://wowpedia.fandom.com/wiki/API_C_GossipInfo.GetFriendshipReputation - local friendshipReputationInfo = C_GossipInfo.GetFriendshipReputation(factionID) + local friendshipReputationInfo = C_GossipInfo.GetFriendshipReputation(watchedFactionData.factionID) - local factionStandingLabel = _G["FACTION_STANDING_LABEL" .. standing] + local factionStandingLabel = _G["FACTION_STANDING_LABEL" .. watchedFactionData.reaction] if renownReputationData ~= nil then --Renown minRep = 0 @@ -766,7 +773,7 @@ function FuXP:OnTextUpdate() currentRep = currentRepParagon % maxRepParagon factionStandingLabel = "|cffB2D7F7Paragon" - elseif friendshipReputationInfo and friendshipReputationInfo.friendshipFactionID == factionID then --Friendship + elseif friendshipReputationInfo and friendshipReputationInfo.friendshipFactionID == watchedFactionData.factionID then --Friendship minRep = 0 maxRep = friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.reactionThreshold or friendshipReputationInfo.maxRep currentRep = maxRep - (friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.standing or 0) @@ -775,21 +782,21 @@ function FuXP:OnTextUpdate() else local standingColor - if standing == 1 then + if watchedFactionData.reaction == 1 then standingColor = "|cffcc2222" --Hated - elseif standing == 2 then + elseif watchedFactionData.reaction == 2 then standingColor = "|cffff0000" --Hostile - elseif standing == 3 then + elseif watchedFactionData.reaction == 3 then standingColor = "|cffee6622" --Unfriendly - elseif standing == 4 then + elseif watchedFactionData.reaction == 4 then standingColor = "|cffD1BB48" --Neutral - elseif standing == 5 then + elseif watchedFactionData.reaction == 5 then standingColor = "|cff00ff00" --Friendly - elseif standing == 6 then + elseif watchedFactionData.reaction == 6 then standingColor = "|cff00ff88" --Honored - elseif standing == 7 then + elseif watchedFactionData.reaction == 7 then standingColor = "|cff00ffcc" --Revered - elseif standing == 8 then + elseif watchedFactionData.reaction == 8 then standingColor = "|cff00ffff" --Exalted end @@ -801,15 +808,15 @@ function FuXP:OnTextUpdate() local toGo = max - xp if maxRep - currentRep > 0 then - self:SetText(string.format(L["%s: %3.0f%% (%s/%s) (%s) // XP: %3.0f%%/%s to go"], name, ((currentRep - minRep) / (maxRep - minRep)) * 100, numWithCommas(currentRep - minRep), numWithCommas(maxRep - minRep), factionStandingLabel .. "|r", math.floor(xp / max * 100), numWithCommas(toGo))) + self:SetText(string.format(L["%s: %3.0f%% (%s/%s) (%s) // XP: %3.0f%%/%s to go"], watchedFactionData.name, ((currentRep - minRep) / (maxRep - minRep)) * 100, numWithCommas(currentRep - minRep), numWithCommas(maxRep - minRep), factionStandingLabel .. "|r", math.floor(xp / max * 100), numWithCommas(toGo))) else - self:SetText(string.format(L["%s (%s) // XP: %3.0f%%/%s to go"], name, factionStandingLabel .. "|r", math.floor(xp / max * 100), numWithCommas(toGo))) + self:SetText(string.format(L["%s (%s) // XP: %3.0f%%/%s to go"], watchedFactionData.name, factionStandingLabel .. "|r", math.floor(xp / max * 100), numWithCommas(toGo))) end else if currentRep == minRep and minRep == maxRep then -- Max reputation - self:SetText(string.format("%s (%s)", name, factionStandingLabel .. "|r")) + self:SetText(string.format("%s (%s)", watchedFactionData.name, factionStandingLabel .. "|r")) else - self:SetText(string.format(L["%s: %3.0f%% (%s/%s) (%s)"], name, ((currentRep - minRep) / (maxRep - minRep)) * 100 , numWithCommas(currentRep - minRep), numWithCommas(maxRep - minRep), factionStandingLabel .. "|r")) + self:SetText(string.format(L["%s: %3.0f%% (%s/%s) (%s)"], watchedFactionData.name, ((currentRep - minRep) / (maxRep - minRep)) * 100 , numWithCommas(currentRep - minRep), numWithCommas(maxRep - minRep), factionStandingLabel .. "|r")) end end else @@ -843,7 +850,7 @@ function FuXP:OnTooltipUpdate() xpExPercent = "|cff" .. crayon:GetThresholdHexColor(xpExPercent, 1, 25, 50, 75, 100) .. xpExPercent .. "|r" end if GetXPExhaustion() - toLevelXP > 0 then - xpExPercent = "100% + " .. xpExPercent + xpExPercent = "100 + " .. xpExPercent end end @@ -872,16 +879,20 @@ function FuXP:OnTooltipUpdate() end if self.db.profile.ShowRep == true then - local _, standing, _, _, _, factionID = GetWatchedFactionInfo() + local watchedFactionData = C_Reputation.GetWatchedFactionData() - if standing > 0 then -- 'Unknown' usually means that the player just started their character and aren't tracking any faction - local name, _, _, minRep, maxRep, currentRep = GetFactionInfoByID(factionID) + if watchedFactionData then -- nil usually means that the player just started their character and aren't tracking any faction + local factionData = C_Reputation.GetFactionDataByID(watchedFactionData.factionID) + local standing + local minRep = factionData.currentReactionThreshold + local maxRep = factionData.nextReactionThreshold + local currentRep = factionData.currentStanding local standingColor - local renownReputationData = C_MajorFactions.GetMajorFactionData(factionID) - local currentRepParagon, maxRepParagon = C_Reputation.GetFactionParagonInfo(factionID) - local friendshipReputationInfo = C_GossipInfo.GetFriendshipReputation(factionID) + local renownReputationData = C_MajorFactions.GetMajorFactionData(watchedFactionData.factionID) + local currentRepParagon, maxRepParagon = C_Reputation.GetFactionParagonInfo(watchedFactionData.factionID) + local friendshipReputationInfo = C_GossipInfo.GetFriendshipReputation(watchedFactionData.factionID) if renownReputationData ~= nil then maxRep = renownReputationData.renownLevelThreshold @@ -900,36 +911,36 @@ function FuXP:OnTooltipUpdate() currentRep = currentRepParagon % maxRepParagon standing = "|cffB2D7F7Paragon|r" --Paragon - elseif friendshipReputationInfo and friendshipReputationInfo.friendshipFactionID == factionID then + elseif friendshipReputationInfo and friendshipReputationInfo.friendshipFactionID == watchedFactionData.factionID then maxRep = friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.reactionThreshold or friendshipReputationInfo.maxRep currentRep = maxRep - (friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.standing or 0) - local rankInfo = C_GossipInfo.GetFriendshipReputationRanks(factionID) + local rankInfo = C_GossipInfo.GetFriendshipReputationRanks(watchedFactionData.factionID) standing = "|cffffdea1" .. friendshipReputationInfo.reaction .. " (" .. rankInfo.currentLevel .. "/" .. rankInfo.maxLevel .. ")|r" --Friendship else - if standing == 1 then + if watchedFactionData.reaction == 1 then standingColor = "|cffcc2222" --Hated - elseif standing == 2 then + elseif watchedFactionData.reaction == 2 then standingColor = "|cffff0000" --Hostile - elseif standing == 3 then + elseif watchedFactionData.reaction == 3 then standingColor = "|cffee6622" --Unfriendly - elseif standing == 4 then + elseif watchedFactionData.reaction == 4 then standingColor = "|cffD1BB48" --Neutral - elseif standing == 5 then + elseif watchedFactionData.reaction == 5 then standingColor = "|cff00ff00" --Friendly - elseif standing == 6 then + elseif watchedFactionData.reaction == 6 then standingColor = "|cff00ff88" --Honored - elseif standing == 7 then + elseif watchedFactionData.reaction == 7 then standingColor = "|cff00ffcc" --Revered - elseif standing == 8 then + elseif watchedFactionData.reaction == 8 then standingColor = "|cff00ffff" --Exalted end - standing = standingColor .. _G["FACTION_STANDING_LABEL" .. standing] .. "|r" + standing = standingColor .. _G["FACTION_STANDING_LABEL" .. watchedFactionData.reaction] .. "|r" end tablet:AddCategory( - 'text', "|cffe3e3e3" .. name .. "|r", + 'text', "|cffe3e3e3" .. watchedFactionData.name .. "|r", 'justify', 'CENTER', 'size', 13, 'hideBlankLine', not showXPBar @@ -968,7 +979,7 @@ function FuXP:OnTooltipUpdate() 'wrap', true ) end - elseif friendshipReputationInfo.friendshipFactionID == factionID then + elseif friendshipReputationInfo.friendshipFactionID == watchedFactionData.factionID then local repCat3 = tablet:AddCategory() repCat3:AddLine( @@ -985,7 +996,7 @@ end function FuXP:OnClick() local renownReputationData = C_MajorFactions.GetMajorFactionData(watchedFactionID) - if renownReputationData ~= nil and renownReputationData.isUnlocked then + if renownReputationData and renownReputationData.isUnlocked then tablet:Close() MajorFactions_LoadUI(); diff --git a/FuBar_FuXPFu/FuBar_FuXPFu.toc b/FuBar_FuXPFu/FuBar_FuXPFu.toc index 56ff4fe..3434331 100644 --- a/FuBar_FuXPFu/FuBar_FuXPFu.toc +++ b/FuBar_FuXPFu/FuBar_FuXPFu.toc @@ -1,10 +1,10 @@ -## Interface: 100105 +## Interface: 110002 ## Title: FuBar - |cffffffffFuXP|r|cff00ff00Fu|r ## Title-koKR: |CFF99FF99F|CFFFFFFFFu|CFF99FF99B|CFFFFFFFFar - |cffffffffFuXP|r|cff00ff00Fu|r ## Notes: Lightweight XP Bar ## Notes-zhCN: 迷你经验条 ## Notes-zhTW: 輕量級的經驗值條模組。 -## Version: 10.1.5.0 +## Version: 11.0.0.0 ## Author: Wobin, azuraji ## eMail: wobster@gmail.com ## X-Credits: Bant (For the design) diff --git a/FuBar_FuXPFu/Libs/AceAddon-2.0/AceAddon-2.0.lua b/FuBar_FuXPFu/Libs/AceAddon-2.0/AceAddon-2.0.lua index 0836fbc..aed910a 100644 --- a/FuBar_FuXPFu/Libs/AceAddon-2.0/AceAddon-2.0.lua +++ b/FuBar_FuXPFu/Libs/AceAddon-2.0/AceAddon-2.0.lua @@ -560,10 +560,10 @@ function AceAddon:InitializeAddon(addon, name) if addon.name == nil then addon.name = name end - if GetAddOnMetadata then + if C_AddOns.GetAddOnMetadata then -- TOC checks if addon.title == nil then - addon.title = GetAddOnMetadata(name, "Title") + addon.title = C_AddOns.GetAddOnMetadata(name, "Title") end if type(addon.title) == "string" then local num = addon.title:find(" |cff7fff7f %-Ace2%-|r$") @@ -573,13 +573,13 @@ function AceAddon:InitializeAddon(addon, name) addon.title = addon.title:trim() end if addon.notes == nil then - addon.notes = GetAddOnMetadata(name, "Notes") + addon.notes = C_AddOns.GetAddOnMetadata(name, "Notes") end if type(addon.notes) == "string" then addon.notes = addon.notes:trim() end if addon.version == nil then - addon.version = GetAddOnMetadata(name, "Version") + addon.version = C_AddOns.GetAddOnMetadata(name, "Version") end if type(addon.version) == "string" then if addon.version:find("%$Revision: (%d+) %$") then @@ -592,25 +592,25 @@ function AceAddon:InitializeAddon(addon, name) addon.version = addon.version:trim() end if addon.author == nil then - addon.author = GetAddOnMetadata(name, "Author") + addon.author = C_AddOns.GetAddOnMetadata(name, "Author") end if type(addon.author) == "string" then addon.author = addon.author:trim() end if addon.credits == nil then - addon.credits = GetAddOnMetadata(name, "X-Credits") + addon.credits = C_AddOns.GetAddOnMetadata(name, "X-Credits") end if type(addon.credits) == "string" then addon.credits = addon.credits:trim() end if addon.donate == nil then - addon.donate = GetAddOnMetadata(name, "X-Donate") + addon.donate = C_AddOns.GetAddOnMetadata(name, "X-Donate") end if type(addon.donate) == "string" then addon.donate = addon.donate:trim() end if addon.date == nil then - addon.date = GetAddOnMetadata(name, "X-Date") or GetAddOnMetadata(name, "X-ReleaseDate") + addon.date = C_AddOns.GetAddOnMetadata(name, "X-Date") or C_AddOns.GetAddOnMetadata(name, "X-ReleaseDate") end if type(addon.date) == "string" then if addon.date:find("%$Date: (.-) %$") then @@ -622,25 +622,25 @@ function AceAddon:InitializeAddon(addon, name) end if addon.category == nil then - addon.category = GetAddOnMetadata(name, "X-Category") + addon.category = C_AddOns.GetAddOnMetadata(name, "X-Category") end if type(addon.category) == "string" then addon.category = addon.category:trim() end if addon.email == nil then - addon.email = GetAddOnMetadata(name, "X-eMail") or GetAddOnMetadata(name, "X-Email") + addon.email = C_AddOns.GetAddOnMetadata(name, "X-eMail") or C_AddOns.GetAddOnMetadata(name, "X-Email") end if type(addon.email) == "string" then addon.email = addon.email:trim() end if addon.license == nil then - addon.license = GetAddOnMetadata(name, "X-License") + addon.license = C_AddOns.GetAddOnMetadata(name, "X-License") end if type(addon.license) == "string" then addon.license = addon.license:trim() end if addon.website == nil then - addon.website = GetAddOnMetadata(name, "X-Website") + addon.website = C_AddOns.GetAddOnMetadata(name, "X-Website") end if type(addon.website) == "string" then addon.website = addon.website:trim() @@ -1000,8 +1000,8 @@ function AceAddon.prototype:init() AceAddon:RegisterEvent("ADDON_LOADED", "ADDON_LOADED") local names = {} - for i = 1, GetNumAddOns() do - if IsAddOnLoaded(i) then names[GetAddOnInfo(i)] = true end + for i = 1, C_AddOns.GetNumAddOns() do + if C_AddOns.IsAddOnLoaded(i) then names[C_AddOns.GetAddOnInfo(i)] = true end end self.possibleNames = names table.insert(AceAddon.nextAddon, self) @@ -1087,7 +1087,7 @@ local function external(self, major, instance) AceConsole = instance local slashCommands = { "/ace2" } - local _,_,_,enabled,loadable = GetAddOnInfo("Ace") + local _,_,_,enabled,loadable = C_AddOns.GetAddOnInfo("Ace") if not enabled or not loadable then table.insert(slashCommands, "/ace") end @@ -1119,15 +1119,15 @@ local function external(self, major, instance) end local function listNormalAddon(i) - local name,_,_,loadable = GetAddOnInfo(i) + local name,_,_,loadable = C_AddOns.GetAddOnInfo(i) -- local enableState = GetAddOnEnableState(nil, i) -- local enabled = enableState == 1 or enableState == 2 local enabled = loadable if self.addons[name] then listAddon(self.addons[name]) else - local s = " - " .. tostring(GetAddOnMetadata(i, "Title") or name) - local version = GetAddOnMetadata(i, "Version") + local s = " - " .. tostring(C_AddOns.GetAddOnMetadata(i, "Title") or name) + local version = C_AddOns.GetAddOnMetadata(i, "Version") if version then if version:find("%$Revision: (%d+) %$") then version = version:gsub("%$Revision: (%d+) %$", "%1") @@ -1141,7 +1141,7 @@ local function external(self, major, instance) if not enabled then s = s .. " |cffff0000(disabled)|r" end - if IsAddOnLoadOnDemand(i) then + if C_AddOns.IsAddOnLoadOnDemand(i) then s = s .. " |cff00ff00[LoD]|r" end print(s) @@ -1189,8 +1189,8 @@ local function external(self, major, instance) name = "All", type = "execute", func = function() - print("|cffffff7fAddonYY list:|r") - local count = GetNumAddOns() + print("|cffffff7fAddon list:|r") + local count = C_AddOns.AddOns() for i = 1, count do listNormalAddon(i) end @@ -1202,9 +1202,9 @@ local function external(self, major, instance) type = "execute", func = function() print("|cffffff7fAddon list:|r") - local count = GetNumAddOns() + local count = C_AddOns.GetNumAddOns() for i = 1, count do - local _,_,_,loadable = GetAddOnInfo(i) + local _,_,_,loadable = C_AddOns.GetAddOnInfo(i) if loadable then listNormalAddon(i) end @@ -1217,9 +1217,9 @@ local function external(self, major, instance) type = "execute", func = function() print("|cffffff7fAddon list:|r") - local count = GetNumAddOns() + local count = C_AddOns.GetNumAddOns() for i = 1, count do - local _,_,_,loadable = GetAddOnInfo(i) + local _,_,_,loadable = C_AddOns.GetAddOnInfo(i) if not loadable then listNormalAddon(i) end @@ -1232,9 +1232,9 @@ local function external(self, major, instance) type = "execute", func = function() print("|cffffff7fAddon list:|r") - local count = GetNumAddOns() + local count = C_AddOns.GetNumAddOns() for i = 1, count do - if IsAddOnLoadOnDemand(i) then + if C_AddOns.IsAddOnLoadOnDemand(i) then listNormalAddon(i) end end @@ -1246,9 +1246,9 @@ local function external(self, major, instance) type = "execute", func = function() print("|cffffff7fAddon list:|r") - local count = GetNumAddOns() + local count = C_AddOns.GetNumAddOns() for i = 1, count do - local dep1, dep2, dep3, dep4 = GetAddOnDependencies(i) + local dep1, dep2, dep3, dep4 = C_AddOns.GetAddOnDependencies(i) if dep1 == "Ace" or dep2 == "Ace" or dep3 == "Ace" or dep4 == "Ace" then listNormalAddon(i) end @@ -1289,9 +1289,9 @@ local function external(self, major, instance) for i,v in ipairs(arg) do arg[i] = v:gsub('%*', '.*'):gsub('%%', '%%%%'):lower() end - local count = GetNumAddOns() + local count = C_AddOns.GetNumAddOns() for i = 1, count do - local name = GetAddOnInfo(i) + local name = C_AddOns.GetAddOnInfo(i) local good = true for _,v in ipairs(arg) do if not name:lower():find(v) then @@ -1317,15 +1317,19 @@ local function external(self, major, instance) set = function(...) for i = 1, select("#", ...) do local addon = select(i, ...) - local name, title, _, enabled, _, reason = GetAddOnInfo(addon) + local name, title, _, loadable, reason = C_AddOns.GetAddOnInfo(addon) + local enableState = C_AddOns.GetAddOnEnableState(nil, addon) + if reason == "MISSING" then print(("|cffffff7fAce2:|r AddOn %q does not exist."):format(addon)) - elseif not enabled then - EnableAddOn(addon) - print(("|cffffff7fAce2:|r %s is now enabled."):format(addon or name)) - else - print(("|cffffff7fAce2:|r %s is already enabled."):format(addon or name)) - end + elseif loadable then + if enableState == 0 then + EnableAddOn(addon) + print(("|cffffff7fAce2:|r %s is now enabled."):format(addon or name)) + else + print(("|cffffff7fAce2:|r %s is already enabled."):format(addon or name)) + end + end end end, }, @@ -1339,15 +1343,20 @@ local function external(self, major, instance) set = function(...) for i = 1, select("#", ...) do local addon = select(i, ...) - local name, title, _, enabled, _, reason = GetAddOnInfo(addon) + + local name, title, _, loadable, reason = C_AddOns.GetAddOnInfo(addon) + local enableState = C_AddOns.GetAddOnEnableState(nil, addon) + if reason == "MISSING" then - print(("|cffffff7fAce2:|r AddOn %q does not exist."):format(addon)) - elseif enabled then - DisableAddOn(addon) - print(("|cffffff7fAce2:|r %s is now disabled."):format(addon or name)) - else - print(("|cffffff7fAce2:|r %s is already disabled."):format(addon or name)) - end + print(("|cffffff7fAce2:|r AddOn %q does not exist."):format(addon)) + elseif loadable then + if enableState == 1 or enableState == 2 then + DisableAddOn(addon) + print(("|cffffff7fAce2:|r %s is now disabled."):format(addon or name)) + else + print(("|cffffff7fAce2:|r %s is already disabled."):format(addon or name)) + end + end end end, }, @@ -1361,7 +1370,7 @@ local function external(self, major, instance) set = function(...) for i = 1, select("#", ...) do local addon = select(i, ...) - local name, title, _, _, loadable, reason = GetAddOnInfo(addon) + local name, title, _, loadable, reason = C_AddOns.GetAddOnInfo(addon) if reason == "MISSING" then print(("|cffffff7fAce2:|r AddOn %q does not exist."):format(addon)) elseif not loadable then @@ -1389,22 +1398,24 @@ local function external(self, major, instance) print((" - |cffffff7fLatency [|r%.0f ms|cffffff7f]|r"):format(latency)) print((" - |cffffff7fBandwidth in [|r%.0f B/s|cffffff7f]|r"):format(bandwidthIn)) print((" - |cffffff7fBandwidth out [|r%.0f B/s|cffffff7f]|r"):format(bandwidthOut)) - print((" - |cffffff7fTotal addons [|r%d|cffffff7f]|r"):format(GetNumAddOns())) + print((" - |cffffff7fTotal addons [|r%d|cffffff7f]|r"):format(C_AddOns.GetNumAddOns())) print((" - |cffffff7fAce2 addons [|r%d|cffffff7f]|r"):format(#self.addons)) local ace = 0 local enabled = 0 local disabled = 0 local lod = 0 - for i = 1, GetNumAddOns() do - local dep1, dep2, dep3, dep4 = GetAddOnDependencies(i) + for i = 1, C_AddOns.GetNumAddOns() do + local dep1, dep2, dep3, dep4 = C_AddOns.GetAddOnDependencies(i) if dep1 == "Ace" or dep2 == "Ace" or dep3 == "Ace" or dep4 == "Ace" then ace = ace + 1 end - if IsAddOnLoadOnDemand(i) then + if C_AddOns.IsAddOnLoadOnDemand(i) then lod = lod + 1 end - local isActive, loadable = select(4, GetAddOnInfo(i)) - if not isActive or not loadable then + local loadable = select(4, C_AddOns.GetAddOnInfo(i)) + local enableState = C_AddOns.GetAddOnEnableState(nil, i) + + if not loadable or enableState == 0 then disabled = disabled + 1 else enabled = enabled + 1 diff --git a/FuBar_FuXPFu/Libs/AceAddon-2.0/AceAddon-2.0.toc b/FuBar_FuXPFu/Libs/AceAddon-2.0/AceAddon-2.0.toc index 430b3b9..9b342f7 100644 --- a/FuBar_FuXPFu/Libs/AceAddon-2.0/AceAddon-2.0.toc +++ b/FuBar_FuXPFu/Libs/AceAddon-2.0/AceAddon-2.0.toc @@ -1,4 +1,4 @@ -## Interface: 100105 +## Interface: 110002 ## X-Curse-Packaged-Version: r1101 ## X-Curse-Project-Name: Ace2 ## X-Curse-Project-ID: ace2 diff --git a/FuBar_FuXPFu/Libs/AceConsole-2.0/AceConsole-2.0.lua b/FuBar_FuXPFu/Libs/AceConsole-2.0/AceConsole-2.0.lua index c72036a..3d510c7 100644 --- a/FuBar_FuXPFu/Libs/AceConsole-2.0/AceConsole-2.0.lua +++ b/FuBar_FuXPFu/Libs/AceConsole-2.0/AceConsole-2.0.lua @@ -2664,7 +2664,7 @@ local function activate(self, oldLib, oldDeactivate) self:RegisterChatCommand("/reload", "/rl", "/reloadui", ReloadUI, "RELOAD") self:RegisterChatCommand("/gm", ToggleHelpFrame, "GM") local t = { "/print", "/echo" } - local _,_,_,enabled,loadable = GetAddOnInfo("DevTools") + local _,_,_,enabled,loadable = C_AddOns.GetAddOnInfo("DevTools") if not enabled and not loadable then table.insert(t, "/dump") end diff --git a/FuBar_FuXPFu/Libs/AceConsole-2.0/AceConsole-2.0.toc b/FuBar_FuXPFu/Libs/AceConsole-2.0/AceConsole-2.0.toc index c5c0b81..ae87ab4 100644 --- a/FuBar_FuXPFu/Libs/AceConsole-2.0/AceConsole-2.0.toc +++ b/FuBar_FuXPFu/Libs/AceConsole-2.0/AceConsole-2.0.toc @@ -1,4 +1,4 @@ -## Interface: 100105 +## Interface: 110002 ## X-Curse-Packaged-Version: r1101 ## X-Curse-Project-Name: Ace2 ## X-Curse-Project-ID: ace2 diff --git a/FuBar_FuXPFu/Libs/AceDB-2.0/AceDB-2.0.toc b/FuBar_FuXPFu/Libs/AceDB-2.0/AceDB-2.0.toc index 8ed47c9..da4eba1 100644 --- a/FuBar_FuXPFu/Libs/AceDB-2.0/AceDB-2.0.toc +++ b/FuBar_FuXPFu/Libs/AceDB-2.0/AceDB-2.0.toc @@ -1,4 +1,4 @@ -## Interface: 100105 +## Interface: 110002 ## X-Curse-Packaged-Version: r1101 ## X-Curse-Project-Name: Ace2 ## X-Curse-Project-ID: ace2 diff --git a/FuBar_FuXPFu/Libs/AceEvent-2.0/AceEvent-2.0.toc b/FuBar_FuXPFu/Libs/AceEvent-2.0/AceEvent-2.0.toc index 86ddaf9..c3196e7 100644 --- a/FuBar_FuXPFu/Libs/AceEvent-2.0/AceEvent-2.0.toc +++ b/FuBar_FuXPFu/Libs/AceEvent-2.0/AceEvent-2.0.toc @@ -1,4 +1,4 @@ -## Interface: 100105 +## Interface: 110002 ## X-Curse-Packaged-Version: r1101 ## X-Curse-Project-Name: Ace2 ## X-Curse-Project-ID: ace2 diff --git a/FuBar_FuXPFu/Libs/AceHook-2.1/AceHook-2.1.toc b/FuBar_FuXPFu/Libs/AceHook-2.1/AceHook-2.1.toc index 6a77b7e..31148bd 100644 --- a/FuBar_FuXPFu/Libs/AceHook-2.1/AceHook-2.1.toc +++ b/FuBar_FuXPFu/Libs/AceHook-2.1/AceHook-2.1.toc @@ -1,4 +1,4 @@ -## Interface: 100105 +## Interface: 110002 ## Title: Lib: AceHook-2.1 ## Notes: AddOn development framework diff --git a/FuBar_FuXPFu/Libs/AceLibrary/AceLibrary.lua b/FuBar_FuXPFu/Libs/AceLibrary/AceLibrary.lua index 8ff1742..e040551 100644 --- a/FuBar_FuXPFu/Libs/AceLibrary/AceLibrary.lua +++ b/FuBar_FuXPFu/Libs/AceLibrary/AceLibrary.lua @@ -20,7 +20,7 @@ License: LGPL v2.1 local ACELIBRARY_MAJOR = "AceLibrary" local ACELIBRARY_MINOR = 90000 + tonumber(("$Revision: 1091 $"):match("(%d+)")) -local _G = getfenv(0) +local _G = _G local previous = _G[ACELIBRARY_MAJOR] if previous and not previous:IsNewVersion(ACELIBRARY_MAJOR, ACELIBRARY_MINOR) then return end @@ -357,13 +357,13 @@ end local function TryToEnable(addon) if DONT_ENABLE_LIBRARIES then return end - local isondemand = IsAddOnLoadOnDemand(addon) + local isondemand = C_AddOns.IsAddOnLoadOnDemand(addon) if isondemand then - local _, _, _, enabled = GetAddOnInfo(addon) - EnableAddOn(addon) - local _, _, _, _, loadable = GetAddOnInfo(addon) + local _, _, _, enabled = C_AddOns.GetAddOnInfo(addon) + C_AddOns.EnableAddOn(addon) + local _, _, _, _, loadable = C_AddOns.GetAddOnInfo(addon) if not loadable and not enabled then - DisableAddOn(addon) + C_AddOns.DisableAddOn(addon) end return loadable @@ -381,7 +381,7 @@ local function TryToLoadStandalone(major) AceLibrary.scannedlibs[major] = true - local name, _, _, enabled, loadable = GetAddOnInfo(major) + local name, _, _, enabled, loadable = C_AddOns.GetAddOnInfo(major) loadable = (enabled and loadable) or TryToEnable(name) @@ -392,9 +392,9 @@ local function TryToLoadStandalone(major) end local field = "X-AceLibrary-" .. major - for i = 1, GetNumAddOns() do - if GetAddOnMetadata(i, field) then - name, _, _, enabled, loadable = GetAddOnInfo(i) + for i = 1, C_AddOns.GetNumAddOns() do + if C_AddOns.GetAddOnMetadata(i, field) then + name, _, _, enabled, loadable = C_AddOns.GetAddOnInfo(i) loadable = (enabled and loadable) or TryToEnable(name) if loadable then @@ -478,11 +478,13 @@ end -- @return The library with the given major/minor version. function AceLibrary:GetInstance(major, minor) argCheck(self, major, 2, "string") + if minor ~= false then TryToLoadStandalone(major) end local data, ver = LibStub:GetLibrary(major, true) + if not data then if self.libs[major] then data, ver = self.libs[major].instance, self.libs[major].minor @@ -505,6 +507,7 @@ function AceLibrary:GetInstance(major, minor) _G.error(("Cannot find a library instance of %s, minor version %d."):format(major, minor), 2) end end + --print(major, data) return data end diff --git a/FuBar_FuXPFu/Libs/AceLibrary/AceLibrary.toc b/FuBar_FuXPFu/Libs/AceLibrary/AceLibrary.toc index feb085d..7594b1e 100644 --- a/FuBar_FuXPFu/Libs/AceLibrary/AceLibrary.toc +++ b/FuBar_FuXPFu/Libs/AceLibrary/AceLibrary.toc @@ -1,4 +1,4 @@ -## Interface: 100105 +## Interface: 110002 ## X-Curse-Packaged-Version: r1101 ## X-Curse-Project-Name: Ace2 ## X-Curse-Project-ID: ace2 diff --git a/FuBar_FuXPFu/Libs/AceLocale-2.2/AceLocale-2.2.toc b/FuBar_FuXPFu/Libs/AceLocale-2.2/AceLocale-2.2.toc index 8672a9a..b46b14b 100644 --- a/FuBar_FuXPFu/Libs/AceLocale-2.2/AceLocale-2.2.toc +++ b/FuBar_FuXPFu/Libs/AceLocale-2.2/AceLocale-2.2.toc @@ -1,4 +1,4 @@ -## Interface: 100105 +## Interface: 110002 ## X-Curse-Packaged-Version: r1101 ## X-Curse-Project-Name: Ace2 ## X-Curse-Project-ID: ace2 diff --git a/FuBar_FuXPFu/Libs/AceOO-2.0/AceOO-2.0.toc b/FuBar_FuXPFu/Libs/AceOO-2.0/AceOO-2.0.toc index bbcaa55..4661723 100644 --- a/FuBar_FuXPFu/Libs/AceOO-2.0/AceOO-2.0.toc +++ b/FuBar_FuXPFu/Libs/AceOO-2.0/AceOO-2.0.toc @@ -1,4 +1,4 @@ -## Interface: 100105 +## Interface: 110002 ## X-Curse-Packaged-Version: r1101 ## X-Curse-Project-Name: Ace2 ## X-Curse-Project-ID: ace2 diff --git a/FuBar_FuXPFu/Libs/CrayonLib/AceLibrary/AceLibrary.lua b/FuBar_FuXPFu/Libs/CrayonLib/AceLibrary/AceLibrary.lua index 8ff1742..5e419c0 100644 --- a/FuBar_FuXPFu/Libs/CrayonLib/AceLibrary/AceLibrary.lua +++ b/FuBar_FuXPFu/Libs/CrayonLib/AceLibrary/AceLibrary.lua @@ -357,11 +357,11 @@ end local function TryToEnable(addon) if DONT_ENABLE_LIBRARIES then return end - local isondemand = IsAddOnLoadOnDemand(addon) + local isondemand = C_AddOns.IsAddOnLoadOnDemand(addon) if isondemand then - local _, _, _, enabled = GetAddOnInfo(addon) + local _, _, _, enabled = C_AddOns.GetAddOnInfo(addon) EnableAddOn(addon) - local _, _, _, _, loadable = GetAddOnInfo(addon) + local _, _, _, _, loadable = C_AddOns.GetAddOnInfo(addon) if not loadable and not enabled then DisableAddOn(addon) end @@ -381,7 +381,7 @@ local function TryToLoadStandalone(major) AceLibrary.scannedlibs[major] = true - local name, _, _, enabled, loadable = GetAddOnInfo(major) + local name, _, _, enabled, loadable = C_AddOns.GetAddOnInfo(major) loadable = (enabled and loadable) or TryToEnable(name) @@ -392,9 +392,9 @@ local function TryToLoadStandalone(major) end local field = "X-AceLibrary-" .. major - for i = 1, GetNumAddOns() do - if GetAddOnMetadata(i, field) then - name, _, _, enabled, loadable = GetAddOnInfo(i) + for i = 1, C_AddOns.GetNumAddOns() do + if C_AddOns.GetAddOnMetadata(i, field) then + name, _, _, enabled, loadable = C_AddOns.GetAddOnInfo(i) loadable = (enabled and loadable) or TryToEnable(name) if loadable then diff --git a/FuBar_FuXPFu/Libs/CrayonLib/AceLibrary/AceLibrary.toc b/FuBar_FuXPFu/Libs/CrayonLib/AceLibrary/AceLibrary.toc index 35f9967..22f594a 100644 --- a/FuBar_FuXPFu/Libs/CrayonLib/AceLibrary/AceLibrary.toc +++ b/FuBar_FuXPFu/Libs/CrayonLib/AceLibrary/AceLibrary.toc @@ -1,4 +1,4 @@ -## Interface: 100105 +## Interface: 110002 ## X-Curse-Packaged-Version: r1094 ## X-Curse-Project-Name: Ace2 ## X-Curse-Project-ID: ace2 diff --git a/FuBar_FuXPFu/Libs/CrayonLib/CrayonLib.toc b/FuBar_FuXPFu/Libs/CrayonLib/CrayonLib.toc index ca47954..8608cad 100644 --- a/FuBar_FuXPFu/Libs/CrayonLib/CrayonLib.toc +++ b/FuBar_FuXPFu/Libs/CrayonLib/CrayonLib.toc @@ -1,4 +1,4 @@ -## Interface: 100105 +## Interface: 110002 ## LoadOnDemand: 1 ## Title: Lib: Crayon-2.0 ## Notes: A library to provide coloring tools. diff --git a/FuBar_FuXPFu/Libs/FuBarPlugin-2.0/FuBarPlugin-2.0.lua b/FuBar_FuXPFu/Libs/FuBarPlugin-2.0/FuBarPlugin-2.0.lua index c5006bc..8844d8b 100644 --- a/FuBar_FuXPFu/Libs/FuBarPlugin-2.0/FuBarPlugin-2.0.lua +++ b/FuBar_FuXPFu/Libs/FuBarPlugin-2.0/FuBarPlugin-2.0.lua @@ -901,7 +901,7 @@ function FuBarPlugin:IsLoadOnDemand() if not addon then return end - return IsAddOnLoadOnDemand(addon) + return C_AddOns.IsAddOnLoadOnDemand(addon) end function FuBarPlugin:IsDisabled()