From ab5f2ab521e6e04587d1691146e25f791fa39e1a Mon Sep 17 00:00:00 2001 From: "Mike A. Trethewey" Date: Sun, 5 Apr 2020 09:50:01 -0700 Subject: [PATCH] JSON Spoiler output --- .gitignore | 1 + GuiUtils.py | 1 + Main.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index ed3e8193..1fa1e41c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .idea .vscode *_Spoiler.txt +*_Spoiler.json *.pyc *.sfc *.srm diff --git a/GuiUtils.py b/GuiUtils.py index f0aee3b9..840e8520 100644 --- a/GuiUtils.py +++ b/GuiUtils.py @@ -1,4 +1,5 @@ import queue +import os import threading import tkinter as tk diff --git a/Main.py b/Main.py index 0cac21e5..19629109 100644 --- a/Main.py +++ b/Main.py @@ -304,6 +304,8 @@ def main(args, seed=None, fish=None): elif args.create_spoiler: logger.info(world.fish.translate("cli","cli","patching.spoiler")) world.spoiler.to_file(output_path('%s_Spoiler.txt' % outfilebase)) + with open(output_path('%s_Spoiler.json' % outfilebase), 'w') as outfile: + outfile.write(world.spoiler.to_json()) YES = world.fish.translate("cli","cli","yes") NO = world.fish.translate("cli","cli","no")