Группа :: Игры/Аркады
Пакет: koules
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: koules-1.4-alt-tmpfile.patch
Скачать
Скачать
diff -Naur koules1.4-orig/koules koules1.4/koules
--- koules1.4-orig/koules 2009-06-06 15:04:54 +0000
+++ koules1.4/koules 2009-06-06 15:03:32 +0000
@@ -1,24 +1,27 @@
#!/bin/sh
KOULESDIR=/usr/games
-XKOULESDIR=/usr/games
-if [ $TERM != console ]; then
-if [ $TERM != linux ]; then
-if [ $DISPLAY != "" ]; then
- exec $KOULESDIR/koules.tcl
-fi
-fi
+XKOULESDIR=/usr/games # unused in this script, hm
+DIALOGOUT=`mktemp`
+
+if [ "$TERM" != console ]; then
+ if [ "$TERM" != linux ]; then
+ if [ "$DISPLAY" != "" ]; then
+ exec $KOULESDIR/koules.tcl
+ fi
+ fi
fi
+
single()
{
- dialog --title "Koules options" --menu "Select resolution" 9 40 2 "320x200" "low resolution" "640x480" "High resolution" 2> /tmp/dialogout.$$
- resolution=`cat /tmp/dialogout.$$`
+ dialog --title "Koules options" --menu "Select resolution" 9 40 2 "320x200" "low resolution" "640x480" "High resolution" 2> $DIALOGOUT
+ resolution=`cat $DIALOGOUT`
if [ $resolution = "320x200" ]; then
resolution="-s"
else
resolution="-l"
fi
- dialog --title "Koules options" --checklist "Driver options" 9 40 2 "Mouse support" "" on "Sound support" "" on 2> /tmp/dialogout.$$
- drivers=`cat /tmp/dialogout.$$`
+ dialog --title "Koules options" --checklist "Driver options" 9 40 2 "Mouse support" "" on "Sound support" "" on 2> $DIALOGOUT
+ drivers=`cat $DIALOGOUT`
mouse="-M"
sound="-d"
for opt in $drivers; do
@@ -33,29 +36,30 @@
0) echo "$KOULESDIR/koules.svga $opt" >~/.koules.single
esac
}
+
server()
{
- dialog --title "Server options" --menu "Select resolution" 10 50 3 "Normal" "For 320x250 and 640x480 clients" "Wide" "For 320x200 and 640x400 clients" "Large" "For extra large 800x620 clients" 2> /tmp/dialogout.$$
- resolution=`cat /tmp/dialogout.$$`
+ dialog --title "Server options" --menu "Select resolution" 10 50 3 "Normal" "For 320x250 and 640x480 clients" "Wide" "For 320x200 and 640x400 clients" "Large" "For extra large 800x620 clients" 2> $DIALOGOUT
+ resolution=`cat $DIALOGOUT`
case $resolution in
"Normal") resolution="" ;;
"Wide") resolution="-W" ;;
"Large") resolution="-E" ;;
esac
- dialog --title "Server options" --menu "Difficulty" 12 50 5 "0" "Nightmare" "1" "hard" "2" "medium" "3" "easy" "4" "very easy" 2> /tmp/dialogout.$$
- diff=`cat /tmp/dialogout.$$`
- dialog --title "Server options" --checklist "Game options" 8 40 1 "Deathmatch" "" off 2> /tmp/dialogout.$$
- drivers=`cat /tmp/dialogout.$$`
+ dialog --title "Server options" --menu "Difficulty" 12 50 5 "0" "Nightmare" "1" "hard" "2" "medium" "3" "easy" "4" "very easy" 2> $DIALOGOUT
+ diff=`cat $DIALOGOUT`
+ dialog --title "Server options" --checklist "Game options" 8 40 1 "Deathmatch" "" off 2> $DIALOGOUT
+ drivers=`cat $DIALOGOUT`
deathmatch=""
for opt in $drivers; do
case $opt in
*Deathmatch*) deathmatch="-K";;
esac
done
- dialog --title "Server options" --inputbox "Starting level" 9 40 "1" 2>/tmp/dialogout.$$
- level=`cat /tmp/dialogout.$$`
- dialog --title "Server options" --inputbox "Inet port" 9 40 "12345" 2>/tmp/dialogout.$$
- port=`cat /tmp/dialogout.$$`
+ dialog --title "Server options" --inputbox "Starting level" 9 40 "1" 2>$DIALOGOUT
+ level=`cat $DIALOGOUT`
+ dialog --title "Server options" --inputbox "Inet port" 9 40 "12345" 2>$DIALOGOUT
+ port=`cat $DIALOGOUT`
opt="$resolution -S $deathmatch -D $diff -L $level -P $port"
dialog --title "Koules options" --yesno "Save configuration" 5 40
case $? in
@@ -64,15 +68,15 @@
}
client()
{
- dialog --title "Client options" --menu "Select resolution" 9 40 2 "320x200" "low resolution" "640x480" "High resolution" 2> /tmp/dialogout.$$
- resolution=`cat /tmp/dialogout.$$`
+ dialog --title "Client options" --menu "Select resolution" 9 40 2 "320x200" "low resolution" "640x480" "High resolution" 2> $DIALOGOUT
+ resolution=`cat $DIALOGOUT`
if [ $resolution = "320x200" ]; then
resolution="-s"
else
resolution="-l"
fi
- dialog --title "Client options" --checklist "Driver options" 9 40 2 "Mouse support" "" on "Sound support" "" on 2> /tmp/dialogout.$$
- drivers=`cat /tmp/dialogout.$$`
+ dialog --title "Client options" --checklist "Driver options" 9 40 2 "Mouse support" "" on "Sound support" "" on 2> $DIALOGOUT
+ drivers=`cat $DIALOGOUT`
mouse="-M"
sound="-d"
for opt in $drivers; do
@@ -81,20 +85,21 @@
\"Sound) sound=" ";;
esac
done
- dialog --title "Client options" --inputbox "Host" 9 40 "localhost" 2>/tmp/dialogout.$$
- host=`cat /tmp/dialogout.$$`
- dialog --title "Client options" --inputbox "Inet port" 9 40 "12345" 2>/tmp/dialogout.$$
- port=`cat /tmp/dialogout.$$`
+ dialog --title "Client options" --inputbox "Host" 9 40 "localhost" 2>$DIALOGOUT
+ host=`cat $DIALOGOUT`
+ dialog --title "Client options" --inputbox "Inet port" 9 40 "12345" 2>$DIALOGOUT
+ port=`cat $DIALOGOUT`
opt="-C$host $resolution $mouse $sound -P $port"
dialog --title "Koules options" --yesno "Save configuration" 5 40
case $? in
0) echo "$KOULESDIR/koules.svga $opt" >~/.koules.client
esac
}
+
configure()
{
-dialog --title "Koules options" --menu "Select game mode" 11 30 4 "g" "single" "s" "Network server" "c" "Network client" "b" "Back to main menu" 2> /tmp/dialogout.$$
-mode=`cat /tmp/dialogout.$$`
+dialog --title "Koules options" --menu "Select game mode" 11 30 4 "g" "single" "s" "Network server" "c" "Network client" "b" "Back to main menu" 2> $DIALOGOUT
+mode=`cat $DIALOGOUT`
case $mode in
g)\
single ;;
@@ -107,8 +112,8 @@
mainmenu()
{
-dialog --title "Koules startup menu" --menu "Select game mode" 11 30 4 "g" "single" "s" "Network server" "c" "Network client" "m" "Configuration menu" 2> /tmp/dialogout.$$
-mode=`cat /tmp/dialogout.$$`
+dialog --title "Koules startup menu" --menu "Select game mode" 11 30 4 "g" "single" "s" "Network server" "c" "Network client" "m" "Configuration menu" 2> $DIALOGOUT
+mode=`cat $DIALOGOUT`
case $mode in
g)\
if [ ! -r ~/.koules.single ]; then
@@ -133,4 +138,6 @@
mainmenu ;;
esac
}
+
mainmenu
+rm -f $DIALOGOUT