Exemplo n.º 1
0
 /// <summary>
 /// Clears the current speaker, so none is displayed the next time TextDialogue is called!
 /// </summary>
 public void ResetSpeaker(bool keysound = true)
 {
     m_curspeakerID   = MonsterID.Invalid;
     m_curspeakerName = null;
     m_curspeakerEmo  = new EmoteStyle(0);
     m_curspeakerSnd  = keysound;
 }
Exemplo n.º 2
0
        public SpeakerPortrait(MonsterID speaker, EmoteStyle emotion, Loc loc, bool bordered)
        {
            Speaker        = speaker;
            SpeakerEmotion = emotion;
            Bordered       = bordered;

            Loc = loc;
        }
Exemplo n.º 3
0
 public void SetPortrait(MonsterID speaker, EmoteStyle emotion)
 {
     if (speaker.IsValid())
     {
         Loc loc = new Loc(DialogueBox.SIDE_BUFFER, Bounds.Y - 56);
         speakerPic = new SpeakerPortrait(speaker, emotion, loc, true);
     }
 }
Exemplo n.º 4
0
 public void SetEmoteStyle(NWObject obj, EmoteStyle style)
 {
     if (obj.IsPlayer)
     {
         NWPlayer player = obj.Object;
         Player   pc     = _data.Single <Player>(x => x.ID == player.GlobalID);
         pc.IsUsingNovelEmoteStyle = style == EmoteStyle.Novel;
         _data.SubmitDataChange(pc, DatabaseActionType.Update);
     }
 }
Exemplo n.º 5
0
 public static void SetEmoteStyle(NWObject obj, EmoteStyle style)
 {
     if (obj.IsPlayer)
     {
         NWPlayer player = obj.Object;
         Player   pc     = DataService.Player.GetByID(player.GlobalID);
         pc.IsUsingNovelEmoteStyle = style == EmoteStyle.Novel;
         DataService.SubmitDataChange(pc, DatabaseActionType.Update);
     }
 }
Exemplo n.º 6
0
        public QuestionDialog CreateQuestion(MonsterID speaker, string speakerName, EmoteStyle emotion,
                                             string msg, bool sound, Action yes, Action no, bool defaultNo)
        {
            DialogueChoice[] choices = new DialogueChoice[2];
            choices[0] = new DialogueChoice(Text.FormatKey("DLG_CHOICE_YES"), yes);
            choices[1] = new DialogueChoice(Text.FormatKey("DLG_CHOICE_NO"), no);

            QuestionDialog box = new QuestionDialog(msg, sound, choices, defaultNo ? 1 : 0, 1);

            box.SetSpeaker(speaker, speakerName, emotion);
            return(box);
        }
Exemplo n.º 7
0
 public DialogueBox CreateDialogue(MonsterID speaker, string speakerName, EmoteStyle emotion, bool sound, Action finishAction, int waitTime, params string[] msgs)
 {
     if (msgs.Length > 0)
     {
         DialogueBox box = null;
         for (int ii = msgs.Length - 1; ii >= 0; ii--)
         {
             DialogueBox prevBox = box;
             box = CreateBox(speaker, speakerName, emotion, sound, (prevBox == null) ? finishAction : () => { AddMenu(prevBox, false); }, waitTime, msgs[ii]);
         }
         return(box);
     }
     return(null);
 }
Exemplo n.º 8
0
        public void SetSpeaker(MonsterID speaker, string speakerName, EmoteStyle emotion)
        {
            SetPortrait(speaker, emotion);

            if (!String.IsNullOrEmpty(speakerName))
            {
                Text.Text              = speakerName + ": " + Text.Text;
                Text.CurrentCharIndex += speakerName.Length + 2;
                foreach (TextPause pause in Pauses)
                {
                    pause.LetterIndex += speakerName.Length + 2;
                }
            }
        }
Exemplo n.º 9
0
        public DialogueBox CreateBox(MonsterID speaker, string speakerName, EmoteStyle emotion, bool sound,
                                     Action finishAction, int waitTime, string msg)
        {
            DialogueBox box = null;

            if (waitTime > -1)
            {
                box = new TimedDialog(msg, sound, waitTime, finishAction);
            }
            else
            {
                box = new ClickedDialog(msg, sound, finishAction);
            }
            box.SetSpeaker(speaker, speakerName, emotion);
            return(box);
        }
Exemplo n.º 10
0
 public DialogueBox CreateDialogue(MonsterID speaker, string speakerName, EmoteStyle emotion, bool sound, Action finishAction, int waitTime, params string[] msgs)
 {
     if (msgs.Length > 0)
     {
         List <string> sep_msgs = new List <string>();
         for (int ii = 0; ii < msgs.Length; ii++)
         {
             string[] break_str = Regex.Split(msgs[ii], "\\[br\\]", RegexOptions.IgnoreCase);
             sep_msgs.AddRange(break_str);
         }
         DialogueBox box = null;
         for (int ii = sep_msgs.Count - 1; ii >= 0; ii--)
         {
             DialogueBox prevBox = box;
             box = CreateBox(speaker, speakerName, emotion, sound, (prevBox == null) ? finishAction : () => { AddMenu(prevBox, false); }, waitTime, sep_msgs[ii]);
         }
         return(box);
     }
     return(null);
 }
Exemplo n.º 11
0
        public DialogueBox CreateQuestion(MonsterID speaker, string speakerName, EmoteStyle emotion,
                                          string msg, bool sound, Action yes, Action no, bool defaultNo)
        {
            string[] break_str = Regex.Split(msg, "\\[br\\]", RegexOptions.IgnoreCase);

            DialogueChoice[] choices = new DialogueChoice[2];
            choices[0] = new DialogueChoice(Text.FormatKey("DLG_CHOICE_YES"), yes);
            choices[1] = new DialogueChoice(Text.FormatKey("DLG_CHOICE_NO"), no);

            DialogueBox box = new QuestionDialog(break_str[break_str.Length - 1], sound, choices, defaultNo ? 1 : 0, 1);

            box.SetSpeaker(speaker, speakerName, emotion);

            if (break_str.Length > 1)
            {
                string[] pre_str = new string[break_str.Length - 1];
                Array.Copy(break_str, pre_str, pre_str.Length);
                return(CreateDialogue(speaker, speakerName, emotion, sound, () => { AddMenu(box, false); }, -1, pre_str));
            }
            else
            {
                return(box);
            }
        }
Exemplo n.º 12
0
 public IEnumerator <YieldInstruction> SetDialogue(MonsterID speaker, EmoteStyle emotion, params string[] msgs)
 {
     return(SetDialogue(speaker, DataManager.Instance.GetMonster(speaker.Species).Name.ToLocal(), emotion, true, () => { }, -1, msgs));
 }
Exemplo n.º 13
0
        public QuestionDialog CreateMultiQuestion(MonsterID speaker, string speakerName, EmoteStyle emotion,
                                                  string msg, bool sound, DialogueChoice[] choices, int defaultChoice, int cancelChoice)
        {
            QuestionDialog box = new QuestionDialog(msg, sound, choices, defaultChoice, cancelChoice);

            box.SetSpeaker(speaker, speakerName, emotion);
            return(box);
        }
Exemplo n.º 14
0
 public DialogueBox CreateDialogue(MonsterID speaker, string speakerName, EmoteStyle emotion, bool sound, params string[] msgs)
 {
     return(CreateDialogue(speaker, speakerName, emotion, sound, () => { }, -1, msgs));
 }
Exemplo n.º 15
0
        public IEnumerator <YieldInstruction> SetDialogue(MonsterID speaker, string speakerName, EmoteStyle emotion, bool sound, Action finishAction, int waitTime, params string[] msgs)
        {
            DialogueBox box = CreateDialogue(speaker, speakerName, emotion, sound, finishAction, waitTime, msgs);

            yield return(CoroutineManager.Instance.StartCoroutine(ProcessMenuCoroutine(box)));
        }
Exemplo n.º 16
0
 public IEnumerator <YieldInstruction> SetDialogue(MonsterID speaker, string speakerName, EmoteStyle emotion, bool sound, params string[] msgs)
 {
     return(SetDialogue(speaker, speakerName, emotion, sound, () => { }, -1, msgs));
 }
Exemplo n.º 17
0
        public DialogueBox CreateMultiQuestion(MonsterID speaker, string speakerName, EmoteStyle emotion,
                                               string msg, bool sound, DialogueChoice[] choices, int defaultChoice, int cancelChoice)
        {
            string[] break_str = Regex.Split(msg, "\\[br\\]", RegexOptions.IgnoreCase);

            DialogueBox box = new QuestionDialog(break_str[break_str.Length - 1], sound, choices, defaultChoice, cancelChoice);

            box.SetSpeaker(speaker, speakerName, emotion);

            if (break_str.Length > 1)
            {
                string[] pre_str = new string[break_str.Length - 1];
                Array.Copy(break_str, pre_str, pre_str.Length);
                return(CreateDialogue(speaker, speakerName, emotion, sound, () => { AddMenu(box, false); }, -1, pre_str));
            }
            else
            {
                return(box);
            }
        }