Esempio n. 1
0
        public void InitializeField()
        {
            this.worldMapSpritePb             = new PictureBox();
            this.worldMapSpritePb.Width       = this.Width;
            this.worldMapSpritePb.Height      = this.Height;
            this.worldMapSpritePb.BackColor   = Color.Transparent;
            this.worldMapSpritePb.Parent      = this;
            this.worldMapSpritePb.BorderStyle = BorderStyle.None;

            this.inCombat = false;

            this.textBoxReader = new TextBoxReader();

            this.LoadNewMap(0, 0);

            this.Controls.Add(this.Player.SpritePictureBox);
            this.Player.SpritePictureBox.Parent = this.worldMapSpritePb;
        }
Esempio n. 2
0
        private void ConsoleView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (DataContext is ConsoleViewModel)
            {
                ConsoleViewModel vm = (ConsoleViewModel)DataContext;

                TextBoxWriter Output = new TextBoxWriter(vm);
                TextBoxWriter Error  = new TextBoxWriter(vm);
                TextBoxReader Input  = new TextBoxReader(vm);

                vm.FocusEvent = () =>
                {
                    txtOutput.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
                    {
                        txtOutput.Focus();
                        Keyboard.Focus(txtOutput);
                    }));
                };

                //Routing.EventManager.ChangeIO(String.Empty, ConsoleModel.GetInstance().Output, ConsoleModel.GetInstance().Error, null);
                Events.InvokeEvent("SetIO", String.Empty, Output, Error, Input);
            }
        }
Esempio n. 3
0
        public void InitializeField()
        {
            this.worldMapSpritePb = new PictureBox();
            this.worldMapSpritePb.Width = this.Width;
            this.worldMapSpritePb.Height = this.Height;
            this.worldMapSpritePb.BackColor = Color.Transparent;
            this.worldMapSpritePb.Parent = this;
            this.worldMapSpritePb.BorderStyle = BorderStyle.None;

            this.inCombat = false;

            this.textBoxReader = new TextBoxReader();

            this.LoadNewMap(0, 0);

            this.Controls.Add(this.Player.SpritePictureBox);
            this.Player.SpritePictureBox.Parent = this.worldMapSpritePb;
        }