- self.mapping.start_running(self, start_time)
- for action in self.actions:
- if self.mapping.keep_running(self, start_time):
- action.run()
-
- self.mapping.finished_running(self, start_time)
-
- def list_actions(self, screen):
- action_descriptions = [action.description() for action in self.actions]
- #print("actions linked to key {}:".format(self.key_sym))
- #print("\t" + "\n\t".join(action_descriptions))
- self.draw_lock.acquire()
- surface = pygame.Surface((690, 250)).convert()
- surface.fill((250, 250, 250))
- police = font(14)
-
- offset = 0
- police.set_bold(True)
- text = police.render("actions linked to key {}:".format(self.key_sym), True, (0,0,0))
- surface.blit(text, (0, offset))
- offset += police.get_linesize()
-
- police.set_bold(False)
- for description in action_descriptions:
- text = police.render(description, True, (0,0,0))
- surface.blit(text, (0, offset))
- offset += police.get_linesize()
-
- screen.blit(surface, (5, 308))
- pygame.display.flip()
- self.draw_lock.release()
-
-
+ self.parent.start_running(self, start_time)
+ action_number = 0
+ for self.current_action in self.actions:
+ if self.parent.keep_running(self, start_time):
+ self.list_actions(action_number = action_number + 0.5)
+ self.current_action.run()
+ action_number += 1
+ self.list_actions(action_number = action_number)
+
+ self.parent.finished_running(self, start_time)
+
+ def list_actions(self, action_number = 0):
+ self.parent.parent.ids['ActionList'].update_list(self, action_number)
+
+ def on_press(self):
+ self.list_actions()
+ pass