Ejemplo n.º 1
0
    private void DisplayDialogueOptions(List <int> next_dialogue_list)
    {
        m_textDisplay.DisplayActiveBubble(false);
        m_textDisplay.DisplayActiveOptionBubble(true, next_dialogue_list.Count);
        m_textDisplay.ClearDisplay();
        m_textDisplay.DisplayingOptions();

        //header details
        DialogueData header_dialogue;

        m_dialogueAsset.m_dialogueData.TryGetValue(next_dialogue_list[0], out header_dialogue);
        CharacterComponent characterComp;

        m_dialogueAsset.m_characterData.TryGetValue(header_dialogue.characterName, out characterComp);

        // displaying text for each dialogue option
        int drawIndex = 0;

        foreach (int dialogue_index in next_dialogue_list)
        {
            DialogueData dialogue;
            m_dialogueAsset.m_dialogueData.TryGetValue(dialogue_index, out dialogue);
            if (dialogue != null)
            {
                if (dialogue.previewDialogueText != "")
                {
                    if (drawIndex == playerSelectedOption)
                    {
                        m_textDisplay.AddBoldTextToDisplayImmediate(dialogue.previewDialogueText);
                    }
                    else
                    {
                        m_textDisplay.AddToDisplayImmediate(dialogue.previewDialogueText);
                    }
                }
                else
                {
                    if (drawIndex == playerSelectedOption)
                    {
                        m_textDisplay.AddBoldTextToDisplayImmediate(dialogue.dialogueText);
                    }
                    else
                    {
                        m_textDisplay.AddToDisplayImmediate(dialogue.dialogueText);
                    }
                }
                m_textDisplay.NewOption();
            }
            ++drawIndex;
        }
        m_textDisplay.DisplayDialogueHeader(header_dialogue.characterName, characterComp.characterIcon);
        hasPlayerOptions = true;
        nextDialogue     = false;
    }