Inventory/Container GUI

Everything about development and the OpenMW source code.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Inventory/Container GUI

Post by scrawl »

thanks,you're right.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Inventory/Container GUI

Post by Zini »

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.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Inventory/Container GUI

Post by scrawl »

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.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Inventory/Container GUI

Post by Zini »

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.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Inventory/Container GUI

Post by scrawl »

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)
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Inventory/Container GUI

Post by Zini »

he second seems better to me, because it's only relevant for containers and no other Class
Agreed.
User avatar
natirips
Posts: 52
Joined: 26 Apr 2012, 10:48
Location: Solar System/~Zagreb
Contact:

Re: Inventory/Container GUI

Post by natirips »

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;
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)).

(in case you were talking about the trade window)
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Inventory/Container GUI

Post by Zini »

NPC and creature records don't have this flag. Therefore this point is moot.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Inventory/Container GUI

Post by scrawl »

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?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Inventory/Container GUI

Post by Zini »

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.
Post Reply