Fix alpha of MTG water and Repixture swamp water

master
Hugues Ross 2021-04-03 15:30:34 -04:00
parent c3bd008eb9
commit e23e1c4b66
3 changed files with 29 additions and 2 deletions

7
default/alphas.txt Normal file
View File

@ -0,0 +1,7 @@
# Set water to 75% transparency
default/default_river_water.png,75%
default/default_river_water_flowing_animated.png,75%
default/default_river_water_source_animated.png,75%
default/default_water.png,75%
default/default_water_flowing_animated.png,75%
default/default_water_source_animated.png,75%

View File

@ -12,7 +12,7 @@ fi
# converting .gif textures to the standard spritesheet format
function folderExport() {
echo "Exporting folder ${1}..."
rsync -r --exclude="*.gif" "${1}" "${EXPORT_DIR}"
rsync -r --exclude="*.gif" --exclude="*.txt" "${1}" "${EXPORT_DIR}"
for i in `find "${1}" -name "*.gif" -print`; do
mkdir -p "${EXPORT_DIR}/$(dirname "${i}")"
@ -34,7 +34,6 @@ function copyExport() {
# Paths from this file are relative to ${EXPORT_DIR}
# Empty lines are also allowed
function makeClones() {
# for i in `cat "${1}"`; do
while read i; do
if [[ -n ${i} && ${i::1} != '#' ]]; then
dest="${EXPORT_DIR}/${i#*,}"
@ -44,6 +43,22 @@ function makeClones() {
done < ${1}
}
# Set texture alphas from a file
#
# Alpha file format:
# relative/path/to/destination,alpha
# #Comment
#
# Paths from this file are relative to ${EXPORT_DIR}
# Empty lines are also allowed
function makeAlphas() {
while read i; do
if [[ -n ${i} && ${i::1} != '#' ]]; then
mogrify -type TrueColorAlpha -alpha set -channel A -evaluate set ${i#*,} "${EXPORT_DIR}/${i%,*}"
fi
done < ${1}
}
# Ensure that the build directory exists
mkdir -p "${EXPORT_DIR}"
@ -75,6 +90,7 @@ folderExport "butterflies"
folderExport "carts"
folderExport "caverealms"
folderExport "default"
makeAlphas "default/alphas.txt"
folderExport "doors"
folderExport "dye"
folderExport "email"
@ -149,6 +165,7 @@ folderExport "repixture/player_skins"
folderExport "repixture/ui"
folderExport "repixture/village"
folderExport "repixture/weather"
makeAlphas "repixture/default/alphas.txt"
makeClones "repixture-clones.txt"
echo "Done! Files copied to ${EXPORT_DIR}"

View File

@ -0,0 +1,3 @@
# Set swamp water to 85% opacity
default/default_swamp_water.png,85%
repixture/default/default_swamp_water_animated.png,85%