From 69397fcb97229111b172095d4615ae56379dd95d Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Tue, 9 May 2017 17:36:36 +0200 Subject: [PATCH] Allow generating only the UI for certain elements --- original-resources/gen-ui-png.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/original-resources/gen-ui-png.py b/original-resources/gen-ui-png.py index 961760f..c1f2bbd 100755 --- a/original-resources/gen-ui-png.py +++ b/original-resources/gen-ui-png.py @@ -1,6 +1,7 @@ #!/usr/bin/python3.6 import os +import sys from subprocess import run, DEVNULL multipliers = [0.75, 1.0, 1.25, 1.5, 2.0, 4.0] @@ -45,6 +46,7 @@ cells = [ inkscape_default_dpi = 90 svg = 'buttons.svg' root = '../android/assets/ui' +gen_only = sys.argv[1:] for multiplier in multipliers: folder = os.path.join(root, f'x{multiplier}') @@ -53,6 +55,8 @@ for multiplier in multipliers: dpi = int(inkscape_default_dpi * multiplier) print('Generating assets for', folder) for objectid in ids: + if gen_only and objectid not in gen_only: + continue filename = os.path.join(folder, objectid + '.png') # -z not to use the X server # -i to select the given object id @@ -65,6 +69,8 @@ for multiplier in multipliers: folder = os.path.join(folder, 'cells') os.makedirs(folder, exist_ok=True) for cellid in cells: + if gen_only and cellid not in gen_only: + continue filename = os.path.join(folder, cellid + '.png') run(f'inkscape -z -i{cellid} -j -e{filename} -d{dpi} {svg}', shell=True, stdout=DEVNULL)