Skip to content

Commit

Permalink
1.0.8
Browse files Browse the repository at this point in the history
Added Button to Blizzard Warband Bank UI to open the Log window
  • Loading branch information
Noshei committed Dec 15, 2024
1 parent 77761c4 commit 2105bc3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"EventUtil",
"Baganator_CategoryViewBankViewFrame",
"Baganator_SingleViewBankViewFrame",
"Baganator"
"Baganator",
"AccountBankPanel"
],
"Lua.diagnostics.disable": ["assign-type-mismatch"]
}
1 change: 1 addition & 0 deletions Broker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function WBL:InitializeBroker()
local dataObj = ldb:NewDataObject(WBL.metaData.name, {
type = "launcher",
icon = 1505935,
label = "Warband Bank Log",
OnClick = function(frame, button)
if button == "LeftButton" then
WBL_API:Toggle()
Expand Down
14 changes: 14 additions & 0 deletions Display.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ function WBL:CreateDisplay()
WBL:InitializeDataProvider()
end

function WBL:CreateBankButton()
local WBLButton = CreateFrame("Button", "WBLBlizzardButton", AccountBankPanel, "UIPanelButtonTemplate")
WBLButton:SetPoint("BOTTOMLEFT", 2, 6)
WBLButton:SetSize(105, 21)
WBLButton:SetFrameLevel(700)
WBLButton:SetText("Log")

WBLButton:SetScript("OnClick", function()
WBL_API:Toggle()
end)

WBL.Display.Button = WBLButton
end

function WBL:InitializeDataProvider()
if #WBL.Logs == 0 then
return
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EventUtil.ContinueOnAddOnLoaded("Baganator", function()
end
local parent = details.region.Warband

local WBLButton = CreateFrame("Button", "WarbandBankLogButton", parent, "WBLBaganatorIcon")
local WBLButton = CreateFrame("Button", "WBLBaganatorButton", parent, "WBLBaganatorIcon")
WBLButton:SetPoint("TOPLEFT", 5, 0)
WBLButton:SetFrameLevel(700)
WBLButton.tooltipHeader = "Warband Bank Log"
Expand Down
21 changes: 2 additions & 19 deletions Warband-Bank-Log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function WBL:OnInitialize()

WBL:InitializeBroker()
WBL:CreateDisplay()
WBL:CreateBankButton()
WBL:MinimapHandler(WBL.db.profile.minimap.enable)

SLASH_WarbandBankLog1 = "/warbandbanklog"
Expand Down Expand Up @@ -212,6 +213,7 @@ end

---Gets the contents of the Warband Bank and returns a temporary table that will be used to compare to cached data
---see https://warcraft.wiki.gg/wiki/BagID bag ID's that are used for initial loop values
---@param event string
function WBL:GetBankContent(event)
local items = {}
local continuableContainer = ContinuableContainer:Create()
Expand All @@ -221,25 +223,6 @@ function WBL:GetBankContent(event)
if not item:IsItemEmpty() then
table.insert(items, item)
continuableContainer:AddContinuable(item)

--[[if not C_Item.IsItemDataCachedByID(itemInfo.itemID) then
local item = Item:CreateFromBagAndSlot(bag, slot)
item:ContinueOnItemLoad(function()
output("Loaded item")
local chunks = strsplittable(":", item:GetItemLink())
chunks[10] = ""
chunks[11] = ""
local link = table.concat(chunks, ":")
tempBank[link] = (tempBank[link] or 0) + item:GetStackCount()
end)
else
output("Cached item")
local chunks = strsplittable(":", itemInfo.hyperlink)
chunks[10] = ""
chunks[11] = ""
local link = table.concat(chunks, ":")
tempBank[link] = (tempBank[link] or 0) + itemInfo.stackCount
end]]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion Warband-Bank-Log.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: Warband Bank Log
## Notes: Provides a log of which character added or removed items/gold from the Warband Bank
## Author: Noshei
## Version: 1.0.7
## Version: 1.0.8
## SavedVariables: WarbandBankLogDB, WarbandBankLogSettings
## AddonCompartmentFunc: WarbandBankLog_OnAddonCompartmentClick
## IconTexture: 1505935
Expand Down

0 comments on commit 2105bc3

Please sign in to comment.