|
| 1 | +local addonName = ... |
| 2 | +---@class AdiBags: ABEvent-1.0 |
| 3 | +local addon = LibStub('AceAddon-3.0'):GetAddon(addonName) |
| 4 | + |
| 5 | +-- This is a deprecation message for AdiBags. To remove this for whatever reason, |
| 6 | +-- remove this call from Core.lua in OnInitialize. |
| 7 | +function addon:Deprecation() |
| 8 | + if addon.db.profile.deprecationPhase < 2 then |
| 9 | + print("AdiBags is deprecated and will get no new feature releases.") |
| 10 | + print("Please consider switching to AdiBags' successor, BetterBags.") |
| 11 | + print("BetterBags is available at Curse, Wago, and github.com/Cidan/BetterBags") |
| 12 | + local frame = CreateFrame("Frame", nil, UIParent, "BackdropTemplate") |
| 13 | + frame:SetBackdrop({ |
| 14 | + bgFile = "Interface/Tooltips/UI-Tooltip-Background", |
| 15 | + edgeFile = "Interface/Tooltips/UI-Tooltip-Border", |
| 16 | + tile = true, |
| 17 | + tileSize = 16, |
| 18 | + edgeSize = 16, |
| 19 | + insets = { left = 4, right = 0, top = 4, bottom = 4 } |
| 20 | + }) |
| 21 | + frame:SetBackdropColor(0, 0, 0, 0.9) |
| 22 | + frame:SetPoint("LEFT", 30, 0) |
| 23 | + frame:SetSize(440, 300) |
| 24 | + local text = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge") |
| 25 | + text:SetTextColor(1, 1, 1, 1) |
| 26 | + text:SetPoint("LEFT", 20, 0) |
| 27 | + text:SetJustifyH("LEFT") |
| 28 | + text:SetText([[ |
| 29 | +AdiBags is deprecated, will get no new feature releases, and may or may not get bug fixes over time. |
| 30 | +Please consider switching to AdiBags' successor, BetterBags. |
| 31 | +BetterBags is written by the same team that maintains AdiBags. |
| 32 | +BetterBags is available at Curse, Wago, and github.com/Cidan/BetterBags |
| 33 | +This message will not be shown again, but you can continue to use AdiBags so long as it works. |
| 34 | +Thanks! :) |
| 35 | + ]]) |
| 36 | + text:SetWordWrap(true) |
| 37 | + text:SetWidth(400) |
| 38 | + --frame:SetSize(text:GetStringWidth()+ 40, 200) |
| 39 | + |
| 40 | + local button = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") |
| 41 | + button:SetSize(180, 25) |
| 42 | + button:SetPoint("BOTTOM", 0, 10) |
| 43 | + button:SetText("Do Not Show Again") |
| 44 | + button:SetScript("OnClick", function() |
| 45 | + addon.db.profile.deprecationPhase = 2 |
| 46 | + frame:Hide() |
| 47 | + end) |
| 48 | + frame:Show() |
| 49 | + end |
| 50 | +end |
0 commit comments