summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-23 19:36:43 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-23 19:36:43 -0300
commit9613437fee7667b32b20c976ca76c43f85d1416a (patch)
tree1354dfcf96c4331167205174829edc59db6919e1
parent3bf6ffd35f0dcc16f5cb6b20359be5fa09b521b6 (diff)
downloadsdk-9613437fee7667b32b20c976ca76c43f85d1416a.tar.gz
sdk-9613437fee7667b32b20c976ca76c43f85d1416a.tar.bz2
sdk-9613437fee7667b32b20c976ca76c43f85d1416a.tar.xz
sdk-9613437fee7667b32b20c976ca76c43f85d1416a.zip
Fix line encoding, add trial-and-error safe.
-rw-r--r--script.rpy86
1 files changed, 48 insertions, 38 deletions
diff --git a/script.rpy b/script.rpy
index 807b34b..ed11e04 100644
--- a/script.rpy
+++ b/script.rpy
@@ -1,38 +1,48 @@
-# The script of the game goes in this file.
-define e = Character("SDK")
-
-label start:
- scene black
- centered "Click to load game data"
- $ GAME_LOADER()
-
-label loop:
- menu:
- "Quest editor":
- jump quest_editors
- "Units editor":
- jump units_editors
- "Quit":
- return
-
-label restore:
- menu:
- "Save changes":
- python:
- f=open(get_path("quests.editor.json"), "r")
- alltquests["Main"]=json.load(f)
- f.close()
- f=open(get_path("quests.json"), "w")
- json.dump(alltquests, f, indent=1, separators=(',', ': '))
- f.close()
- f=open(get_path("units.editor.json"), "r")
- allunitsbase=json.load(f)
- f.close()
- f=open(get_path("units.json"), "w")
- json.dump(allunitsbase, f, indent=1, separators=(',', ': '))
- f.close()
- pass
- "Continue editing":
- pass
- jump loop
-
+# The script of the game goes in this file.
+define e = Character("SDK")
+
+label start:
+ scene black
+ centered "Click to load game data"
+ $ GAME_LOADER()
+
+label loop:
+ menu:
+ "Quest editor":
+ jump quest_editors
+ "Units editor":
+ jump units_editors
+ "Quit":
+ return
+
+label restore:
+ menu:
+ "Save changes":
+ python:
+ try:
+ f=open(get_path("quests.editor.json"), "r")
+ alltquests["Main"]=json.load(f)
+ f.close()
+ f=open(get_path("quests.json"), "w")
+ json.dump(alltquests, f, indent=1, separators=(',', ': '))
+ f.close()
+ print("Quests saved!")
+ except:
+ print("No quests to save")
+ pass
+ try:
+ f=open(get_path("units.editor.json"), "r")
+ allunitsbase=json.load(f)
+ f.close()
+ f=open(get_path("units.json"), "w")
+ json.dump(allunitsbase, f, indent=1, separators=(',', ': '))
+ f.close()
+ print("Units saved!")
+ except:
+ print("No units to save")
+ pass
+ pass
+ "Continue editing":
+ pass
+ jump loop
+