Example #1
0
        protected override void OnSettingUp()
        {
            base.OnSettingUp();

            var mapTemplate =
                new PanelTemplate
            {
                Size       = new Size(Size.Width - 15, Size.Height - 10),
                HasFrame   = false,
                TopLeftPos = new Point(0, 0),
            };

            MapPanel = new MapPanel(World, AssetsManager, mapTemplate);

            AddControl(MapPanel);

            var statusTemplate =
                new PanelTemplate
            {
                Size     = new Size(Size.Width - mapTemplate.Size.Width, mapTemplate.Size.Height),
                HasFrame = true,
            };

            statusTemplate.AlignTo(LayoutDirection.East, mapTemplate);

            StatusPanel = new StatusPanel(World, statusTemplate);

            AddControl(StatusPanel);

            var logTemplate = new LogPanelTemplate
            {
                HasFrame   = true,
                Log        = World.Log,
                Size       = new Size(Size.Width, Size.Height - mapTemplate.Size.Height),
                TopLeftPos = mapTemplate.CalculateRect().BottomLeft
            };

            LogPanel = new LogPanel(logTemplate);
            AddControl(LogPanel);

            PromptTemplate =
                new PromptWindowTemplate
            {
                HasFrame   = false,
                IsPopup    = true,
                TopLeftPos = logTemplate.TopLeftPos.Shift(1, 1),
                Log        = World.Log,
                Size       = new Size(Size.Width - 2, Size.Height - mapTemplate.Size.Height - 2)
            };

            this.KeyPressed += GameplayWindow_KeyPressed;
        }
Example #2
0
 public LogPanel(LogPanelTemplate template) : base(template)
 {
     _log = template.Log;
     _maxNumOfDisplayLines  = Size.Height - 2;
     _maxNumberOfCharacters = Size.Width - 3;
 }