Example #1
0
        /// <summary>
        /// Shows the actual line of dialog, name and portrait of the actual character talking
        /// It handles the dialog lines and names
        /// </summary>
        private void ShowScript()
        {
            ListDialog actualDialog = GetCurrentHeadDialog();

            // If dialog is either: OFF, OVER or is not even there at all, don't show anything.
            if (actualDialog != null && !actualDialog.IsDialogOver() && !actualDialog.IsDialogOff())
            {
                // Gets the next character name and line from the actual dialog
                string[] nameAndLine = actualDialog.GetNextNameAndLine();
                if (nameAndLine[0][0] == '/')
                {
                    HandleCommand(nameAndLine);
                }
                else
                {
                    // Updates the portrait and text to the actual character in screen
                    UpdateTextBox(nameAndLine);
                }
            }
        }
Example #2
0
        /// <summary>
        /// If there's no dialog lines left on the actual dialog, show the buttons (if any)
        /// </summary>
        private void HandlePrintCompleted()
        {
            ListDialog currentDialog = GetCurrentHeadDialog();

            if (currentDialog.currentIndex >= currentDialog.dialogueLines.Count)
            {
                currentDialog.dialogIsOver = true;
            }

            if (!currentDialog.IsDialogOver())
            {
                // If the next line is a certain command, just show script, dont wait for a mouse click
                string testIfCommand = currentDialog.characterNames[currentDialog.currentIndex].Substring(1);
                switch (testIfCommand)
                {
                case "wait":
                case "w":
                    ShowScript();
                    break;

                case "playsound":
                case "playSound":
                case "ps":
                    ShowScript();
                    break;

                case "playMusic":
                case "playmusic":
                case "pm":
                    ShowScript();
                    break;
                }
            }
            else
            {
                //Debug.Log("PRINT COMPLETED");
                SetButtons(dialogBucket.dialogs[dialogHeadIndex].action);
            }
        }