From 83019dab44a376835dd0aa0596175ade025c1b9b Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 4 Feb 2025 20:16:31 +1000 Subject: [PATCH] Update wickedx/svg scripts for current tools Also makes the prints a bit nicer (for set -ex mode, and because modern versions of these tools are quite spammy). No bashisms so no need to depend on bash specifically. --- gfx/menu/wickedx/svg/export.sh | 77 ++++++++++++----------- gfx/menu/wickedx/svg/export_newversion.sh | 35 ++++++----- gfx/menu/wickedx/wickedx.txt | 2 +- 3 files changed, 62 insertions(+), 52 deletions(-) diff --git a/gfx/menu/wickedx/svg/export.sh b/gfx/menu/wickedx/svg/export.sh index 092f3a6..c3476a4 100755 --- a/gfx/menu/wickedx/svg/export.sh +++ b/gfx/menu/wickedx/svg/export.sh @@ -1,47 +1,52 @@ -#!/bin/bash -#Requires Inkscape, Gimp and ~/.gimp*/scripts/png-tga.scm +#!/bin/sh +#Requires Inkscape, Gimp and ~/.config/GIMP/*.*/scripts/png-tga.scm #Exports png images from svg files (to /tga) and converts them to tga. +# bones_was_here: updated for inkscape 1.2.2 and gimp 2.10.34 / 3.0 +# but script-fu seems broken in gimp 3.0-RC2 + +set -e + if [ ! -d tga ] then mkdir tga fi -echo "Exporting png images from svg files..." -inkscape -e tga/background_l2.png -d 90 background_l2.svg -inkscape -e tga/bigbutton_c.png -d 90 bigbutton_c.svg -inkscape -e tga/bigbutton_f.png -d 90 bigbutton_f.svg -inkscape -e tga/bigbutton_n.png -d 90 bigbutton_n.svg -inkscape -e tga/border.png -d 90 border.svg -inkscape -e tga/button_c.png -d 45 button_c.svg -inkscape -e tga/button_f.png -d 45 button_f.svg -inkscape -e tga/button_n.png -d 45 button_n.svg -inkscape -e tga/charmapbutton.png -d 45 charmapbutton.svg -inkscape -e tga/checkbox_n0.png -d 45 checkbox_n0.svg -inkscape -e tga/checkbox_n1.png -d 45 checkbox_n1.svg -inkscape -e tga/checkmark.png -d 45 checkmark.svg -inkscape -e tga/closebutton_c.png -d 90 closebutton_c.svg -inkscape -e tga/closebutton_f.png -d 90 closebutton_f.svg -inkscape -e tga/closebutton_n.png -d 90 closebutton_n.svg -inkscape -e tga/color.png -d 45 color.svg -inkscape -e tga/crosshairbutton_c.png -d 45 crosshairbutton_c.svg -inkscape -e tga/crosshairbutton_f.png -d 45 crosshairbutton_f.svg -inkscape -e tga/cursor.png -d 45 cursor.svg -inkscape -e tga/inputbox_f.png -d 45 inputbox_f.svg -inkscape -e tga/inputbox_n.png -d 45 inputbox_n.svg -inkscape -e tga/radiobutton_c.png -d 45 radiobutton_c.svg -inkscape -e tga/radiobutton_f.png -d 45 radiobutton_f.svg -inkscape -e tga/radiobutton_n.png -d 45 radiobutton_n.svg -inkscape -e tga/scrollbar_n.png -d 45 scrollbar_n.svg -inkscape -e tga/scrollbar_s.png -d 45 scrollbar_s.svg -inkscape -e tga/slider_n.png -d 45 slider_n.svg -inkscape -e tga/slider_s.png -d 45 slider_s.svg -inkscape -e tga/tooltip.png -d 45 tooltip.svg +printf "\e[1mExporting png images from svg files...\e[m\n" +inkscape -o tga/background_l2.png -d 90 background_l2.svg +inkscape -o tga/bigbutton_c.png -d 90 bigbutton_c.svg +inkscape -o tga/bigbutton_f.png -d 90 bigbutton_f.svg +inkscape -o tga/bigbutton_n.png -d 90 bigbutton_n.svg +inkscape -o tga/border.png -d 90 border.svg +inkscape -o tga/button_c.png -d 45 button_c.svg +inkscape -o tga/button_f.png -d 45 button_f.svg +inkscape -o tga/button_n.png -d 45 button_n.svg +inkscape -o tga/charmapbutton.png -d 45 charmapbutton.svg +inkscape -o tga/checkbox_n0.png -d 45 checkbox_n0.svg +inkscape -o tga/checkbox_n1.png -d 45 checkbox_n1.svg +inkscape -o tga/checkmark.png -d 45 checkmark.svg +inkscape -o tga/closebutton_c.png -d 90 closebutton_c.svg +inkscape -o tga/closebutton_f.png -d 90 closebutton_f.svg +inkscape -o tga/closebutton_n.png -d 90 closebutton_n.svg +inkscape -o tga/color.png -d 45 color.svg +inkscape -o tga/crosshairbutton_c.png -d 45 crosshairbutton_c.svg +inkscape -o tga/crosshairbutton_f.png -d 45 crosshairbutton_f.svg +inkscape -o tga/cursor.png -d 45 cursor.svg +inkscape -o tga/inputbox_f.png -d 45 inputbox_f.svg +inkscape -o tga/inputbox_n.png -d 45 inputbox_n.svg +inkscape -o tga/radiobutton_c.png -d 45 radiobutton_c.svg +inkscape -o tga/radiobutton_f.png -d 45 radiobutton_f.svg +inkscape -o tga/radiobutton_n.png -d 45 radiobutton_n.svg +inkscape -o tga/scrollbar_n.png -d 45 scrollbar_n.svg +inkscape -o tga/scrollbar_s.png -d 45 scrollbar_s.svg +inkscape -o tga/slider_n.png -d 45 slider_n.svg +inkscape -o tga/slider_s.png -d 45 slider_s.svg +inkscape -o tga/tooltip.png -d 45 tooltip.svg cd tga -echo "Converting png to tga..." +printf "\e[1mConverting png to tga...\e[m\n" #(png-tga fileIn fileOut grayscale alpha0.5) -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(png-tga "background_l2.png" "background_l2.tga" 0 0)' \ -b '(png-tga "background_l2.png" "background_ingame.tga" 0 0)' \ -b '(png-tga "bigbutton_c.png" "bigbutton_c.tga" 0 0)' \ @@ -102,7 +107,7 @@ gimp -d -f -i \ -b '(png-tga "tooltip.png" "tooltip.tga" 0 0)' \ -b '(gimp-quit 0)' -echo "Removing png files from /tga ..." +printf "\e[1mRemoving png files from /tga ...\e[m\n" rm background_l2.png rm bigbutton_c.png rm bigbutton_f.png @@ -133,4 +138,4 @@ rm slider_n.png rm slider_s.png rm tooltip.png -echo "Export complete." +printf "\e[1;32mExport to ./tga/ complete.\e[m\n" diff --git a/gfx/menu/wickedx/svg/export_newversion.sh b/gfx/menu/wickedx/svg/export_newversion.sh index 517d962..5eb5019 100755 --- a/gfx/menu/wickedx/svg/export_newversion.sh +++ b/gfx/menu/wickedx/svg/export_newversion.sh @@ -1,10 +1,15 @@ -#!/bin/bash -#Requires vi, Inkscape, Gimp and ~/.gimp*/scripts/png-tga.scm +#!/bin/sh +#Requires vi, Inkscape, Gimp and ~/.config/GIMP/*.*/scripts/png-tga.scm #Used when the version number in background_l2.svg is changed. #Exports png images from background_l2.svg of all color versions, #converts them to tga and copyies them into wickedx folders in /tga -echo "Creating folders ..." +# bones_was_here: updated for inkscape 1.2.2 and gimp 2.10.34 / 3.0 +# but script-fu seems broken in gimp 3.0-RC2 + +set -e + +printf "\e[1mCreating folders ...\e[m\n" if [ ! -d tga ] then mkdir tga @@ -44,7 +49,7 @@ fi cd .. -echo "Creating individual color versions of background_l2.svg ..." +printf "\e[1mCreating individual color versions of background_l2.svg ...\e[m\n" cp background_l2.svg background_l2_blue.svg cp background_l2.svg background_l2_green.svg cp background_l2.svg background_l2_magenta.svg @@ -81,23 +86,23 @@ vi -e background_l2_yellow.svg <<-EOF :quit EOF -echo "Exporting png images from svg files..." -inkscape -e tga/background_l2.png -d 90 background_l2.svg -inkscape -e tga/background_l2_blue.png -d 90 background_l2_blue.svg -inkscape -e tga/background_l2_green.png -d 90 background_l2_green.svg -inkscape -e tga/background_l2_magenta.png -d 90 background_l2_magenta.svg -inkscape -e tga/background_l2_red.png -d 90 background_l2_red.svg -inkscape -e tga/background_l2_yellow.png -d 90 background_l2_yellow.svg +printf "\e[1mExporting png images from svg files...\e[m\n" +inkscape -o tga/background_l2.png -d 90 background_l2.svg +inkscape -o tga/background_l2_blue.png -d 90 background_l2_blue.svg +inkscape -o tga/background_l2_green.png -d 90 background_l2_green.svg +inkscape -o tga/background_l2_magenta.png -d 90 background_l2_magenta.svg +inkscape -o tga/background_l2_red.png -d 90 background_l2_red.svg +inkscape -o tga/background_l2_yellow.png -d 90 background_l2_yellow.svg rm background_l2_blue.svg rm background_l2_green.svg rm background_l2_magenta.svg rm background_l2_red.svg rm background_l2_yellow.svg -echo "Converting png to tga..." +printf "\e[1mConverting png to tga...\e[m\n" #(png-tga fileIn fileOut grayscale alpha0.5) cd tga -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(png-tga "background_l2.png" "background_l2.tga" 0 0)' \ -b '(png-tga "background_l2_blue.png" "background_l2_blue.tga" 0 0)' \ -b '(png-tga "background_l2_green.png" "background_l2_green.tga" 0 0)' \ @@ -106,7 +111,7 @@ gimp -d -f -i \ -b '(png-tga "background_l2_yellow.png" "background_l2_yellow.tga" 0 0)' \ -b '(gimp-quit 0)' -echo "Copying tga files to folders and removing temporary files..." +printf "\e[1mCopying tga files to folders and removing temporary files...\e[m\n" cp background_l2.tga wickedx/background_l2.tga cp background_l2.tga wickedx/background_ingame.tga cp background_l2_blue.tga wickedx_blue/background_l2.tga @@ -133,4 +138,4 @@ rm background_l2_magenta.tga rm background_l2_red.tga rm background_l2_yellow.tga -echo "Export complete." +printf "\e[1;32mExport to ./tga/ complete.\e[m\n" diff --git a/gfx/menu/wickedx/wickedx.txt b/gfx/menu/wickedx/wickedx.txt index 3ee77fe..6fd58fa 100755 --- a/gfx/menu/wickedx/wickedx.txt +++ b/gfx/menu/wickedx/wickedx.txt @@ -15,7 +15,7 @@ I had to use colour images (/textures). To batch export tga images from the svg files, I wrote the export.sh, export_newversion.sh and png-tga.scm scripts. -(Requires vi, Inkscape and Gimp. Put the Gimp script in ~/.gimp*/scripts/) +(Requires vi, Inkscape and Gimp. Put the Gimp script in ~/.config/GIMP/*.*/scripts/) ================================================================================ Credits -- 2.39.5