示例#1
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);
        }
示例#2
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);
            }
        }