*$Id: ds\040gui\040-\040inventory.cos,v 1.2 2000/10/12 09:45:06 aharman Exp $
*+--------------------+
*|                    |
*|   GUI: Inventory   |
*|                    |
*+--------------------+
** Create the Inventory
new: vhcl 1 2 11 "ds gui" 4 0 8900
seta game "c3_inventory" targ
seta game "ds_gui_inventory" targ
* imsk 4
pose 2

**set in/put flag
*-1=in, +1=out
setv ov99 -1

attr 316
perm 60
clac 0
cabn 25 15 355 192
cabv grap 4392 1434
cabw 64
setv ov10 28
setv ov11 396
setv va10 wndw
subv va10 ov10
flto va10 ov11

** The following scripts are mostly untouched from Creatures 3.
**Inventory events
scrp 1 2 11 1
	lock
	sndc "gui1"
	clac -1
	velo -20 0
	wait 12
	velo -10 0
	wait 8
	velo -5 0
	wait 3
	velo 0 0
*change in/out state
	negv ov99
	clac 1
endm
scrp 1 2 11 2
	lock
	sndc "gui3"
	clac -1
	velo 20 0
	wait 10
	velo 10 0
	wait 8
	velo 5 0
	wait 6
	velo 0 0
	setv va10 wndw
	subv va10 ov10
	flto va10 ov11

*change in/out state
	negv ov99
	clac 0
endm
* This little script checks to see if the hand is holding something
* over the inventory. If so, it makes the inventory pop out so you can
* drop things into it. It was decided during testing of C3 that this was
* annoying rather than helpful - you decide! Uncommenting the following script
* will restore this feature.  
*
*scrp 1 2 11 75
*	inst
*	targ pntr
*	doif held <> null
*		doif hots = ownr
*			targ ownr
*			doif ov00 = 0 and clac = 0
*				mesg writ targ 0
*			endi
*
*		endi
*	endi
*endm
** Window Resize Event
scrp 1 2 11 123
	inst
	doif ov99 lt 0
		setv va10 wndw
		subv va10 ov10
		flto va10 ov11
	else
		mesg writ ownr 1
	endi
endm

rscr
enum 1 2 11
	kill targ
next
seta game "c3_inventory" null
seta game "ds_gui_inventory" null