File DreamWeb of Package DreamWeb

#!/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/DreamWeb/" $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=en
            echo $tmplang | grep en_US &>/dev/null && lang=us
            ;;
	de|fr|it|es)
	    ;;
	*)
	    lang=en
	    ;;
    esac

    xmessage -buttons "English(UK):0,English(US):2,German:3,French:4,Italian:5,Spanish:6" \
             -default "English(UK)" \
             -center \
             -file /usr/share/DreamWeb/info \
             -print
    result=$?

    case $result in
        0)
            lang=en
            language="English(UK)"
            ;;
        2)
            lang=us
            language="English(US)"
            ;;

        3)
            lang=de
            language=German
            ;;
        4)
            lang=fr
            language=French
            ;;
        5)
            lang=it
            language=Italian
            ;;
        6)
            lang=es
            language=Spanish
            ;;
        *)
            ;;
    esac
    
    echo "Using language: $lang ($language)"

    cat >> $SCUMMVM_INI_FILE << EOF

[DreamWeb]
description=DreamWeb (CD/DOS/$language)
path=/usr/share/DreamWeb/$lang
engineid=dreamweb
gameid=dreamweb
language=$lang
scale_factor=3
scaler=hq
subtitles=true
fullscreen=true

EOF
fi

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