Skip to content

Commit

Permalink
Added deprecation warning to all versions of the game.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cidan committed Feb 19, 2024
1 parent 7f04e70 commit 78b5a5b
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions AdiBags.toc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ modules\Masque.lua

core\ItemDatabase.lua
core\DefaultFilters.lua
core\Deprecation.lua

#@debug@
## Version: DEV
Expand Down
1 change: 1 addition & 0 deletions AdiBags_TBC.toc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ modules\Masque.lua

core\ItemDatabase.lua
core\DefaultFilters.lua
core\Deprecation.lua

#@debug@
## Version: DEV
Expand Down
1 change: 1 addition & 0 deletions AdiBags_Vanilla.toc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ modules\Masque.lua

core\ItemDatabase.lua
core\DefaultFilters.lua
core\Deprecation.lua

#@debug@
## Version: DEV
Expand Down
1 change: 1 addition & 0 deletions AdiBags_Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ modules\Masque.lua

core\ItemDatabase.lua
core\DefaultFilters.lua
core\Deprecation.lua

#@debug@
## Version: DEV
Expand Down
1 change: 1 addition & 0 deletions core/Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ addon.DEFAULT_SETTINGS = {
bags = {
["*"] = true,
},
deprecationPhase = 1,
positionMode = "manual",
positions = {
anchor = { point = "BOTTOMRIGHT", xOffset = -32, yOffset = 200 },
Expand Down
1 change: 1 addition & 0 deletions core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ function addon:OnInitialize()
C_CVar.SetCVar("professionAccessorySlotsExampleShown", 1)
end

self:Deprecation()
self:Debug('Initialized')
end

Expand Down
50 changes: 50 additions & 0 deletions core/Deprecation.lua
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 78b5a5b

Please sign in to comment.