Add smogdex social builds

This commit is contained in:
Christopher Monsanto 2020-04-13 03:24:52 -04:00
parent 141750f376
commit 6da52b8764
4 changed files with 41 additions and 4 deletions

View File

@ -3,7 +3,9 @@ The Smogon/Pokemon-Showdown sprite repository
# Installation
You will need to install the Tup build system. Instructions for Windows/Mac/Linux can be found [here](http://gittup.org/tup/).
- Tup build system. Instructions for Windows/Mac/Linux can be found [here](http://gittup.org/tup/).
- GraphicsMagick
- AdvPng
# Building

View File

@ -24,7 +24,26 @@ for file in iglob{"src/models/back-shiny/*", "src/models/back-shiny-cosmetic/*"}
tup.rule(file, "ln -s ../../../%f %o", "build/ps/ani-back-shiny/" .. output)
end
function fbsprite(input, output)
tup.foreach_rule(
input,
"^ fbsprite %f^ tools/fbsprite.sh %f %o",
output
)
end
function twittersprite(input, output)
tup.foreach_rule(
input,
"^ twittersprite %f^ tools/twittersprite.sh %f %o",
output
)
end
for file in iglob{"src/models/front/*"} do
local output = toSmogonAlias(decodeFS(tup.base(file))) .. "." .. tup.ext(file)
tup.rule(file, "ln -s ../../../%f %o", "build/smogon/xy/" .. output)
end
local base = toSmogonAlias(decodeFS(tup.base(file)))
tup.foreach_rule(file, "ln -s ../../../%f %o", "build/smogon/xy/" .. base .. ".%e")
fbsprite(file, "build/smogon/fbsprites/xy/" .. base .. ".png")
twittersprite(file, "build/smogon/twittersprites/xy/" .. base .. ".png")
end

8
tools/fbsprite.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# Smogdex Facebook social images
set -e
gm convert $1'[0]' -trim -resize 150x150 -background white -gravity center -extent 198x198 -bordercolor black -border 1 $2
advpng -z $2

8
tools/twittersprite.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# Smogdex Twitter social images
set -e
gm convert $1'[0]' -trim -resize 115x115 -background white -gravity center -extent 120x120 $2
advpng -z $2