Inventory/Container GUI
Re: Inventory/Container GUI
Once again the same problem. You are creating a manual ref (which is a local variable). Then you get a Ptr to it and then the local variable goes out of scope. First add the object to the cell and then take the Ptr. Not the other way around.
Re: Inventory/Container GUI
Ok, it works now. Are there any backend functions missing for trade windows? If not I will start with that, shouldn't be hard to integrate with the inventory.
Re: Inventory/Container GUI
We don't have any means to calculate price modifications from player stats (skills and others). Everything else should work. Make sure not to show equipped items in the merchant's inventory window.
Re: Inventory/Container GUI
There's one feature missing for containers; they have a flag "Organic" and if that flag is there, it is not allowed to place items in this container at all; should I implement that as a new virtual function in MWWorld::Class or just retrieve the LiveCellRef in the container gui? (the second seems better to me, because it's only relevant for containers and no other Class)
Re: Inventory/Container GUI
Agreed.he second seems better to me, because it's only relevant for containers and no other Class
Re: Inventory/Container GUI
I think that flag should be set only for plants and stuff like that, but not for NPCs and creatures (i.e. if you kill a ghost or a skeleton (I just tried that in original MW) you can put items onto them (I tried with weapons, clothes and scrolls)).scrawl wrote:There's one feature missing for containers; they have a flag "Organic" and if that flag is there, it is not allowed to place items in this container at all;
(in case you were talking about the trade window)
Re: Inventory/Container GUI
NPC and creature records don't have this flag. Therefore this point is moot.
Re: Inventory/Container GUI
I'm currently not seeing almost all of the items that NPC should have to offer. This is due to the "re-stocking" flag that is implemented as a negative item count in the ESM files. I guess this will need some changes to the ContainerStore, what's your suggestion on handling that?
Re: Inventory/Container GUI
Right. The function you want to modify is MWWorld::ContainerStore::fill. Just check for negative numbers and make them positive. That should do it for now.
Restocking is not implemented yet (containers/NPCs/creatures only get stocked once). We will have to investigate this feature a bit more eventually, because I am not entirely sure in all details how it works.
Restocking is not implemented yet (containers/NPCs/creatures only get stocked once). We will have to investigate this feature a bit more eventually, because I am not entirely sure in all details how it works.