コード例 #1
0
ファイル: main_menu.py プロジェクト: xjzpguob/singularity
    def rebuild(self):
        # Rebuild dialogs
        self.options_button.dialog.needs_rebuild = True
        self.about_button.dialog.needs_rebuild = True
        self.map_screen.needs_rebuild = True
        self.load_dialog.needs_rebuild = True

        difficulty_buttons = []
        for name, diff in difficulty.get_difficulties() + [(_("&BACK"), None)]:
            difficulty_buttons.append(
                button.ExitDialogButton(None,
                                        None,
                                        None,
                                        text=name,
                                        autohotkey=True,
                                        exit_code=diff,
                                        default=(diff == None)))
        self.difficulty_dialog.buttons = difficulty_buttons

        # Update buttons translations
        self.new_game_button.text = _("&NEW GAME")
        self.load_game_button.text = _("&LOAD GAME")
        self.options_button.text = _("&OPTIONS")
        self.quit_button.text = _("&QUIT")
        self.about_button.text = _("&ABOUT")

        super(MainMenu, self).rebuild()
コード例 #2
0
ファイル: main_menu.py プロジェクト: Wuzzy2/singularity
    def rebuild(self):
        # Rebuild dialogs
        self.options_button.dialog.needs_rebuild = True
        self.about_button.dialog.needs_rebuild = True
        self.map_screen.needs_rebuild = True
        self.load_dialog.needs_rebuild = True

        difficulty_buttons = []
        for name, diff in difficulty.get_difficulties() + [(_("&BACK"), None)]:
            difficulty_buttons.append(
                button.ExitDialogButton(None, None, None, text=name,
                                        autohotkey=True,
                                        exit_code=diff,
                                        default=(diff == None)))
        self.difficulty_dialog.buttons = difficulty_buttons

        super(MainMenu, self).rebuild()