7 Star 19 Fork 1

Comitaro / Master Duel 汉化版本切换

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pack.py 973 Bytes
一键复制 编辑 原始数据 按行查看 历史
lfcky 提交于 2023-03-28 22:59 . feat:适配英文及日文
import os
from typing import Any
import UnityPy
from hint import CardEncryptedData
from utils import getFilesList
def createFolder(path: str):
path = path.strip()
path = path.rstrip("\\")
isExists = os.path.exists(path)
if not isExists:
os.makedirs(path)
def card_pack(card_encrypt_data: CardEncryptedData, dir_input: str, dir_output: str):
for file in getFilesList(dir_input):
env = UnityPy.load(os.path.join(dir_input, file))
for obj in env.objects:
if obj.type.name == "TextAsset":
data: Any = obj.read()
name: str = data.name.upper()
# if name in ["CARD_PIDX"]:
# continue
data.script = card_encrypt_data[name.replace('RUBY', '')]
data.save()
createFolder(os.path.join(dir_output, file[:2]))
with open(os.path.join(dir_output, file[:2], file), "wb") as f:
f.write(env.file.save())
1
https://gitee.com/fetiss/master-duel-chinese-switch.git
git@gitee.com:fetiss/master-duel-chinese-switch.git
fetiss
master-duel-chinese-switch
Master Duel 汉化版本切换
master

搜索帮助