Add some debug variable

This commit is contained in:
Sandor Takacs
2014-10-22 17:19:01 +02:00
parent 9c84784542
commit 237217ede4
2 changed files with 18 additions and 2 deletions

View File

@ -1,5 +1,5 @@
local MBC = "MyBagsCore-1.0" 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 if not LibStub then error(MBC .. " requires LibStub.") end
local MyBagsCore = LibStub:NewLibrary(MBC, MBC_MINOR) local MyBagsCore = LibStub:NewLibrary(MBC, MBC_MINOR)
if not MyBagsCore then return end if not MyBagsCore then return end
@ -36,6 +36,7 @@ local strfind, strlen, strsub, strlower, strgmatch, strupper = string.find, stri
local strtrim = strtrim local strtrim = strtrim
local tinsert, tremove = table.insert, table.remove local tinsert, tremove = table.insert, table.remove
local tostring, tonumber, select = tostring, tonumber, select local tostring, tonumber, select = tostring, tonumber, select
local CreateFrame = _G.CreateFrame
local mb_options = { local mb_options = {
type = "group", type = "group",
@ -761,6 +762,7 @@ function MyBagsCore:ItemButton_OnLeave(widget)
CursorUpdate(widget) CursorUpdate(widget)
end end
--[[
function MyBagsCore:ItemButton_OnClick(widget, button) function MyBagsCore:ItemButton_OnClick(widget, button)
if self.isLive then if self.isLive then
if widget.hasItem then if widget.hasItem then
@ -774,6 +776,7 @@ function MyBagsCore:ItemButton_OnClick(widget, button)
end end
end end
end end
]]
function MyBagsCore:ItemButton_OnModifiedClick(widget, button) function MyBagsCore:ItemButton_OnModifiedClick(widget, button)
if self.isLive then if self.isLive then
@ -1343,7 +1346,14 @@ function MyBagsCore:LayoutBagFrame(bagFrame)
bagFrame.size = 0 bagFrame.size = 0
else else
for slot = 1, bagFrame.size do 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 if (self:IsLive()) then
itemButton:SetID(slot); itemButton:SetID(slot);
else else
@ -1818,6 +1828,10 @@ function MyBagsCore:BagSearch_OnEditFocusGained()
self:LayoutFrame() self:LayoutFrame()
end end
function MyBagsCore:GetCoreVersion()
return MBC .. " version " .. MBC_MINOR;
end
local mixins = { local mixins = {
"ToggleBag", "ToggleBag",
"OpenBag", "OpenBag",
@ -1896,6 +1910,7 @@ local mixins = {
"BagSearch_OnEditFocusGained", "BagSearch_OnEditFocusGained",
"RegisterEvents", "RegisterEvents",
"UnregisterEvents", "UnregisterEvents",
"GetCoreVersion",
} }
function MyBagsCore:Embed( target ) function MyBagsCore:Embed( target )

View File

@ -55,6 +55,7 @@ function MyInventory:OnInitialize()
self.anchorOffsetX = -5 self.anchorOffsetX = -5
self.anchorOffsetY = 100 self.anchorOffsetY = 100
self.isBank = false self.isBank = false
self.version = MB_Core:GetCoreVersion()
self.db = LibStub("AceDB-3.0"):New("MyInventoryDB") self.db = LibStub("AceDB-3.0"):New("MyInventoryDB")
local prof = self.db:GetCurrentProfile() local prof = self.db:GetCurrentProfile()
if self.db.profiles[prof] and self.db.profiles[prof]["Columns"] and self.db.profiles[prof]["Columns"] > 0 then if self.db.profiles[prof] and self.db.profiles[prof]["Columns"] and self.db.profiles[prof]["Columns"] > 0 then