diff --git a/deploy.py b/deploy.py index 6c4531b..394072f 100644 --- a/deploy.py +++ b/deploy.py @@ -141,13 +141,21 @@ def fetch_and_cut_song(tape, ffmpeg_version): sys.exit() -def assemble_png_image(tapes, icons=False): - if icons: - img_names = [f"./source/images/{tape['identifier']}_icon.png" for tape in tapes] - else: - img_names = [f"./source/images/{tape['identifier']}.png" for tape in tapes] +def assemble_png_images(tapes, outfile: str, resize=None): + + img_names = [f"./source/images/{tape['identifier']}.png" for tape in tapes] images = [Image.open(x) for x in img_names] + + if resize is not None: + for i, (im, tape) in enumerate(zip(images, tapes)): + im.thumbnail((128, 82), Image.ANTIALIAS) + if resize == (64, 41) and tape["icon_resize"] == "blur": + im.thumbnail(resize, Image.ANTIALIAS) + else: + im.thumbnail(resize, Image.NEAREST) + images[i] = im + widths, heights = zip(*(i.size for i in images)) columns = int((len(images))**0.5) @@ -163,10 +171,7 @@ def assemble_png_image(tapes, icons=False): y_offset = max(heights) * math.floor(i / columns) new_im.paste(im, (x_offset, y_offset)) - if icons: - new_im.save("./build/icons.png") - else: - new_im.save("./build/covers.png") + new_im.save(f"./build/{outfile}.png") def prepare_music(data): @@ -196,12 +201,13 @@ def prepare_music(data): def prepare_images(data, config): logging.info(f"assembling covers and icons into png files") - assemble_png_image(data) - assemble_png_image(data, icons=True) + assemble_png_images(data, "covers") + assemble_png_images(data, "icons", resize=(64, 41)) + assemble_png_images(data, "sprites", resize=(33, 21)) logging.info(f"copying other images") - shutil.copy("./source/images/boombox.png", "./build/boombox.png") - shutil.copy("./source/images/boombox_icon.png", "./build/boombox_icon.png") + shutil.copy("./source/images/players_icons.png", "./build/players_icons.png") + shutil.copy("./source/images/players_sprites.png", "./build/players_sprites.png") shutil.copy("./source/images/PreviewImage.png", "./build/PreviewImage.png") diff --git a/source/filelist_template.xml b/source/filelist_template.xml index 14dea09..dea433c 100644 --- a/source/filelist_template.xml +++ b/source/filelist_template.xml @@ -3,10 +3,12 @@ + - - {% for tape in tapes %} + + + {% for tape in tapes %} {% endfor %} diff --git a/source/images/08080_canyons_joyride_icon.png b/source/images/08080_canyons_joyride_icon.png deleted file mode 100644 index b8dc2e3..0000000 Binary files a/source/images/08080_canyons_joyride_icon.png and /dev/null differ diff --git a/source/images/08080_minor_threat_icon.png b/source/images/08080_minor_threat_icon.png deleted file mode 100644 index b8dc2e3..0000000 Binary files a/source/images/08080_minor_threat_icon.png and /dev/null differ diff --git a/source/images/alphabrain_icon.png b/source/images/alphabrain_icon.png deleted file mode 100644 index ac2adc8..0000000 Binary files a/source/images/alphabrain_icon.png and /dev/null differ diff --git a/source/images/atarispeed_icon.png b/source/images/atarispeed_icon.png deleted file mode 100644 index 37f7acf..0000000 Binary files a/source/images/atarispeed_icon.png and /dev/null differ diff --git a/source/images/balans_icon.png b/source/images/balans_icon.png deleted file mode 100644 index d7e995d..0000000 Binary files a/source/images/balans_icon.png and /dev/null differ diff --git a/source/images/bedouin_icon.png b/source/images/bedouin_icon.png deleted file mode 100644 index 9afc003..0000000 Binary files a/source/images/bedouin_icon.png and /dev/null differ diff --git a/source/images/biosphere_icon.png b/source/images/biosphere_icon.png deleted file mode 100644 index 064b6e5..0000000 Binary files a/source/images/biosphere_icon.png and /dev/null differ diff --git a/source/images/blade_icon.png b/source/images/blade_icon.png deleted file mode 100644 index f367c0b..0000000 Binary files a/source/images/blade_icon.png and /dev/null differ diff --git a/source/images/blank_icon.png b/source/images/blank_icon.png deleted file mode 100644 index 195ae61..0000000 Binary files a/source/images/blank_icon.png and /dev/null differ diff --git a/source/images/boombox_icon.png b/source/images/boombox_icon.png deleted file mode 100644 index 97e41c5..0000000 Binary files a/source/images/boombox_icon.png and /dev/null differ diff --git a/source/images/ddt_icon.png b/source/images/ddt_icon.png deleted file mode 100644 index cfcc242..0000000 Binary files a/source/images/ddt_icon.png and /dev/null differ diff --git a/source/images/deadmeadow_icon.png b/source/images/deadmeadow_icon.png deleted file mode 100644 index 605b034..0000000 Binary files a/source/images/deadmeadow_icon.png and /dev/null differ diff --git a/source/images/devilinthedetails_icon.png b/source/images/devilinthedetails_icon.png deleted file mode 100644 index 05b95a1..0000000 Binary files a/source/images/devilinthedetails_icon.png and /dev/null differ diff --git a/source/images/dm_icon.png b/source/images/dm_icon.png deleted file mode 100644 index 91748be..0000000 Binary files a/source/images/dm_icon.png and /dev/null differ diff --git a/source/images/dmx_icon.png b/source/images/dmx_icon.png deleted file mode 100644 index 9a27be8..0000000 Binary files a/source/images/dmx_icon.png and /dev/null differ diff --git a/source/images/dmxcut_icon.png b/source/images/dmxcut_icon.png deleted file mode 100644 index 12e1428..0000000 Binary files a/source/images/dmxcut_icon.png and /dev/null differ diff --git a/source/images/hardbass_icon.png b/source/images/hardbass_icon.png deleted file mode 100644 index 95e351d..0000000 Binary files a/source/images/hardbass_icon.png and /dev/null differ diff --git a/source/images/immigrantsong_icon.png b/source/images/immigrantsong_icon.png deleted file mode 100644 index 32bbeb5..0000000 Binary files a/source/images/immigrantsong_icon.png and /dev/null differ diff --git a/source/images/ira_icon.png b/source/images/ira_icon.png deleted file mode 100644 index 1111f88..0000000 Binary files a/source/images/ira_icon.png and /dev/null differ diff --git a/source/images/java_icon.png b/source/images/java_icon.png deleted file mode 100644 index 7a08bdc..0000000 Binary files a/source/images/java_icon.png and /dev/null differ diff --git a/source/images/nazare_icon.png b/source/images/nazare_icon.png deleted file mode 100644 index 80c6cfa..0000000 Binary files a/source/images/nazare_icon.png and /dev/null differ diff --git a/source/images/players_icons.png b/source/images/players_icons.png new file mode 100644 index 0000000..44ef47b Binary files /dev/null and b/source/images/players_icons.png differ diff --git a/source/images/players_sprites.png b/source/images/players_sprites.png new file mode 100644 index 0000000..3ddd8c1 Binary files /dev/null and b/source/images/players_sprites.png differ diff --git a/source/images/put_icon.png b/source/images/put_icon.png deleted file mode 100644 index 9b69eb6..0000000 Binary files a/source/images/put_icon.png and /dev/null differ diff --git a/source/images/rainbowstalin_icon.png b/source/images/rainbowstalin_icon.png deleted file mode 100644 index f73aac1..0000000 Binary files a/source/images/rainbowstalin_icon.png and /dev/null differ diff --git a/source/images/redoctober_icon.png b/source/images/redoctober_icon.png deleted file mode 100644 index e8f2219..0000000 Binary files a/source/images/redoctober_icon.png and /dev/null differ diff --git a/source/images/resize.py b/source/images/resize.py new file mode 100644 index 0000000..be624c1 --- /dev/null +++ b/source/images/resize.py @@ -0,0 +1,19 @@ +from PIL import Image +from pathlib import Path + +print(dir(Image)) + +size = 33, 21 +#size = 64, 41 +size_intermediate = 128, 82 + +for infile in Path('./').glob("*.png"): + if "icon" not in str(infile) and "sprite" not in str(infile): + try: + outfile = infile.with_name(infile.name.replace(".png", "_sprite.png")) + im = Image.open(infile) + im.thumbnail(size_intermediate, Image.ANTIALIAS) + im.thumbnail(size, Image.NEAREST) + im.save(outfile, "PNG") + except IOError: + print(f"cannot create thumbnail for {infile}") diff --git a/source/images/rum_icon.png b/source/images/rum_icon.png deleted file mode 100644 index cef5923..0000000 Binary files a/source/images/rum_icon.png and /dev/null differ diff --git a/source/images/rusija_icon.png b/source/images/rusija_icon.png deleted file mode 100644 index 5bdefaa..0000000 Binary files a/source/images/rusija_icon.png and /dev/null differ diff --git a/source/images/schritte_08080_icon.png b/source/images/schritte_08080_icon.png deleted file mode 100644 index 3a6e2d7..0000000 Binary files a/source/images/schritte_08080_icon.png and /dev/null differ diff --git a/source/images/schritte_icon.png b/source/images/schritte_icon.png deleted file mode 100644 index 4431260..0000000 Binary files a/source/images/schritte_icon.png and /dev/null differ diff --git a/source/images/shanty1_icon.png b/source/images/shanty1_icon.png deleted file mode 100644 index 637c958..0000000 Binary files a/source/images/shanty1_icon.png and /dev/null differ diff --git a/source/images/shanty2_icon.png b/source/images/shanty2_icon.png deleted file mode 100644 index 5316fe3..0000000 Binary files a/source/images/shanty2_icon.png and /dev/null differ diff --git a/source/images/shanty3_icon.png b/source/images/shanty3_icon.png deleted file mode 100644 index 48ce559..0000000 Binary files a/source/images/shanty3_icon.png and /dev/null differ diff --git a/source/images/shanty4_icon.png b/source/images/shanty4_icon.png deleted file mode 100644 index 8028000..0000000 Binary files a/source/images/shanty4_icon.png and /dev/null differ diff --git a/source/images/shanty5_icon.png b/source/images/shanty5_icon.png deleted file mode 100644 index f457936..0000000 Binary files a/source/images/shanty5_icon.png and /dev/null differ diff --git a/source/images/shoegazeprincessa_icon.png b/source/images/shoegazeprincessa_icon.png deleted file mode 100644 index 70f7ff7..0000000 Binary files a/source/images/shoegazeprincessa_icon.png and /dev/null differ diff --git a/source/images/sigma_icon.png b/source/images/sigma_icon.png deleted file mode 100644 index 5a01874..0000000 Binary files a/source/images/sigma_icon.png and /dev/null differ diff --git a/source/images/sprites_players.png b/source/images/sprites_players.png new file mode 100644 index 0000000..aa8dfbb Binary files /dev/null and b/source/images/sprites_players.png differ diff --git a/source/images/swgd_icon.png b/source/images/swgd_icon.png deleted file mode 100644 index 8ad6d0c..0000000 Binary files a/source/images/swgd_icon.png and /dev/null differ diff --git a/source/images/tha_icon.png b/source/images/tha_icon.png deleted file mode 100644 index 5900f8c..0000000 Binary files a/source/images/tha_icon.png and /dev/null differ diff --git a/source/images/theroom_icon.png b/source/images/theroom_icon.png deleted file mode 100644 index ffd2635..0000000 Binary files a/source/images/theroom_icon.png and /dev/null differ diff --git a/source/images/theshadowsareyou_icon.png b/source/images/theshadowsareyou_icon.png deleted file mode 100644 index 7a513d7..0000000 Binary files a/source/images/theshadowsareyou_icon.png and /dev/null differ diff --git a/source/images/underwaterlove_icon.png b/source/images/underwaterlove_icon.png deleted file mode 100644 index 036b7ea..0000000 Binary files a/source/images/underwaterlove_icon.png and /dev/null differ diff --git a/source/images/urfaust_icon.png b/source/images/urfaust_icon.png deleted file mode 100644 index 148f019..0000000 Binary files a/source/images/urfaust_icon.png and /dev/null differ diff --git a/source/images/vjeranpas_icon.png b/source/images/vjeranpas_icon.png deleted file mode 100644 index 017d20e..0000000 Binary files a/source/images/vjeranpas_icon.png and /dev/null differ diff --git a/source/images/wacky_tape_icon.png b/source/images/wacky_tape_icon.png deleted file mode 100644 index 9da518d..0000000 Binary files a/source/images/wacky_tape_icon.png and /dev/null differ diff --git a/source/sunken_tapes_template.xml b/source/sunken_tapes_template.xml index b4407cc..8d38caa 100644 --- a/source/sunken_tapes_template.xml +++ b/source/sunken_tapes_template.xml @@ -24,9 +24,9 @@ - - - + + + @@ -78,11 +78,9 @@ - - - - - + + + @@ -97,20 +95,40 @@ - + - + + + + + + + + + + + + + + + + + + + + + {% for tape in tapes %} @@ -130,8 +148,8 @@ - - + + diff --git a/source/tapes.yaml b/source/tapes.yaml index 4212e71..2ed8bce 100644 --- a/source/tapes.yaml +++ b/source/tapes.yaml @@ -2,6 +2,7 @@ name: Blank Tape source: ./source/original_audio/blank.ogg note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -20,6 +21,7 @@ end: -1 volume: 0 note: "" + icon_resize: blur spawn: - location: abandonedcrewcab probability: 0.05 @@ -39,6 +41,7 @@ end: -1 volume: 0 note: "" + icon_resize: blur spawn: - location: abandonedcrewcab probability: 0.05 @@ -58,6 +61,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.04 @@ -77,6 +81,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -96,6 +101,7 @@ end: -1 volume: 0 note: "" + icon_resize: blur spawn: - location: abandonedcrewcab probability: 0.05 @@ -116,6 +122,7 @@ end: 00:06:50 volume: 2 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -136,6 +143,7 @@ end: 00:02:49 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -155,6 +163,7 @@ end: 00:04:32 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -174,6 +183,7 @@ end: -1 volume: 3 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -193,6 +203,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -214,6 +225,7 @@ end: -1 volume: 3 note: "" + icon_resize: blur spawn: - location: abandonedcrewcab probability: 0.05 @@ -234,6 +246,7 @@ end: -1 volume: 3 note: "" + icon_resize: blur spawn: - location: abandonedcrewcab probability: 0.05 @@ -254,6 +267,7 @@ end: 00:04:18 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -274,6 +288,7 @@ end: 00:02:45 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -294,6 +309,7 @@ end: 00:03:20 volume: 6 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -314,6 +330,7 @@ end: 00:02:33 volume: 6 note: "" + icon_resize: blur spawn: - location: abandonedcrewcab probability: 0.05 @@ -334,6 +351,7 @@ end: -1 volume: 6 note: "" + icon_resize: blur spawn: - location: abandonedcrewcab probability: 0.05 @@ -354,6 +372,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -374,6 +393,7 @@ end: -1 volume: 6 note: "" + icon_resize: blur spawn: - location: abandonedcrewcab probability: 0.05 @@ -394,6 +414,7 @@ end: 00:05:51 volume: 3 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -414,6 +435,7 @@ end: -1 volume: 3 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -434,6 +456,7 @@ end: -1 volume: 6 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.02 @@ -454,6 +477,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -475,6 +499,7 @@ end: 00:02:35 volume: 2 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -495,6 +520,7 @@ end: 00:04:08.8 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -515,6 +541,7 @@ end: -1 volume: 3 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -533,6 +560,7 @@ end: -1 volume: 10 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -553,6 +581,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -573,6 +602,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -581,7 +611,7 @@ price: 450 multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine sold: [false, true, false, false, false] # outpost, city, research, military, mine - no_of_uses: 6 + no_of_uses: 6 # post-processing buffs: False buff_multiplier: 0.5 @@ -589,6 +619,7 @@ name: Inka - Schritte (08080 remix) source: ./source/original_audio/schritte_08080.ogg note: Anžiček remix + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -608,6 +639,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -622,6 +654,7 @@ name: Neznani Rock Fotri source: ./source/original_audio/wacky_tape.ogg note: Made by a broken cassette player + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -636,6 +669,7 @@ name: 08080 - Minor Threat source: ./source/original_audio/08080_minor_threat.ogg note: Original song by 08080 + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.04 @@ -652,6 +686,7 @@ name: 08080 - Canyon's Joyride source: ./source/original_audio/08080_canyons_joyride.ogg note: Original song by 08080 + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.03 @@ -672,6 +707,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -691,6 +727,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -710,6 +747,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.05 @@ -730,6 +768,7 @@ end: 00:06:46 volume: 0 note: "" + icon_resize: sharp spawn: - location: outpostcrewcabinet probability: 0.02 @@ -748,6 +787,7 @@ end: -1 volume: 12 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.03 @@ -768,6 +808,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.04 @@ -788,6 +829,7 @@ end: -1 volume: 0 note: "" + icon_resize: sharp spawn: - location: abandonedcrewcab probability: 0.04