File soltys of Package soltys

#!/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/soltys/" $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
	es|pl)
	    ;;
	*)
	    lang=en
	    ;;
    esac

    xmessage -buttons English:0,Spanish:2,Polish:3 \
             -default English \
             -center \
             -file /usr/share/soltys/info \
             -print
    result=$?

    case $result in
        0)
            lang=en
            language=English
            ;;
	2)
            lang=es
            language=Spanish
            ;;
        3)
            lang=pl
            language=Polish
            ;;
        *)
            ;;
    esac
    
    echo "Using language: $lang ($language)"

    cat >> $SCUMMVM_INI_FILE << EOF

[soltys]
description=Soltys (Freeware v1.0/DOS/$language)
path=/usr/share/soltys/$lang
engineid=cge
gameid=soltys
language=$lang
scale_factor=3
scaler=hq
subtitles=true
fullscreen=true

EOF
fi

scummvm -g opengl soltys
openSUSE Build Service is sponsored by