Esempio n. 1
0
    public void PushNextBox()
    {
        if (waiting_for_next_box)
        {
            waiting_for_next_box = false;

            if (curr_frame_printing < dialog_frames_to_show.Count)
            {
                DialogFrame curr_frame = dialog_frames_to_show[curr_frame_printing];

                curr_frame.ClearText();;
            }
            else
            {
                if (dialog_frames_to_show.Count > 0)
                {
                    DialogFrame curr_frame = dialog_frames_to_show[dialog_frames_to_show.Count - 1];

                    curr_frame.ClearText();

                    printing_dialog = false;
                }
            }
        }
    }
Esempio n. 2
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        var me = Toolbox.Instance.GameManager.Player.Username;

        DialogFrame frame;

        if (Toolbox.Instance.QuestManager.Current.Id == "networking")
        {
            frame = new DialogFrame(Name, "Naomi is looking for you upstairs!");
        }
        else if (Toolbox.Instance.QuestManager.HasFinishedOrIsCurrent(QuestId))
        {
            frame = GetInstructorDialog(me);
        }
        else
        {
            var current = Toolbox.Instance.QuestManager.Current.Title;
            // Capitalize first character & lowercase everything else
            current = current.Substring(0, 1).ToUpper() + current.Substring(1).ToLower();

            frame = new DialogFrame(Name,
                                    "Sorry it looks like you aren't enrolled for this workshop right now, check your timetable to see " +
                                    "where you should be going.")
            {
                Next = new DialogFrame(Name, "It looks like you're currently enrolled in the " + current + ".")
            };
        }

        var directions = new Dictionary <string, DialogPosition>
        {
            { me, DialogPosition.Left }, { Name, DialogPosition.Right }
        };

        return(new Dialog(frame, directions));
    }
Esempio n. 3
0
    /// <summary>
    /// 开启选项进行选择.
    /// </summary>
    /// <param name="use">Use.</param>
    private void makeSelect(DialogFrame use)
    {
        theInformationText.text = "怎么选择呢?";
        theNameText.text        = "";
        use.picture             = "noOne";
        Texture2D theTextureIn = SystemValues.LoadResources <Texture2D> ("TalkPicture/" + use.picture);

        UIController.GetInstance().ShowUI <UITalkSelect> (use.information);
    }
Esempio n. 4
0
 private void makeMission(DialogFrame use)
 {
     string[] missionNames = use.information.Split(',');
     for (int i = 0; i < missionNames.Length; i++)
     {
         System.Reflection.Assembly AS = System.Reflection.Assembly.GetExecutingAssembly();
         MissionBasic theMission       = AS.CreateInstance(missionNames[i])  as MissionBasic;
         SystemValues.thePlayer.GetComponent <Player> ().theMissionPackage.AddNewMission(theMission);
     }
 }
Esempio n. 5
0
    private void UpdateCurrentDialog()
    {
        if (printing_dialog)
        {
            if (curr_frame_printing < dialog_frames_to_show.Count)
            {
                DialogFrame curr_frame = dialog_frames_to_show[curr_frame_printing];

                if (!waiting_for_next_box)
                {
                    if (curr_frame.GetLines() > curr_line_printing)
                    {
                        string curr_line_text = curr_frame.GetTextAtLine(curr_line_printing);

                        if (curr_line_text.Length > curr_word_printing)
                        {
                            if (printing_leter_timer.ReadTime() > printing_leter_time || curr_word_printing == 0)
                            {
                                printing_leter_timer.Start();

                                curr_frame.GetTextToUse().text += curr_line_text[curr_word_printing];

                                ++curr_word_printing;
                            }
                        }
                        else
                        {
                            curr_word_printing = 0;
                            ++curr_line_printing;

                            curr_frame.GetTextToUse().text += "\n";

                            if (curr_line_printing > max_lines_per_box - 1)
                            {
                                waiting_for_next_box = true;
                            }
                        }
                    }
                    else
                    {
                        curr_line_printing = 0;
                        curr_word_printing = 0;

                        curr_frame.CallOnFrameFinish();

                        ++curr_frame_printing;
                    }
                }
            }
            else
            {
                waiting_for_next_box = true;
            }
        }
    }
Esempio n. 6
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        var me = Toolbox.Instance.GameManager.Player.Username;

        const string npc = "Harry Potter";

        var frame = new DialogFrame(npc, "Why hello there!")
        {
            Next = new DialogFrame(npc, "I'm Harry Potter (the chosen one)!")
            {
                Next = new DialogFrame(me, "The chosen what?")
                {
                    Next = new DialogFrame(npc, "…nevermind, how was your day?")
                    {
                        Next = new DialogFrame(me,
                                               "It was good, I really enjoyed talking to all the other prospective students… like " +
                                               "yourself! How about yourself?")
                        {
                            Next = new DialogFrame(npc,
                                                   "Well, there are more opportunities in engineering than I previously realized – it’s " +
                                                   "more than Calculus and Physics, it’s practical.")
                            {
                                Next = new DialogFrame(npc,
                                                       "It can be a glove controlled shooter game or a smartphone gaming app, for " +
                                                       "example – engineering can be for pleasure.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "This enginuity day showcased all the ‘hidden’ aspects of engineering, and " +
                                                           "promoted understanding in a helpful way that I would recommend to any " +
                                                           "students considering working in the field.")
                                    {
                                        Next = new DialogFrame(npc,
                                                               "I learnt that the future is limitless; it is not bound by gender or " +
                                                               "stereotypes.")
                                        {
                                            Next = new DialogFrame(me, "Oh wow! Really interesting!")
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        };

        var directions = new Dictionary <string, DialogPosition>
        {
            { me, DialogPosition.Left }, { npc, DialogPosition.Right }
        };

        var achievementsManager = Toolbox.Instance.AchievementsManager;

        return(new Dialog(frame, directions, () => { achievementsManager.MarkCompleted("talk-to-student"); }));
    }
Esempio n. 7
0
    /// <summary>
    /// 正常的对话.
    /// </summary>
    /// <param name="use">Use.</param>
    private void makeTalk(DialogFrame use)
    {
        theNameText.text        = use.name;
        theInformationText.text = use.information;

        use.picture = !string.IsNullOrEmpty(use.picture) ? use.picture : "noOne";
        Texture2D theTextureIn = SystemValues.LoadResources <Texture2D> ("TalkPicture/" + use.picture);        //Resources.Load <Texture2D> ("TalkPicture/" + use.picture);
        Sprite    theSprite    = Sprite.Create(theTextureIn, new Rect(0, 0, theTextureIn.width, theTextureIn.height), new Vector2(0, 0));

        theTalkHeadPicture.sprite = theSprite;
    }
Esempio n. 8
0
 /// <summary>
 /// 获得经验值,给出消息框
 /// </summary>
 /// <param name="use">Use.</param>
 private void makeOver(DialogFrame use)
 {
     UIController.GetInstance().ShowUI <PlayerActCanvas> ();
     UIController.GetInstance().ShowUI <HpBasicPanel> ();
     UIController.GetInstance().CloseUI <TalkCanvas> ();
     OnEndShow();
     string [] values = use.information.Split(',');
     if (values.Length >= 2)
     {
         SystemValues.thePlayer.GetComponent <Player> ().OnGetLearningValue((float)XmlConvert.ToDouble(values[0]));
         UIController.GetInstance().ShowUI <messageBox> (values[1]);
     }
 }
Esempio n. 9
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        var me = Toolbox.Instance.GameManager.Player.Username;

        const string npc = "Naomi";

        DialogFrame frame;

        if (IsGreeting)
        {
            frame = IntroductionDialogFrame(me, npc);
        }
        else if (IntroduceStudentServices)
        {
            frame = IntroduceStudentServicesDialogFrame(me, npc);
        }
        else if (Toolbox.Instance.QuestManager.Current.Id == "visit-leech")
        {
            frame = new DialogFrame(npc, "You should go downstairs via the elevator to visit the workshops");
        }
        else if (Toolbox.Instance.QuestManager.Current.Id.EndsWith("-workshop"))
        {
            var workshop = Toolbox.Instance.QuestManager.Current.Title.ToLower();
            frame = new DialogFrame(npc, "You should go downstairs via the elevator to do your " + workshop);
        }
        else
        {
            switch (Toolbox.Instance.QuestManager.Current.Id)
            {
            case "networking":
                frame = NetworkingDialogFrame(me, npc);
                break;

            case "collect-prize":
                frame = CollectPrizeDialogFrame(me, npc);
                break;

            default:
                frame = new DialogFrame(npc, "I hope you had a great time at Enginuity Day!");
                break;
            }
        }

        var directions = new Dictionary <string, DialogPosition>
        {
            { me, DialogPosition.Left }, { npc, DialogPosition.Right }
        };

        return(new Dialog(frame, directions));
    }
Esempio n. 10
0
 //点击生效
 public void ShowText()
 {
     if (theFrames.Count == 0)
     {
         UIController.GetInstance().ShowUI <PlayerActCanvas> ();
         UIController.GetInstance().ShowUI <HpBasicPanel> ();
         UIController.GetInstance().CloseUI <TalkCanvas> ();
     }
     else
     {
         DialogFrame use = theFrames.Dequeue();
         OperateFrame(use);
     }
 }
Esempio n. 11
0
 /// <summary>
 /// 可以外部控制的直接关闭
 /// </summary>
 public void MakeJustClose()
 {
     if (theFrames.Count >= 0)
     {
         DialogFrame use = theFrames.Dequeue();
         while (theFrames.Count > 0)
         {
             use = theFrames.Dequeue();
         }
         OperateFrame(use);
     }
     UIController.GetInstance().ShowUI <PlayerActCanvas> ();
     UIController.GetInstance().ShowUI <HpBasicPanel> ();
     UIController.GetInstance().CloseUI <TalkCanvas> ();
 }
Esempio n. 12
0
    public void AddDialogText(TextMeshProUGUI text_to_use, string text, DelDialogFrame on_finish_callback = null)
    {
        if (text != "" && text_to_use != null)
        {
            text_to_use.text = "";

            DialogFrame df = new DialogFrame(text_to_use, text);

            if (on_finish_callback != null)
            {
                df.SuscribeToOnFrameFinish(on_finish_callback);
            }

            dialog_frames_to_add.Add(df);
        }
    }
Esempio n. 13
0
        private void DialogWindow_Loaded(object sender, RoutedEventArgs e)
        {
            DialogFrame.Navigate(Page);
            Window          window = sender as Window;
            DoubleAnimation d      = new DoubleAnimation();

            d.From = 0;
            d.To   = 1;
            PowerEase pe = new PowerEase();

            pe.EasingMode    = EasingMode.EaseInOut;
            pe.Power         = 4;
            d.SpeedRatio     = SpeedRatio;
            d.EasingFunction = pe;
            d.Completed     += (s, ee) => { Page.LoadCompleted(this, new EventArgs()); };
            window.BeginAnimation(OpacityProperty, d);
        }
Esempio n. 14
0
    void Display(ContextMenuEvent contextMenuEvent)
    {
        if (_event != null)
        {
            Close();
        }

        if (contextMenuEvent == null)
        {
            return;
        }

        _event      = contextMenuEvent;
        _uiPosition = contextMenuEvent.UiPosition;

        var optionElements         = new List <IUiElement>();
        ContextMenuGroup?lastGroup = null;

        foreach (var option in _event.Options)
        {
            lastGroup ??= option.Group;
            if (lastGroup != option.Group)
            {
                optionElements.Add(new Spacing(0, 2));
            }
            lastGroup = option.Group;

            var option1 = option;
            optionElements.Add(new Button(option.Text).OnClick(() => OnButton(option1, option1.Disabled)));
        }

        var elements = new List <IUiElement>
        {
            new Spacing(0, 2),
            new HorizontalStack(new Spacing(5, 0), new BoldHeader(_event.Heading), new Spacing(5, 0)),
            new Divider(CommonColor.Yellow3),
            new Padding(new VerticalStack(optionElements), 0, 2)
        };

        var frame = new DialogFrame(new VerticalStack(elements));

        AttachChild(frame);
        Raise(new PushInputModeEvent(InputMode.ContextMenu));
    }
Esempio n. 15
0
    private void Awake()
    {
        _bgImage = transform.Find("Bg").GetComponent <RawImage>();

        _role1 = transform.Find("Role1").GetComponent <RawImage>();
        _role2 = transform.Find("Role2").GetComponent <RawImage>();

        _dialogFrame = transform.Find("DialogFrame").GetComponent <DialogFrame>();

        _mask = transform.Find("Mask").GetComponent <RectTransform>();

        _screenEffect = transform.GetImage("ScreenEffect");

        _recordBtn = transform.Find("RecordBtn").GetComponent <Button>();
        _recordBtn.onClick.AddListener(ShowRecordView);

        _skipBtn = transform.Find("SkipBtn").GetComponent <Button>();
        _skipBtn.onClick.AddListener(OnSkip);

        _playBtn = transform.Find("PlayBtn").GetComponent <Button>();
        _playBtn.transform.GetText("Text").text = I18NManager.Get("Story_Autoplay");
        _playBtn.onClick.AddListener(() =>
        {
            OnAutoPlay(!_isAutoPlay);
        });

        PointerClickListener.Get(gameObject).onClick = NextStep;

        RectTransform rect       = GetComponent <RectTransform>();
        float         containerH = rect.GetSize().y;

        _offsetY = (int)((containerH - Main.StageHeight) / 2);

        Reset();

        _isAutoPlay            = false;
        _dialogFrame.OnStepEnd = DoAutoPlay;

        _spineCache  = new List <SkeletonGraphic>();
        _live2DCache = new List <Live2dGraphic>();

        _screenEffect.gameObject.Hide();
    }
Esempio n. 16
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        const string npc = "Cho Chang";

        var frame = new DialogFrame(npc, "Hey, I'm " + npc + ", today is so exiting!")
        {
            Next = new DialogFrame(npc, "I've learnt so many interesting things!")
            {
                Next = new DialogFrame(npc,
                                       "This day really exposed a variety of things you can do with an engineering degree and the " +
                                       "places it can take you.")
                {
                    Next = new DialogFrame(npc,
                                           "Talking to many people who have been through the same process…")
                    {
                        Next = new DialogFrame(npc,
                                               "…you’re currently wading through was incredibly helpful as they hold the wisdom " +
                                               "of hindsight, thus knowing how the degree works in its entirety.")
                        {
                            Next = new DialogFrame(npc,
                                                   "Meeting students from all over the country was also a wonderful experience, a " +
                                                   "room full of intelligent young women brimming with potential…")
                            {
                                Next = new DialogFrame(npc,
                                                       "…and all glad to be given the chance to explore the option of engineering " +
                                                       "in this busy day.")
                            }
                        }
                    }
                }
            }
        };

        var directions = new Dictionary <string, DialogPosition>
        {
            { npc, DialogPosition.Right }
        };

        var achievementsManager = Toolbox.Instance.AchievementsManager;

        return(new Dialog(frame, directions, () => { achievementsManager.MarkCompleted("talk-to-student"); }));
    }
Esempio n. 17
0
        public ConversationTextWindow() : base(DialogPositioning.Bottom)
        {
            On <UiLeftClickEvent>(e => Clicked?.Invoke());
            On <DismissMessageEvent>(e => Clicked?.Invoke());

            var content = new FixedSize(248, 159,
                                        new Padding(
                                            new UiText(_text)
                                            .Scrollable()
                                            .Filter(0),
                                            3));

            // Transparent background, scrollable
            var frame = new DialogFrame(content)
            {
                Background = DialogFrameBackgroundStyle.DarkTint
            };

            AttachChild(frame);
        }
Esempio n. 18
0
    private void LoadTexts(string value)
    {
        //print ("value =" +value);
        theFrames = new Queue <DialogFrame> ();
        TextAsset textAsset = SystemValues.LoadResources <TextAsset>("XML/" + value);

        xml.LoadXml(textAsset.text);
        theXmlList = xml.SelectNodes("Root/Dialog");
        foreach (XmlNode node in theXmlList)
        {
            DialogFrame aFrame = new DialogFrame();
            //print (node.SelectSingleNode("Name").InnerText);
            //print (node.SelectSingleNode("Picture").InnerText);
            //print (node.SelectSingleNode("Information").InnerText);
            aFrame.name        = node.SelectSingleNode("Name").InnerText;
            aFrame.picture     = node.SelectSingleNode("Picture").InnerText;
            aFrame.information = node.SelectSingleNode("Information").InnerText;
            theFrames.Enqueue(aFrame);
        }
    }
Esempio n. 19
0
    /// <summary>
    /// 对每一个剧本帧的操作
    /// </summary>
    private void OperateFrame(DialogFrame use)
    {
        switch (use.name)
        {
        case "SELECT":
            makeSelect(use);
            break;

        case "GOLD":
            makeOver(use);
            break;

        case "MISSION":
            makeMission(use);
            break;

        default:
            makeTalk(use);
            break;
        }
    }
Esempio n. 20
0
        /// <summary>
        /// Show dialog to tell the user to come upstairs for the networking event
        /// </summary>
        private void ShowWorkshopCongratulatoryDialog()
        {
            var me = Toolbox.Instance.GameManager.Player.Username;

            const string npc = "Naomi";

            var frame = new DialogFrame(npc,
                                        "Nice one " + me +
                                        ", you’ve completed all your workshops today! Let’s head to the lobby for the networking event");

            var directions = new Dictionary <string, DialogPosition>
            {
                { npc, DialogPosition.Right }
            };

            var canvas = FindObjectOfType <DialogCanvasManager>();

            var dialog = new Dialog(frame, directions);

            canvas.ShowDialog(dialog, null, NpcSprite);
        }
Esempio n. 21
0
    public override Dialog GetDialog()
    {
        var me = Toolbox.Instance.GameManager.Player.Username;

        DialogFrame frame;

        if (!Toolbox.Instance.GameManager.Settings.HasBeenGreeted)
        {
            // Block the player from switching levels if they haven't been introduced to the game
            frame = new DialogFrame(me, "Maybe I should talk to Naomi first…");
        }
        else
        {
            frame = new DialogFrame(me, "This is going to take me to " + Level + ".")
            {
                Options = new Dictionary <string, DialogFrame>
                {
                    {
                        "Let's go!", new DialogFrame(me, "Let's go!")
                        {
                            TransitionToScene = Level
                        }
                    },
                    {
                        "I want to stay!", new DialogFrame(me, "On second thought…")
                    }
                }
            };
        }

        var directions = new Dictionary <string, DialogPosition>
        {
            { me, DialogPosition.Left }
        };

        return(new Dialog(frame, directions));
    }
Esempio n. 22
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        var me = Toolbox.Instance.GameManager.Player.Username;

        const string npc = "Bellatrix Lestrange";

        var frame = new DialogFrame(npc, "I'm Lestrange, " + npc + "!")
        {
            Next = new DialogFrame(npc, "Nice to make your acquaintance…")
            {
                Next = new DialogFrame(me, "Are you enjoying the exhibition day?")
                {
                    Next = new DialogFrame(npc, "Well…")
                    {
                        Next = new DialogFrame(npc,
                                               "We each have a unique toolbox comprised of life experience, daily experience, school " +
                                               "experience, sport experience, and anything else that we know without knowing we know…")
                        {
                            Next = new DialogFrame(npc,
                                                   "…which can empower us to improve the conditions of life we see around us, if we " +
                                                   "know how to be creative in how we approach this toolbox.")
                        }
                    }
                }
            }
        };

        var directions = new Dictionary <string, DialogPosition>
        {
            { me, DialogPosition.Left }, { npc, DialogPosition.Right }
        };

        var achievementsManager = Toolbox.Instance.AchievementsManager;

        return(new Dialog(frame, directions, () => { achievementsManager.MarkCompleted("talk-to-student"); }));
    }
Esempio n. 23
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        const string npc = "Minerva McGonagall";

        var frame = new DialogFrame(npc, "Helloooooooo!")
        {
            Next = new DialogFrame(npc, "I'm Minerva!")
            {
                Next = new DialogFrame(npc, "I'm really enjoying today!")
                {
                    Next = new DialogFrame(npc,
                                           "One of the more striking comments from the student panel was, 'don’t hesitate in " +
                                           "taking opportunities.'")
                    {
                        Next = new DialogFrame(npc,
                                               "So whether you have any doubts, or if you are dead set on engineering, you may find " +
                                               "yourself pleasantly surprised")
                        {
                            Next = new DialogFrame(npc,
                                                   "as I have. It was because of this event that I decided to shed my perpetual state " +
                                                   "of ambiguity with my career choice, and set my heart on becoming an engineer.")
                        }
                    }
                }
            }
        };

        var directions = new Dictionary <string, DialogPosition>
        {
            { npc, DialogPosition.Right }
        };

        var achievementsManager = Toolbox.Instance.AchievementsManager;

        return(new Dialog(frame, directions, () => { achievementsManager.MarkCompleted("talk-to-student"); }));
    }
Esempio n. 24
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        var me = Toolbox.Instance.GameManager.Player.Username;

        const string npc = "Megan";

        var frame = new DialogFrame(me, "Hello, I'm " + me)
        {
            Next = new DialogFrame(npc, "Nice to meet you!")
            {
                Next = new DialogFrame(npc, "My name's Megan, and I study Software Engineering!")
                {
                    Next = new DialogFrame(me, "Hey, if you don't mind me asking?")
                    {
                        Options = new Dictionary <string, DialogFrame>
                        {
                            {
                                "Why Engineering?", new DialogFrame(npc,
                                                                    "My choice was less traditional than most, I wasn't sure what I wanted to do, " +
                                                                    "and Engineering is such a vast industry, which has so much to offer.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "Another major consideration was that Engineering gave me structure, once I " +
                                                           "chose Engineering I only had to choose one general…")
                                    {
                                        Next = new DialogFrame(npc,
                                                               "… education paper and then my next decision was my specialisation at " +
                                                               "the end of first year.")
                                        {
                                            Next = new DialogFrame(npc,
                                                                   "I chose Engineering because I loved problem solving and enjoyed " +
                                                                   "calculus, and engineering would allow open many different doors " +
                                                                   "for me.")
                                            {
                                                Next = new DialogFrame(npc,
                                                                       "Engineering allows a lot of choice, without an overwhelming " +
                                                                       "vastness of options.")
                                                {
                                                    Next = new DialogFrame(me,
                                                                           "Oh wow, that's really interesting!")
                                                    {
                                                        Next = new DialogFrame(npc,
                                                                               "Thanks, no problem, come to talk me anytime!")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            {
                                "Your experience?", new DialogFrame(npc,
                                                                    "Honestly, I was worried that I wouldn't be smart enough. I loved Calculus and " +
                                                                    "English, but I was not a fan of Physics, so I was worried that Engineering " +
                                                                    "wouldn't be the right choice for me.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "While it’s true some specialisations require you to know Physics, but many " +
                                                           "like Software don’t require it after first year.")
                                    {
                                        Next = new DialogFrame(me, "Oh wow, that's really interesting!")
                                        {
                                            Next = new DialogFrame(npc,
                                                                   "Thanks, no problem, come to talk me anytime!")
                                        }
                                    }
                                }
                            },
                            {
                                "Any advice?", new DialogFrame(npc,
                                                               "University is not the same as highschool, it demands more attention than you " +
                                                               "gave high school.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "University gives you a lot of freedom, and it’s important that you focus " +
                                                           "on what is most important to you.")
                                    {
                                        Next = new DialogFrame(npc,
                                                               "In first year I tried to do uni, work and spend a lot of time with " +
                                                               "my friends - you can’t have it all.")
                                        {
                                            Next = new DialogFrame(npc,
                                                                   "But you do have a very long summer to catch up with all your friends.")
                                            {
                                                Next = new DialogFrame(npc,
                                                                       "Balance is important and if you are working part-time, as much " +
                                                                       "as you can try and focus on your studies because at the end of " +
                                                                       "the day it is more important. ")
                                                {
                                                    Next = new DialogFrame(me,
                                                                           "Oh wow, that's really interesting!")
                                                    {
                                                        Next = new DialogFrame(npc,
                                                                               "Thanks, no problem, come to talk me anytime!")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        };

        var directions = new Dictionary <string, DialogPosition>
        {
            { me, DialogPosition.Left }, { npc, DialogPosition.Right }
        };

        return(new Dialog(frame, directions, () =>
        {
            Toolbox.Instance.QuestManager.MarkCurrentFinished("networking");
            Toolbox.Instance.AchievementsManager.MarkCompleted("speak-undergrad");
        }));
    }
Esempio n. 25
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        var me = Toolbox.Instance.GameManager.Player.Username;

        const string npc = "Tina";

        var frame = new DialogFrame(me, "Hi, I'm " + me)
        {
            Next = new DialogFrame(npc, "Nice to meet you!")
            {
                Next = new DialogFrame(npc, "My name's " + npc + ", and I study Software Engineering!")
                {
                    Next = new DialogFrame(me, "Hey, if you don't mind me asking?")
                    {
                        Options = new Dictionary <string, DialogFrame>
                        {
                            {
                                "Why Engineering?", new DialogFrame(npc,
                                                                    "I chose engineering as I enjoyed design and science at school.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "I had researched engineering and found that it offered a good combination " +
                                                           "of both theoretical and practical skills that would be useful for many " +
                                                           "career paths. ")
                                    {
                                        Next = new DialogFrame(npc,
                                                               "Oooo, and by the way, you might want to head to the leech and to talk " +
                                                               "to Katherine, the software advisor!")
                                        {
                                            Next = new DialogFrame(me,
                                                                   "Thanks a lot! Your insight will definitely be super helpful in " +
                                                                   "helping me decide whether engineering is for me!")
                                        }
                                    }
                                }
                            },
                            {
                                "Your experience?", new DialogFrame(npc,
                                                                    "I was nervous about the programming paper that is taken by all engineering " +
                                                                    "students in their first year.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "I had never done any coding before and was worried that I may fall " +
                                                           "behind the other students.")
                                    {
                                        Next = new DialogFrame(npc,
                                                               "However, the class ended up being a very good introduction to the " +
                                                               "basics of programming, and I enjoyed it a lot and chose to continue " +
                                                               "in software as my specialisation.")
                                        {
                                            Next = new DialogFrame(npc,
                                                                   "Oooo, and by the way, you might want to head to the leech and " +
                                                                   "to talk to Katherine, the software advisor!")
                                            {
                                                Next = new DialogFrame(me,
                                                                       "Thanks alot! Your insight will definitely be super helpful " +
                                                                       "in helping me decide whether engineering is for me!")
                                            }
                                        }
                                    }
                                }
                            },
                            {
                                "Any advice?", new DialogFrame(npc,
                                                               "I would encourage everyone to stay open-minded and give everything a try. " +
                                                               "There are many clubs and events that university offers, both within and " +
                                                               "outside of engineering.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "They are a great place to meet new people and make friends.")
                                    {
                                        Next = new DialogFrame(npc,
                                                               "Engineering especially is a degree that focuses a lot on teamwork and " +
                                                               "collaboration, so having a good group of friends is really important.")
                                        {
                                            Next = new DialogFrame(npc,
                                                                   "Oooo, and by the way, you might want to head to the leech and to " +
                                                                   "talk to Katherine, the software advisor!")
                                            {
                                                Next = new DialogFrame(me,
                                                                       "Thanks alot! Your insight will definitely be super helpful in " +
                                                                       "helping me decide whether engineering is for me!")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        };

        var directions = new Dictionary <string, DialogPosition>
        {
            { me, DialogPosition.Left }, { npc, DialogPosition.Right }
        };

        return(new Dialog(frame, directions, () =>
        {
            Toolbox.Instance.QuestManager.MarkCurrentFinished("networking");
            Toolbox.Instance.AchievementsManager.MarkCompleted("speak-undergrad");
        }));
    }
Esempio n. 26
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        var me = Toolbox.Instance.GameManager.Player.Username;

        const string npc = "Susanne";

        var frame = new DialogFrame(me, "Hello, I'm " + me)
        {
            Next = new DialogFrame(npc, "Nice to meet you!")
            {
                Next = new DialogFrame(npc, "My name's " + npc + ", and I study CHEMMAT!")
                {
                    Next = new DialogFrame(me, "Hey, if you don't mind me asking?")
                    {
                        Options = new Dictionary <string, DialogFrame>
                        {
                            {
                                "Why Engineering?", new DialogFrame(npc,
                                                                    "I really liked the idea of helping other people and making a change in the " +
                                                                    "world. I think that engineering shows so much growth and potential and I really " +
                                                                    "wished to be a part of that.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "I had talked to a few female students beforehand and they also really " +
                                                           "enjoyed the experience and that inspired me to take this course")
                                    {
                                        Next = new DialogFrame(me, "Oh wow, that's really interesting!")
                                        {
                                            Next = new DialogFrame(npc, "Thanks, no problem, come to talk me anytime!")
                                        }
                                    }
                                }
                            },
                            {
                                "Your experience?", new DialogFrame(npc,
                                                                    "I was really worried that perhaps my skills weren't satisfactory enough to be " +
                                                                    "able to show my full potential as an engineer.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "However, I ended up making good friends who I have established a study " +
                                                           "group with in which us as a group can grow together and inspire one another.")
                                    {
                                        Next = new DialogFrame(me, "Oh wow, that's really interesting!")
                                        {
                                            Next = new DialogFrame(npc, "Thanks, no problem, come to talk me anytime!")
                                        }
                                    }
                                }
                            },
                            {
                                "Any advice?", new DialogFrame(npc,
                                                               "I would advise younger students to go out and talk to those who are taking " +
                                                               "the course now.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "I'm sure that it would be inspiring to them and would help them decide on " +
                                                           "where their future paths might lead them.")
                                    {
                                        Next = new DialogFrame(npc,
                                                               "I would also advise the younger female students to get involved with " +
                                                               "WEN and see the future of engineering for females.")
                                        {
                                            Next = new DialogFrame(me, "Oh wow, that's really interesting!")
                                            {
                                                Next = new DialogFrame(npc,
                                                                       "Thanks, no problem, come to talk me anytime!")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        };

        var directions = new Dictionary <string, DialogPosition>
        {
            { me, DialogPosition.Left }, { npc, DialogPosition.Right }
        };

        return(new Dialog(frame, directions, () =>
        {
            Toolbox.Instance.QuestManager.MarkCurrentFinished("networking");
            Toolbox.Instance.AchievementsManager.MarkCompleted("speak-undergrad");
        }));
    }
Esempio n. 27
0
    private T LoadDialog <T>(string _dialogName = null) where T : BaseDialog
    {
        T result = null;

        if (dialogCanvas != null)
        {
            _dialogName = (!string.IsNullOrEmpty(_dialogName))
                                ? _dialogName
                                : typeof(T).Name;

            if (!string.IsNullOrEmpty(_dialogName))
            {
                GameObject baseDialogPrefab =
                    PrefabManager.Instance.LoadPrefab(typeof(T).Name);

                T dialogPrefab = (baseDialogPrefab != null)
                                        ? baseDialogPrefab.GetComponent <T>()
                                        : null;

                if (dialogPrefab != null)
                {
                    if (dialogPrefab.dialogFramePrefab != null)
                    {
                        DialogFrame dialoFrame =
                            GameObjectHelper.AddChildrenWithComponent <DialogFrame>(
                                dialogPrefab.dialogFramePrefab,
                                dialogCanvas.transform
                                );

                        if (dialoFrame != null)
                        {
                            result = dialoFrame.TryInstantiateDialogContent(dialogPrefab) as T;

                            if (result == null)
                            {
                                LogHelper.LogError(
                                    "Failed to instantiate dialog content for "
                                    + _dialogName,
                                    this
                                    );

                                GameObjectHelper.Destroy(result.gameObject, true);
                            }
                        }
                    }
                    else
                    {
                        LogHelper.LogWarning("Failed to load "
                                             + typeof(T).Name
                                             + "; missing "
                                             + nameof(dialogPrefab.dialogFramePrefab),
                                             this
                                             );
                    }
                }
            }
        }
        else
        {
            LogHelper.LogError("Failed to load dialog; "
                               + nameof(dialogCanvas)
                               + " is not set",
                               this
                               );
        }

        return(result);
    }
Esempio n. 28
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        var me = Toolbox.Instance.GameManager.Player.Username;

        const string npc = "Hannah";

        var frame = new DialogFrame(me, "Hello, I'm " + me)
        {
            Next = new DialogFrame(npc, "Nice to meet you!")
            {
                Next = new DialogFrame(npc, "My name's " + npc + ", and I study engineering science!")
                {
                    Next = new DialogFrame(me, "Hey, is it ok if I ask you a couple of questions?")
                    {
                        Options = new Dictionary <string, DialogFrame>
                        {
                            {
                                "Why Engineering?", new DialogFrame(npc,
                                                                    "I chose engineering as I have always loved using maths and" +
                                                                    " science to solve problems.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "Being curious about why things work the way they do also made" +
                                                           " me interested in engineering as a career choice, as through engineering" +
                                                           " I could get a better understanding of the world around me.")
                                    {
                                        Next = new DialogFrame(me, "Wow that's so cool!")
                                        {
                                            Next = new DialogFrame(npc,
                                                                   "It really is. Come back and talk to me anytime.")
                                        }
                                    }
                                }
                            },
                            {
                                "Your experience?", new DialogFrame(npc,
                                                                    "My biggest concern coming in was not meeting new people. " +
                                                                    "I thought with engineering being an academic heavy subject, " +
                                                                    "and the fact that people joke about engineers being anti-social, " +
                                                                    "I wouldn’t be able to find many new people to make friends with.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "Everyone is really lovely though, and there is a lot of group work " +
                                                           "where you get to meet new people.")
                                    {
                                        Next = new DialogFrame(me,
                                                               "Oh wow, that's really interesting!")
                                        {
                                            Next = new DialogFrame(npc,
                                                                   "Thanks, no problem, come to talk me anytime!")
                                        }
                                    }
                                }
                            },
                            {
                                "Any advice?", new DialogFrame(npc,
                                                               "I would advise that you go into university with an idea of meeting new people. " +
                                                               "If you go in with a lot of friends you are already close to, that’s great! ")
                                {
                                    Next = new DialogFrame(npc,
                                                           "But having new friends who study the same thing as you can really help " +
                                                           "encourage you to get through hard assignments and tests.")
                                    {
                                        Next = new DialogFrame(npc,
                                                               "Plus creating a good network of contacts early on is only going to help you further on in life and in your career!")
                                        {
                                            Next = new DialogFrame(me, "Thank you, that's really helpful!")
                                            {
                                                Next = new DialogFrame(npc,
                                                                       "Thanks, no problem, come to talk me anytime!")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        };

        var directions = new Dictionary <string, DialogPosition>
        {
            { me, DialogPosition.Left }, { npc, DialogPosition.Right }
        };

        return(new Dialog(frame, directions, () =>
        {
            Toolbox.Instance.QuestManager.MarkCurrentFinished("networking");
            Toolbox.Instance.AchievementsManager.MarkCompleted("speak-undergrad");
        }));
    }
Esempio n. 29
0
    // Use this for initialization
    public override Dialog GetDialog()
    {
        var me = Toolbox.Instance.GameManager.Player.Username;

        const string npc = "Sophie";

        var frame = new DialogFrame(me, "Hello, I'm " + me)
        {
            Next = new DialogFrame(npc, "Nice to meet you!")
            {
                Next = new DialogFrame(npc, "My name's " + npc + ", and I study biomedical engineering!")
                {
                    Next = new DialogFrame(me, "Is it alright if I ask you some questions?")
                    {
                        Options = new Dictionary <string, DialogFrame>
                        {
                            {
                                "Why Engineering?", new DialogFrame(npc,
                                                                    "I loved graphics, physics and biology in high school " +
                                                                    "and engineering was the best mix. ")
                                {
                                    Next = new DialogFrame(npc,
                                                           "Biomedical engineering allows me to combine this love of both whilst constantly" +
                                                           "challenging me mentally.")
                                    {
                                        Next = new DialogFrame(me, "That's so awesome, I might like the visual side too!")
                                        {
                                            Next = new DialogFrame(npc,
                                                                   "It sure is. Come back and talk to me anytime.")
                                        }
                                    }
                                }
                            },
                            {
                                "Your experience?", new DialogFrame(npc,
                                                                    "I was scared because I didn't have " +
                                                                    "any coding, or really much " +
                                                                    "mechanical knowledge that I would struggle.")
                                {
                                    Next = new DialogFrame(npc,
                                                           "But the first year courses were very approachable. " +
                                                           "The lecturers really do their best to help you get the skills you need and are" +
                                                           "always keen to give you their extra time.")
                                    {
                                        Next = new DialogFrame(me,
                                                               "Oh wow, that's reassuring!")
                                        {
                                            Next = new DialogFrame(npc,
                                                                   "No problem, come to talk me anytime!")
                                        }
                                    }
                                }
                            },
                            {
                                "Any advice?", new DialogFrame(npc,
                                                               "Talk to as many second years as you can!")
                                {
                                    Next = new DialogFrame(npc,
                                                           " While the courses may not offer the best representation" +
                                                           " of the specialisation, those that have done it will tell you how it is.")
                                    {
                                        Next = new DialogFrame(me, "Thank you, that's really helpful!")
                                        {
                                            Next = new DialogFrame(npc,
                                                                   "Thanks for talking to me, come back anytime!")
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        };

        var directions = new Dictionary <string, DialogPosition>
        {
            { me, DialogPosition.Left }, { npc, DialogPosition.Right }
        };

        return(new Dialog(frame, directions, () =>
        {
            Toolbox.Instance.QuestManager.MarkCurrentFinished("networking");
            Toolbox.Instance.AchievementsManager.MarkCompleted("speak-undergrad");
        }));
    }
Esempio n. 30
0
    private DialogFrame IntroduceStudentServicesDialogFrame(string me, string npc)
    {
        // This is what the dialog eventually jumps to, different options lead to this - which is why it's a variable
        var timetable = new DialogFrame(npc, "It’s your timetable for the day!")
        {
            Next = new DialogFrame(npc,
                                   "Here you will find the workshops you will be attending as well as the networking event in " +
                                   "the afternoon.")
            {
                Next = new DialogFrame(npc,
                                       "I hope you find this useful. There is also a list of items you should complete before the " +
                                       "day is over.")
                {
                    Next = new DialogFrame(npc,
                                           "Each time you complete a task it will be ticked off your list. Complete all tasks and " +
                                           "return back to this stall for a prize!")
                    {
                        Next = new DialogFrame(me, "Thanks!")
                        {
                            Next = new DialogFrame(npc,
                                                   "No problem! Use the elevator to visit the workshops in the engineering leech")
                            {
                                OnComplete = () =>
                                {
                                    Toolbox.Instance.QuestManager.MarkFinished("get-timetable");
                                    Toolbox.Instance.AchievementsManager.MarkCompleted("timetable");
                                    Toolbox.Instance.GameManager.Settings.HasBeenGreeted = true;
                                    IntroduceStudentServices = false;
                                }
                            }
                        }
                    }
                }
            }
        };

        return(new DialogFrame(npc,
                               "This is the Student Services stall, where students come to pick up their assignments and exam scripts.")
        {
            Next = new DialogFrame(npc, "I have an important file for you too!")
            {
                Next = new DialogFrame(npc, "I wonder what it is…")
                {
                    Options = new Dictionary <string, DialogFrame>
                    {
                        {
                            "Okay", new DialogFrame(me, "What is it?")
                            {
                                Next = timetable
                            }
                        },
                        {
                            "Oh no!", new DialogFrame(me, "I hope it's not an assignment")
                            {
                                Next = new DialogFrame(npc, "No…")
                                {
                                    Next = timetable
                                }
                            }
                        }
                    }
                }
            }
        });

        ;
    }