Simple adjustable inventory

Return to Code Snippets

Simple adjustable inventory

Postby ninth » Tue Aug 30, 2011 8:09 am

Image Image
http://panda3d.org.ru/_fr/1/inventory.7z

First click to start drag item, second - to put/merge/replace item into slot
Vodka, bears, balalaika... hmm... sorry for my English =)
ninth
 
Posts: 479
Joined: Fri Jan 23, 2009 9:06 am
Location: Russia

Postby matkod » Tue Aug 30, 2011 9:49 am

Very nice man :D


EDIT:I was playing with your code and found out that when the pop up pops ( :shock: ) you cant click the slot. To solve this you just need to add 0.01 to its position.
Code: Select all
if self.item_under_mouse >=0 and self.drag_item < 0:
                    txt = self.items[self.item_under_mouse].get_info()
                    self.informer.show(txt, (x+.01, 0, y+.01), bound = self.bg_size)
                elif self.slot_under_mouse >=0:
                    txt = self.slots[self.slot_under_mouse].get_info()
                    self.informer.show(txt, (x+.01, 0, y+.01), bound = self.bg_size)

on line 361
User avatar
matkod
 
Posts: 18
Joined: Mon May 02, 2011 3:29 pm
Location: Brazil

Postby ninth » Tue Aug 30, 2011 2:12 pm

Thanks )
I tested script on Ubuntu and has no this problem, but i'll make changes, thanks again.
Vodka, bears, balalaika... hmm... sorry for my English =)
ninth
 
Posts: 479
Joined: Fri Jan 23, 2009 9:06 am
Location: Russia

Postby arikel » Wed Aug 31, 2011 5:48 am

You're great, Ninth! :)
For the second time you provide exactly what i was looking for, and right when i was starting to look for it. Thanks a lot for this snippet, i'll definitely use it in my PPARPG project.
User avatar
arikel
 
Posts: 35
Joined: Thu Jun 12, 2008 5:27 am
Location: Paris, France


Return to Code Snippets

Who is online

Users browsing this forum: No registered users and 0 guests

cron