Beispiel #1
0
    public static void CreateDialogueOptionListSortedType(List <RHStatement> statements, RHSpeaker speaker, RHConversation baseConversation, string prompt = "Select your next statement")
    {
        DialogueSelectionInitializer             dialogue         = new DialogueSelectionInitializer(prompt);
        Dictionary <RHType, List <RHStatement> > sortedStatements = new Dictionary <RHType, List <RHStatement> >();

        foreach (RHStatement s in statements)
        {
            if (!sortedStatements.ContainsKey(s.RhetoricType))
            {
                sortedStatements[s.RhetoricType] = new List <RHStatement>();
            }
            sortedStatements[s.RhetoricType].Add(s);
        }

        foreach (RHType t in sortedStatements.Keys)
        {
            void InitializeSubList(DialogueOption dop2)
            {
                DialogueSelectionInitializer dialogueSubList = new DialogueSelectionInitializer(prompt);

                foreach (RHStatement s in sortedStatements[t])
                {
                    DialogueOptionInitializer doi = convertToDialogueOption(s, statements, speaker, baseConversation);
                    dialogueSubList.AddDialogueOption(doi);
                }
                void ReturnToBase(DialogueOption selectedOption)
                {
                    CreateDialogueOptionListSortedType(statements, speaker, baseConversation, prompt);
                }

                dialogueSubList.AddDialogueOption("Back", ReturnToBase);
                GameObject go = TextboxManager.StartDialogueOptions(dialogueSubList);

                baseConversation.SetDialogueBox(go);
            }

            dialogue.AddDialogueOption(RHTypeToString(t), InitializeSubList);
        }
        void Close(DialogueOption selectedOption)
        {
            baseConversation.CloseConversation();
        }

        dialogue.AddDialogueOption("Close", Close);
        baseConversation.SetDialogueBox(TextboxManager.StartDialogueOptions(dialogue));
    }
Beispiel #2
0
 public void OnConfirm()
 {
     m_conversation?.CloseConversation();
 }