示例#1
0
        private void UpdateDetailPane()
        {
            try
            {
                if (_roomContents == null)
                {
                    return;
                }

                var selected = _roomContents.SelectedItem;

                if (_detail != null)
                {
                    Remove(_detail);
                }

                if (_mapView != null)
                {
                    Remove(_mapView);
                }

                if (_roomContents.HasFocus)
                {
                    _detail = new HasStatsView()
                    {
                        AllowScrolling = false
                    };

                    var o = _roomContentsObjects[selected];

                    _detail.InitializeComponent(o as IActor ?? World.Player, o, Bounds.Width, Bounds.Height - 3);
                    _detail.X      = 1;
                    _detail.Y      = 1;
                    _detail.Width  = Dim.Percent(70);
                    _detail.Height = Dim.Fill() - 5;

                    Add(_detail);
                }
                else
                {
                    HideDetailPane();
                }

                TriggerTerminalResized();
            }
            catch (Exception ex)
            {
                ShowException("Error updating Detail Pane", ex);
            }
        }
示例#2
0
        private void HideDetailPane()
        {
            if (_detail != null)
            {
                Remove(_detail);
            }

            _detail = null;

            if (_mapView != null)
            {
                Add(_mapView);
            }
        }
示例#3
0
        public void ShowStats(IHasStats of)
        {
            if (of == null)
            {
                ShowMessage("No World", "No game is currently loaded");
                return;
            }

            var v = new HasStatsView();

            v.InitializeComponent(of as IActor ?? World.Player, of, DlgWidth, DlgHeight);
            var dlg = new ModalDialog(this, of.Name, v);

            Application.Run(dlg);
        }