;;; Sierra Script 1.0 - (do not remove this comment)
(script# 997)
(include sci.sh)
(use Main)
(use Class_255_0)
(use Gauge)
(use Sound)
(use InvI)
(use User)


(class TheMenuBar of Class_255_0
	(properties
		state $0000
	)
	
	(method (init)
		(AddMenu { \01_} {About KQ4`^a:Help`#1})
		(AddMenu
			{ File_}
			{Save`#5:Restore`#7:-!:Restart`#9:Quit`^q}
		)
		(AddMenu { Action_} {Pause`^p:Inventory`^i:Retype`#3})
		(AddMenu
			{ Speed_}
			{Speed`^s:-!:Faster`+:Normal`=:Slower`-}
		)
		(AddMenu { Sound_} {Volume`^v:-!:Turn Off=1`#2})
		(SetMenu
			1283
			110
			(if (DoSound sndSET_SOUND) {Turn Off} else {Turn On})
		)
		(SetMenu 513 109 'save[/game]')
		(SetMenu 514 109 'restore[/game]')
		(SetMenu 516 109 'restart[/game]')
		(SetMenu 517 109 'quit[/game]')
		(SetMenu 769 109 'pause[/game]')
		(SetMenu 770 109 'inventory')
	)
	
	(method (handleEvent pEvent &tmp temp0 temp1 [temp2 4] temp6 [temp7 288])
		(switch (= temp0 (super handleEvent: pEvent))
			(257
				(= temp6 (Sound pause: 1))
				(Print
					(Format @temp7 997 0 global28)
					80
					{A Ken Williams Production}
					33
					gSmallFont
					30
					1
					67
					20
					10
					70
					260
				)
				(Sound pause: temp6)
			)
			(258
				(= temp6 (Sound pause: 1))
				(Print 997 1 33 gSmallFont)
				(Sound pause: temp6)
			)
			(513
				(if (not (proc0_12 1028))
					(Print 997 2)
				else
					(gGame save:)
				)
			)
			(514
				(if (not (proc0_12 1028))
					(Print 997 3)
				else
					(gGame restore:)
				)
			)
			(516
				(= temp6 (Sound pause: 1))
				(if
					(Print
						997
						4
						82
						100
						0
						0
						33
						0
						81
						{ Restart_}
						1
						81
						{Continue}
						0
					)
					(gGame restart:)
				)
				(Sound pause: temp6)
			)
			(517
				(= temp6 (Sound pause: 1))
				(= gQuit
					(Print
						997
						5
						82
						100
						0
						0
						33
						0
						81
						{____Quit____}
						1
						81
						{ Continue_}
						0
					)
				)
				(Sound pause: temp6)
			)
			(769
				(= temp6 (Sound pause: 1))
				(Print 997 6 33 0 30 1 81 { Continue_} 0)
				(Sound pause: temp6)
			)
			(770
				(if (not (proc0_12 2348))
					(Print 997 7)
				else
					(= temp6 (Sound pause: 1))
					(Inv showSelf: gEgo)
					(Sound pause: temp6)
				)
			)
			(771
				(pEvent claimed: 0 type: 4 message: (User echo?))
			)
			(1025
				(if (not (proc0_12 1850))
					(Print 997 8)
				else
					(= temp1
						((Gauge new:)
							description:
								{Use the mouse or the left and right arrow keys to change the speed of moving characters.}
							text: {Animation Speed}
							minimum: 0
							normal: 10
							maximum: 15
							higher: {Faster}
							lower: {Slower}
							doit: (- 16 gSpeed)
						)
					)
					(gGame setSpeed: (- 16 temp1))
					(DisposeScript 987)
				)
			)
			(1027
				(if (> gSpeed 1) (gGame setSpeed: (-- gSpeed)))
			)
			(1028 (gGame setSpeed: 6))
			(1029
				(gGame setSpeed: (++ gSpeed))
			)
			(1281
				(if (not (proc0_12 1850))
					(Print 997 9)
				else
					(= temp6 (DoSound sndPAUSE 1))
					(= temp1
						((Gauge new:)
							description:
								{Use the mouse or left and right arrow keys to change the volume.}
							text: {Sound Volume}
							minimum: 0
							normal: 12
							maximum: 15
							higher: {Louder}
							lower: {Softer}
							doit: (DoSound sndVOLUME)
						)
					)
					(DoSound sndPAUSE temp6)
					(DoSound sndVOLUME temp1)
					(DisposeScript 987)
				)
			)
			(1283
				(if (= temp1 (DoSound sndSET_SOUND))
					(SetMenu 1283 110 {Turn On})
				else
					(SetMenu 1283 110 {Turn Off})
				)
				(DoSound sndSET_SOUND (not temp1))
			)
			(else 
				(if global202 (global202 doit: temp0))
			)
		)
	)
)
