.key Figure

Echo "*N                           - [1mFIGURE CONVERSION[22m -*N"

If "<Figure>" Eq ""
	Echo "     Highlight this icon (click on it once) then hold down shift and*N     double click on the figure that you want to convert.*N"
	Ask "               [32mPress RETURN to continue.[31m"
        EndCli
EndIf

List >Ram:CopyFile1 "<Figure>" lformat "Copy Ram:MakeFigure/Figure.crn /CharactersGfx/%N.gfx"
List >Ram:CopyFile2 "<Figure>" lformat "Copy Ram:MakeFigure/Figure.crn *"Hired Guns Disk 1:CharactersGfx/%N.gfx*""
List >Ram:CopyFile3 "<Figure>" lformat "Copy Ram:MakeFigure/Figure.crn //Disk1/CharactersGfx/%N.gfx"

If Not Exists Ram:MakeFigure
	Echo "               [3mCopying commands to RAM:....[23m*N"
	Copy /MakeFigure Ram:MakeFigure quiet
	Copy /C/Crunch Ram:MakeFigure/Crunch quiet
EndIf
Path Ram:MakeFigure Add

Echo "     This script will convert a figure graphic so that it can be used"
Echo "     within Hired Guns."
Echo "     Floppy disk users : the script will attempt to [4mwrite[24m onto disk 1,"
Echo "     so please make sure that you are using a backup copy. Refer to the"
Echo "     manual on how to make a backup copy of your Hired Guns disks.*N"

Ask "               [32mDo you wish to start the conversion? ([31mY[32m/[31mN[32m)[31m"

If Warn
	Echo "*N               [3mCopying new figure graphics to RAM:....[23m"
	Copy "<Figure>" Ram:MakeFigure/Figure.ilbm quiet

	Echo "               [3mExtracting left facing graphics....[23m"
	MakeFigure >nil: -@Ram:MakeFigure/Filters -#Left Ram:MakeFigure/Figure.ilbm Ram:MakeFigure/Left.bin
	Join Ram:MakeFigure/Figure.dump Ram:MakeFigure/Left.bin as Ram:MakeFigure/Left.bob

	Echo "               [3mExtracting right facing graphics....[23m"
	MakeFigure >nil: -@Ram:MakeFigure/Filters -#Right Ram:MakeFigure/Figure.ilbm Ram:MakeFigure/Right.bin
	Join Ram:MakeFigure/Figure.dump Ram:MakeFigure/Right.bin as Ram:MakeFigure/Right.bob

	Echo "               [3mExtracting front facing graphics....[23m"
	MakeFigure >nil: -@Ram:MakeFigure/Filters -#Front Ram:MakeFigure/Figure.ilbm Ram:MakeFigure/Front.bin
	Join Ram:MakeFigure/Figure.dump Ram:MakeFigure/Front.bin as Ram:MakeFigure/Front.bob

	Echo "               [3mExtracting rear facing graphics....[23m"
	MakeFigure >nil: -@Ram:MakeFigure/Filters -#Back Ram:MakeFigure/Figure.ilbm Ram:MakeFigure/Back.bin
	Join Ram:MakeFigure/Figure.dump Ram:MakeFigure/Back.bin as Ram:MakeFigure/Back.bob

	Echo "               [3mExtracting face graphics....[23m"
	MakeFigure >nil: -@Ram:MakeFigure/Filters -#Face Ram:MakeFigure/Figure.ilbm Ram:MakeFigure/Face.bin
	Join Ram:MakeFigure/Face.dump Ram:MakeFigure/Face.bin as Ram:MakeFigure/Face.bob

	Echo "               [3mCompressing file (this may take a while)....[23m"

	Join Ram:MakeFigure/Front.bob Ram:MakeFigure/Left.bob Ram:MakeFigure/Right.bob Ram:MakeFigure/Back.bob Ram:MakeFigure/Face.bob as Ram:MakeFigure/Figure.bob
	Crunch >nil: Ram:MakeFigure/Figure.bob ram:Makefigure/Figure.crn

	Echo "               [3mWriting file....[23m"

	If Exists //Disk1/CharactersGfx
		Execute Ram:CopyFile3
	Else
		If Exists /CharactersGfx
			Execute Ram:CopyFile1
		Else
			Execute Ram:CopyFile2
		EndIf
	EndIf

	Echo "*N               Conversion finished!"
Else
	Echo "*N               Conversion aborted!"
EndIf
