The forum

Crayon Physics Deluxe

Author Replies
twinoatl Tuesday 13 January 2009 at 12:05
twinoatlAnonymous

Hi,

I've just written a script for Crayon Physics Deluxe.

Bye
twinoatl Tuesday 13 January 2009 at 13:51
twinoatlAnonymous

#!/bin/bash

if [ "$PLAYONLINUX" = "" ]; then
exit 0
fi

source "$PLAYONLINUX/lib/sources"

GAME_NAME="Crayon Physics Deluxe"
GAME_PREFIX="crayon-physics-deluxe"

presentation "${GAME_NAME}" "Kloonigames" "http://www.crayonphysics.com/" "twinoatl" "${GAME_PREFIX}"

FILE=$(select_file "Please select the ${GAME_NAME} installer in the following dialog" "$HOME")

select_prefix "$HOME/.PlayOnLinux/wineprefix/${GAME_PREFIX}"
polprefixcreate

wine $FILE

creer_lanceur "${GAME_PREFIX}" "Program Files/Crayon Physics Deluxe" "crayon.exe" "" "${GAME_NAME}"
Ghostofkendo Tuesday 13 January 2009 at 15:24
Ghostofkendo

Hi twinoatl,

Your script isn't exactly wrong but it's written in the old version of the PlayOnLinux language. A new version was introduced with PlayOnLinux 3 and now, we don't accept new scripts written in an older version.
But, as you may have noticed, the English documentation wasn't updated and, because we are rewriting the whole doc, it won't be available soon enough.
Given the fact that your script can't be accepted because of our lateness, I'll adapt it for you.
It should be done tomorrow.

Bye

Edited by Ghostofkendo

twinoatl Wednesday 14 January 2009 at 9:53
twinoatlAnonymous

Hi Ghostofkendo,

thank you for the translation to the newer version. I think you are sending a wrong message to the community by not giving any way to the users to write acceptable scripts. I think you should at least give a list of scripts that are written using the new functions so that we can read them and learn from them.

Have a pleasant day and keep improving PoL, it's very cool.

Thank you
Ghostofkendo Wednesday 14 January 2009 at 11:43
Ghostofkendo

I think you are sending a wrong message to the community by not giving any way to the users to write acceptable scripts. I think you should at least give a list of scripts that are written using the new functions so that we can read them and learn from them.

Quote from twinoatl
Sure it's bad that there is currently no up-to-date English doc, but if you have read more carefully my previous answer, you would have understand that it's just temporary, we do it during our spare time and the delay is simply due to a lack of time.
Again, by being more careful, you would have seen the "Scripts" entry in the menu on the right. Thus, you can see the validated scripts
An example of POL 3 script ? Let's take Crayon Physics' one !

EDIT: So here is your script in POL language v3. I took the liberty to add variables for translations (I yet added the French translation). If you speak other languages that are supported by PlayOnLinux, feel free to add them.
And could you please test it?
#!/bin/bash

if [ "$PLAYONLINUX" = "" ]; then
exit 0
fi
source "$PLAYONLINUX/lib/sources"
cfg_check

GAME_NAME="Crayon Physics Deluxe"
GAME_PREFIX="CrayonPhysicsDeluxe"

if [ "$POL_LANG" == "fr" ]
then

LNG_WAIT="Installation en cours..."
LNG_FILE="Veuillez sélectionner l'installeur de $GAME_NAME"

else

LNG_WAIT="Installing..."
LNG_FILE="Please select the $GAME_NAME installer"

fi

POL_SetupWindow_Init "" ""

POL_SetupWindow_presentation "$GAME_NAME" "Kloonigames" "http://www.crayonphysics.com/" "twinoatl" "$GAME_PREFIX"

mkdir -p $REPERTOIRE/wineprefix/$GAME_PREFIX
select_prefix "$REPERTOIRE/wineprefix/$GAME_PREFIX"
POL_SetupWindow_prefixcreate

cd $HOME
POL_SetupWindow_browse "$LNG_FILE" "$GAME_NAME" "$HOME"
FILE="$APP_ANSWER"

POL_SetupWindow_wait_next_signal "$LNG_WAIT" "$GAME_NAME"
wine $FILE
POL_SetupWindow_detect_exit

POL_SetupWindow_make_shortcut "${GAME_PREFIX}" "Program Files/Crayon Physics Deluxe" "crayon.exe" "" "${GAME_NAME}"

POL_SetupWindow_Close
exit

Edited by Ghostofkendo

twinoatl Thursday 15 January 2009 at 9:55
twinoatlAnonymous

The script works perfectly, thank you very much.

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmcayonlinux.com