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* |
All times are GMT -6. The time now is 03:33 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI