File BASS of Package BASS

#!/bin/bash

SCUMMVM_INI_DIR=$HOME/.config/scummvm/
SCUMMVM_INI_FILE=$HOME/.config/scummvm/scummvm.ini

if [ ! -f $SCUMMVM_INI_FILE ]; then
    test -d $SCUMMVM_INI_DIR || mkdir -p $SCUMMVM_INI_DIR
    scummvmversion=`scummvm -v|grep ^ScummVM|awk '{print $2}'`
    echo "[scummvm]" > $SCUMMVM_INI_FILE
    echo "versioninfo=$scummvmversion" >> $SCUMMVM_INI_FILE
fi

grep "path=/usr/share/BASS/" $SCUMMVM_INI_FILE
if [ $? -ne 0 ]; then

    tmplang="$LANG"
    test "$LC_MESSAGES" != "" && tmplang="$LC_MESSAGES"
    test "$LC_ALL"      != "" && tmplang="$LC_ALL"
    test "$LANGUAGE"    != "" && tmplang="$LANGUAGE"
    
    lang=`echo $tmplang|cut -d "_" -f 1`

    case $lang in
	en)
	    lang=gb
	    echo $tmplang | grep en_US &>/dev/null && lang=en
	    ;;
	de|fr|it|es|se)
	    ;;
	*)
	    lang=gb
	    ;;
    esac

    xmessage -buttons English:0,German:6,French:2,Italian:3,Spanish:4,Swedish:5 \
             -default English \
             -center \
             -file /usr/share/BASS/info \
             -print
    result=$?

    case $result in
        0)
            lang=en
            language=English
            ;;
        6)
            lang=de
            language=German
            ;;
        2)
            lang=fr
            language=French
            ;;
        3)
            lang=it
            language=Italian
            ;;
        4)
            lang=es
            language=Spanish
            ;;
        5)
            lang=se
            language=Swedish
            ;;

        *)
            ;;
    esac
    
    echo "Using language: $lang"

    cat >> $SCUMMVM_INI_FILE << EOF

[sky]
description=Beneath a Steel Sky ($language)
path=/usr/share/BASS/
engineid=sky
gameid=sky
language=$lang
scale_factor=3
scaler=hq
subtitles=true
fullscreen=true

EOF
fi

scummvm -g opengl $OPTIONS sky
openSUSE Build Service is sponsored by