forked from Tuxemon/Tuxemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tuxemon.py
executable file
·87 lines (82 loc) · 2.25 KB
/
run_tuxemon.py
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Tuxemon
# Copyright (C) 2014, William Edwards <[email protected]>,
# Benjamin Bean <[email protected]>
#
# This file is part of Tuxemon.
#
# Tuxemon is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Tuxemon is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Tuxemon. If not, see <http://www.gnu.org/licenses/>.
#
# Contributor(s):
#
# William Edwards <[email protected]>
# Leif Theden <[email protected]>
#
#
from argparse import ArgumentParser
if __name__ == "__main__":
from tuxemon import main, prepare
config = prepare.CONFIG
parser = ArgumentParser()
parser.add_argument(
"-m",
"--mod",
dest="mod",
metavar="mymod",
type=str,
nargs="?",
default=None,
help="The mod directory used in the mods directory",
)
parser.add_argument(
"-l",
"--load",
dest="slot",
metavar="1,2,3",
type=int,
nargs="?",
default=None,
help="The index of the save file to load",
)
parser.add_argument(
"-s",
"--starting-map",
dest="starting_map",
metavar="map.tmx",
type=str,
nargs="?",
default=None,
help="The starting map",
)
parser.add_argument(
"-t",
"--test-map",
dest="test_map",
type=str,
nargs="?",
default=None,
help="Skip title screen and load map directly",
)
args = parser.parse_args()
if args.mod:
config.mods.insert(0, args.mod)
if args.starting_map:
config.starting_map = args.starting_map
if args.test_map:
config.starting_map = args.test_map
config.skip_titlescreen = True
config.splash = False
main.main(load_slot=args.slot)