diff options
author | SmallJoker <st.rentsch@hotmail.com> | 2014-07-23 13:46:42 +0200 |
---|---|---|
committer | SmallJoker <st.rentsch@hotmail.com> | 2014-07-23 13:46:42 +0200 |
commit | dc44a8805fc5e3d5c8a3b4464c377dbdbf4a7e68 (patch) | |
tree | 96a443c2e4783eb31af44e181cc4b57b0b2f0310 /set_meta.sh | |
parent | 597213a67d3e224ef0e5f8aabdb53861d8c4db77 (diff) |
Update
Diffstat (limited to 'set_meta.sh')
-rwxr-xr-x | set_meta.sh | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/set_meta.sh b/set_meta.sh deleted file mode 100755 index 1db43cd..0000000 --- a/set_meta.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -SPRITES=$(find -regextype sed -regex '.*/player_[0-9]\{1,\}.png' | sort -V) -MODELS=$(find -regextype sed -regex '.*/character_[0-9]\{1,\}.png' | sort -V) -function ask_for_meta { - convert $2 -scale 100x200 /tmp/skins_set_meta - SNAME=$(basename $1) - SNAME=${SNAME%.*} - METAFILE=u_skins/meta/$SNAME.txt - FORCE=$3 - if $FORCE || ! [ -f $METAFILE ] - then - echo $METAFILE - YADOUT=$(yad --form --image=/tmp/skins_set_meta --field $SNAME:LBL --field=Name --field=Author --field=Description --field=Comment) - if [ -z "$YADOUT" ]; then exit; fi # canceled - OIFS="$IFS" - IFS='|' - read -a VALUES <<< "$YADOUT" - IFS="$OIFS" - NAME=${VALUES[1]} - AUTHOR=${VALUES[2]} - DESCRIPTION=${VALUES[3]} - COMMENT=${VALUES[4]} - if [ -n "$NAME" ] && [ -n "$AUTHOR" ] - then - echo -n > $METAFILE # clear it - echo 'name = "'$NAME'",' >> $METAFILE - echo 'author = "'$AUTHOR'",' >> $METAFILE - # only write description and comment if they are specified - if [ -n "$DESCRIPTION" ] - then - echo 'description = "'$DESCRIPTION'",' >> $METAFILE - fi - if [ -n "$COMMENT" ] - then - echo 'comment = "'$COMMENT'",' >> $METAFILE - fi - echo "Saved !" - fi - fi -} -if [ -z $1 ] -then - for i in $SPRITES - do - ask_for_meta $i $i false - done - for i in $MODELS - do - ask_for_meta $i ${i%.*}_preview.png false - done -else - if [ -f ${1%.*}_preview.png ] - then - ask_for_meta $1 ${1%.*}_preview.png true - else - ask_for_meta $1 $1 true - fi -fi -rm /tmp/skins_set_meta |