summaryrefslogtreecommitdiff
path: root/script.rpy
blob: 15fc53c796990306f42855e3e8dce8db4aaba44b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 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
        "Discard changes":
            $ GAME_LOADER()
            pass
        "Continue editing":
            pass
    jump loop