Skip to content

Commit

Permalink
Fixed a bug where bag opacity was ignored in non-retail builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cidan committed May 19, 2024
1 parent ab1b0f3 commit 0ef634e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/database.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ function DB:SetFirstTimeMenu(value)
DB.data.profile.firstTimeMenu = value
end

---@param kind BagKind
---@param view BagView
---@param opacity number
function DB:SetBagViewSizeOpacity(kind, view, opacity)
DB.data.profile.size[view][kind].opacity = opacity
end
Expand Down
2 changes: 2 additions & 0 deletions frames/classic/bag.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function bagFrame:Create(kind)
b.toRelease = {}
b.toReleaseSections = {}
b.kind = kind
local sizeInfo = database:GetBagSizeInfo(b.kind, database:GetBagView(b.kind))
local name = kind == const.BAG_KIND.BACKPACK and "Backpack" or "Bank"
-- The main display frame for the bag.
---@class Frame: BetterBagsClassicBagPortrait
Expand Down Expand Up @@ -123,6 +124,7 @@ function bagFrame:Create(kind)
ButtonFrameTemplate_HidePortrait(b.frame)
ButtonFrameTemplate_HideButtonBar(b.frame)
b.frame.Inset:Hide()
b.frame.Bg:SetAlpha(sizeInfo.opacity / 100)
b.frame:SetTitle(L:G(kind == const.BAG_KIND.BACKPACK and "Backpack" or "Bank"))
b.frame.CloseButton:SetScript("OnClick", function()
b:Hide()
Expand Down

0 comments on commit 0ef634e

Please sign in to comment.