N_A_editor.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Nier-Automata-editor 作者: CensoredUsername 项目源码 文件源码
def main():
    user_folder = os.getenv("USERPROFILE")
    nier_automata_folder = path.join(user_folder, "Documents", "My Games", "NieR_Automata")
    if not path.isdir(nier_automata_folder):
        messagebox.showerror("Error", "Could not find Nier;Automata's save folder location. Please select the save folder location")
        nier_automata_folder = filedialog.askdirectory()

    gamedata_path = path.join(nier_automata_folder, "GameData.dat")
    if not path.isfile(gamedata_path):
        raise Exception("Could not find NieR_Automata/GameData.dat. Please run Nier;Automata at least once before using this tool.")

    # read the gamedata header.
    with open(gamedata_path, "rb") as f:
        gamedata_header = f.read(12)

    locations = ("SlotData_0.dat", "SlotData_1.dat", "SlotData_2.dat")
    import collections
    saves = collections.OrderedDict()

    for location in locations:
        savedata_path = path.join(nier_automata_folder, location)
        if path.isfile(savedata_path):
            saves[location] = SaveGame(savedata_path)

    interface = Interface(saves, gamedata_header)
    interface.master.title("NieR;Automata Save Editor")
    interface.mainloop()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号