Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions gameInformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,31 @@ def run(path, logger):
if key == "otherSongs":
continue
for song in songs:
if len(song["difficulty"]) == 5:
song["difficulty"].pop()
if song["difficulty"][-1] == 0.0:
song["difficulty"].pop()
song["charter"].pop()
for i in range(len(song["difficulty"])):
song["difficulty"][i] = str(round(song["difficulty"][i], 1))
song["songsId"] = song["songsId"][:-2]
difficulty.append([song["songsId"]]+song["difficulty"])
table.append((song["songsId"], song["songsName"], song["composer"], song["illustrator"], *song["charter"]))
if song["songsName"] == "望影の方舟Six":
difficulty.append([song["songsId"]] + song["difficulty"] + ["0.0"] + song["difficulty"])
song["charter"].append("NULL")
for i in range(0,3):
song["charter"].append(song["charter"][i])
else:
difficulty.append([song["songsId"]] + song["difficulty"])
if song["songsName"] == "Random":
a = ["","[R]","[A]","[N]","[D]","[O]","[M]"]
charters = [
["Barbarianerman", "IMD_6", "_鉄"],
["Barbarianerman × V17AMax", "IMD_6 × JKy", "_鉄 × Rikko"],
["Barbarianerman × Pcat", "IMD_6 × Ctymax", "_鉄 × NerSAN"],
["Barbarianerman × TimiTini", "IMD_6 × Gausbon", "_鉄 × Myna"],
["Barbarianerman × Clutter", "IMD_6 × Uvernight", "_鉄 × Su1fuR"],
["Barbarianerman × 阿爽", "IMD_6 × 晨", "_鉄 × 百九十八"],
["Barbarianerman × J.R", "IMD_6 × Likey", "_鉄 × XMT小咩兔"]
]
for i in range(0,7):
difficulty.append([song["songsId"][:-1] + str(i)] + song["difficulty"])
table.append((song["songsId"][:-1] + str(i), song["songsName"] + a[i], song["composer"], song["illustrator"], *charters[i]))
else:
table.append((song["songsId"], song["songsName"], song["composer"], song["illustrator"], *song["charter"]))

logger.info(difficulty)
logger.info(table)
Expand Down
22 changes: 12 additions & 10 deletions phira.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import shutil
from zipfile import ZipFile, BadZipFile

levels = ["EZ", "HD", "IN", "AT"]
levels = ["EZ", "HD", "IN", "AT","Legacy","EZ_Error","HD_Error","IN_Error"]

# 删除旧目录并创建新目录
try:
Expand Down Expand Up @@ -60,6 +60,8 @@
try:
print(f"正在处理:{info['Name']},作曲者:{info['Composer']}")
for level_index in range(len(info.get("difficulty", []))):
if info['difficulty'][level_index] == "0.0":
continue
level = levels[level_index]
pez_path = f"phira/{level}/{id}-{level}.pez"
try:
Expand All @@ -68,9 +70,9 @@
info_txt_content = (
f"#\n"
f"Name: {info['Name']}\n"
f"Song: {id}.ogg\n"
f"Picture: {id}.png\n"
f"Chart: {id}.json\n"
f"Song: {id[:-2]}.ogg\n"
f"Picture: {id[:-2]}.png\n"
f"Chart: {id[:-2]}.json\n"
f"Level: {level} Lv.{info['difficulty'][level_index]}\n"
f"Composer: {info['Composer']}\n"
f"Illustrator: {info['Illustrator']}\n"
Expand All @@ -80,19 +82,19 @@

# 添加文件到 .pez 压缩包
try:
pez.write(f"chart/{id}.0/{level}.json", f"{id}.json")
pez.write(f"chart/{id}/{level}.json", f"{id[:-2]}.json")
except FileNotFoundError:
print(f"警告:未找到 {id} 的 {level} 图表文件 (chart/{id}.0/{level}.json)。")
print(f"警告:未找到 {id} 的 {level} 图表文件 (chart/{id}/{level}.json)。")

try:
pez.write(f"IllustrationLowRes/{id}.png", f"{id}.png")
pez.write(f"illustrationLowRes/{id[:-2]}.png", f"{id[:-2]}.png")
except FileNotFoundError:
print(f"警告:未找到 {id} 的插图文件 (IllustrationLowRes/{id}.png)。")
print(f"警告:未找到 {id} 的插图文件 (illustrationLowRes/{id[:-2]}.png)。")

try:
pez.write(f"music/{id}.ogg", f"{id}.ogg")
pez.write(f"music/{id[:-2]}.ogg", f"{id[:-2]}.ogg")
except FileNotFoundError:
print(f"警告:未找到 {id} 的音乐文件 (music/{id}.ogg)。")
print(f"警告:未找到 {id} 的音乐文件 (music/{id[:-2]}.ogg)。")

except BadZipFile as e:
print(f"错误:创建 .pez 文件 {pez_path} 时出错 - {e}")
Expand Down
12 changes: 12 additions & 0 deletions resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ def save(key, entry, pool, logger):
if not os.path.exists(p):
os.mkdir(p)
queue_in.put(("chart/%s/%s.json" % (key[:-14], key[-7:-5]), obj.script))
elif config["chart"] and key[-18:-11] == "/Chart_" and key[-5:] == ".json":
logger.info(key)
p = "chart/" + key[:-18]
if not os.path.exists(p):
os.mkdir(p)
queue_in.put(("chart/%s/%s.json" % (key[:-18], key[-11:-5]), obj.script))
elif config["chart"] and key[-20:-13] == "/Chart_" and key[-5:] == ".json":
logger.info(key)
p = "chart/" + key[:-20]
if not os.path.exists(p):
os.mkdir(p)
queue_in.put(("chart/%s/%s.json" % (key[:-20], key[-13:-5]), obj.script))
elif config["illustrationBlur"] and key[-23:-3] == ".0/IllustrationBlur.":
key = key[:-23]
bytesIO = BytesIO()
Expand Down