mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-04 03:38:26 +02:00
* added utf8 support to ct_config.json * Updated track * added 377 new tracks * added 377 tracks to ct_config, also added tracks_list to make edtiting track way easier * renamed (Vide).wu8 to just .wu8, to avoid problem with translation * updated README.md * added test files and distribution.txt to .gitignore * added discord and wiki link * game's version is now in definition.py * update will now only enable if gitversion is newer than local version * added math to lib * renamed .wu8 to _.wu8 * removed 28 unused track * replaced "" by "_" * prepared version file * Removed 5 unused files * config tracks_list is now supported * added missing game prefix * A track name was too long for the game
41 lines
1.8 KiB
Python
41 lines
1.8 KiB
Python
from PIL import Image, ImageFont, ImageDraw
|
|
import json
|
|
import math
|
|
import os
|
|
|
|
|
|
def patch_ct_icon(self):
|
|
with open("./ct_config.json", encoding="utf8") as f: config = json.load(f)
|
|
|
|
cup_number = len(config["cup"]) + math.ceil(len(config["tracks_list"]) / 4)
|
|
ct_icon = Image.new("RGBA", (128, 128 * (cup_number + 2)))
|
|
|
|
files = ["left", "right"]
|
|
files.extend(config["cup"].keys())
|
|
files.extend(["_"] * ((len(config["tracks_list"]) // 4) + 1))
|
|
|
|
for i, id in enumerate(files):
|
|
if os.path.exists(f"./file/cup_icon/{id}.png"):
|
|
cup_icon = Image.open(f"./file/cup_icon/{id}.png").resize((128, 128))
|
|
|
|
else:
|
|
cup_icon = Image.new("RGBA", (128, 128))
|
|
draw = ImageDraw.Draw(cup_icon)
|
|
font = ImageFont.truetype("./file/SuperMario256.ttf", 90)
|
|
draw.text((4 - 2, 4 - 2), "CT", (0, 0, 0), font=font)
|
|
draw.text((4 + 2, 4 - 2), "CT", (0, 0, 0), font=font)
|
|
draw.text((4 - 2, 4 + 2), "CT", (0, 0, 0), font=font)
|
|
draw.text((4 + 2, 4 + 2), "CT", (0, 0, 0), font=font)
|
|
draw.text((4, 4), "CT", (255, 165, 0), font=font)
|
|
|
|
font = ImageFont.truetype("./file/SuperMario256.ttf", 60)
|
|
draw.text((5 - 2, 80 - 2), "%03i" % (i-10), (0, 0, 0), font=font) # i-10 car on ne compte pas les 8 coupes
|
|
draw.text((5 + 2, 80 - 2), "%03i" % (i-10), (0, 0, 0), font=font) # de base (0-7), la coupe aléatoire, et
|
|
draw.text((5 - 2, 80 + 2), "%03i" % (i-10), (0, 0, 0), font=font) # les icones droite et gauche.
|
|
draw.text((5 + 2, 80 + 2), "%03i" % (i-10), (0, 0, 0), font=font)
|
|
|
|
draw.text((5, 80), "%03i" % (i-10), (255, 165, 0), font=font)
|
|
|
|
ct_icon.paste(cup_icon, (0, i * 128))
|
|
|
|
ct_icon.save("./file/ct_icons.tpl.png")
|