Exemplo n.º 1
0
 def execute(self, *args):
     """ Executes command button contains. """
     if not self._activated:
         return
     try:
         self._action(*args)
     # If command cannot be executed, shows error message.
     except exceptions.CreationError as error:
         msg = message.Message(str(error), lifetime=2)
         msg.rect.topleft = self.rect.x, self.rect.y - 70
         click_handler.ClickHandler().handle_command_bad_execution(msg)
     finally:
         self.passive()
Exemplo n.º 2
0
 def first_click_action(self):
     click_handler.ClickHandler().handle_command_first_click(self)
     self.execute()
Exemplo n.º 3
0
 def second_click_action(self):
     click_handler.ClickHandler().handle_command_second_click(self)
Exemplo n.º 4
0
 def second_click_action(self):
     click_handler.ClickHandler().handle_object_second_click(self)
Exemplo n.º 5
0
 def first_click_action(self):
     click_handler.ClickHandler().handle_object_first_click(self)
Exemplo n.º 6
0
 def die(self):
     """ Is called when object is out of health. """
     click_handler.ClickHandler().handle_object_kill(self)
     self.kill()