示例#1
0
        /// <summary>
        /// Take an IDialogueBox and break it down into multiple instructions as necessary
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public IInstruction[] BreakUpDialgoueBox(IDialogueBox input, BoxLines[] boxes)
        {
            /*if (boxes.Length == 1)
             * {
             *  return new IInstruction[1] { input as IInstruction };
             * }
             * //Leaving this old here for posterity. I removed this out because it was causing issues with text boxes that have 2 lines but no overflow. (They weren't wrapping properly for some reason.)
             */

            List <IInstruction> newBoxes = new List <IInstruction>();

            input.SetDialogue(boxes[0].ToString());
            newBoxes.Add(input as IInstruction);

            for (int i = 1; i < boxes.Length; i++)
            {
                var          workingBox   = boxes[i];
                BasicTextBox newDialogBox = new BasicTextBox();
                newDialogBox.InitalizeDefault();
                newDialogBox.SetDialogue(workingBox.ToString());
                newDialogBox.SetName(input.GetName());
                newBoxes.Add(newDialogBox);
            }

            return(newBoxes.ToArray());
        }
示例#2
0
        /// <summary>
        /// Main Constructor
        /// </summary>
        /// <param name="_sl">Reference to Service Locator</param>
        /// <param name="_lines">Lines to display</param>
        /// <param name="_path">Character art path</param>
        /// <param name="_pos">Character art position</param>
        /// <param name="_speaker">Reference to the speaker</param>
        public DialogueDisplay(IServiceLocator _sl, string[] _lines, string _path, ISpeaker _speaker)
        {
            mLines = _lines;

            mInterval       = 3000f;
            mTimer          = 0f;
            mDialogueBox    = new DialogueBox(_sl);
            mInputManager   = _sl.GetService <IInput_Manager>();
            mContentManager = _sl.GetService <IContent_Manager>();
            mArtpath        = _path;
            mSpeaker        = _speaker;
        }