new planner maps

This commit is contained in:
Sendou
2020-06-20 11:53:23 +03:00
parent 0b737bf9c6
commit dd85227429
260 changed files with 139 additions and 100 deletions

29
scripts/planner_maps.py Normal file
View File

@@ -0,0 +1,29 @@
import os
import glob
import shutil
highest_ver = {}
# images from https://mega.nz/folder/3QwygIBL#r9ghq3oeOYmEH0sUIYcMfg
for filepath in glob.iglob("stageImgs/*.png"):
name = filepath.replace("stageImgs\\", "").replace(".png", "").replace("v", "")
img_type, map_code, mode, version = name.split(" ")
if mode == "SF":
continue
code = f"{img_type} {map_code} {mode}"
version_prev = highest_ver.get(code, "asd asd asd 0").split(" ")[3]
if int(version) > int(version_prev.replace("v", "").replace(".png", "")):
highest_ver[code] = filepath
os.mkdir("stageImgs_result")
for filepath in glob.iglob("stageImgs/*.png"):
for value in highest_ver.values():
if value == filepath:
shutil.copy(filepath, "stageImgs_result")
for filepath in glob.iglob("stageImgs_result/*.png"):
os.rename(filepath, filepath.split(" v")[0] + ".png")