-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Masque integration is now evented instead of in-line. * Item frame resizing now resizes all properties manually.
- Loading branch information
Showing
11 changed files
with
85 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
local addonName = ... ---@type string | ||
|
||
---@class BetterBags: AceAddon | ||
local addon = LibStub('AceAddon-3.0'):GetAddon(addonName) | ||
|
||
---@class Events: AceModule | ||
local events = addon:GetModule('Events') | ||
|
||
---@class MasqueTheme: AceModule | ||
---@field groups table<string, MasqueGroup> | ||
local masque = addon:NewModule('Masque') | ||
|
||
---@class Masque: AceAddon | ||
local Masque = LibStub('Masque', true) | ||
|
||
---@private | ||
function masque:AddButtonToGroup(group, button) | ||
if not Masque then | ||
return | ||
end | ||
self.groups[group]:AddButton(button) | ||
end | ||
|
||
---@private | ||
function masque:RemoveButtonFromGroup(group, button) | ||
if not Masque then | ||
return | ||
end | ||
if group == nil then | ||
return | ||
end | ||
self.groups[group]:RemoveButton(button) | ||
end | ||
|
||
function masque:OnEnable() | ||
if not Masque then return end | ||
self.groups = {} | ||
self.groups["Backpack"] = Masque:Group('BetterBags', 'Backpack') | ||
self.groups["Bank"] = Masque:Group('BetterBags', 'Bank') | ||
|
||
events:RegisterMessage('item/Updated', function(_, item) | ||
---@cast item Item | ||
local group = item.kind == 'Bank' and self.groups["Bank"] or self.groups["Backpack"] | ||
group:AddButton(item.button) | ||
item.button.IconBorder:SetBlendMode("BLEND") | ||
end) | ||
|
||
events:RegisterMessage('item/Clearing', function(_, item) | ||
---@cast item Item | ||
local group = item.kind == 'Bank' and self.groups["Bank"] or self.groups["Backpack"] | ||
group:RemoveButton(item.button) | ||
end) | ||
|
||
events:RegisterMessage('bagbutton/Updated', function(_, bag) | ||
---@cast bag BagButton | ||
local group = bag.kind == 'Bank' and self.groups["Bank"] or self.groups["Backpack"] | ||
group:AddButton(bag.frame) | ||
bag.frame.IconBorder:SetBlendMode("BLEND") | ||
end) | ||
|
||
events:RegisterMessage('bagbutton/Clearing', function(_, bag) | ||
---@cast bag BagButton | ||
local group = bag.kind == 'Bank' and self.groups["Bank"] or self.groups["Backpack"] | ||
group:RemoveButton(bag.frame) | ||
end) | ||
|
||
print("BetterBags: Masque integration enabled.") | ||
end |
This file was deleted.
Oops, something went wrong.