From 78b5a5b30ad3a91007417c936c6491d9c2348894 Mon Sep 17 00:00:00 2001 From: Antonio Lobato Date: Sun, 18 Feb 2024 21:29:34 -0800 Subject: [PATCH] Added deprecation warning to all versions of the game. --- AdiBags.toc | 1 + AdiBags_TBC.toc | 1 + AdiBags_Vanilla.toc | 1 + AdiBags_Wrath.toc | 1 + core/Constants.lua | 1 + core/Core.lua | 1 + core/Deprecation.lua | 50 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 56 insertions(+) create mode 100644 core/Deprecation.lua diff --git a/AdiBags.toc b/AdiBags.toc index 25f3b45..531e856 100644 --- a/AdiBags.toc +++ b/AdiBags.toc @@ -86,6 +86,7 @@ modules\Masque.lua core\ItemDatabase.lua core\DefaultFilters.lua +core\Deprecation.lua #@debug@ ## Version: DEV diff --git a/AdiBags_TBC.toc b/AdiBags_TBC.toc index 89233d8..2c7d44d 100644 --- a/AdiBags_TBC.toc +++ b/AdiBags_TBC.toc @@ -78,6 +78,7 @@ modules\Masque.lua core\ItemDatabase.lua core\DefaultFilters.lua +core\Deprecation.lua #@debug@ ## Version: DEV diff --git a/AdiBags_Vanilla.toc b/AdiBags_Vanilla.toc index 5260a2d..f0dde88 100644 --- a/AdiBags_Vanilla.toc +++ b/AdiBags_Vanilla.toc @@ -82,6 +82,7 @@ modules\Masque.lua core\ItemDatabase.lua core\DefaultFilters.lua +core\Deprecation.lua #@debug@ ## Version: DEV diff --git a/AdiBags_Wrath.toc b/AdiBags_Wrath.toc index f31c3a2..6f850c9 100644 --- a/AdiBags_Wrath.toc +++ b/AdiBags_Wrath.toc @@ -82,6 +82,7 @@ modules\Masque.lua core\ItemDatabase.lua core\DefaultFilters.lua +core\Deprecation.lua #@debug@ ## Version: DEV diff --git a/core/Constants.lua b/core/Constants.lua index 7781e33..c95bda4 100644 --- a/core/Constants.lua +++ b/core/Constants.lua @@ -194,6 +194,7 @@ addon.DEFAULT_SETTINGS = { bags = { ["*"] = true, }, + deprecationPhase = 1, positionMode = "manual", positions = { anchor = { point = "BOTTOMRIGHT", xOffset = -32, yOffset = 200 }, diff --git a/core/Core.lua b/core/Core.lua index dfa2431..58fc13f 100644 --- a/core/Core.lua +++ b/core/Core.lua @@ -111,6 +111,7 @@ function addon:OnInitialize() C_CVar.SetCVar("professionAccessorySlotsExampleShown", 1) end + self:Deprecation() self:Debug('Initialized') end diff --git a/core/Deprecation.lua b/core/Deprecation.lua new file mode 100644 index 0000000..f376650 --- /dev/null +++ b/core/Deprecation.lua @@ -0,0 +1,50 @@ +local addonName = ... +---@class AdiBags: ABEvent-1.0 +local addon = LibStub('AceAddon-3.0'):GetAddon(addonName) + +-- This is a deprecation message for AdiBags. To remove this for whatever reason, +-- remove this call from Core.lua in OnInitialize. +function addon:Deprecation() + if addon.db.profile.deprecationPhase < 2 then + print("AdiBags is deprecated and will get no new feature releases.") + print("Please consider switching to AdiBags' successor, BetterBags.") + print("BetterBags is available at Curse, Wago, and github.com/Cidan/BetterBags") + local frame = CreateFrame("Frame", nil, UIParent, "BackdropTemplate") + frame:SetBackdrop({ + bgFile = "Interface/Tooltips/UI-Tooltip-Background", + edgeFile = "Interface/Tooltips/UI-Tooltip-Border", + tile = true, + tileSize = 16, + edgeSize = 16, + insets = { left = 4, right = 0, top = 4, bottom = 4 } + }) + frame:SetBackdropColor(0, 0, 0, 0.9) + frame:SetPoint("LEFT", 30, 0) + frame:SetSize(440, 300) + local text = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge") + text:SetTextColor(1, 1, 1, 1) + text:SetPoint("LEFT", 20, 0) + text:SetJustifyH("LEFT") + text:SetText([[ +AdiBags is deprecated, will get no new feature releases, and may or may not get bug fixes over time. +Please consider switching to AdiBags' successor, BetterBags. +BetterBags is written by the same team that maintains AdiBags. +BetterBags is available at Curse, Wago, and github.com/Cidan/BetterBags +This message will not be shown again, but you can continue to use AdiBags so long as it works. +Thanks! :) + ]]) + text:SetWordWrap(true) + text:SetWidth(400) + --frame:SetSize(text:GetStringWidth()+ 40, 200) + + local button = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") + button:SetSize(180, 25) + button:SetPoint("BOTTOM", 0, 10) + button:SetText("Do Not Show Again") + button:SetScript("OnClick", function() + addon.db.profile.deprecationPhase = 2 + frame:Hide() + end) + frame:Show() + end +end