Thread Tools Display Modes
12-15-07, 08:49 AM   #1
cag_dk
A Deviate Faerie Dragon
 
cag_dk's Avatar
Join Date: Jan 2006
Posts: 14
Empty bag count

Is there any way to 'reverse' the free bag-slot-space? Mazzle show ie. 30/50 which tells you there are 30 slots FILLED out of 50, can that be 'reversed' so it will say 20/50 = 20 FREE slots out of 50??

/Cag
__________________
King for a Day, Fool for a Lifetime
  Reply With Quote
12-21-07, 12:59 AM   #2
cag_dk
A Deviate Faerie Dragon
 
cag_dk's Avatar
Join Date: Jan 2006
Posts: 14
bump

Anyone? pretty sure I've seen this elsewhere (can't remember where though)
__________________
King for a Day, Fool for a Lifetime
  Reply With Quote
12-31-07, 02:58 AM   #3
cag_dk
A Deviate Faerie Dragon
 
cag_dk's Avatar
Join Date: Jan 2006
Posts: 14
still no idea guys?

my lua-editing is very limited, but can/will *try* to fix if I know where to look..
__________________
King for a Day, Fool for a Lifetime
  Reply With Quote
01-02-08, 04:19 PM   #4
Haakan
A Murloc Raider
Join Date: Feb 2007
Posts: 5
Hej

i just made this little change to have what u want
it seems to work i just made some add and delete out of my bags
handson fix
will se if i can add it that we have the choice of what we want to have


in the subdirectory StatusWindow
in the file
StatusWindowModule.lua
original looks like this

--
-- Bag slots
--
SWBagSlots = {
name = "Bag Slots",
updateEvent = "UNIT_INVENTORY_CHANGED",

Init = function(self)
if not self.initialised then
StatusWindow:HookModuleEvent(self, "UNIT_INVENTORY_CHANGED")
StatusWindow:HookModuleEvent(self, "BAG_UPDATE");
StatusWindow:HookModuleEvent(self, "BAG_OPEN");
StatusWindow:HookModuleEvent(self, "ITEM_LOCK_CHANGED");
StatusWindow:HookModuleEvent(self, "UPDATE_INVENTORY_ALERTS");
self.initialised = 1
end
end,

Update = function(self, event)
local used,total
used = 0
total = 0
for i=0,4 do
used = used + self:CountBagSlots(i)
total = total + (GetContainerNumSlots(i) or 0)
end
return string.format("Bags: %d/%d", used, total)
end,

CountBagSlots = function(self, bag)
local used = 0
for i=1,GetContainerNumSlots(bag) do
used = used + ((GetContainerItemInfo(bag, i) and 1) or 0)
end
return used
end,
}
StatusWindow:RegisterModule(SWBagSlots)


my new code red lines
--
-- Bag slots
--
SWBagSlots = {
name = "Bag Slots",
updateEvent = "UNIT_INVENTORY_CHANGED",

Init = function(self)
if not self.initialised then
StatusWindow:HookModuleEvent(self, "UNIT_INVENTORY_CHANGED")
StatusWindow:HookModuleEvent(self, "BAG_UPDATE");
StatusWindow:HookModuleEvent(self, "BAG_OPEN");
StatusWindow:HookModuleEvent(self, "ITEM_LOCK_CHANGED");
StatusWindow:HookModuleEvent(self, "UPDATE_INVENTORY_ALERTS");
self.initialised = 1
end
end,

Update = function(self, event)
local used,total
used = 0
total = 0
left = 0
for i=0,4 do
used = used + self:CountBagSlots(i)
total = total + (GetContainerNumSlots(i) or 0)
left = total - used
end
return string.format("Bags: %d/%d", left, total)
end,

CountBagSlots = function(self, bag)
local used = 0
for i=1,GetContainerNumSlots(bag) do
used = used + ((GetContainerItemInfo(bag, i) and 1) or 0)
end
return used
end,
}
StatusWindow:RegisterModule(SWBagSlots)
  Reply With Quote
01-03-08, 12:03 PM   #5
cag_dk
A Deviate Faerie Dragon
 
cag_dk's Avatar
Join Date: Jan 2006
Posts: 14
WOOT.. it works great!!

Thanks Haakan! although a bit crude like you said, but still.. it gets the job done

/Cag
__________________
King for a Day, Fool for a Lifetime
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Empty bag count


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off