Exemplo n.º 1
0
 def _on_menu_button_press(self) -> None:
     is_muted = ba.app.config.resolve('Chat Muted')
     popup.PopupMenuWindow(
         position=self._menu_button.get_screen_space_center(),
         scale=2.3 if ba.app.small_ui else 1.65 if ba.app.med_ui else 1.23,
         choices=['unmute' if is_muted else 'mute'],
         choices_display=[
             ba.Lstr(
                 resource='chatUnMuteText' if is_muted else 'chatMuteText')
         ],
         current_choice='unmute' if is_muted else 'mute',
         delegate=self)
     self._popup_type = 'menu'
Exemplo n.º 2
0
 def _on_menu_button_press(self) -> None:
     is_muted = ba.app.config.resolve('Chat Muted')
     uiscale = ba.app.ui.uiscale
     popup.PopupMenuWindow(
         position=self._menu_button.get_screen_space_center(),
         scale=(2.3 if uiscale is ba.UIScale.SMALL else
                1.65 if uiscale is ba.UIScale.MEDIUM else 1.23),
         choices=['unmute' if is_muted else 'mute'],
         choices_display=[
             ba.Lstr(
                 resource='chatUnMuteText' if is_muted else 'chatMuteText')
         ],
         current_choice='unmute' if is_muted else 'mute',
         delegate=self)
     self._popup_type = 'menu'
Exemplo n.º 3
0
    def _on_extras_menu_press(self) -> None:
        choices = ['more', 'report']
        choices_display = [
            ba.Lstr(resource='coopSelectWindow.seeMoreText'),
            ba.Lstr(resource='reportThisPlayerText')
        ]
        is_admin = False
        if is_admin:
            ba.screenmessage('TEMP FORCING ADMIN ON')
            choices.append('ban')
            choices_display.append(ba.Lstr(resource='banThisPlayerText'))

        popup.PopupMenuWindow(
            position=self._extras_menu_button.get_screen_space_center(),
            scale=2.3 if ba.app.small_ui else 1.65 if ba.app.med_ui else 1.23,
            choices=choices,
            choices_display=choices_display,
            current_choice='more',
            delegate=self)
Exemplo n.º 4
0
 def _on_party_member_press(self, client_id: int, is_host: bool,
                            widget: ba.Widget) -> None:
     # if we're the host, pop up 'kick' options for all non-host members
     if _ba.get_foreground_host_session() is not None:
         kick_str = ba.Lstr(resource='kickText')
     else:
         # kick-votes appeared in build 14248
         if (_ba.get_connection_to_host_info().get('build_number', 0) <
                 14248):
             return
         kick_str = ba.Lstr(resource='kickVoteText')
     popup.PopupMenuWindow(
         position=widget.get_screen_space_center(),
         scale=2.3 if ba.app.small_ui else 1.65 if ba.app.med_ui else 1.23,
         choices=['kick'],
         choices_display=[kick_str],
         current_choice='kick',
         delegate=self)
     self._popup_type = 'partyMemberPress'
     self._popup_party_member_client_id = client_id
     self._popup_party_member_is_host = is_host