Пример #1
0
        /// <summary>
        /// Commande CharSay
        /// </summary>
        /// <param name="command"></param>
        private static void CommandCharSay(string[] command)
        {
            if (ScriptManager.CurrentScript == null)
            {
                string message = string.Join(" ", command, 3, command.Length - 3);

                string            characterName = command[1];
                VO_Stage          currentStage  = _Service.GetCurrentStage();
                VO_StageCharacter character     = currentStage.ListCharacters.Find(p => p.Title.ToLower() == characterName);

                if (character != null)
                {
                    VO_RunningScript runningScript = new VO_RunningScript();
                    runningScript.ScriptType = Enums.ScriptType.Events;
                    runningScript.Lines      = new List <VO_Line>();
                    VO_Script_Message messageScript = new VO_Script_Message();
                    messageScript.Dialog          = new VO_Dialog();
                    messageScript.Dialog.Messages = new List <VO_Message>();
                    messageScript.Dialog.Messages.Add(new VO_Message()
                    {
                        Character = character.Id, Duration = message.Length, FontSize = 14, Text = message
                    });
                    runningScript.Lines.Add(messageScript);
                    runningScript.CurrentLine   = runningScript.Lines[0];
                    ScriptManager.CurrentScript = runningScript;
                }
                else
                {
                    AddConsoleLine(string.Format("{0}: {1} not found", ConsoleConstants.C_SAY, command[1]));
                }
            }
        }