Commit e3e966ef authored by Studer Brendan's avatar Studer Brendan
Browse files

removed line returns in dialogs

parent d2a22409
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -14,10 +14,8 @@ Jeudi 10h. Claude est devant la porte de la chambre d’Agathe.
# 1
Claude: Claude est devant la porte de la chambre d’Agathe. 

@choice "Claude prend un temps pour respirer et se recentrer. Claude frappe et entre doucement avec son chariot. Agathe est dans son fauteuil.
Claude dit: Bonjour Agathe, comment allez-vous aujourd’hui?" set:Authenticity+=0;Respect+=1;Compassion+=0;Hope+=0;Empathy+=1 goto:.3
@choice "Claude prend un temps pour respirer et se recentrer. Claude frappe puis après avoir attendu qu'Agathe lui réponde, entre, en poussant le chariot avec le matériel dont nécessaire pour changer le pansement. 
Claude dit: Bonjour Agathe, comment allez-vous aujourd’hui?" set:Authenticity+=0;Respect+=1;Compassion+=1;Hope+=0;Empathy+=1 goto:.3
@choice "Claude prend un temps pour respirer et se recentrer. Claude frappe et entre doucement avec son chariot. Agathe est dans son fauteuil.Claude dit: Bonjour Agathe, comment allez-vous aujourd’hui?" set:Authenticity+=0;Respect+=1;Compassion+=0;Hope+=0;Empathy+=1 goto:.3
@choice "Claude prend un temps pour respirer et se recentrer. Claude frappe puis après avoir attendu qu'Agathe lui réponde, entre, en poussant le chariot avec le matériel dont nécessaire pour changer le pansement. Claude dit: Bonjour Agathe, comment allez-vous aujourd’hui?" set:Authenticity+=0;Respect+=1;Compassion+=1;Hope+=0;Empathy+=1 goto:.3
@choice "Claude frappe et entre en poussant son chariot et dit: Bonjour Agathe, comment allez-vous aujourd’hui?" set:Authenticity+=0;Respect+=1;Compassion+=0;Hope+=0;Empathy+=0 goto:.2
@choice "Elle entre " set:Authenticity+=0;Respect+=0;Compassion+=0;Hope+=0;Empathy+=-2 goto:.4
@stop
+8 −5
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@ def normalize_string(text):
    return text.lower().replace(" ", "_").replace("é", "e") \
        .replace("ê", "e").replace("è", "e").replace("à", "a")
        
def normlize_dialog(text):
    return text.replace("\n","")


def main(argv):
    """Main function"""
@@ -136,7 +139,7 @@ def main(argv):
                        for choice in interaction['Responses']:

                            stat_update = f"set:Authenticity+={choice['Authenticity']};Respect+={choice['Respect']};Compassion+={choice['Compassion']};Hope+={choice['Hope']};Empathy+={choice['Empathy']}"
                            
                            choice_text = normlize_dialog(choice['Text'])
                            #Check if this is an end choice of the current script
                            if choice['NextInteractionID'] == int(app_config.get("LAST_INTERACTION")):
                                #Check if the current scene is the last one from the current chapter
@@ -146,20 +149,20 @@ def main(argv):
                                        #f.write(
                                        #f"@choice \"{choice['Text']}\" {stat_update} goto:FIN\n")
                                        f.write(
                                        f"@choice \"{choice['Text']}\" {stat_update};next_scene=\"FIN\" goto:Scores \n")
                                        f"@choice \"{choice_text}\" {stat_update};next_scene=\"FIN\" goto:Scores \n")
                                    else:
                                        #f.write(
                                        #f"@choice \"{choice['Text']}\" {stat_update} goto:{normalize_string(contents['Chapters'][idx_chapter + 1]['Name']) + '_intro'}\n")
                                        f.write(
                                        f"@choice \"{choice['Text']}\" {stat_update};next_scene=\"{normalize_string(contents['Chapters'][idx_chapter + 1]['Name']) + '_intro'}\" goto:Scores \n")
                                        f"@choice \"{choice_text}\" {stat_update};next_scene=\"{normalize_string(contents['Chapters'][idx_chapter + 1]['Name']) + '_intro'}\" goto:Scores \n")
                                else:
                                    #f.write(
                                    #    f"@choice \"{choice['Text']}\" {stat_update} goto:{normalize_string(chapter['Scenes'][idx_scene+1]['Title'])}\n")
                                    f.write(
                                        f"@choice \"{choice['Text']}\" {stat_update};next_scene=\"{normalize_string(chapter['Scenes'][idx_scene+1]['Title'])}\" goto:Scores \n")
                                        f"@choice \"{choice_text}\" {stat_update};next_scene=\"{normalize_string(chapter['Scenes'][idx_scene+1]['Title'])}\" goto:Scores \n")
                            else:
                                f.write(
                                    f"@choice \"{choice['Text']}\" {stat_update} goto:.{choice['NextInteractionID']}\n")
                                    f"@choice \"{choice_text}\" {stat_update} goto:.{choice['NextInteractionID']}\n")

                        f.write("@stop\n\n")
        logger.debug("DONE !")