Skip to content

Commit

Permalink
Stack.fix.7 (#297)
Browse files Browse the repository at this point in the history
* Moved key bindings check to a delayed function call on addon enable, fixing the alert for missing key bindings.

* Fixed slots being redraw if a stack item was removed.

* (Internal) Item categories no longer set the category to the bag name when bag view is shown

* (Internal) Bag view now locally calculates the category name for each bag on render.

* (Internal) Fixed both list and one view for new rendering data

* (Internal) Removed first load code, added some comments.

* Complete rework of how free slots are counted, generated, and displayed.

* Free slots now render for all bag types.

* Added free slots tooltip on mouse over.

* Fixed an error that would happen if a bag type is full.
  • Loading branch information
Cidan authored Mar 18, 2024
1 parent a89d623 commit 74b1e5f
Show file tree
Hide file tree
Showing 17 changed files with 359 additions and 325 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@
"StaticPopup_Show",
"tonumber",
"LE_FRAME_TUTORIAL_MOUNT_EQUIPMENT_SLOT_FRAME",
"GameMenuFrame"
"GameMenuFrame",
"LE_SCRIPT_BINDING_TYPE_INTRINSIC_POSTCALL",
"LE_SCRIPT_BINDING_TYPE_INTRINSIC_PRECALL"
],
"Notes.notesLocation": ".notes",
"Lua.diagnostics.ignoredFiles": "Disable",
Expand Down
2 changes: 1 addition & 1 deletion BetterBags.toc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ core\database.lua
core\hooks.lua

data\equipmentsets.lua
data\items.lua
data\categories.lua
data\items.lua

util\color.lua
util\resize.lua
Expand Down
2 changes: 1 addition & 1 deletion BetterBags_Vanilla.toc
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ core\database.lua
core\hooks.lua

data\equipmentsets.lua
data\items.lua
data\categories.lua
data\items.lua

util\color.lua
util\resize.lua
Expand Down
2 changes: 1 addition & 1 deletion BetterBags_Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ core\database.lua
core\hooks.lua

data\equipmentsets.lua
data\items.lua
data\categories.lua
data\items.lua

util\color.lua
util\resize.lua
Expand Down
15 changes: 15 additions & 0 deletions core/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@ const.BACKPACK_ONLY_REAGENT_BAGS = {
[Enum.BagIndex.ReagentBag] = Enum.BagIndex.ReagentBag,
}

const.ITEM_BAG_FAMILY = {
[0] = L:G("Bags"),
[1] = L:G("Quiver"),
[2] = L:G("Ammo Pouch"),
[4] = L:G("Soul Bag"),
[8] = L:G("Leatherworking Bag"),
[16] = L:G("Inscription Bag"),
[32] = L:G("Herb Bag"),
[64] = L:G("Enchanting Bag"),
[128] = L:G("Engineering Bag"),
[256] = L:G("Keyring"),
[512] = L:G("Gem Bag"),
[1024] = L:G("Mining Bag"),
}

---@enum BagView
const.BAG_VIEW = {
UNDEFINED = 0,
Expand Down
16 changes: 10 additions & 6 deletions core/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ function addon:HideBlizzardBags()
BankFrame:SetScript("OnEvent", nil)
end

local function CheckKeyBindings()
if GetBindingKey("OPENALLBAGS") == nil then
question:Alert("No Binding Set", [[
Better Bags does not have a key binding set for opening all bags.
Please set a key binding for "Open All Bags" in the key bindings menu.
]])
end
end
-- OnEnable is called when the addon is enabled.
function addon:OnEnable()
itemFrame:Enable()
Expand Down Expand Up @@ -173,10 +181,6 @@ function addon:OnEnable()
-- the base UI/UX these screens refer to.
C_CVar.SetCVarBitfield("closedInfoFrames", LE_FRAME_TUTORIAL_EQUIP_REAGENT_BAG --[[@as number]], true)
end
if GetBindingKey("OPENALLBAGS") == nil then
question:Alert("No Binding Set", [[
Better Bags does not have a key binding set for opening all bags.
Please set a key binding for "Open All Bags" in the key bindings menu.
]])
end

C_Timer.After(5, CheckKeyBindings)
end
3 changes: 0 additions & 3 deletions data/categories.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ local addon = LibStub('AceAddon-3.0'):GetAddon(addonName)
---@class Database: AceModule
local database = addon:GetModule('Database')

---@class Items: AceModule
local items = addon:GetModule('Items')

---@class Events: AceModule
local events = addon:GetModule('Events')

Expand Down
Loading

0 comments on commit 74b1e5f

Please sign in to comment.