Exemplo n.º 1
0
        /// <summary>
        /// Pre-battle initialization sequence to load characters, the battleboard and the image layers.
        /// </summary>
        protected override void OnEntered()
        {
            base.OnEntered();

            QueuedCommands = new List <Command>();

            _characterStats = new CharacterStatsDialog();
            Gui.Screen.Desktop.Children.Add(_characterStats);

            _hud = new HUDDialog();
            _hud.EndTurnPressed += EndPlayerTurn;
            Gui.Screen.Desktop.Children.Add(_hud);

            _queuedCommands = new QueuedCommandsDialog(QueuedCommands);
            _queuedCommands.ExecuteClicked += ExecuteQueuedCommands;

            _abilityStatLayer = new AbilityStatDialog();

            Game.IsMouseVisible = true;

            Gui.Visualizer = FlatGuiVisualizer.FromFile(Game.Services, "Content/Gui/main_gui.xml");

            ((FlatGuiVisualizer)Gui.Visualizer).RendererRepository.AddAssembly(typeof(FlatImageButtonControlRenderer).Assembly);
            ((FlatGuiVisualizer)Gui.Visualizer).RendererRepository.AddAssembly(typeof(FlatTiledIconControlRenderer).Assembly);
            ((FlatGuiVisualizer)Gui.Visualizer).RendererRepository.AddAssembly(typeof(FlatRadialButtonControlRenderer).Assembly);
            ((FlatGuiVisualizer)Gui.Visualizer).RendererRepository.AddAssembly(typeof(FlatQueuedCommandControlRenderer).Assembly);

            var keyboard = new KeyboardInputLayer(this, null);

            keyboard.AddKeyDownBinding(Keys.Escape, Cancel);
            Components.Add(keyboard);

            if (_startingDialog != null)
            {
                StartDialog(_startingDialog);
                _startingDialog = null;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Pre-battle initialization sequence to load characters, the battleboard and the image layers.
        /// </summary>
        protected override void OnEntered()
        {
            base.OnEntered();

            QueuedCommands = new List<Command>();

            _characterStats = new CharacterStatsDialog();
            Gui.Screen.Desktop.Children.Add(_characterStats);

            _hud = new HUDDialog();
            _hud.EndTurnPressed += EndPlayerTurn;
            Gui.Screen.Desktop.Children.Add(_hud);

            _queuedCommands = new QueuedCommandsDialog(QueuedCommands);
            _queuedCommands.ExecuteClicked += ExecuteQueuedCommands;

            _abilityStatLayer = new AbilityStatDialog();

            Game.IsMouseVisible = true;

            Gui.Visualizer = FlatGuiVisualizer.FromFile(Game.Services, "Content/Gui/main_gui.xml");

            ((FlatGuiVisualizer)Gui.Visualizer).RendererRepository.AddAssembly(typeof(FlatImageButtonControlRenderer).Assembly);
            ((FlatGuiVisualizer)Gui.Visualizer).RendererRepository.AddAssembly(typeof(FlatTiledIconControlRenderer).Assembly);
            ((FlatGuiVisualizer)Gui.Visualizer).RendererRepository.AddAssembly(typeof(FlatRadialButtonControlRenderer).Assembly);
            ((FlatGuiVisualizer)Gui.Visualizer).RendererRepository.AddAssembly(typeof(FlatQueuedCommandControlRenderer).Assembly);

            var keyboard = new KeyboardInputLayer(this, null);
            keyboard.AddKeyDownBinding(Keys.Escape, Cancel);
            Components.Add(keyboard);

            if (_startingDialog != null)
            {
                StartDialog(_startingDialog);
                _startingDialog = null;
            }
        }