Exemple #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;
        }
Exemple #2
0
 public LookWindow(Point origin, Func <Point, string> toStringFunction, MapPanel panel, PromptWindowTemplate template)
     : base(template)
 {
     this._panel            = panel;
     this._toStringFunction = toStringFunction;
     SelectedPosition       = origin;
 }
Exemple #3
0
 public DebugLookWindow(Point origin, World world, MapPanel panel, PromptWindowTemplate template) : base(origin, null, panel, template)
 {
     this._world = world;
 }