Ajout d'un locker de lancement de dialogue
This commit is contained in:
parent
011c7f4895
commit
2a47bb5d60
|
@ -7,6 +7,7 @@ class DialogsManager:
|
|||
self.current_dialogs = []
|
||||
self.current_dialog_id = -1
|
||||
self.dialogs = {}
|
||||
self.reading_dialog = False
|
||||
|
||||
def next_dialog(self):
|
||||
"""Passe au dialogue suivant. Renvoie True si le dialogue est fini."""
|
||||
|
@ -14,12 +15,18 @@ class DialogsManager:
|
|||
if self.current_dialog_id == len(self.current_dialogs):
|
||||
self.current_dialogs = []
|
||||
self.current_dialog_id = -1
|
||||
self.reading_dialog = False
|
||||
|
||||
def start_dialog(self, name: str):
|
||||
"""Lance le dialogue au nom donné."""
|
||||
if not self.reading_dialog:
|
||||
self.current_dialogs = self.dialogs[name]
|
||||
self.current_dialog_id = 0
|
||||
|
||||
print(self.current_dialogs)
|
||||
|
||||
self.reading_dialog = True
|
||||
|
||||
def get_current_dialog_sentence(self) -> str:
|
||||
"""Renvoie la phrase actuelle du dialogue."""
|
||||
return self.current_dialogs[self.current_dialog_id]
|
||||
|
|
Loading…
Reference in a new issue