]> git.rm.cloudns.org Git - xonotic/mediasource.git/commitdiff
Update wickedx/svg scripts for current tools
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 4 Feb 2025 10:16:31 +0000 (20:16 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 4 Feb 2025 10:39:46 +0000 (20:39 +1000)
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
gfx/menu/wickedx/svg/export_newversion.sh
gfx/menu/wickedx/wickedx.txt

index 092f3a6448d28fd98c1f304f7bd5668d692cd321..c3476a43f77fea61f0ce299ae2da01c602c9ff34 100755 (executable)
@@ -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"
index 517d962d210c0f1daab0211c29ba4ae581cce8de..5eb5019d34a67dc1e237b2af6156727da620da64 100755 (executable)
@@ -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"
index 3ee77fef6b964b4a197e79c760404e9fb391b587..6fd58fa9bc84a2ab8fa1ccbae30a68f5f46fc7a1 100755 (executable)
@@ -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