Quantcast Help with starting inventory addon? - WoWInterface
Thread Tools Display Modes
07-31-17, 11:28 PM   #1
TurboCrackers
A Murloc Raider
Join Date: Jul 2017
Posts: 6
Help with starting inventory addon?

Hi guys! I'm really new to creating addons, and I have one under my belt (it's a really easy fps display, so nothing special). I'm trying to find some documentation on how I can replace all of a player's bags with one big bag, but I'm having no luck.

I've currently got a frame displaying with the correct number of slots generated in it (I just got the total that the player has and created that many slots), but there are a few problems...

I created my slots using the "ItemButtonTemplate". However, I have no idea how to map the bag inventory slots to these slots I've created. I know that each individual slot in my new frame needs to have a link of some sort to a specific slot in a bag. I just really don't know where to start.

I've tried looking at the code from other addons similar to this one, but they are so complex that I have no idea where to begin looking for what exactly I'm wanting. Can someone give me a good push in the right direction or maybe tell me exactly how to map an inventory slot to a custom slot that I generate?

I've attached a picture of what I've got so far.
Attached Thumbnails
Click image for larger version

Name:	20503980_10209849258655583_540723653_n.png
Views:	76
Size:	72.6 KB
ID:	8967  
  Reply With Quote
08-01-17, 05:29 AM   #2
aallkkaa
A Theradrim Guardian
 
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 63
In old days, cargBags was a sort of library you could use to make your own Bags addon (like oUF did/does again for Unit Frames). The introduction read:
cargBags is a modular inventory framework. It was created with one simple thing in mind: Taking the boring work away for you, so that you can start right-away with the important things: Layout and categories! You don't have to care anymore about fetching item-data, updating at the right time or creating a sophisticated filtering system - cargBags does this all for you!
Unfortunately, the project hasn't been updated since oh ... 2010!

But there is an up to date cargBags layout: cargBags Nivaya (RealUI/standalone). I'm guessing you'll likely find a cargBags subfolder inside the main addon folder with, presumably, more easily-readable functions.
  Reply With Quote
08-01-17, 07:48 AM   #3
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,668
You need to use ContainerFrameItemButtonTemplate, then set the ID of the slot (in the corresponding bag).
The slots needs to be parented to a bag with a proper ID as well, but these can be invisible (faux) if you'd prefer.

See this section of my bag framework Backpack.

Then you need to update the buttons with actual info (textures, count, quality etc), you can look at how I do that here.
Keep in mind, Backpack (which I use as a reference here) is a framework, so my updating is split into two pieces so a "layout" can override it (like this).
  Reply With Quote
08-01-17, 06:39 PM   #4
TurboCrackers
A Murloc Raider
Join Date: Jul 2017
Posts: 6
Originally Posted by p3lim View Post
You need to use ContainerFrameItemButtonTemplate, then set the ID of the slot (in the corresponding bag).
The slots needs to be parented to a bag with a proper ID as well, but these can be invisible (faux) if you'd prefer.

See this section of my bag framework Backpack.

Then you need to update the buttons with actual info (textures, count, quality etc), you can look at how I do that here.
Keep in mind, Backpack (which I use as a reference here) is a framework, so my updating is split into two pieces so a "layout" can override it (like this).
Thank you SO much!!! This is exactly what I was looking for in an answer. You're the best!
  Reply With Quote
08-01-17, 10:03 PM   #5
TurboCrackers
A Murloc Raider
Join Date: Jul 2017
Posts: 6
Hmm I have another question though.. ContainerFrameItemButtonTemplate is a slot that holds a bag itself (I tried placing anything else in there and it told me the other things didn't go there). What is the template for an item slot inside of a bag? Or am I doing this wrong?
  Reply With Quote
08-01-17, 10:05 PM   #6
TurboCrackers
A Murloc Raider
Join Date: Jul 2017
Posts: 6
I think I might be creating the parent bag wrong if it thinks it is a bag slot rather than an item slot. Does that sound right to you?
  Reply With Quote
08-01-17, 10:51 PM   #7
TurboCrackers
A Murloc Raider
Join Date: Jul 2017
Posts: 6
Talking

I figured it out! I just wasn't setting the IDs of each child. Once I did that, everything worked!!
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Help with starting inventory addon?

Thread Tools
Display Modes

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