cargBags - Help & Discussion
Okay, here is the official thread to discuss all parts of modifying cargBags, the modular bag framework.
This thread is mostly for help requests and discussion around layouts, plugins or handlers - for feature requests or bug reports on the core, please write into the comment section of the addon. Or you just show off your own custom layout :) If you have questions, rather write here instead of sending PM's, so people can learn from it ;) Additional resources: - cargBags - Find cargBags layouts/plugins on WoWInterface - Git repository - API-specifications As more plugins and handlers come, I maybe provide some differentiation here and list them. Good luck on creating your own custom bags! |
Ok very nice, thanks for implementing cargBags_Anywhere.
Question : Can i run a function on the bag data before the bags are populated? I want to change the types on some of the items before they get filtered by any potential filters that may exist. ie "Wind-Up Train Wrecker" is listed as consumable when i want it treated as Miscellaneous, and "Fate Rune of Unsurpassed Vigor" is listed as quest when i want it treated as a Consumable. Code:
local itemConversions = { |
Currently there are no functions for the layout that manipulate item data before it is passed to the filters. But there should be no problem in extending a filter like:
Code:
local onlyConsumables = function(item) |
How to add item set filters for ItemRack, Outfitter and Blizzards Equipment Manager
Since I spent quite some time to analyse each of those addons code to extract all the information I need and to create all the necessary callbacks, I thought I'd share my resulting code. You are of course absolutely free to use it in your own cargBags layout, however if you decide to publish it, I'd appreciate to be credited. :) All three filters are also included in my own layout, you can get it here: cargBags_Nivaya (Note: ClosetGnome doesn't need support anymore, since it is now only an LDB plugin for switching sets from Blizzards Equipment Manager.) I'll first explain the code for extracting the item set info from each of those addons. The basic idea is to add some specific callbacks or hooks to each addon, which notify us when sets are added, removed or changed. Those callbacks then create a table containing all set items as a key, so the final filter can do its work efficiently. Blizzards Equipment Manager Code:
-- This table will hold information about all items which are part of a set: Code:
local OF = IsAddOnLoaded('Outfitter') Code:
local IR = IsAddOnLoaded('ItemRack') The filter Finally the filter itself, use this function as an argument to SetFilter() for one of your cargBags bag objects: Code:
local fItemSets = function(item) **edit: Updated for Blizzards Equipment Manager and removed ClosetGnome stuff, since it is not needed anymore. |
Thanks for this very very good work Luzzifus.
Great job :banana: |
Quote:
Please note that it's not a bag object callback, but one for the complete cargBags @Luzzifus: I agree with Soeters - Yep, it's a nice tutorial! ;) |
Hello mates,
I was thinking to share this with you :D .. As you can see i have changed the texture of the border .. see my screen shot. Code:
-- Function is called after a button was added to an object |
Okay, this seems to be a problem of the core. It will be fixed in the next cargBags-update.
|
Quote:
Cheers mate |
Hello,
I had started working on my own layout, but Luzzifus has implemented at least the containers that I want with cbNivaya (and Luzz is adding nice features faster than I have time to ;). However, I have two additional custom functions that I always have to go in and add that color 'unusable' items with a red overlay (thanks for the help here Cargor) and another text overlay with '*BoE*' for BoE equipment (for mailing to my enchanter). I looked into Plugins and Handlers but it seems these have a different purpose. Beyond hooking the two functions in cbNivaya directly (UpdateButton and UpdateButtonLock) using Lua is there a more 'recommended' approach? Thanks! |
I think not. It's up to the layout and cargBags doesn't provide more than one different callback per object. But hooking should be perfectly fine ;)
|
If you PM me the code how you do that I might include it in my layout. :)
|
Restack Button
After moving to cargBags from ArkInventory, I was missing Ark's item stack merging feature, so I wrote kRestack (~18kb idle) and created a button for it in the Aurora layout (v1.0.1). Now, kRestack isn't a plugin, but the function to run it is global and can be called directly from cargBags. Quote:
Code:
--[[ place in layout function ]] Also missed, was search from other mods, so I wrote these snipplets. I personally didn't think it warranted creating a whole plugin. One downside is it doesn't work for keys or other custom windows. I tried, but the extra windows kept bugging out when the filter was applied, and it wasn't pretty. Maybe someone else can figure it out. edit: the problem was actually hiding the key frame when there turned out to be no matches, this was the result. filterName() was changed to work with the keyring and other (specified) spawned frames. This is also for Aurora, and by all means, make it work better. :D Code:
--[[ place in layout function ]] |
Hi, I'm trying to replace the bags when his anchor is hidden.
So far here's the code I have (don't care the strange characters near bak, it means that the previous string his between brackets most likely this, bak[frame]) : lua Code:
Everything works well execpt for equipment, if I hide it then stuff or quest (depending on which ones are shown) don't move at all. It can understand why this bag seems not to work (different anchoring method) but not how to resolve it. |
No one knows ?
|
I'm not exactly certain what you're trying to achieve. If you want empty bags to hide and all bags around the hidden bag to move together then you could also take a look at my approach, which works perfectly an is easily extendable.
My idea was to save anchoring information for every bag frame. This is not information about which one the bag is anchored to but rather which bags are anchored to the current one (mainly for performance reasons). Then there is a function which does the actual anchoring based on this information whenever it is needed (UpdateButtonPositions). If that is what you need I can explain my approach further if you want. |
What I try to achieve is move the bag to his parent previous placement when the parent hides. For exemple I hide my consumable bag and then my trade goods bag moves to consumable place, but when I show the consumable bag again the tade goods bag goes to his initial placement.
If I use my work (the functions given above) everything works fine, except for the equipment bag, because the stuff bag doesn't move when I hide it. I don't know why the bag doesn't move but the only difference with the other bags is that it has a different anchoring method (topright to topleft). But you can help me with hiding empty bags that would also be cool :banana: |
Ok, now what comes to my attention is that you don't call ClearAllPoints in the parents OnHide() function. And if I understand your code correctly this should be there, since you always re-set the points on hiding/showing.
---------- What I am doing has a pretty similar effect to what you are doing, though I'm doing it different. You could simply expand your code to hide empty bags by simply expanding your conditions to hide bags. Hiding empty bags with parent anchoring The idea was to save anchoring information in every frame. This is not information about which one the frame is anchored to but rather which frames are anchored to the current one (mainly for performance reasons). So when I'm spawning the bags, it looks like this: Code:
----------------------------------------------- Now you need this little fella in your code: Code:
function cargBags_Nivaya:UpdateAnchors(self) The last thing you have to do is bind the anchoring update to an event. So just add something like the following to your UpdateButtonPositions handler. At the same time I'm checking for empty bags: Code:
local tName = self.Name Now it basically should work. There's two things you still have to do. First is to apply the check for empty bags to you OpenCargBags() function, I'm doing it like this: Code:
local function ShowBag(bag) if not cB_BagHidden[bag.Name] then bag:Show() end end Code:
local tName = self.Name After typing all that I realize how complex my solution is.. :rolleyes: Hope it helps anyways. |
This isn't so complex, it's just a different point of view for setting points.
Thanks for the help, I didn't see that I forgot the ClearAllPoints in the OnHide script but not in the OnShow. Now everything is fine. I will adapt your solution to adapt this with my layout. |
didn't see there is a help & discussion session, sry.
so here again my post: i use the Nivaya addon! first of all: very good addon, i want to use it further!! ;-) but... the game always gets really jerky if (it wasn't so before!) there's access to the bags. they are closed, and if i pick up loot or craft something which involves a bag place, the game stops for about 0,5 sec. it's a no go :-( as in raids/instances where you often loot, it slows the whole game down... never had that in ANY other addon! i hope there is a fix for this great addon... *sigh* |
Hello, Carg.
First off, I love the addon; very minimalistic and to the point. Secondly, is there a way to disable the item glow that your addon provides and use oGlow instead for this? I've tried commenting out all of the "glow" sections in _Pernobilis (3 to 12 & 26 to 32) which effectively removed your glow, but oGlow's does not show up. The only reasons that I wish to use oGlow instead are that I'm using it to already glow the items in the character frame, merchant display, guild bank, etc. and also because haste's newest revision will glow quest items as well (http://github.com/haste/oGlow/tree/master). Any help with this would be greatly appreciated. :) |
Preamble: This only works with the new oGlow-API (basically on haste's git).
You basically have to tell oGlow that cargBags needs to be updated, too. Add this code on top of the layout (basically replacing the old createGlow-function): Code:
local function dummy() end And then this part into the UpdateButton-function, replacing the old glow-code: Code:
oGlow:CallFilters('cargBags_Pernobilis', button, item.link) |
Thanks for the reply. :)
I might just be overlooking something or completely dumb (most likely the latter), but it's telling me that it's unable to index the global "oGlow". "Interface\AddOns\cargBags_Pernobilis\layout.lua:4:attempt to index global 'oGlow' (a nil value)" Here's how I changed the code in the Pernobilis layout. http://i28.tinypic.com/28ugz2q.gif |
Uh yeah, I forgot that you have to add oGlow to the RequiredDeps-line in the cargBags_Pernobilis.toc-file. This ensures that it's loaded before cargBags ;)
|
I even added that to it and reloaded my ui, but I guess I needed to exit the game completely. :P
Thanks, carg, it works like a charm now. :D |
Thanks for this great mod I really like it.
The API page on your website is down, is there a copy of this API somewhere else? also new features for 2.0 are exciting, any ETA on this one? :) |
Quote:
Quote:
The API can be found as well on top of all the files in the cargBags-core. I'd recommend looking there, even if the site is back online, because ... you know, programmers are lazy .... just have to program a script which does this automatically ;) Concerning 2.0: Uhh no, not at the moment. I'm just busy on writing a bugfix-release (1.3) and releasing it in the next days. Though 2.0 is planned as the next update then. EDIT: server back online. |
how do i activate layouts for cargbags? i have downloaded cargbags and the nivaya layout. but now i don't know how to activate it. pls help someone who knows how it works
this error comes every start. Code:
cargBags_Nivaya\cargBags_Nivaya.lua:575: attempt to call method 'GetHandler' (a nil value) |
You' ve got a totally outdated version of cargBags (0.4.4.1). The new version is already 1.2 - with this version, it should work without problems ;)
|
Occasionally when I get in combat I am unable to open my bags (or close them if they're open before I get in combat). Here's the message that I get with Baud Error:
Code:
cargBags blocked from using cBags_Main:Show() http://www.pastey.net/124517 Without Baud Error no error is displayed aside from "Interface action failed because of an AddOn" in the chat frame. Edit: I'm using 1.3 of cargBags and 1.1 of Pernobilis. |
At the moment, I don't think, cargBags is solely responsible for this taint, since it doesn't use any protected frames. I assume, the error is caused, because some protected frame interacts with cargBags / the inventory in some way that causes it to become protected.
Some questions to narrow down the issue: Can you define 'occasionally' a bit more clearly? How do you toggle your bags? Which addons you are using could interfere with cargBags or the inventory in general? Does it happen with the normal _Pernobilis or another layout? (Although your code looks good to me) |
"Occasionally" meaning that at a random time while playing it will start to do this and will continue to consistently until I reload the UI.
My bags are toggled with the standard "B" keybinding. No other mods that I use really interfere with the bags at all. Here's a list and I've highlighted the ones that could possibly have anything to do with the bags. http://www.pastey.net/124530 I can try using the standard Pernobilis layout later today and see if it happens at all. |
At a quick glance, Dolemite and Molinari seem suspicious to me, because both have a secure frame and anchor it to the item-buttons of cargBags, as soon as their animation starts, making it protected in combat.
I would suggest you to show the animation on the inventory button and after that try to toggle cargBags in combat. EDIT: Tested and reported it to the author. |
You're awesome, thanks! :)
|
Haha, sorry to keep coming back here with problems. I just noticed today while playing an alt that the [max] tag isn't including the backpack. Here's a screenshot to show you what I mean.
http://i28.tinypic.com/10y06wy.jpg Nothing has changed since my last posting. |
You mean the default "backpack" that you get at the beginning?
|
Quote:
|
I don't believe any of the flavors are showing bagID0, might be because it cannot be un-equipped.
|
The so-called custom variable bagType define which bags should be addressed by a plugin. In _Pernobilis it is defined in lines 111 to 116, directly before the space-indicator.
The default here is "bags", so using bagIDs 1 to 4. You can however replace it by "backpack+bags" to get 0 to 4. Same goes for bank which can also be replaced by "bankframe+bank". Seems like it's an error and I will fix it in the next version. |
Yeah, changing:
lua Code:
lua Code:
Thanks again for everything. :p |
How to ?
Hi to all,
I wanted to thank the author of CargBags, and the author of Cargbags_Nivaya, layaout i'm currently using. I'm missing one thing actually : I put a lot of items in bank from bags, and vice-versa. CargBags could help me i guess, i would like to see 2 functions (plugins ?) : One put all items specified (by subtype for example, or with a configurable filter) from bags to bank, Other one do exactly the opposite :D Is this something easy to do ? Even if the functions are only useable from commandline but actually, putting 140 items in bank to take 140 others items from bank is boring, so boring... :/ Another thing : is there a function to autostack all items in bag and bank ? Thanks for your time reading my (so poor) english :D |
Quote:
Quote:
|
Thank you for your answer and time you will spend for me, i will look in this addon, and will look the post every day :D
Have a good day ! |
CB_Niv help
First of all, I'd like to thank the authors of CB and CB_Niv for such a great lightweight bag addon. It fulfills most of what I wanted with so little memory, not to mention I don't have to swim in a sea of confusion for configuration problems.
However, there are just 2 things that I want to ask for help. 1. Is there any way to track currency on the bag? It doesn't seem to show up when I've enabled tracking. 2. Currently CB_Niv changes the looks on both my inventory and bank bags. Is there anyway to disable the bank bags totally so that it shows in blizzard default? I only need the great CB_Niv functions for my inventory. Again, thank you for such great addons, they are close to perfect! |
Quote:
Quote:
|
Thank you for the very fast reply Cargor.
I look forward to the day when you add "track currency" function to the addon. I'll look into the alternatives you've mentioned. As to the bank bag question, I guess I'll try asking it at CB_Niv. Hopefully the author is still active. |
Okay, just wanted to provide a small roadmap on version 2.0, because I know you are all waiting for it ;)
The stack-compression is actually my biggest problem at the moment, because it is really difficult by terms of Blizz' API and my own modularity- and optimization-principles. I'm thinking really hard to find a good way to implement it while staying true to the principles, but it's a lot more difficult than I expected. The focus on 2.0 is on a lot more modularity and diversity of the core cargBags. Let's face it: cargBags got so much features incorporated that I'm already getting requests of different "memory-minimalists" who would like to see a _Pernobilis without additional features. My plan is to support both sides and introduce two versions of the core, one with only the most important features and one with all. There is also the possibility that I create a script on my website which acts as a "builder" for the core: You could select which components of the cargBags-core you'd like to see. I also plan to simplify a lot of things for the not-so-experienced users. It already began in the unreleased version 1.4 (on GitHub) which moves a lot of the layout functions back into the core, so that the layout only focuses on the important things - of course, you can completely rewrite this feature and I want to support backwards compatibility. New default modules should include a search and a more comprehensive databroker-display. (Lightweight fanatics, remember the lite-version! ;)) Apart from that, Version 2.0 is going to feature another feature preview layout, to the same extend as _Pernobilis was to version 0.x and _Aurora/_Nivaya were to 1.x.The new version will bring a completely ingame configurable, intuitive inventory frame - I'm aiming to support draggable bags which can be compressed into one all-inventory type, a _Aurora-style mainbag with categories or separate bags like in _Nivaya. If all goes well, this configuration interface can also be easily included in other layouts. Release date on 2.0? Don't ask that! I really don't know, and because I'm working in my unpaid freetime for it (in addition to other addons), it severely depends if I'm in the mood for cargBags-scripting. Especially since Luzzifus (author of _Nivaya) seems to be inactive, I don't get a lot of indepth API / layout suggestions and so not much motivation. Stay tuned! :) |
Definitely looking forward to it! :)
One thing I'd suggest is instead of having multiple cores, include a config with the modules turned on (for those who are less likely to want to change things anyway) but turning off modules completely prevents them from loading (for the memory-conscious). |
While I'm not a guru like luzzifus I've thought about making a new layout based on a lot of the same ideas. I'm horrible at graphics but I'm willing to give it a shot. If you have a beta version I'd be happy to test it andeither start a completely new mod for it or update Nivaya with the authors permission.....
|
Quote:
Quote:
I currently don't have a beta-version for you - I have to admit that 2.0 isn't even in the alpha-stage, just thinking about the core changes at the moment. You can, however, begin with the current cargBags-release - I keep an eye on backwards-compatibility and most of the layout API would stay the same, it's more about enhancements and internal core changes. |
Quote:
|
If you enable/disable files in the .toc, you would also just need to do a ReloadUI. I learned that from another poster on this forums, as well - guess, Blizz changed it in some patch. ;)
But your Lua-approach has some good points, too. I could probably handle module dependancy a lot better this way. |
Quote:
|
is there a way to include the gildbank?
after looking in Nivaya I Suspect this would be the filter for Consumables Code:
local t = cargBags:Spawn("cBniv_BankCons") |
At the moment there is no guildbank-support in cargBags, but it is planned for 2.0.
|
Quote:
|
woooooo back up
I just downloaded cargbags and it is the closest thing to what I have been looking for that I have found. At least after I downloaded cargBags_Nivaya to go with it.
but it isnt perfect of course, and I would like to make a new bag or 3. so I tried your more info links to find out how to make a bag. The first link API-specifications seems to be broken ( so I figure with my luck that's the one I need). then there was this link......... just a tad over the head of someone that just downloaded this thing. could someone point me to a page that will get me started. the nivaya layout is almost perfect all i want to change is. I have 2 gem bags and a mining bag in my bank. yet my gems are in my bank bag and my mining mats are in trade goods with a bunch of meet. I would just like to add a miner bag and a JCing bag to the layout. I'm cool with learning what I need to. but I need a place to start and this thread seems to jump right in the middle. If I missed something obvious feal free to flame me, but try to add the info someplace in the flame please. |
The key to adding bags is in the filter section and in the right order.
cargBags_Nivaya keeps the info in two places. In filters.lua you have the basic filters which then get applied in cargBags_Nivaya.lua and some descriptions in localization.lua. Assuming you want to do it right, I'd start out in localization.lua. Here, I'd start with adding 'cBinvL.Mining = "Mining"' after the bullet entry, and then add '["cBinv_Mining"],' after the new items entry. Do something similar for JC. Next we head over to filters.lua. I'd add these just after the Trade Goods filter in here, but that's just to keep them ordered in my mind. I don't think they have to go in any order here. Our first filter is going to be for mining. The first few lines for a filter in Nivaya look to be pretty common (ignoring the config option). A basic filter looks like this: Code:
cB_Filters.fMining = function(item) Then create something similar for JC. Now we get to the fun part. Something important about cargBags is that when it processes the filters it does so in a particular order. The first filter it comes across that matches the item is where it is placed. This means that if we put our above filters after the trade goods filter, they'll only ever be placed in trade goods. The order of the filters seems to be around lines 64 - 153 of cargBags_Nivaya.lua. We see the trade goods bag appears at 144 - 147, so let's put our new bags just before that and after Consumable. Since filters appear to be applied in order of the bags, this should work for us. The format for the bags is very simple. The mining bag should look something like this: Code:
local t = cargBags:Spawn("cBinv_Mining") -- from localization.lua Finally, we place the bag by anchoring it to something else. While you can place it where you want, I'll put it under the quest items. The function to use here is called out at line 159 (note, all line numbers are before changes) and is really simple: CreateAnchorInfo(bag we anchor to, bag we want to anchor, source bag anchor point). So, if we want to attach our bag to the bottom of something, it appears to be "CreateAnchorInfo(cB_Bags.bagStuff, cB_Bags.mining, "Top")". If we put that in after the last CreateAnchorInfo line, you should be good. Now, I haven't tested this, but it should work with only minimal debugging. Hopefully there was enough explanation there to help. :) |
wow that was amazing
thanks for the trouble you went threw I spent a good part of last night playing with it and got it (sorta) working as I want. with a little more learning and playing I think ill have it. thanks again. once I finnish compleetly is there a place you would like me to post my new arangment so others can use it or is it werth it I cant say this setup method is user friendly, but it sure is powerful but I spose if everyone posts there work when they create a new layout soon there will be something out there for everyone thnks again for your trouble and your addon |
Edit:
-nearly fixed- just looking for a way to get soulbound / accoundbound gear in a filter |
All times are GMT -6. The time now is 06:21 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI