def show_game_menu(self): options = ['Controls', 'Quit Game'] keys = ['c', 'q'] selection = GuiUtilities.show_menu(self.surface_display, 'Game Menu', options, keys) if selection is None: return elif selection == 0: print('Game Menu: ' + options[0]) GuiUtilities.show_message_controls(self.surface_display) elif selection == 1: print('Game Menu: ' + options[1]) self.stop_game() else: print('Game Menu: unknown selection...?')
def show_main_menu(self): options = ['New local game', 'Controls', 'Quit', 'Debug Maps', 'Connect to server'] keys = ['n', 'c', 'q', 'd', 's'] selection = GuiUtilities.show_menu(self.surface_display, 'Main Menu', options, keys) if selection is None: return elif selection == 0: print('Main Menu: ' + options[0]) self.new_game() elif selection == 1: print('Main Menu: ' + options[1]) GuiUtilities.show_message_controls(self.surface_display) elif selection == 2: print('Main Menu: ' + options[2]) sys.exit() elif selection == 3: print('Main Menu: ' + options[3]) self.debug_maps() elif selection == 4: print('Main Menu: ' + options[4]) self.connect_to_server() else: print('Main menu: unknown selection...?')
def event_show_controls(self): """ Event handler to show game controls. :return: None """ GuiUtilities.show_message_controls(self.surface_display)