From 237217ede46309ec4d402dfebcaa1c767322921a Mon Sep 17 00:00:00 2001 From: Sandor Takacs Date: Wed, 22 Oct 2014 17:19:01 +0200 Subject: [PATCH] Add some debug variable --- MyBagsCore/MyBags.lua | 19 +++++++++++++++++-- MyInventory/MyInventory.lua | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/MyBagsCore/MyBags.lua b/MyBagsCore/MyBags.lua index 60082f9..fcfe373 100644 --- a/MyBagsCore/MyBags.lua +++ b/MyBagsCore/MyBags.lua @@ -1,5 +1,5 @@ local MBC = "MyBagsCore-1.0" -local MBC_MINOR = "2014.10.21.1" +local MBC_MINOR = "2014.10.22.5" if not LibStub then error(MBC .. " requires LibStub.") end local MyBagsCore = LibStub:NewLibrary(MBC, MBC_MINOR) if not MyBagsCore then return end @@ -36,6 +36,7 @@ local strfind, strlen, strsub, strlower, strgmatch, strupper = string.find, stri local strtrim = strtrim local tinsert, tremove = table.insert, table.remove local tostring, tonumber, select = tostring, tonumber, select +local CreateFrame = _G.CreateFrame local mb_options = { type = "group", @@ -761,6 +762,7 @@ function MyBagsCore:ItemButton_OnLeave(widget) CursorUpdate(widget) end +--[[ function MyBagsCore:ItemButton_OnClick(widget, button) if self.isLive then if widget.hasItem then @@ -774,6 +776,7 @@ function MyBagsCore:ItemButton_OnClick(widget, button) end end end +]] function MyBagsCore:ItemButton_OnModifiedClick(widget, button) if self.isLive then @@ -1343,7 +1346,14 @@ function MyBagsCore:LayoutBagFrame(bagFrame) bagFrame.size = 0 else for slot = 1, bagFrame.size do - local itemButton = _G[itemBase .. slot] or CreateFrame("Button", itemBase .. slot, bagFrame, "MyBagsItemButtonTemplate") + local itemButton + if (_G[itemBase .. slot]) then + itemButton = _G[itemBase .. slot] + else + itemButton = CreateFrame("Button", itemBase .. slot, bagFrame, "MyBagsItemButtonTemplate") + -- print("Button " .. itemBase .. slot .. " created"); + end + -- local itemButton = () or CreateFrame("Button", itemBase .. slot, bagFrame, "MyBagsItemButtonTemplate") if (self:IsLive()) then itemButton:SetID(slot); else @@ -1818,6 +1828,10 @@ function MyBagsCore:BagSearch_OnEditFocusGained() self:LayoutFrame() end +function MyBagsCore:GetCoreVersion() + return MBC .. " version " .. MBC_MINOR; +end + local mixins = { "ToggleBag", "OpenBag", @@ -1896,6 +1910,7 @@ local mixins = { "BagSearch_OnEditFocusGained", "RegisterEvents", "UnregisterEvents", + "GetCoreVersion", } function MyBagsCore:Embed( target ) diff --git a/MyInventory/MyInventory.lua b/MyInventory/MyInventory.lua index 50dcbf7..41ee52b 100644 --- a/MyInventory/MyInventory.lua +++ b/MyInventory/MyInventory.lua @@ -55,6 +55,7 @@ function MyInventory:OnInitialize() self.anchorOffsetX = -5 self.anchorOffsetY = 100 self.isBank = false + self.version = MB_Core:GetCoreVersion() self.db = LibStub("AceDB-3.0"):New("MyInventoryDB") local prof = self.db:GetCurrentProfile() if self.db.profiles[prof] and self.db.profiles[prof]["Columns"] and self.db.profiles[prof]["Columns"] > 0 then