public void DrawDialog(DialogGroup dialogControl)
        {
            this.CurrentDialog = dialogControl;

            Grid container = (Grid)LogicalTreeHelper.FindLogicalNode(WindowController.Get<MainWindow>(), "grid_View");

            Game.Instance.Player.Location.BlurBackground();

            this.Dialog = null;
            container.Children.RemoveRange(1, container.Children.Count);

            MediaElement pb = new MediaElement();
            if (this.CurrentDialog.Current().Image != null)
            {
                pb.Stretch = System.Windows.Media.Stretch.Uniform;
                pb.Name = "pb_Action";
                pb.StretchDirection = StretchDirection.Both;
                pb.Source = new Uri(this.CurrentDialog.Current().Image);
                pb.VerticalAlignment = VerticalAlignment.Center;
                pb.HorizontalAlignment = HorizontalAlignment.Center;
                container.Children.Add(pb);
            }
            
            container.PreviewMouseRightButtonUp += ToggleDialog;

            this.CurrentDialog.Current().PrepareBeginEffects(container);

            this.AddDialogControl();

            this.CurrentDialog.Current().StartBeginEffects();
        }
Beispiel #2
0
        public void MyLogic(ActionEventArgs args)
        {
            if (DoerIsPlayer)
            {
                DialogGroup group = new DialogGroup();
                Dialog dialog = new Dialog();
                dialog.RawText = "You talk to " + args.Target.FirstName + ".";
                group.Entries.Add(dialog);

                Game.Instance.DialogController.DrawDialog(group);
            }
        }
Beispiel #3
0
        public void MyLogic(ActionEventArgs args)
        {
            if (DoerIsPlayer)
            {
                DialogGroup group = new DialogGroup();
                Dialog dialog = new Dialog();
                dialog.RawText = "You give " + args.Target.FirstName + " a warm hug.";
                dialog.Image = Game.Instance.ResourceController.GetActionImage(this, @"person\hug\", true);
                group.Entries.Add(dialog);

                Game.Instance.DialogController.DrawDialog(group);
            }
        }
Beispiel #4
0
        public void MyLogic(ActionEventArgs args)
        {
            if (DoerIsPlayer)
            {
                DialogGroup group = new DialogGroup();

                Dialog dialog = new Dialog();
                dialog.RawText = "You crawl into the bed and fall asleep.";
                dialog.Image = Game.Instance.ResourceController.GetActionImage(this, @"bed\sleep\", true);
                dialog.AddBeginEffect(new GUI.Effects.FadeColorOut());
                dialog.AddEndEffect(new GUI.Effects.FadeColorIn());
                dialog.Choices.Add(new DialogChoice("Test", new Action(() => { Game.Instance.Player.Stats.SetValue("Happiness", 0.0); })));
                dialog.Choices.Add(new DialogChoice("Test2", new Action(() => 
                {
                    Game.Instance.Player.Stats.SetValue("Happiness", 50.0);

                    dialog.ClearEndEffects();

                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.White));
                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.Red), 1);
                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.Blue), 2);
                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.Yellow), 3);
                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.Green), 4);
                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.White), 5);

                    dialog.AddEndEffect(new GUI.Effects.FadeColorIn(), 10);
                })));
                dialog.Choices.Add(new DialogChoice("Test3", new Action(() => { Game.Instance.Player.Stats.SetValue("Happiness", 100.0); })));
                group.Entries.Add(dialog);
                
                Dialog dialog2 = new Dialog();
                dialog2.RawText = "You wake up.";
                dialog2.AddBeginEffect(new GUI.Effects.FadeColorOut());
                dialog2.AddEndEffect(new GUI.Effects.FadeColorIn());
                group.Entries.Add(dialog2);

                Dialog dialog3 = new Dialog();
                dialog3.RawText = "You crawl into the bed and fall asleep.";
                dialog3.Image = Game.Instance.ResourceController.GetActionImage(this, @"bed\sleep\", true);
                dialog3.AddBeginEffect(new GUI.Effects.FadeColorOut());
                dialog3.AddEndEffect(new GUI.Effects.FadeColorIn());
                group.Entries.Add(dialog3);

                Game.Instance.DialogController.DrawDialog(group);
            }
            else if (this.Witnesses.Contains(Game.Instance.Player))
            {
                //Game.Instance.DialogController.DrawDialog(new DialogControl(args.Doer.FirstName + " crawls into the bed and falls asleep.", true));
            }
        }
Beispiel #5
0
        public void MyLogic(ActionEventArgs args)
        {
            if (DoerIsPlayer)
            {
                DialogGroup group = new DialogGroup();
                Dialog dialog = new Dialog();
                dialog.RawText = "You lie back on the bed and take a short nap.";
                dialog.Image = Game.Instance.ResourceController.GetActionImage(this, @"bed\sleep\", true);
                group.Entries.Add(dialog);

                Game.Instance.DialogController.DrawDialog(group);
            }
            else if(this.Witnesses.Contains(Game.Instance.Player))
            {
                //Game.Instance.DialogController.DrawDialog(new DialogControl(args.Doer.FirstName + " lies back on the bed and takes a short nap.", true));
            }
        }