// You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////// require_once 'includes/global.php'; $pagedOutput = $argv[1] == 'pagedOutput=true'; $decklistOnlyOutput = $argv[2] == 'decklistOnlyOutput=true'; $fileNames = array_slice($argv, 3); $mode = 'Generate '; if ($decklistOnlyOutput) { $mode .= 'Decklist '; } $mode .= $pagedOutput ? 'Pages' : 'Cards'; echo "Card Generator v{$version} - {$mode}\n\n"; $files = getInputFiles($fileNames, 'Drag and drop a decklist file or directory into this window and press enter...'); configPrompt($decklistOnlyOutput); cleanOutputDir($pagedOutput); $writer = new ImageWriter(); $writer->setOutputType($pagedOutput, $decklistOnlyOutput); foreach ($files as $file) { $writer->parseDecklist($file); } echo "Generating images...\n"; if ($pagedOutput) { $count = $writer->writePages(); echo "Image generation complete.\n"; echo $count . " pages written.\n"; } else { $count = $writer->writeCards(); echo "Image generation complete.\n"; echo $count . " images written.\n"; }