Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: mowren on July 20, 2008, 10:21:52 AM

Title: Changing the order inventory items are displayed
Post by: mowren on July 20, 2008, 10:21:52 AM
I've looked around in this forum for quite some time now but didn't find an satisfying answer to my question yet. If there's a matching thread already please link me to it.

But on to my concern.
I'd like to know if it's possible to change the order an InventoryBox is filled with items when displayed. As far as I see it, the default method to display inventory items in the box starts in the top left corner and fills the columns from left to right until the row is filled. Then a new row starts under the filled one.

This works just fine but for my game I'd like the InventoryBox to start at the bottom right corner. After that the following items should be placed in the row over the previous item until the column is filled. Then a new column should be startet next to the filled one (building the grid from right to left).

Therefore I'd like to know if this is possibile with Wintermute.
And if so, where should I start to achieve it?

For your ease I visualized my idea. The numbers show the order of the inventory items being displayed.
(http://img155.imageshack.us/img155/7212/inventorydefaultxr1.jpg) (http://img293.imageshack.us/img293/3148/inventorydesiredqa3.jpg)
Title: Re: Changing the order inventory items are displayed
Post by: DocBass on July 22, 2008, 12:05:32 AM
seems to me like this would be pretty easy if you set one up manually. You could number the boxes in any way that you wanted and then fill them in a corresponding fashion with your items.
Title: Re: Changing the order inventory items are displayed
Post by: mowren on July 22, 2008, 06:33:05 AM
So basicly your'e saying I should start with creating a new gui window instead of using the build-in inventory support?

But how would I place an item from an associative array in the corresponding nested window or entity container? I guess every item is displayed as an entity object which can be created by script, right?

Title: Re: Changing the order inventory items are displayed
Post by: DocBass on July 22, 2008, 07:42:54 AM
Yeah I would build one from the ground up if you want total control over it. I'm working on one right now that is a bit more complex than the built in one, similar but it does a few things differently. Maybe when I'm done I could post some generic code if you still need some help.
Title: Re: Changing the order inventory items are displayed
Post by: mowren on July 28, 2008, 08:13:58 AM
Well, I still need some help. I'm already struggeling with displaying an intentory icon outsite of an InventoryBox.
I created a new window and tried to create new entities for the inventory items by script and place them in nested windows or entity containers. But those entities are just images and don't behave like icons in an InventoryBox.
I'm just able to define things like MouseEntry, LeftClick, etc. but can't get it to reference a specific item in the inventory array.