-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
executable file
·74 lines (64 loc) · 2.09 KB
/
main.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
#!/usr/bin/env python3
import sys
import traceback
sys.excepthook = lambda *args: (
traceback.print_exception(*args),
input("Press Enter to Exit"),
)
import os
import fa_paths
import multiplayer
from fa_menu import *
import modify_config
import launch_and_monitor
import save_management
from fa_arg_parse import args
from map_gen_setting_menu import sub_preset
from translations import check_lang
from fa_scenarios import get_scenarios, pre_launch_scenario
from fa_mod_menu import mod_menu
from version import version
os.chdir(fa_paths.MY_CONFIG_DIR)
menu = {
"Launch last played": launch_and_monitor.just_launch,
("gui-menu.single-player-menu",): {
("gui-menu.new-game",): {
("gui-new-game.main-game",): sub_preset,
("gui-new-game.mod-scenarios",): pre_launch_scenario,
},
("gui-menu.load-game",): {
save_management.get_menu_saved_games: launch_and_monitor.launch,
},
},
("gui-menu.multi-player-menu",): {
multiplayer.get_username_menu: multiplayer.username_menu,
"Host Settings": multiplayer.host_settings_menu(),
("gui-menu.host-saved-game",): {
save_management.get_menu_saved_games: multiplayer.multiplayer_host,
},
("gui-menu.browse-public-games",): {
"Friend List": multiplayer.friend_list,
"List Games With Friends": {
multiplayer.games_with_friends_menu: multiplayer.multiplayer_join
},
},
("gui-menu.connect-to-address",): launch_and_monitor.connect_to_address_menu,
},
("gui-menu.mods",): mod_menu,
("gui-menu.about",): {
"Factorio": {
"_desc": fa_paths.FACTORIO_VERSION,
},
"Launcher": {
"_desc": f"Factorio Access Launcher Version {version.tag}\nCommit:{version.commit}"
},
},
("gui.exit",): launch_and_monitor.time_to_exit,
}
check_lang()
modify_config.do_config_check()
if args.launch:
launch_and_monitor.launch_with_params([], save_rename=False)
else:
main_menu = new_menu(("gui-menu.main-menu",), menu)
main_menu()