diff --git a/res/text/encounters.yarn b/res/text/intro.yarn similarity index 50% rename from res/text/encounters.yarn rename to res/text/intro.yarn index 471cc53..8d58e4b 100644 --- a/res/text/encounters.yarn +++ b/res/text/intro.yarn @@ -3,8 +3,9 @@ title: Intro You: It's been 3 earth-days since I woke up from cryostasis, and I still don't know what's going on. You: Why is nobody else awake? You: What happened to the updates from mission control? --> Wow, some options! - You got it, pal! --> Can I put text inside options? - You sure can! +-> Maybe I'm still asleep? + You: Surely the scriptwriting isn't *that* cliché... +-> Is this even still the same ship? + You: Best not get too philsophical just yet +You: Let's have another look around... === diff --git a/src/DialogueManager.hx b/src/DialogueManager.hx index 1edee23..ba1ba64 100644 --- a/src/DialogueManager.hx +++ b/src/DialogueManager.hx @@ -8,13 +8,19 @@ import hxyarn.dialogue.OptionSet; import hxyarn.compiler.Compiler; import hxyarn.compiler.CompilationJob; +typedef Option = { + text:String, + callback:() -> Void +}; + class DialogueManager { var storage = new MemoryVariableStore(); var dialogue:Dialogue; var stringTable:Map; - var callback:(DialogueManager, String) -> Void; + var dialogueCallback:(DialogueManager, String) -> Void; + var optionCallback:(DialogueManager, Array