Ejemplo n.º 1
0
    public void ShowDialogue(int dialogueID)
    {
        string           text             = null;
        string           speakerName      = null;
        bool             tryAbove         = false;
        bool             autoClose        = false;
        GameTextDatabase gameTextDatabase = null;
        TextBoxManager   textBoxManager   = null;

        gameTextDatabase = GameTextDatabase.Instance;
        textBoxManager   = TextBoxManager.Instance;
        if ((gameTextDatabase != null) && (textBoxManager != null))
        {
            text = gameTextDatabase.GetDialogueText(dialogueID, ref speakerName, ref tryAbove, ref autoClose);
            textBoxManager.ShowDialogue(speakerName, text, tryAbove, autoClose);
        }
    }
Ejemplo n.º 2
0
    protected override void PerformAction(float timeStep)
    {
        string text        = null;
        string speakerName = null;
        bool   tryAbove    = false;
        bool   autoClose   = false;

        base.PerformAction(timeStep);
        if (!dialogueCreated)
        {
            if ((gameTextDatabase != null) && (textBoxManager != null))
            {
                switch (dialogueType)
                {
                case GameTextDatabase.TextType.Platform:
                    text            = gameTextDatabase.GetPlatformText(dialogueID, dialoguePlatform, ref autoClose);
                    dialogueCreated = textBoxManager.ShowDialogue(null, text, false, autoClose, this);
                    break;

                case GameTextDatabase.TextType.System:
                    text            = gameTextDatabase.GetSystemText(dialogueID, ref autoClose);
                    dialogueCreated = textBoxManager.ShowDialogue(null, text, false, autoClose, this);
                    break;

                case GameTextDatabase.TextType.Dialogue:
                    text            = gameTextDatabase.GetDialogueText(dialogueID, ref speakerName, ref tryAbove, ref autoClose);
                    dialogueCreated = textBoxManager.ShowDialogue(speakerName, text, tryAbove, autoClose, this);
                    break;

                case GameTextDatabase.TextType.Item:
                    text            = gameTextDatabase.GetItemDescription(dialogueID, ref speakerName);
                    dialogueCreated = textBoxManager.ShowDialogue(speakerName, text, false, false, this);
                    break;
                }
            }
        }
    }