; The Big Red Adventure Installer script
;
; di Luciano Montanaro
;

; Non installo niente, in realtà

(set @default-dest "")
(set #defaultsave "SYS:s")

;
; definizione stringhe per le varie lingue
;

(if (= @language "italiano")
	(
		(set #prompt_dir "Dove vuoi salvare le partite?")
		(set #help_dir 
			(cat "Scegli un cassetto dove salvare le partite.\n"
			     "Dovresti creare o scegliere un cassetto "
			     "nel quale salvare le partite. Puoi farlo adesso, "
			     "o modificare la tua scelta in seguito."
			)
		)
		(set #prompt_language "Che lingua preferisci?")
		(set #help_language 
			(cat "Scegli la lingua in cui vuoi giocare a\n"
			      "The Big Red Adventure"
			)
		)
		(set #welcome 
			(cat "Benvenuti all'installazione di "
		     	     "``The Big Red Adventure\'\'\n\n"
			     "L'installazione non copia nulla sul "
			     "disco rigido, ma ti permette di scegliere "
			     "la lingua in cui giocare e dove salvare le "
			     "partite"
			)
		)
	)
	
; stringhe in inglese	

	(
		(set #prompt_dir "Where would you store saved games?")
		(set #help_dir 
			(cat "Choose the drawer in which you want to store "
			     "saved games.\n"
			     "You should create a drawer for your games, "
			     "so retrieving them will be easier.\n"
			     "Here you have the opportunity of doing it."
			)
		)	
		(set #prompt_language "What's your preferred language?")
		(set #help_language 
			(cat "Choose the language in which you want to play\n"
		 	     "The Big Red Adventure"
			)
		)
		(set #welcome 
			(cat "Welcome to the installer for "
		     	     "``The Big Red Adventure\'\'\n\n"
			     "Nothing is installed to your hard disk.\n"
			     "With this installer you can chose "
			     "the game language and where to save your games."
			)
		)
	)
)

; Presentazione

(welcome #welcome)

; Scegli come lingua di default quella del workbench

(if (= @language "english") (set #ln 0))
(if (= @language "deutsch") (set #ln 1))
(if (= @language "francais") (set #ln 2))
(if (= @language "italiano") (set #ln 3))

(set #ln 
	(askchoice 
		(prompt #prompt_language) 
		(help #help_language)
		(default #ln)
		(choices "\x1b[2pEnglish" "Deutsch" "Francais" "Italiano")
	)
)

;(askstring (prompt "")(help "")(default ("%ld" #ln)))

(set #language 
	(select #ln "english" "deutsch" "francais" "italiano")
)

(set #savedir
	(askdir
		(prompt #prompt_dir)
		(help #help_dir)
		(default #defaultsave)
	)
)

(set #optstring 
	(cat "SAVEDIR " #savedir " LANGUAGE " #language)
)

(textfile 
	(dest "ENVARC:BigRedAdventureOpts")
	(append #optstring)
)

(textfile 
	(dest "ENV:BigRedAdventureOpts")
	(append #optstring)
)

