Exemple #1
0
 public void OnPointerClick(PointerEventData pointerEventData)
 {
     if (pointerEventData.button.ToString() == "Right")
     {
         DialogueSelectionInitializer doi = new DialogueSelectionInitializer("Item");
         doi.AddDialogueOption("Drop Item", dropItem);
         doi.AddDialogueOption("Text2", "you selection something else");
         doi.AddDialogueOption("Last 3", "Final item selected");
         Debug.Log("open menu item: " + ItemInfo);
         TextboxManager.StartDialogueOptions(doi);
     }
 }
Exemple #2
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));
    }
Exemple #3
0
    public static void CreateDialogueOptionList(List <RHStatement> statements, RHSpeaker speaker, RHConversation baseConversation, string prompt = "Select your next statement", float scroll = 0.0f)
    {
        DialogueSelectionInitializer dialogue         = new DialogueSelectionInitializer(prompt);
        List <RHStatement>           sortedStatements = new List <RHStatement>();

        sortedStatements = RHManager.SortedList(statements, speaker, baseConversation);

        foreach (RHStatement s in sortedStatements)
        {
            DialogueOptionInitializer doi = convertToDialogueOption(s, statements, speaker, baseConversation);
            dialogue.AddDialogueOption(doi);
        }
        void Close(DialogueOption selectedOption)
        {
        }

        dialogue.AddDialogueOption("Close", Close);
        GameObject go = TextboxManager.StartDialogueOptions(dialogue);

        go.GetComponent <DialogueOptionBox>().SetScrollValue(scroll);
        baseConversation.SetDialogueBox(go);
    }