def __init__(self): self.mainlistener = MainListener(self) self.windows = WindowManager() # temporary aliases for compatibility with rest of the code self.open_popup = self.windows.open_popup self.open_error_popup = self.windows.open_error_popup # Main menu background image setup. available_images = glob.glob('content/gui/images/background/mainmenu/bg_*.png') self.bg_images = deque(available_images) latest_bg = horizons.globals.fife.get_uh_setting("LatestBackground") try: # If we know the current background from an earlier session, # show all other available ones before picking that one again. self.bg_images.remove(latest_bg) self.bg_images.append(latest_bg) except ValueError: pass self._background = Icon(position_technique='center:center') self.rotate_background() self._background.show() # Initialize menu dialogs and widgets that are accessed from `gui`. self.singleplayermenu = SingleplayerMenu(self.windows) self.multiplayermenu = MultiplayerMenu(self, self.windows) self.help_dialog = HelpDialog(self.windows) self.loadingscreen = LoadingScreen() self.settings_dialog = SettingsDialog(self.windows) self.mainmenu = MainMenu(self, self.windows) self.fps_display = FPSDisplay()
def __init__(self): self.mainlistener = MainListener(self) self.windows = WindowManager() # temporary aliases for compatibility with rest of the code self.show_popup = self.windows.show_popup self.show_error_popup = self.windows.show_error_popup self._background = Icon(image=self._get_random_background(), position_technique='center:center') self._background.show() self.singleplayermenu = SingleplayerMenu(self.windows) self.multiplayermenu = MultiplayerMenu(self, self.windows) self.help_dialog = HelpDialog(self.windows) self.loadingscreen = LoadingScreen() self.settings_dialog = SettingsDialog(self.windows) self.mainmenu = MainMenu(self, self.windows) self.fps_display = FPSDisplay()
def __init__(self): self.mainlistener = MainListener(self) self.windows = WindowManager() # temporary aliases for compatibility with rest of the code self.open_popup = self.windows.open_popup self.open_error_popup = self.windows.open_error_popup self._background = Background() self._background.show() # Initialize menu dialogs and widgets that are accessed from `gui`. self.singleplayermenu = SingleplayerMenu(self.windows) self.multiplayermenu = MultiplayerMenu(self, self.windows) self.help_dialog = HelpDialog(self.windows) self.loadingscreen = LoadingScreen() self.settings_dialog = SettingsDialog(self.windows) self.mainmenu = MainMenu(self, self.windows) self.fps_display = FPSDisplay()