aliases:
- jongle:
- file: "/home/immae/temp/Pirates/PIRATE_01-1-intro_jonglacro.mp3"
- volume: 110 # pouvoir dire que "par défaut" la musique a un volume à 110%
- acros:
- file: "../../temp/Pirates/PIRATE_01-2-jonglacro_suite.mp3"
+ intro_jonglacro:
+ file: "PIRATE_01-1-intro_jonglacro.mp3"
+ jonglacro_suite:
+ file: "PIRATE_01-2-jonglacro_suite.mp3"
+ lancer_prisonniere:
+ file: "PIRATE_02-lancers_de_prisonniere.mp3"
+ quete:
+ file: "PIRATE_03-quete.mp3"
+ entree_ondine:
+ file: "PIRATE_04-entree_ondine.mp3"
+ cour_ondine:
+ file: "PIRATE_05-cour_a_londine.mp3"
+ fouille_jonglage:
+ file: "PIRATE_07-fouille_jonglage.mp3"
+ liberation_prisonniere:
+ file: "PIRATE_08-liberation_prisonniere.mp3"
+ duo_pirate_ondine:
+ file: "PIRATE_09-duo_pirate_ondine.mp3"
+ trio_jalousie:
+ file: "PIRATE_10-trios_jalousie.mp3"
+ piquage_2_4:
+ file: "PIRATE_11-piquage_2_4.mp3"
+ baston:
+ file: "PIRATE_12-1-baston.mp3"
+ baston_ascension:
+ file: "PIRATE_12-3-baston_ascension.mp3"
+ bruit:
+ file: "PIRATE_bruit.wav"
+ paf:
+ file: "PIRATE_paf.mp3"
+ ralenti:
+ file: "PIRATE_12-2-ralenti.mp3"
+
+key_properties:
+ 'a':
+ description:
+ - Chloé
+ - Jonglacro
+ color: [255, 0, 0]
+ 'z':
+ description:
+ - Chloé
+ - Jonglacro 2
+ color: [255, 0, 0]
+ 'e':
+ description:
+ - Chloé
+ - Stop jonglacro 2
+ color: [255, 0, 0]
+ 'r':
+ description:
+ - Chloé
+ - Lancer prisonnière
+ color: [255, 0, 0]
+ 't':
+ description:
+ - Chloé
+ - Stop lancer prisonnière
+ color: [255, 0, 0]
+ 'y':
+ description:
+ - Chloé
+ - Quête
+ color: [255, 0, 0]
+ 'u':
+ description:
+ - Chloé
+ - Grrr
+ color: [255, 0, 0]
+ 'i':
+ description:
+ - Chloé
+ - Transition -> entrée ondine
+ color: [255, 0, 0]
+ 'o':
+ description:
+ - Denise
+ - Cour ondine
+ color: [0, 255, 0]
+ 'p':
+ description:
+ - Denise
+ - Stop cour ondine
+ color: [0, 255, 0]
+ 'q':
+ description:
+ - Chloé
+ - Fouille jonglage
+ color: [255, 0, 0]
+ 's':
+ description:
+ - Denise
+ - Stop fouille jonglage
+ color: [0, 255, 0]
+ 'd':
+ description:
+ - Denise
+ - Libération prisonnière
+ color: [0, 255, 0]
+ 'f':
+ description:
+ - Denise
+ - Paf + baisser musique
+ color: [0, 255, 0]
+ 'g':
+ description:
+ - Denise
+ - Stop musique
+ color: [0, 255, 0]
+ 'h':
+ description:
+ - Denise
+ - Duos
+ color: [0, 255, 0]
+ 'j':
+ description:
+ - Jérôme
+ - Transition trios
+ color: [0, 0, 255]
+ 'k':
+ description:
+ - Jérôme
+ - Stop trios
+ color: [0, 0, 255]
+ 'l':
+ description:
+ - Jérôme
+ - Jeu à 2-4
+ color: [0, 0, 255]
+ 'm':
+ description:
+ - Chloé
+ - Début baston
+ color: [255, 0, 0]
+ 'w':
+ description:
+ - Christophe
+ - Transition ralenti
+ color: [255, 255, 0]
+ 'x':
+ description:
+ - Christophe
+ - Stop ralenti
+ color: [255, 255, 0]
+ 'c':
+ description:
+ - Christophe
+ - Début baston 2
+ color: [255, 255, 0]
+ 'v':
+ description:
+ - Auréliane
+ - Stop baston 2
+ color: [0, 255, 255]
+
keys:
'a':
- play:
- include: jongle
- fade_in: 5
- restart_if_running: False
+ include: intro_jonglacro
'z':
- stop:
- include: jongle
+ include: intro_jonglacro
+ fade_out: 5
- wait:
- duration: 3
+ duration: 7
+ - play:
+ include: jonglacro_suite
+ 'e':
+ - stop:
+ include: jonglacro_suite
+ fade_out: 5
+ 'r':
+ - play:
+ include: lancer_prisonniere
+ 't':
+ - stop:
+ include: lancer_prisonniere
+ fade_out: 3
+ 'y':
- play:
- include: acros
- fade_in: 4
- start_at: 40
+ include: quete
+ 'u':
+ - volume:
+ include: quete
+ value: 50
+ - play:
+ include: bruit
- wait:
- duration: 10
+ duration: 2
- volume:
- include: acros
- value: 50
+ include: quete
+ value: 100
+ 'i':
- stop:
- include: acros
- fade_out: 10
- 'e':
+ include: quete
+ fade_out: 5
+ - wait:
+ duration: 20
- play:
- include: acros
- restart_if_running: true
- 'r':
+ include: entree_ondine
+ 'o':
+ - stop:
+ include: entree_ondine
+ fade_out: 5
+ - wait:
+ duration: 5
- play:
- include: acros
+ include: cour_ondine
+ 'p':
+ - stop:
+ include: cour_ondine
+ fade_out: 5
+ 'q':
+ - play:
+ include: fouille_jonglage
+ 's':
+ - stop:
+ include: fouille_jonglage
+ fade_out: 2
+ 'd':
+ - play:
+ include: liberation_prisonniere
+ 'f':
+ - volume:
+ include: liberation_prisonniere
+ value: 20
+ - play:
+ include: paf
+ 'g':
+ - stop:
+ include: liberation_prisonniere
+ fade_out: 3
+ 'h':
+ - play:
+ include: duo_pirate_ondine
+ 'j':
+ - stop:
+ include: duo_pirate_ondine
+ fade_out: 2
+ - wait:
+ duration: 2
+ - play:
+ include: trio_jalousie
+ 'k':
+ - stop:
+ include: trio_jalousie
+ 'l':
+ - play:
+ include: piquage_2_4
+ 'm':
+ - stop:
+ include: piquage_2_4
+ fade_out: 5
+ - wait:
+ duration: 7
+ - play:
+ include: baston
+ 'w':
+ - stop:
+ include: baston
+ fade_out: 1
+ - wait:
+ duration: 1
+ - play:
+ include: ralenti
+ 'x':
+ - stop:
+ include: ralenti
+ fade_out: 2
+ 'c':
+ - play:
+ include: baston_ascension
+ 'v':
+ - stop:
+ include: baston_ascension
+ fade_out: 2
'ESC':
- stop: ~
- stop_all_actions: ~
- '-':
- - volume:
- value: 90
- 'p':
- - command:
- command: une_super_commande_de_feu_d'artifice
+
lighter_outer_color = (200, 200, 200)
default_inner_color = (255, 255, 255)
mapped_inner_color = ( 0, 255, 0)
- mapped_unready_inner_color = (255, 165, 0)
+ mapped_unready_inner_color = ( 0, 255, 0, 100)
+ #mapped_unready_inner_color = (255, 165, 0)
def __init__(self, mapping, draw_lock, key_name, key_sym, top, left, width = 48, height = 48, disabled = False):
self.draw_lock = draw_lock
self.inner_color = self.default_inner_color
self.actions = []
+ self.description = []
+ self.custom_color = None
+ self.custom_unready_color = None
def square(self, all_actions_ready):
if self.has_actions():
if all_actions_ready:
- self.inner_color = self.mapped_inner_color
+ self.inner_color = self.custom_color or self.mapped_inner_color
else:
- self.inner_color = self.mapped_unready_inner_color
+ self.inner_color = self.custom_unready_color or self.mapped_unready_inner_color
return RoundedRect((0, 0, self.width, self.height),
self.outer_color, self.inner_color, self.linewidth)
position[1] - self.position[1]
)
+ def set_description(self, description):
+ self.description = description
+
+ def set_color(self, color):
+ self.custom_color = tuple(color)
+ color.append(100)
+ self.custom_unready_color = tuple(color)
+
def draw(self, background_surface):
self.draw_lock.acquire()
all_actions_ready = self.all_actions_ready()
if getattr(sys, 'frozen', False):
police = pygame.font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 14)
+ text_police = pygame.font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 10)
else:
police = pygame.font.Font("Ubuntu-Regular.ttf", 14)
+ text_police = pygame.font.Font("Ubuntu-Regular.ttf", 10)
+ police.set_bold(True)
text = police.render(self.key_sym, True, (0,0,0))
self.surface.blit(text, (5,5))
+
+ is_first_line = True
+ offset = 11 + text_police.get_linesize()
+ first_line_offset = 18
+ for description in self.description:
+ text = text_police.render(description, True, (0,0,0))
+ if is_first_line:
+ self.surface.blit(text, (first_line_offset, 9))
+ is_first_line = False
+ else:
+ self.surface.blit(text, (5, offset))
+ offset += text_police.get_linesize()
+
background_surface.blit(self.surface, self.position)
self.draw_lock.release()
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))
+ #print("actions linked to key {}:".format(self.key_sym))
+ #print("\t" + "\n\t".join(action_descriptions))
self.draw_lock.acquire()
surface = pygame.Surface((800, 250)).convert()
surface.fill((250, 250, 250))