Rogue Class Linux Download Login

Artifact Content

Artifact 2c83f62a076b0156b1dba1fc7582833cf947d0c6:


#!/bin/sh
result=$(mktemp)
trap onexit EXIT

onexit()
{
    rm -f $result
}

icondir=/usr/share
iconback=icons/gnome/48x48/actions/back.png
iconedit=icons/gnome/48x48/apps/text-editor.png
iconlog=icons/gnome/48x48/status/info.png
iconplay=pixmaps/knights.png
iconserver=icons/gnome/48x48/places/server.png
iconstop=icons/gnome/48x48/actions/stop.png
title="Knights Menu"
dialog                                      \
    --icons $icondir                        \
    --title "$title"                        \
    --menu "$title" 0 0 10                  \
    PLAY   "Play game"          $iconplay   \
    SERVER "Start server"       $iconserver \
    STOP   "Stop server"        $iconstop   \
    VIEW   "View server log"    $iconlog    \
    CONF   "Configure server"   $iconedit   \
    BACK   "Back to games menu" $iconback   \
    2>$result
if [ $? -ne 0 ]
then
    exit 0
fi
case $(<$result) in
BACK)
    # go straight back to the game menu instead of the main knights menu
    rig ~/settings/history.cfg pop $(tty) >/dev/null
    ;;
CONF)
    rig ~/settings/history.cfg push $(tty) knights-menu
    rig ~/settings/history.cfg push $(tty) "ded /usr/share/games/knights/server/knights_config.txt"
    ;;
PLAY)
    rig ~/settings/history.cfg push $(tty) knights-menu
    knights-client
    ;;
SERVER)
    rig ~/settings/history.cfg push $(tty) knights-menu
    knights-start
    ;;
STOP)
    rig ~/settings/history.cfg push $(tty) knights-menu
    knights-stop
    ;;
VIEW)
    rig ~/settings/history.cfg push $(tty) knights-menu
    knights-log
    ;;
esac
exit 0