[go: up one dir, main page]

Menu

[9c5ccb]: / game / screens.rpy  Maximize  Restore  History

Download this file

1066 lines (845 with data), 36.8 kB

# Ce fichier est dans le domaine public. N'hésitez pas à le modifier pour vos
# propres écrans

##############################################################################
# Dialogues
#
# Écrans utilisés pour le mode ADV
# http://www.renpy.org/doc/html/screen_special.html#say
screen say:

    # Valeurs par défaut de 'side_image' et 'two_window'
    default side_image = None
    default two_window = False

    # Options selon le que l'on soit en mode une fenêtre ou deux fenêtres.
    if not two_window:

        # Cas avec une fenêtre.
        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"

    else:

        # Cas avec deux fenêtres.
        vbox:
            style "say_two_window_vbox"

            if who:
                window:
                    style "say_who_window"

                    text who:
                        id "who"

            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"

    # Si il y a une image latérale, on la montre au dessus du texte.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0

    # Utilisation du menu rapide.
    use quick_menu


##############################################################################
# Choix
#
# Écran utilisé pour les menus au sein du jeu
# http://www.renpy.org/doc/html/screen_special.html#choice

screen choice:

    window:
        style "menu_window"
        xanchor 0.5
        xpos 0.3
        yalign 0.5

        vbox:
            spacing 2

            for caption, action, chosen in items:

                if action:

                    button:
                        action action
                        style "menu_choice_button"

                        text caption style "menu_choice"

                else:
                    text caption style "menu_caption"

init -2 python:
    config.narrator_menu = True

    style.menu_window.set_parent(style.default)
    style.menu_choice.set_parent(style.button_text)
    style.menu_choice.clear()
    style.menu_choice_button.set_parent(style.button)
    #style.menu_choice_button.xminimum = int(config.screen_width * 0.6 * 0.75)
    style.menu_choice_button.xmaximum = int(config.screen_width * 0.6 * 0.75)


##############################################################################
# Entrée
#
# Écran utilisé lors de l'utilisation de renpy.input()
# http://www.renpy.org/doc/html/screen_special.html#input

screen input:

    window style "input_window":
        has vbox

        text prompt style "input_prompt"
        input id "input" style "input_text"

    use quick_menu

##############################################################################
# Nvl
#
# Écran utilisé pour les dialogues et les menus en mode NVL
# http://www.renpy.org/doc/html/screen_special.html#nvl

screen nvl:

    window:
        style "nvl_window"

        has vbox:
            style "nvl_vbox"

        # Affiche un dialogue
        for who, what, who_id, what_id, window_id in dialogue:
            window:
                id window_id

                has hbox:
                    spacing 10

                if who is not None:
                    text who id who_id

                text what id what_id

        # Affiche un menu si il y en a un
        if items:

            vbox:
                id "menu"

                for caption, action, chosen in items:

                    if action:

                        button:
                            style "nvl_menu_choice_button"
                            action action

                            text caption style "nvl_menu_choice"

                    else:

                        text caption style "nvl_dialogue"

    add SideImage() xalign 0.0 yalign 1.0

    use quick_menu

##############################################################################
# Menu principal
#
# Écran utilisé pour le menu principal, quand Ren'Py démarre
# http://www.renpy.org/doc/html/screen_special.html#main-menu

screen main_menu:

    # Pour être sûr que tout autre menu est remplacé
    tag menu
    
    # Le menu principal est une imagemap
    imagemap:
        auto "gui/main/main_%s.png"
        alpha True
        
        hotspot (46,52,87,94):
            action ShowMenu("histoires")
            hovered Show("aide_gui",message=_("Choisir une\nhistoire à lire"),position=(145,80))
            unhovered Hide ("aide_gui")
        hotspot (498,40,95,99):
            action ShowMenu("preferences")
            hovered Show("aide_gui",message=_("Modifier les\nparamètres"),position=(368,53))
            unhovered Hide ("aide_gui")
        hotspot (502,309,94,105):
            action Help()
            hovered Show("aide_gui",message=_("Aide à la\nprise en main"),position=(359,331))
            unhovered Hide ("aide_gui")
        hotspot (42,549,85,51):
            action If(_preferences.language==None,true=Language("en"),false=Language(None))
            hovered Show("aide_gui",message=_("See english\nversion"),position=(134,520))
            unhovered Hide ("aide_gui")
        hotspot (47,302,86,94):
            action ShowMenu("menu_apropos")
            hovered Show("aide_gui",message=_("Coulisses\ndu jeu"),position=(155,332))
            unhovered Hide ("aide_gui")
        hotspot (857,318,104,105):
            action Quit()
            hovered Show("aide_gui",message=_("Quitter"),position=(775,344))
            unhovered Hide ("aide_gui")
        hotspot (860,38,105,108):
            action ShowMenu("load")
            hovered Show("aide_gui",message=_("Charger une\nsauvegarde"),position=(739,66))
            unhovered Hide ("aide_gui")
    
    # on efface toute trace éventuelle des bulles d'aide au changement de screen
    on "hide" action [Hide("aide_gui"),Play("sound","gui/audio/ouvrir_tiroir.ogg")]
    on "replaced" action [Hide("aide_gui"),Play("sound","gui/audio/ouvrir_tiroir.ogg")]
    
    # Le fond du menu principal
    #window:
    #    style "mm_root"

    # Les boutons du menu principal.
    #frame:
    #    style_group "mm"
    #    xalign .98
    #    yalign .98

    #    has vbox
    #rajout d'un bouton qui permet de changer de langue, dans le menu principal
    #    if _preferences.language == None:
    #        textbutton _("English") action Language("en")
    #    else:
    #        textbutton _(u"Français") action Language(None)
    #    textbutton _("Start Game") action Start()
    #    textbutton _("Load Game") action ShowMenu("load")
    #    textbutton _("Preferences") action ShowMenu("preferences")
    #    textbutton _("Help") action Help()
    #    textbutton _("Quit") action Quit(confirm=False)

init -2 python:

    # Donne la même taille à tous les boutons du menu.
    style.mm_button.size_group = "mm"

##############################################################################
# Menu "Histoires"
#
# Écran utilisé pour choisir entre les différentes histoires de la compilation
screen histoires:
    
    tag menu
    
    #navigation avec une image map
    imagemap:
        auto "gui/histoires/histoire_%s.png"
        alpha True
        
        # section pour revenir au menu principal
        hotspot (0,0,999,150):
            action If(main_menu,Return(),MainMenu())
            hovered Show("aide_gui",message=_("Refermer ce tiroir"),position=(410,65))
            unhovered Hide ("aide_gui")
                    
        hotspot (209,425,215,82): # Ivy
            action Show("dossier_action",legende="ivy",souris=(316,466))
            hovered Show("dossier_hover",legende="ivy",souris=(316,466))
            unhovered Hide("dossier_hover")
            
        hotspot (471,370,203,70): # Chocolat
            action Show("dossier_action",legende="chocolat",souris=(572,405))
            hovered Show("dossier_hover",legende="chocolat",souris=(572,405))
            unhovered Hide("dossier_hover")
            
        hotspot (695,349,199,67): # Iris
            action Show("dossier_action",legende="iris",souris=(795,382))
            hovered Show("dossier_hover",legende="iris",souris=(795,382))
            unhovered Hide("dossier_hover")
        
        
        hotspot (36,344,185,64): # Temps / Time
            action Show("dossier_action",legende="time",souris=(129,376))
            hovered Show("dossier_hover",legende="time",souris=(129,376))
            unhovered Hide("dossier_hover")
        
        # Hotspots non utilisés pour l'instant
        #hotspot (241,316,191,66)
        #hotspot (441,297,171,58)
        #hotspot (614,285,173,56)
        #hotspot (804,266,171,56) 

    # À la fermeture
    # on efface toute trace éventuelle des bulles d'aide, et on joue un son de fermeture de tiroir
    on "replaced" action [Hide("aide_gui"),Play("sound","gui/audio/fermer_tiroir.ogg")]
    on "hide" action [Hide("aide_gui"),Play("sound","gui/audio/fermer_tiroir.ogg")]
                
##############################################################################
# Menu "À propos"
#
# Écran utilisé pour choisir entre les différentes possibilités 
screen menu_apropos:
    
    tag menu
    
   
    #navigation avec une image map
    imagemap:
        auto "gui/apropos/apropos_%s.png"
        alpha True
        
        # section pour revenir au menu principal
        hotspot (0,0,999,150):
            action If(main_menu,Return(),MainMenu(confirm=False))
            hovered Show("aide_gui",message=_("Refermer ce tiroir"),position=(410,65))
            unhovered Hide ("aide_gui")
        
        hotspot (209,425,215,82): # Ivy
            action Show("dossier_action",legende="apropos",souris=(316,466))
            hovered Show("dossier_hover",legende="apropos",souris=(316,466))
            unhovered Hide("dossier_hover")
            
        hotspot (471,370,203,70): # Chocolat
            action Show("dossier_action",legende="renpy",souris=(572,405))
            hovered Show("dossier_hover",legende="renpy",souris=(572,405))
            unhovered Hide("dossier_hover")
            
        hotspot (695,349,199,67): # Iris
            action Show("dossier_action",legende="gimp",souris=(795,382))
            hovered Show("dossier_hover",legende="gimp",souris=(795,382))
            unhovered Hide("dossier_hover")
        
        
        hotspot (36,344,185,64): # Temps / Time
            action Show("dossier_action",legende="credits_gen",souris=(129,376))
            hovered Show("dossier_hover",legende="credits_gen",souris=(129,376))
            unhovered Hide("dossier_hover")
        
        # Hotspots non utilisés pour l'instant
        #hotspot (241,316,191,66)
        #hotspot (441,297,171,58)
        #hotspot (614,285,173,56)
        #hotspot (804,266,171,56)

    # À la fermeture
    # on efface toute trace éventuelle des bulles d'aide, et on joue un son de fermeture de tiroir
    on "replaced" action [Hide("aide_gui"),Play("sound","gui/audio/fermer_tiroir.ogg")]
    on "hide" action [Hide("aide_gui"),Play("sound","gui/audio/fermer_tiroir.ogg")]
        
##############################################################################
# Menu d'aide
#
# Écran qui affiche des bulles d'aide pour l'utilisation des screens        
screen aide_gui:
    
    tag aide

    default message = _("Cliquer")
    text "[message!t]":
        xpos position[0] 
        ypos position[1]
        style "bulle"

init -2:
    style bulle:
        font "Graziano.ttf"
        color "#ffff35"#"#ded473"
        bold True
        outlines [(15,"#fff8",0,0),(2,"#98914f",2,2),(2,"#33311b",0,0)]
        
##############################################################################
# Ecran pour afficher la couverture d'un dossier d'histoire
#
# Écran utilisé pour choisir entre les différentes histoires de la compilation
screen dossier_couv(legende=legende,souris,r=False):
    
    
    # on positionne le screen à droite ou à gauche en fonction de la position initiale de la souris
    $ x = position_couv(souris[0])
    $ y =  - 550 + souris[1]
    
    # Affichage de la couverture du dossier
        # On teste s'il faut effectuer une rotation et si le dossier est un bouton
    if r:
        add "gui/dossiers/DossierCouv_ground.png" xpos x rotate -45 xoffset -100 yoffset y
    else:
        add "gui/dossiers/DossierCouv_ground.png" xpos x
            

# Affichage des élément spécifiques à chaque histoire sur les dossiers
screen dossier_illu(legende=legende,souris,r=False):
    ## on positionne le screen en fonction de la position initiale de la souris
    $ x = position_couv(souris[0])
    $ y = -550 + souris[1]

    ### Affichage de l'image du dossier
    # Affichage de l'image des titres de l'histoire (définition dans un dictionnaire dans le fichier "script")
    if r:
        add description[legende]["couv"] xpos x rotate -45 xoffset -100 yoffset y
    else:
        add description[legende]["couv"] xpos x
    # Affichage du trombone, juste pour faire joli
    if r:
        add "gui/dossiers/DossierCouv_trombone.png" xpos x rotate -45 xoffset -100 yoffset y
    else:
        add "gui/dossiers/DossierCouv_trombone.png" xpos x
        
    # en fonction du type de menus, on affiche les coches ou un texte explicatif
    if legende in ['renpy','gimp','apropos','credits_gen']:
        use texte_apropos(legende=legende,r=r,x=x,y=y)
    else:
        use coches(legende=legende,r=r,x=x,y=y)

# écran pour afficher les coches des dossiers, si ce sont des histoires
screen coches:
    
    # Affichages des textes des coches (c'est une image)
    if r:
        add "gui/dossiers/coches.png" xpos x rotate -45 xoffset -100 yoffset y
    else:
        add "gui/dossiers/coches.png" xpos x
    
    # Affichage des coches en fonction du parcours des histoires effectué préalablement par le lecteur
    if legende in persistent.consultes:
        if r:
            add "gui/dossiers/DossierCouv_coche2.png" xpos x rotate -45 xoffset -100 yoffset y
        else :
            add "gui/dossiers/DossierCouv_coche2.png" xpos x
        if legende in persistent.lus:
            if r:
                add "gui/dossiers/DossierCouv_coche3.png" xpos x rotate -45 xoffset -100 yoffset y
            else:
                add "gui/dossiers/DossierCouv_coche3.png" xpos x
    else:
        if r:
            add "gui/dossiers/DossierCouv_coche1.png" xpos x rotate -45 xoffset -100 yoffset y
        else:
            add "gui/dossiers/DossierCouv_coche1.png" xpos x
    
# Ecran pour afficher un texte sur la couverture du dossier
screen texte_apropos:
    $ texte = HBox(Null(width=75),VBox(Null(height=280),Text("{space=50}[titre!t]",scope={"titre":description[legende]["titre"]},substitue=True,style="categorie",size=30), Text("[pitch!t]",scope={"pitch":description[legende]["pitch"]},substitue=True,style="categorie",yfill=True),xfill=True,xmaximum=350),Null(width=75),xysize=(500,600),background=Solid("#123"))
    
    if r:
        add texte xpos x rotate -45 xoffset -100 yoffset y
        
    else:
        add texte xpos x
        

screen dossier_hover(legende=legende,souris=souris):
    
    tag dossier
     
    # simple affichage, sans interaction
    use dossier_couv(legende=legende,souris=souris,r=True) 
    use dossier_illu(legende=legende,souris=souris,r=True)
        
    
    # on rajoute un cache pour simuler la semi-sortie du dossier
    $ nom_cache = "gui/dossiers/cache_" + legende + ".png"
    add nom_cache yalign 1.0
    
    # on ajoute une bulle d'aide
    use aide_gui(message=_("Cliquer pour\nexaminer\nce dossier"),position=(souris[0],souris[1]+15))
    
screen dossier_action(legende=legende,souris=souris):
    
    modal True
    tag dossier
        
    use dossier_couv(legende=legende,souris=souris)
    
    # on ajoute une action pour cacher le dossier
    # Si on clique n'importe où sauf les zone définies ensuite, le dossier est caché
    # Ceci est mis en premier, sinon aucune action différente ne fonctionne
    key "dismiss" action Hide("dossier_action")
    
    $ x = position_couv(souris[0])
    # on prépare une zone pour "ouvrir" le dossier
    imagemap:
        alpha True
        xpos x
        ground "gui/dossiers/DossierCouv_idle.png" 
        idle "gui/dossiers/DossierCouv_idle.png"
        hover "gui/dossiers/DossierCouv_hover.png"
        
        hotspot (0,0,499,599):
            action If(legende in ['renpy','gimp','apropos','credits_gen'],true=Start(legende),false=Show("dossier_interieur",histoire=legende))
            hovered Show("aide_gui",message=_("Cliquer pour\nconsulter\nce dossier"),position=(x+510,300))
            unhovered Hide ("aide_gui")
        #hotspot (364,527,163,67) action Show("dossier_interieur",histoire=legende)
    
    # on affiche l'image du dossier
    use dossier_illu(legende=legende,souris=souris)
    
    on "replaced" action Hide("aide_gui")

# Ecran pour afficher les détails de l'histoire avant de la choisir pour de bon
screen dossier_interieur:
    
    tag dossier
    modal True
    
    # On affiche l'image de fond (cahier ouvert)
    add "gui/dossiers/ClasseurInterieur.png" align (0.5,0.5)
    
    # on crée les zones réactives
    imagemap:
        alpha True
        ground "gui/dossiers/ClasseurInterieur_idle.png"
        idle "gui/dossiers/ClasseurInterieur_idle.png"
        hover "gui/dossiers/ClasseurInterieur_hover.png"
        
        # zone pour ouvrir
        hotspot (796,27,93,537):
            action Start(histoire)
            hovered Show("aide_gui",message=_("Cliquer pour\nlire cette histoire"),position=(800,475))
            unhovered Hide ("aide_gui")
        # zone pour fermer
        hotspot (112,39,97,528):
            action Hide("dossier_interieur")
            hovered Show("aide_gui",message=_("Cliquer pour\nrefermer\nce dossier"),position=(35,475))
            unhovered Hide ("aide_gui")
    
    # On crée les illustrations et textes, qui recouvrent visuellement les zones actives
    #$ illu = "gui/pele-mele_" + histoire + ".png"
    add description[histoire]["illu"] align (0.5,0.5)
    $ keyword = _("Mot-clé : ")
    $ titre = description[histoire]["titre"]
    $ pitch = description[histoire]["pitch"]
    $ details = _("Détails")
    $ genre = description[histoire]["genre"]
    $ mots = _("mots")
    
    hbox:
        pos (0.5,0.5) 
        xoffset -320
        yoffset -235
        xsize 250
        text "[keyword!t]" style "categorie"
        text "[titre!t]" style "contenu"
    vbox:
        pos (0.5,0.5) 
        xoffset 50
        yoffset-225
        xsize 300
        text "Pitch" style "categorie"
        text "[pitch!t]" style "contenu"
    vbox:
        pos (0.5,0.5)
        xoffset 50
        yoffset 40
        xsize 300
        text "[details!]" style "categorie"
        text "[genre!t]" style "contenu"
        text description[histoire]["mots"] + " [mots!t]" style "contenu"
    
    # Provisoire pour test (on cache tout au clic)
    #key "dismiss" action Hide("dossier_interieur")
    
    on "replaced" action Hide("aide_gui")
    on "hide" action Hide("aide_gui")
    
style categorie:
    font "gtw.otf"
    size 16
    color "#000"
    
style contenu is text:
    font "Graziano.ttf"
    size 22
    color "#3232c3"
##############################################################################
# Navigation
#
# Écran inclu dans d'autres écrans pour afficher le menu jeu,  
# et le fond.
# http://www.renpy.org/doc/html/screen_special.html#navigation
screen navigation:

    # Fond du menu jeu
    window:
        style "gm_root"

    # Boutons de navigation.
    frame:
        style_group "gm_nav"
        xalign .98
        yalign .98

        has vbox

        textbutton _("Return") action Return()
        textbutton _("Preferences") action ShowMenu("preferences")
        textbutton _("Save Game") action ShowMenu("save")
        textbutton _("Load Game") action ShowMenu("load")
        textbutton _("Main Menu") action MainMenu()
        textbutton _("Help") action Help()
        textbutton _("Quit") action Quit()

init -2 python:
    style.gm_nav_button.size_group = "gm_nav"


##############################################################################
# Sauvegarder, Charger
#
# Écrans permettant à l'utilisateur de sauvegarder ou charger un jeu
# http://www.renpy.org/doc/html/screen_special.html#save
# http://www.renpy.org/doc/html/screen_special.html#load

# Puisque la sauvegarde et le chargement sont deux actions proches
# nous utilisons un seul écran pour les deux. On utilise l'écran
# file_picker depuis les écrans de sauvegarde et et de chargement.    
# Version perso du screen "file_picker"
screen choix_fichier:
    
    # Affichage de l'image de fond
    add "gui/save_load/interieur.jpg"
    
    # Affichage d'un masque imagemap pour quitter l'écran
    imagemap:
        auto "gui/save_load/interieur_%s.png"
        
        hotspot (0,0,1000,600):
            focus_mask "gui/save_load/masque_hover.png"
            action Return()
            hovered Show("aide_gui",message=_("Cliquer pour\nrefermer\nce dossier"),position=(450,20))
            unhovered Hide ("aide_gui")
            
    # Emplacements pour les screenshots
    for i in range (0,2):
        for j in range (0,3):
            add FileScreenshot(3*i+j+1) xpos 173+i*413 ypos 68+j*170
    # recouvrement des screenshots par le cache
    add "gui/save_load/covers.png"
    
    # affichage des boutons pour sélectionner les emplacements
    for i in range (0,2):
        for j in range (1,4):
        
            $ file_name = FileSaveName(j+i*3)
            $ file_time = FileTime(j+i*3, empty=_("Empty Slot."))
            if file_name is not "":
                $ desc = description[file_name]["titre_long"]
            else:
                $ desc = ""
            $ affich = "[desc!t]\n[file_time!t]"
        
            textbutton affich:
                
                style "etiquette"
                xpos 176 + i*513
                ypos 131 + (j-1)*170
                focus_mask True
                action FileAction(j+i*3)
                
    # Boutons pour sélectionner la page de fichiers
    imagebutton:
        xpos 200
        ypos 15
        auto "gui/save_load/pa_%s.png"
        action FilePage("auto")
        focus_mask True
    imagebutton:
        xpos 270
        ypos 15
        auto "gui/save_load/pr_%s.png"
        focus_mask True
        action FilePage("quick")
    for i in range (1,5):
        $ im = "gui/save_load/p"+str(i)+"_%s.png"
        imagebutton:
            xpos 565 + 55*i
            ypos 15
            auto im
            focus_mask True
            action FilePage(i)
            
init -2:
    style etiquette:
        background "gui/save_load/etiquette.png"
        hover_background "gui/save_load/etiquette_hover.png"
        xpadding 15
        ypadding 15
        xysize (150,86)
    style etiquette_text:
        size 18
        color "#1e1e75"
        font "Graziano.ttf"
        bold True
        line_spacing -3
        line_leading -2

screen save:

    # Pour être sûr que tout autre menu est remplacé.
    tag menu

    use navigation
    use choix_fichier
    
    # Affichage d'une bulle d'aide 
    use aide_gui(message=_("Cliquez une\nétiquette pour\nmettre un signet"),position=(425,250))
    
    # effacer la bulle d'aide à la sortie de l'écran, et on joue le son de fermeture du tiroir
    on "replaced" action [Hide("aide_gui"),Play("sound","gui/audio/fermer_tiroir.ogg")]

screen load:

    # Pour être sûr que tout autre menu est remplacé.
    tag menu

    use navigation
    use choix_fichier
    
    # Affichage d'une bulle d'aide 
    use aide_gui(message=_("Cliquez une\nétiquette pour\nrouvrir un signet"),position=(425,250))
    
    # effacer la bulle d'aide à la sortie de l'écran, et on joue le son de fermeture du tiroir
    on "replaced" action [Hide("aide_gui"),Play("sound","gui/audio/fermer_tiroir.ogg")]

init -2 python:
    style.file_picker_frame = Style(style.menu_frame)

    style.file_picker_nav_button = Style(style.small_button)
    style.file_picker_nav_button_text = Style(style.small_button_text)

    style.file_picker_button = Style(style.large_button)
    style.file_picker_text = Style(style.large_button_text)



##############################################################################
# Préférences
#
# Écran permettant à l'utilisateur de changer les préférences.
# http://www.renpy.org/doc/html/screen_special.html#prefereces

screen preferences:

    tag menu
    
    # On affiche les images de fond
    add "gui/prefs/tiroir_ground.png"
    add "gui/prefs/boite.png"
    
    
    # On permet le retour grâce à une imagemap
    imagemap:
        #auto "gui/prefs/boite_%s.png"
        ground  "gui/prefs/boite_idle.png"
        idle  "gui/prefs/boite_idle.png"
        hover  "gui/prefs/boite_hover.png"
        alpha True
        
        hotspot (83,0,823,69):
            action Return()
            hovered Show("aide_gui",message=_("Refermer la console"),position=(410,40))
            unhovered Hide ("aide_gui")
            

                #if config.sample_sound:
                  #  textbutton _("Test"):
                  #  action Play("sound", config.sample_sound)
        #     style "soundtest_button"

    grid 3 1:
        style_group "prefs"
        pos (120,95)
        xsize 250
        
        vbox:
            xfill False
            text "AFFICHAGE"
            button:
                #ysize 100
                #xalign 0.5
                text "Plein écran":
                    xpos 90
                    yalign 0.0
                text "Fenêtre":
                    xpos 90
                    yalign 1.0
                #yfill True
                action [If(_preferences.fullscreen, Preference("display","window"), Preference("display","fullscreen")), SelectedIf(_preferences.fullscreen)]
            null height 10
            text "TRANSITIONS"
            button:
                #ysize 100
                #xalign 0.5
                text "Aucune":
                    xpos 90
                    yalign 0.0
                text "Toutes":
                    xpos 90
                    yalign 1.0
                    #yfill True
                action [If(_preferences.transitions==2, Preference("transitions","none"), Preference("transitions","all")), SelectedIf(_preferences.transitions==2)]
            null height 10
            text "LANGUE/LANGUAGE"
            button:
                #ysize 100
                #xalign 0.5
                text "English":
                    xpos 90
                    yalign 0.0
                text "Français":
                    xpos 90
                    yalign 1.0
                    #yfill True
                action [If(_preferences.language==None, Language("en"), Language(None)), SelectedIf(_preferences.language=="en")] 
        
        vbox:
            xfill False
            text "AVANCE AUTOMATIQUE"
            button:
                #ysize 100
                #xalign 0.5
                text "Activée":
                    xpos 90
                    yalign 0.0
                text "Désactivée":
                    xpos 90
                    yalign 1.0
                #yfill True
                action [Preference("auto-forward", "toggle"), SelectedIf(_preferences.afm_enable)]
            null height 25
            text "VOLUME"
            hbox:
                vbox:
                    text "Musique" xalign 0.5
                    text  "max" xalign 0.5 size 10
                    bar:
                        xalign 0.5
                        value Preference("music volume")
                        style "prefs_bar"
                    text "0" xalign 0.5 size 10
                vbox:
                    text "Son" xalign 0.5
                    text  "max" xalign 0.5 size 10
                    bar:
                        value Preference("sound volume")
                        style "prefs_bar"
                    text "0" xalign 0.5 size 10
        vbox:
            xfill False
            vbox:
                ypos 27
                text "Vitesse\nAvance auto" xalign 0.5
                text  "max" xalign 0.5 size 10
                bar:
                    value Preference("auto-forward time")
                    style "prefs_bar"
                text "0" xalign 0.5 size 10
                
    vbox:
        style_group "prefs"
        #xfill False
        vbox:
            anchor (1.0,1.0)
            pos (860,520)
            text "Vitesse\ndu texte" xalign 0.5
            text  "max" xalign 0.5 size 10
            bar:
                value Preference("text speed")
                style "prefs_bar"
            text "0" xalign 0.5 size 10    
                
    on "replaced" action [Play("sound","gui/audio/fermer_tiroir.ogg"), Hide("couvercle_gauche"), Hide("pref_droite"), Hide("couvercle_droite"), Hide("pref_gauche"), Hide("aide_gui")]

    
init -2:
        
    style prefs_button:
        idle_background "gui/prefs/potentiometre-b.png"
        selected_background "gui/prefs/potentiometre-h.png"
        hover_background "gui/prefs/potentiometre-n.png"
        selected_hover_background "gui/prefs/potentiometre-n.png"
        ysize 100
        yfill True
        xfill False
        
    style prefs_bar:
        bar_vertical True
        xysize (78,191)
        top_bar "gui/prefs/barre-v.png"
        bottom_bar "gui/prefs/barre-v.png"
        thumb "gui/prefs/curseur-v.png"
        thumb_offset 15
        top_gutter 24
        bottom_gutter 24
        xalign 0.5
        
    style prefs_text:
        font "gtw.otf"
        size 20
        color "#000"
        


init -2 python:
    style.pref_frame.xfill = True
    style.pref_frame.xmargin = 5
    style.pref_frame.top_margin = 5

    style.pref_vbox.xfill = True

    style.pref_button.size_group = "pref"
    style.pref_button.xalign = 1.0

    style.pref_slider.xmaximum = 332
    style.pref_slider.xalign = 1.0

    style.soundtest_button.xalign = 1.0
    





##############################################################################
# Menu Oui/Non
#
# Écran proposant à l'utilisateur une question oui ou non
# http://www.renpy.org/doc/html/screen_special.html#yesno-prompt

screen yesno_prompt:

    modal True

    window:
        style "gm_root"

    frame:
        style_group "yesno"

        xfill True
        xmargin .05
        ypos .1
        yanchor 0
        ypadding .05

        has vbox:
            xalign .5
            yalign .5
            spacing 30

        label _(message):
            xalign 0.5

        hbox:
            xalign 0.5
            spacing 100

            textbutton _("Yes") action yes_action
            textbutton _("No") action no_action

    # Clic droit ou échap pour "non"
    key "game_menu" action no_action

init -2 python:
    style.yesno_button.size_group = "yesno"
    style.yesno_label_text.text_align = 0.5
    style.yesno_label_text.layout = "subtitle"


##############################################################################
# Menu rapide
#
# Écran inclus par défaut pour les dialogues, ajoutant un accès rapide à 
# plusieurs fonctions utiles
screen quick_menu:

    # Ajoute un menu rapide au sein du jeu
    hbox:
        style_group "quick"

        xalign 1.0
        yalign 1.0
        xoffset -5
        yoffset -2

        #textbutton _("Back") action Rollback()
        imagebutton: # bouton pour retourner au menu principal
            yalign 1.0 xminimum 16 xalign 0.5
            idle im.MatrixColor("gui/icones/box-2x.png",im.matrix.invert() * im.matrix.tint(1.0,1.0,1.0) * im.matrix.opacity(0.53))
            hover Text(_("Sortir"),style="quick_button_text")
            insensitive im.MatrixColor("gui/icones/box-2x.png",im.matrix.invert() * im.matrix.tint(0.27,0.27,0.27) * im.matrix.opacity(0.53))
            action MainMenu()
        null width 5
        #textbutton _("Sortir") action MainMenu()
        
        imagebutton: # bouton pour retourner au menu des histoires
            yalign 1.0 xminimum 16
            idle im.MatrixColor("gui/icones/list-rich-2x.png",im.matrix.invert() * im.matrix.tint(1.0,1.0,1.0) * im.matrix.opacity(0.53))
            hover Text(_("Histoires"),style="quick_button_text")
            insensitive im.MatrixColor("gui/icones/list-rich-2x.png",im.matrix.invert() * im.matrix.tint(0.27,0.27,0.27) * im.matrix.opacity(0.53))
            action [Stop('music',fadeout=2.0),Play("sound","gui/audio/ouvrir_tiroir.ogg"),ShowMenu('histoires')]
        null width 5
        #textbutton _("Histoires") action [Stop('music',fadeout=2.0),SetVariable("main_menu",True),,ShowMenu('histoires')]
        
        imagebutton: # bouton pour enregistrer un signet
            yalign 1.0 xminimum 16
            idle im.MatrixColor("gui/icones/bookmark-2x.png",im.matrix.invert() * im.matrix.tint(1.0,1.0,1.0) * im.matrix.opacity(0.53))
            hover Text(_("Signet"),style="quick_button_text")
            insensitive im.MatrixColor("gui/icones/bookmark-2x.png",im.matrix.invert() * im.matrix.tint(0.27,0.27,0.27) * im.matrix.opacity(0.53))
            action [Play("sound","gui/audio/ouvrir_tiroir.ogg"),ShowMenu('save')]
        null width 5
        #textbutton _("Save") action ShowMenu('save')
        
        imagebutton: # bouton pour faire une sauvegarde rapide
            yalign 1.0 xminimum 16
            idle im.MatrixColor("gui/icones/badge-2x.png",im.matrix.invert() * im.matrix.tint(1.0,1.0,1.0) * im.matrix.opacity(0.53))
            hover Text(_("Signet rapide"),style="quick_button_text")
            insensitive im.MatrixColor("gui/icones/badge-2x.png",im.matrix.invert() * im.matrix.tint(0.27,0.27,0.27) * im.matrix.opacity(0.53))
            action QuickSave()
        null width 5
        #textbutton _("Q.Save") action QuickSave()
        #textbutton _("Q.Load") action QuickLoad()
        #textbutton _("Skip") action Skip()
        #textbutton _("F.Skip") action Skip(fast=True, confirm=True)
        #textbutton _("Auto") action Preference("auto-forward", "toggle")
        
        imagebutton: # bouton pour accéder au menu des préférences
            yalign 1.0 xminimum 16
            idle im.MatrixColor("gui/icones/wrench-2x.png",im.matrix.invert() * im.matrix.tint(1.0,1.0,1.0) * im.matrix.opacity(0.53))
            hover Text(_("Prefs"),style="quick_button_text")
            insensitive im.MatrixColor("gui/icones/wrench-2x.png",im.matrix.invert() * im.matrix.tint(0.27,0.27,0.27) * im.matrix.opacity(0.53))
            action [ShowMenu('preferences'),Play("sound","gui/audio/ouvrir_tiroir.ogg")]
        null width 5
        #textbutton _("Prefs") action ShowMenu('preferences')
        
        imagebutton: # bouton pour basculer l'avancement automatique
            yalign 1.0 xminimum 16
            idle im.MatrixColor("gui/icones/media-step-forward-2x.png",im.matrix.invert() * im.matrix.tint(1.0,1.0,1.0) * im.matrix.opacity(0.53))
            hover Text(_("Auto"),style="quick_button_text")
            insensitive im.MatrixColor("gui/icones/media-step-forward-2x.png", im.matrix.invert() * im.matrix.tint(0.27,0.27,0.27) * im.matrix.opacity(0.53))
            selected_idle im.MatrixColor("gui/icones/media-step-forward-2x.png", im.matrix.invert() * im.matrix.tint(1.0,1.0,0.0) * im.matrix.opacity(1.0))
            action Preference("auto-forward", "toggle")
        null width 5
        
        imagebutton: # bouton pour faire une pause
            yalign 1.0 xminimum 16
            idle im.MatrixColor("gui/icones/media-pause-2x.png",im.matrix.invert() * im.matrix.tint(1.0,1.0,1.0) * im.matrix.opacity(0.53))
            hover Text(_("Pause"),style="quick_button_text",xalign=0.5)
            insensitive im.MatrixColor("gui/icones/media-pause-2x.png",im.matrix.invert() * im.matrix.tint(0.27,0.27,0.27) * im.matrix.opacity(0.53))
            action Show("ecran_pause")
        #textbutton _("Pause") action Show("ecran_pause")

init -2 python:
    style.quick_button.set_parent('default')
    style.quick_button.background = None
    style.quick_button.xpadding = 5

    style.quick_button_text.set_parent('default')
    style.quick_button_text.size = 12
    style.quick_button_text.idle_color = "#fff8"
    style.quick_button_text.hover_color = "#fff"
    style.quick_button_text.selected_idle_color = "#ff08"
    style.quick_button_text.selected_hover_color = "#ff0"
    style.quick_button_text.insensitive_color = "#ddd8"
    style.quick_button_text.vertical = True
    style.quick_button_text.min_width = 16
    style.quick_button_text.text_align = 0.5