Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - Inventory

Author
Message
luskos
11
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 2nd Mar 2013 14:35 Edited at: 3rd Mar 2013 21:31
This is Phaelax's inventory with some tweaks.I needed inventory that expand to certain point depending on the weight of items it can hold.I wanted to make it scrollable, but i don't know how to do it yet so i get this one and make it listed inventory with pages instead.You can easily make it to hold certain type of items at certain page if you want.Here is the code :



The original thread with original files in it:
http://forum.thegamecreators.com/?m=forum_view&t=188498&b=8&p=0

There is version with save load inventory function.I use my own images and data sheets in this version.I use only 64x64 images and i tweaked the grid behaivior accordingly.



Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Mar 2013 00:34
If anyone is curious, press "1" or "2" to switch between the pages. Took me a second to figure it out.

I'd recommend adding a button into the gui so users will see what page they're on to prevent confusion.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
luskos
11
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 3rd Mar 2013 21:15
New version with save\load function.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
luskos
11
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 23rd Mar 2013 12:16 Edited at: 29th Mar 2013 19:20
Update!
*The new version have proper saving and loading(there was a bug in the last one).
*Populating inventory with items using space creates item at first available inventory slot.
*If you take item from inventory and place it on top of another item that is not stackable or stackable but not same it moves the item back at original location.
*Smooth cliping and scrolling - Thanks to Phaelax again.
*Stacking does add qty to items now
*Stackable items shows qty like: 874 , 26.98K , 1.3M etc.
*Pages are removed, now inventory is expandable.It expands or shrinks itself depending if you add or remove items.
*Item weight and inventory Volume.

You will need Matrix1Utils: http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18
And Advanced2D : http://forum.thegamecreators.com/?m=forum_view&t=179096&b=5

Coding is My Kung Fu!
And My Kung Fu is better than Yours!

Attachments

Login to view attachments

Login to post a reply

Server time is: 2019-06-16 13:33:29
Your offset time is: 2019-06-16 13:33:29