def init_application(): """Initialise the standalone application.""" import gameMan global window window = TK_ROOT TK_ROOT.title( _('BEEMOD {} - Backup / Restore Puzzles').format(utils.BEE_VERSION) ) init() UI['bar'] = bar = tk.Menu(TK_ROOT) window.option_add('*tearOff', False) if utils.MAC: # Name is used to make this the special 'BEE2' menu item file_menu = menus['file'] = tk.Menu(bar, name='apple') else: file_menu = menus['file'] = tk.Menu(bar) file_menu.add_command(label=_('New Backup'), command=ui_new_backup) file_menu.add_command(label=_('Open Backup'), command=ui_load_backup) file_menu.add_command(label=_('Save Backup'), command=ui_save_backup) file_menu.add_command(label=_('Save Backup As'), command=ui_save_backup_as) bar.add_cascade(menu=file_menu, label=_('File')) game_menu = menus['game'] = tk.Menu(bar) game_menu.add_command(label=_('Add Game'), command=gameMan.add_game) game_menu.add_command(label=_('Remove Game'), command=gameMan.remove_game) game_menu.add_separator() bar.add_cascade(menu=game_menu, label=_('Game')) gameMan.game_menu = game_menu import helpMenu # Add the 'Help' menu here too. helpMenu.make_help_menu(bar) window['menu'] = bar window.deiconify() window.update() gameMan.load() ui_new_backup() # UI.py isn't present, so we use this callback gameMan.setgame_callback = load_game gameMan.add_menu_opts(game_menu)
def init_application(): """Initialise the standalone application.""" global window window = TK_ROOT TK_ROOT.title( _('BEEMOD {} - Backup / Restore Puzzles').format(utils.BEE_VERSION) ) init() UI['bar'] = bar = tk.Menu(TK_ROOT) window.option_add('*tearOff', False) gameMan.load() ui_new_backup() # UI.py isn't present, so we use this callback gameMan.setgame_callback = load_game if utils.MAC: # Name is used to make this the special 'BEE2' menu item file_menu = menus['file'] = tk.Menu(bar, name='apple') else: file_menu = menus['file'] = tk.Menu(bar) file_menu.add_command(label=_('New Backup'), command=ui_new_backup) file_menu.add_command(label=_('Open Backup'), command=ui_load_backup) file_menu.add_command(label=_('Save Backup'), command=ui_save_backup) file_menu.add_command(label=_('Save Backup As'), command=ui_save_backup_as) bar.add_cascade(menu=file_menu, label=_('File')) game_menu = menus['game'] = tk.Menu(bar) game_menu.add_command(label=_('Add Game'), command=gameMan.add_game) game_menu.add_command(label=_('Remove Game'), command=gameMan.remove_game) game_menu.add_separator() bar.add_cascade(menu=game_menu, label=_('Game')) import helpMenu # Add the 'Help' menu here too. helpMenu.make_help_menu(bar) window['menu'] = bar gameMan.add_menu_opts(game_menu) gameMan.game_menu = game_menu
GEN_OPTS.load() GEN_OPTS.set_defaults(DEFAULT_SETTINGS) loadScreen.main_loader.set_length('UI', 14) loadScreen.show_main_loader(GEN_OPTS.get_bool('General', 'compact_splash')) # OS X starts behind other windows, fix that. if utils.MAC: TK_ROOT.lift() logWindow.init(GEN_OPTS.get_bool('Debug', 'show_log_win'), GEN_OPTS['Debug']['window_log_level']) UI.load_settings() gameMan.load() gameMan.set_game_by_name(GEN_OPTS.get_val('Last_Selected', 'Game', ''), ) gameMan.scan_music_locs() LOGGER.info('Loading Packages...') pack_data, package_sys = packageLoader.load_packages( GEN_OPTS['Directories']['package'], loader=loadScreen.main_loader, log_item_fallbacks=GEN_OPTS.get_bool('Debug', 'log_item_fallbacks'), log_missing_styles=GEN_OPTS.get_bool('Debug', 'log_missing_styles'), log_missing_ent_count=GEN_OPTS.get_bool('Debug', 'log_missing_ent_count'), log_incorrect_packfile=GEN_OPTS.get_bool('Debug', 'log_incorrect_packfile'), has_tag_music=gameMan.MUSIC_TAG_LOC is not None, has_mel_music=gameMan.MUSIC_MEL_VPK is not None, )
loadScreen.main_loader.set_length('UI', 14) loadScreen.show_main_loader(GEN_OPTS.get_bool('General', 'compact_splash')) # OS X starts behind other windows, fix that. if utils.MAC: TK_ROOT.lift() logWindow.init( GEN_OPTS.get_bool('Debug', 'show_log_win'), GEN_OPTS['Debug']['window_log_level'] ) UI.load_settings() gameMan.load() gameMan.set_game_by_name( GEN_OPTS.get_val('Last_Selected', 'Game', ''), ) gameMan.scan_music_locs() LOGGER.info('Loading Packages...') pack_data, package_sys = packageLoader.load_packages( GEN_OPTS['Directories']['package'], loader=loadScreen.main_loader, log_item_fallbacks=GEN_OPTS.get_bool( 'Debug', 'log_item_fallbacks'), log_missing_styles=GEN_OPTS.get_bool( 'Debug', 'log_missing_styles'), log_missing_ent_count=GEN_OPTS.get_bool( 'Debug', 'log_missing_ent_count'),