Trivial changes.
[realism.git] / realism.py
blob52b679e10bc58cedfb78627d0c232a9d6877e2da
1 #!/usr/bin/env python
2 # This file is part of Realism, which is Copyright FunnyMan3595 (Charlie Nolan)
3 # and licensed under the GNU GPL v3. For more details, see LICENSE in the main
4 # Realism directory.
7 # We allow mods to exist in the user's home directory, path:
8 # ~/.realism-rpg/mods/<modname>/
9 # On Windows XP, this translates to:
10 # <drive>:\Documents and Settings\<user>\.realism-rpg\mods\<modname>\
11 import sys
12 from os import makedirs
13 from os.path import join, expanduser, isdir
14 user_dir = join(expanduser('~'),'.realism-rpg')
15 if not isdir(user_dir):
16 makedirs(user_dir)
17 sys.path.append(user_dir)
19 from game import game
21 from engine.party import HeroParty
22 game.party = HeroParty()
24 from ui.zork_ui import ZorkUI
25 game.ui = ui = ZorkUI()
27 # Import the maps, register the game object with them, and validate them.
28 from engine.maps import maps
29 for game_map in maps.values():
30 game_map.validate()
32 try:
33 from engine.maps import start_map
34 except ImportError:
35 if "start_map" not in maps.keys():
36 print "No start map found. Realism will exit."
37 sys.exit()
39 # maps["start"] guaranteed to exist.
40 start_map = maps["start_map"]
42 # start_map guaranteed to exist
43 ui.map_mode(start_map)
45 ui.main_loop()