You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
4.5 KiB

4 years ago
--- Kaliel's Tracker
5 months ago
--- Copyright (c) 2012-2025, Marouan Sabbagh <mar.sabbagh@gmail.com>
4 years ago
--- All Rights Reserved.
---
--- This file is part of addon Kaliel's Tracker.
5 months ago
---@type KT
4 years ago
local addonName, KT = ...
5 months ago
---@class AddonOthers
local M = KT:NewModule("AddonOthers")
4 years ago
KT.AddonOthers = M
local MSQ = LibStub("Masque", true)
local _DBG = function(...) if _DBG then _DBG("KT", ...) end end
-- WoW API
local _G = _G
local db
local OTF = KT_ObjectiveTrackerFrame
4 years ago
local msqGroup1, msqGroup2
local KTwarning = " |cff00ffffAddon "..KT.title.." is active. "
5 months ago
-- Internal ------------------------------------------------------------------------------------------------------------
4 years ago
-- Masque
local function Masque_SetSupport()
5 months ago
local isLoaded = (KT:CheckAddOn("Masque", "11.1.5") and db.addonMasque)
if isLoaded then
KT:Alert_IncompatibleAddon("Masque", "11.0.1")
4 years ago
msqGroup1 = MSQ:Group(KT.title, "Quest Item Buttons")
msqGroup2 = MSQ:Group(KT.title, "Quest Active Button")
hooksecurefunc(msqGroup2, "__Enable", function(self)
for button in pairs(self.Buttons) do
if button.Style then
button.Style:SetAlpha(0)
end
end
end)
hooksecurefunc(msqGroup2, "__Disable", function(self)
for button in pairs(self.Buttons) do
if button.Style then
button.Style:SetAlpha(1)
end
end
end)
end
end
5 months ago
-- Auctionator
local function Auctionator_SetSupport()
local isLoaded = (KT:CheckAddOn("Auctionator", "275") and db.addonAuctionator)
if isLoaded then
hooksecurefunc(Auctionator.CraftingInfo, "InitializeObjectiveTrackerFrame", function()
local searchFrame = AuctionatorCraftingInfoObjectiveTrackerFrame
searchFrame:SetParent(KT_ProfessionsRecipeTracker.Header)
searchFrame:ClearAllPoints()
searchFrame:SetPoint("TOPRIGHT")
end)
end
end
4 years ago
-- ElvUI
local function ElvUI_SetSupport()
5 months ago
if KT:CheckAddOn("ElvUI", "v13.89", true) then
4 years ago
local E = unpack(_G.ElvUI)
local B = E:GetModule("Blizzard")
B.ObjectiveTracker_Setup = function() end -- preventive
4 years ago
if E.private.skins.blizzard.objectiveTracker then
StaticPopup_Show(addonName.."_ReloadUI", nil, "Activate changes for |cff00ffe3ElvUI|r.")
end
hooksecurefunc(E, "CheckIncompatible", function(self)
self.private.skins.blizzard.objectiveTracker = false
end)
hooksecurefunc(E, "ToggleOptions", function(self)
4 years ago
if E.Libs.AceConfigDialog.OpenFrames[self.name] then
5 months ago
local options = self.Options.args.general.args.blizzardImprovements.args.objectiveFrameGroup
4 years ago
options.args[addonName.."Warning"] = {
name = "\n"..KTwarning,
type = "description",
5 months ago
order = 0,
4 years ago
}
end
end)
end
end
-- Tukui
local function Tukui_SetSupport()
5 months ago
if KT:CheckAddOn("Tukui", "v20.460", true) then
4 years ago
local T = unpack(_G.Tukui)
T.Miscellaneous.ObjectiveTracker.Enable = function() end
end
end
-- RealUI
local function RealUI_SetSupport()
if KT:CheckAddOn("nibRealUI", "2.3.14", true) then
4 years ago
local R = _G.RealUI
local module = "Objectives Adv."
if R:GetModuleEnabled(module) then
R:SetModuleEnabled(module, false)
StaticPopup_Show(addonName.."_ReloadUI", nil, "Activate changes for |cff00ffe3RealUI|r.")
end
end
end
5 months ago
-- External ------------------------------------------------------------------------------------------------------------
4 years ago
function M:OnInitialize()
_DBG("|cffffff00Init|r - "..self:GetName(), true)
db = KT.db.profile
end
function M:OnEnable()
_DBG("|cff00ff00Enable|r - "..self:GetName(), true)
Masque_SetSupport()
5 months ago
Auctionator_SetSupport()
4 years ago
ElvUI_SetSupport()
Tukui_SetSupport()
RealUI_SetSupport()
end
-- Masque
function KT:Masque_AddButton(button, group)
if db.addonMasque and MSQ and msqGroup1 then
if not group or group == 1 then
group = msqGroup1
elseif group == 2 then
group = msqGroup2
end
group:AddButton(button)
if button.Style then
if not group.db.Disabled then
button.Style:SetAlpha(0)
end
end
end
end