diff --git a/game.sh b/game.sh index 46c072f8e299c22087526c89bd7954bc47f19b79..0485ce5d4a983ac20d64c8f695d8be4a7aad3c8a 100755 --- a/game.sh +++ b/game.sh @@ -4,6 +4,20 @@ # 2 → name of the game as suggested in menu #configuration + #colors +prompt='\033[1;34;40m' +answer='\033[0;32m' +info='\033[0;33m' +choice='\033[1;37;40m' +mistake='\033[0;31m' +normal='\033[0m' +export prompt +export answer +export info +export choice +export mistake +export normal + #where are we ? export workingDirectory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" #(thanks http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in) cd $workingDirectory @@ -12,8 +26,8 @@ echo "Proove you are root…" sudo sleep 0.1 if [ -e "$killProcessesScript" ] then - echo "There seems to be (a) running instance(s) of the game controller, do you want to brutally kill the processes? (Y/n)" - echo "I'm not sure what it does if you don't…" + echo -e "$prompt There seems to be (a) running instance(s) of the game controller, do you want to brutally kill the processes? $info($choice""Y$info/$choice""n$info)$answer" + echo -e "$info I'm not sure what it does if you don't…$answer" read userinput if [ "$userinput" = "Y" -o "$userinput" = "y" ] then @@ -22,11 +36,12 @@ then sleep 1 fi fi - +printf $normal if [ $# = 0 ] then - echo "(X)box or (P)S3 ?" + echo -e "$prompt($choice""X$prompt)box or ($choice""P$prompt)S3 ?$answer" read userinput + printf $normal else userinput="$1" fi @@ -41,7 +56,7 @@ then echo "Xbox it is" else pad="" - echo "Whatever" + echo -e "$mistake""Whatever" fi export pad @@ -50,21 +65,23 @@ then userinput=$2 else # Give a list of available games - echo What game would you like to play? - echo 1\) vvvvvv - echo 2\) Braid - echo 3\) Eggnogg - echo 4\) Metal Slug - echo 5\) Dustforce - echo 6\) Hotline Miami 2: Wrong Number - echo 93\) Limbo - echo 94\) Lone Survivor - echo 95\) Minecraft - echo 96\) Psychonauts - echo 97\) Amnesia - echo "99) None, give me my gamepad mode back." + echo -e "$prompt"What game would you like to play?$info + echo -e "$choice"1"$info"\) "$choice"v"$info"vvvvv + echo -e "$choice"2"$info"\) "$choice"B"$info"raid + echo -e "$choice"3"$info"\) "$choice"E"$info"ggnogg + echo -e "$choice"4"$info"\) "$choice"M"$info"etal Slug + echo -e "$choice"5"$info"\) "$choice"D"$info"ustforce + echo -e "$choice"6"$info"\) "$choice"H"$info"otline "$choice"M"$info"iami "$choice"2"$info": Wrong Number + echo -e "$choice"7"$info"\) The "$choice"B"$info"inding "$choice"o"$info"f "$choice"I"$info"saac: Wrath of the Lamb + echo -e "$choice"93"$info"\) Limbo + echo -e "$choice"94"$info"\) Lone Survivor + echo -e "$choice"95"$info"\) Minecraft + echo -e "$choice"96"$info"\) Psychonauts + echo -e "$choice"97"$info"\) Amnesia + echo -e "$choice"99"$info"\) "None, give me my gamepad mode back.$answer" read userinput fi +printf $normal # Use basic logic to determine which module to load if [ "$userinput" = 1 -o "$userinput" = "vvvvvv" -o "$userinput" = "Vvvvvv" -o "$userinput" = "v" -o "$userinput" = "V" ] @@ -73,7 +90,7 @@ then echo cd modules ./vvvvvv.sh -elif [ "$userinput" = 2 -o "$userinput" = "Braid" -o "$userinput" = "braid" ] +elif [ "$userinput" = 2 -o "$userinput" = "Braid" -o "$userinput" = "braid" -o "$userinput" = "B" -o "$userinput" = "b" ] then echo "Your controller will now be configured for Braid." echo @@ -89,24 +106,28 @@ then elif [ "$userinput" = 4 -o "$userinput" = "MetalSlug" -o "$userinput" = "metalslug" -o "$userinput" = "metal" -o "$userinput" = "Metal" -o "$userinput" = "m" -o "$userinput" = "M" ] then echo "Your controllerS will now be configured for Metal Slug." -#Different types of controllers could be configured, but it's not my case so I won't do it ;) echo cd modules ./metalslug.sh elif [ "$userinput" = 5 -o "$userinput" = "Dustforce" -o "$userinput" = "dustforce" -o "$userinput" = "dust" -o "$userinput" = "Dust" -o "$userinput" = "d" -o "$userinput" = "D" ] then echo "Your controllerS will now be configured for Dust Force." -#Different types of controllers could be configured, but it's not my case so I won't do it ;) echo cd modules ./dustforce.sh elif [ "$userinput" = 6 -o "$userinput" = "Hotline" -o "$userinput" = "Miami" -o "$userinput" = "hotline" -o "$userinput" = "miami" -o "$userinput" = "hm2" -o "$userinput" = "HM2" ] then echo "Your controller will now be configured for Hotline Miami 2: Wrong Number." -#Different types of controllers could be configured, but it's not my case so I won't do it ;) echo cd modules ./hotlinemiami2.sh +elif [ "$userinput" = 7 -o "$userinput" = "Binding" -o "$userinput" = "binding" -o "$userinput" = "Isaac" -o "$userinput" = "isaac" -o "$userinput" = "boi" -o "$userinput" = "BoI" -o "$userinput" = "BOI" ] +then + echo "Your controller will now be configured for The Binding of Isaac: Wrath of the Lamb." + cd modules + padconf=$3 + export padconf + ./bindingofisaac.sh elif [ "$userinput" = 93 -o "$userinput" = "Limbo" -o "$userinput" = "limbo" ] then echo "Your controller will now be configured for Limbo."