Example #1
0
    def _reference_dropdown_hook(self, reference_menu: vpython.menu):
        if reference_menu.selected not in self._3dobjs:
            # The requested entity doesn't exist yet.
            reference_menu.selected = self._origin.name
            return

        self._set_reference(reference_menu.selected)
Example #2
0
    def _target_dropdown_hook(self, target_menu: vpython.menu):
        if target_menu.selected not in self._3dobjs:
            # The requested entity doesn't exist yet.
            target_menu.selected = self._origin.name
            return

        self._set_target(target_menu.selected)
Example #3
0
    def _recentre_dropdown_hook(self, centre_menu: vpython.menu):
        if centre_menu.selected not in self._3dobjs:
            # The requested entity doesn't exist yet.
            centre_menu.selected = self._origin.name
            return

        self._set_origin(centre_menu.selected)
        self.recentre_camera(centre_menu.selected)
Example #4
0
 def _misc_command_hook(self, menu: vpython.menu):
     if menu.selected == MiscCommand.UNDOCK.value:
         self._commands.append(Request(ident=Request.UNDOCK))
     elif menu.selected == MiscCommand.DEPLOY_PARACHUTE.value:
         self._commands.append(
             Request(ident=Request.PARACHUTE,
                     deploy_parachute=not self._state.parachute_deployed))
     elif menu.selected == MiscCommand.IGNITE_SRBS.value:
         self._commands.append(Request(ident=Request.IGNITE_SRBS))
     menu.selected = MiscCommand.UNSELECTED.value