I have been using this little addon "scalemybags" that simply lets me set a scale for the default blizzard bags to make them smaller/bigger (i use default bags to sort stuff into specific bags to be able to fast and easy swap between profession bags and bags holding additional raid gear and similar) but after the 4.0 patch its causing errors with Baggins. Running either on its own is fine, but with both enabled opening baggins bags will toss some errors.
More precisely about 35-40 copies of
Using Ace2 baggins
1x ScaleBags\scalebags.lua:87: attempt to index global 'this' (a nil value)
<string>:"*:OnLoad":1: in function <[string "*:OnLoad"]:1>
<in C code>: ?
<in C code>: ?
<in C code>: in function `CreateFrame'
Baggins-440\Baggins.lua:1650: in function `CreateItemButton'
Baggins-440\Baggins.lua:1359: in function `ReallyLayoutSection'
Baggins-440\Baggins.lua:383: in function <Baggins\Baggins.lua:374>
<in C code>: ?
AceEvent-2.0-91097 (Ace2):298: in function `TriggerEvent'
AceEvent-2.0-91097 (Ace2):372: in function <Ace2\AceEvent-2.0\AceEvent-2.0.lua:345>
Locals:
self = BagginsBag1Section2Item1 {
0 = <userdata>
}
---
Using ace3 Baggins
1x ScaleBags\scalebags.lua:87: attempt to index global 'this' (a nil value)
<string>:"*:OnLoad":1: in function <[string "*:OnLoad"]:1>
<in C code>: ?
<in C code>: ?
<in C code>: in function `CreateFrame'
Baggins-486\Baggins.lua:1658: in function `CreateItemButton'
Baggins-486\Baggins.lua:1381: in function `ReallyLayoutSection'
Baggins-486\Baggins.lua:405: in function `?'
Baggins-486\Baggins.lua:89: in function <Baggins\Baggins.lua:81>
Locals:
self = BagginsBag1Section11Item9 {
0 = <userdata>
}
---
only difference is different Itemx numbers in the locals section.
The error causes items in the blizzard bags to become non-interactive
I went to look for updates but can't find the addon anywhere nor can i seem to find any other addons that does the same so i was wondering if anyone know if there is any update anywhere, have a local copy thats updated or know of an addon that does nothing but let you scale the blizzard bags.
I use OneBag3 for the exact same reason: I swap whole bags in and out of my bank fairly often.
Having the "bag break" option turned on gives me what sounds like the functionality you want, though it also gives a whole lot more than what you're asking for.
Getting OneBag just for that would be kinda overkill since i use baggins for all other bag needs (only one that has consolidated stacks AND option to NOT use onebag view).
I can scale the bags using visor2 but that messes with the natural placement of the bags making them not move properly depending on how many bags i have open.
Good start would be to search through all scalebags files for 'this' and replace it with 'self'
Tested and i get the exact same error but with "self" instead of "this".
The entire code for the original addon is:
LUA
ScaleBags_updateContainerFrameAnchorsOld = updateContainerFrameAnchors
scalebags = CreateFrame("Frame","ScaleMyBags",UIParent)
scalebags:RegisterEvent("VARIABLES_LOADED")
scalebags:SetScript("OnEvent",function () ScaleBags_OnEvent() end)
function ScaleBags_SlashCommand(scale)
scale = tonumber(scale)
ScaleBags_ContainerScale = scale
end
function ScaleBags_OnEvent()
if (not ScaleBags_ContainerScale) then
ScaleBags_ContainerScale = .75
end
function updateContainerFrameAnchors()
local frame, xOffset, yOffset, screenHeight, freeScreenHeight, leftMostPoint, column;
local screenWidth = GetScreenWidth();
local containerScale = ScaleBags_ContainerScale;
local leftLimit = 0;
if ( BankFrame:IsShown() ) then
leftLimit = BankFrame:GetRight() - 25;
end
while ( containerScale > CONTAINER_SCALE ) do
screenHeight = GetScreenHeight() / containerScale;
-- Adjust the start anchor for bags depending on the multibars
xOffset = CONTAINER_OFFSET_X / containerScale;
yOffset = CONTAINER_OFFSET_Y / containerScale;
-- freeScreenHeight determines when to start a new column of bags
freeScreenHeight = screenHeight - yOffset;
leftMostPoint = screenWidth - xOffset;
column = 1;
local frameHeight;
for index, frameName in ipairs(ContainerFrame1.bags) do
frameHeight = getglobal(frameName):GetHeight();
if ( freeScreenHeight < frameHeight ) then
-- Start a new column
column = column + 1;
leftMostPoint = screenWidth - ( column * CONTAINER_WIDTH * containerScale ) - xOffset;
freeScreenHeight = screenHeight - yOffset;
end
freeScreenHeight = freeScreenHeight - frameHeight - VISIBLE_CONTAINER_SPACING;
end
if ( leftMostPoint < leftLimit ) then
containerScale = containerScale - 0.01;
else
break;
end
end
if ( containerScale < CONTAINER_SCALE ) then
containerScale = CONTAINER_SCALE;
end
screenHeight = GetScreenHeight() / containerScale;
-- Adjust the start anchor for bags depending on the multibars
xOffset = CONTAINER_OFFSET_X / containerScale;
yOffset = CONTAINER_OFFSET_Y / containerScale;
-- freeScreenHeight determines when to start a new column of bags
freeScreenHeight = screenHeight - yOffset;
column = 0;
for index, frameName in ipairs(ContainerFrame1.bags) do
frame = getglobal(frameName);
frame:SetScale(containerScale);
if ( index == 1 ) then
-- First bag
frame:SetPoint("BOTTOMRIGHT", frame:GetParent(), "BOTTOMRIGHT", -xOffset, yOffset );
elseif ( freeScreenHeight < frame:GetHeight() ) then
-- Start a new column
column = column + 1;
freeScreenHeight = screenHeight - yOffset;
frame:SetPoint("BOTTOMRIGHT", frame:GetParent(), "BOTTOMRIGHT", -(column * CONTAINER_WIDTH) - xOffset, yOffset );
else
-- Anchor to the previous bag
frame:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[index - 1], "TOPRIGHT", 0, CONTAINER_SPACING);
end
freeScreenHeight = freeScreenHeight - frame:GetHeight() - VISIBLE_CONTAINER_SPACING;
end
end
function ContainerFrameItemButton_OnLoad()
this:RegisterForClicks("LeftButtonUp", "RightButtonUp");
this:RegisterForDrag("LeftButton");
this:RegisterEvent("CURSOR_UPDATE");
this:RegisterEvent("BAG_UPDATE_COOLDOWN");
this:RegisterEvent("MODIFIER_STATE_CHANGED");
this.SplitStack = function(button, split)
SplitContainerItem(button:GetParent():GetID(), button:GetID(), split);
end
end
end
SLASH_SCALEBAGS1 = "/smb"
SlashCmdList["SCALEBAGS"] = ScaleBags_SlashCommand
The global variables this and event and argN no longer exist.
Change:
function ContainerFrameItemButton_OnLoad()
To:
function ContainerFrameItemButton_OnLoad(this)
Change:
function ScaleBags_OnEvent()
To:
function ScaleBags_OnEvent(this, event, ...)
Also, change all instances of getglobal(whatever) function calls to _G[whatever] table lookups.
Finally, please use some indentation in your code so it's not such a pain to try to read.
Its not my code, all credit goes to whoever made it originally!
Its basically a cut and paste of the old addon that i can nolonger find (and i do not know who made, but im forever grateful to them).
Ill try and see if i can wrap my head around it, thanks for the help.
Edit:
Okay, tested it and got it working now by doing the first step.
But the second step is over my head (im guessing it requires more work the just replacing the "getglobal" with "_G") but it works without it (but im guessing the change would make it more effective).
So a big kiss or hug, whichever you prefer for the help!
The getglobal function was deprecated back when 2.0 came out (I think) and was finally removed in 4.0. But, I've seen a few addons definining a global getglobal function so their authors can avoid having to do search-and-replace, which is probably why yours is working as it is.
Basically anywhere you see getglobal, replace it with _G and change the round parentheses to square brackets. For example, in the code you posted, change:
frame = getglobal(frameName);
to:
frame = _G[frameName]
Also, get rid of all the semicolons. They're not required or useful, and they make the code messier.
The getglobal function was deprecated back when 2.0 came out (I think) and was finally removed in 4.0. But, I've seen a few addons definining a global getglobal function so their authors can avoid having to do search-and-replace, which is probably why yours is working as it is.
Basically anywhere you see getglobal, replace it with _G and change the round parentheses to square brackets. For example, in the code you posted, change:
frame = getglobal(frameName);
to:
frame = _G[frameName]
Also, get rid of all the semicolons. They're not required or useful, and they make the code messier.
Ahhh, i messed up on the brackets! *hides in shame*
Ill give it another runover when i get some then.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
More precisely about 35-40 copies of
Using Ace2 baggins
Using ace3 Baggins
only difference is different Itemx numbers in the locals section.
The error causes items in the blizzard bags to become non-interactive
I went to look for updates but can't find the addon anywhere nor can i seem to find any other addons that does the same so i was wondering if anyone know if there is any update anywhere, have a local copy thats updated or know of an addon that does nothing but let you scale the blizzard bags.
Having the "bag break" option turned on gives me what sounds like the functionality you want, though it also gives a whole lot more than what you're asking for.
I can scale the bags using visor2 but that messes with the natural placement of the bags making them not move properly depending on how many bags i have open.
Tested and i get the exact same error but with "self" instead of "this".
The entire code for the original addon is:
LUA
TOC
Change:
To:
Change:
To:
Also, change all instances of getglobal(whatever) function calls to _G[whatever] table lookups.
Finally, please use some indentation in your code so it's not such a pain to try to read.
Its not my code, all credit goes to whoever made it originally!
Its basically a cut and paste of the old addon that i can nolonger find (and i do not know who made, but im forever grateful to them).
Ill try and see if i can wrap my head around it, thanks for the help.
Edit:
Okay, tested it and got it working now by doing the first step.
But the second step is over my head (im guessing it requires more work the just replacing the "getglobal" with "_G") but it works without it (but im guessing the change would make it more effective).
So a big kiss or hug, whichever you prefer for the help!
Basically anywhere you see getglobal, replace it with _G and change the round parentheses to square brackets. For example, in the code you posted, change:
to:
Also, get rid of all the semicolons. They're not required or useful, and they make the code messier.
Ahhh, i messed up on the brackets! *hides in shame*
Ill give it another runover when i get some then.