Esempio n. 1
0
 private void MenuLayer_Clicked(HandledEventArgs obj)
 {
     if (_loadGameWindow == null)
     {
         var position = InputManager.GetMousePostion(true);
         if (position.Y < TopBoundary)
         {
             _viewSwitcher.OpenMap(null);
         }
         else if (position.Y > BottomBoundary)
         {
             // TODO: terminate game
         }
         else
         {
             _loadGameWindow = _commonGuiFactory.CreateLoadGameWindow(args =>
             {
                 RemoveElement(_loadGameWindow);
                 _loadGameWindow = null;
                 args.Handled    = true;
             });
             AddElement(_loadGameWindow);
         }
     }
 }
Esempio n. 2
0
        private void OnOptionsClicked(HandledEventArgs args)
        {
            args.Handled = true;
            var window = new GameOptionsWindow(GuiServices, _texts, _playersRepository, _legionInfo);

            window.LoadGameClicked += _args =>
            {
                _modalLayer.Window = _commonGuiFactory.CreateLoadGameWindow(null);
            };
            window.StatisticsClicked += _args =>
            {
                var statsWindow = new GameStatisticsWindow(GuiServices, _texts, _legionInfo, _mapController, _playersRepository);
                statsWindow.ChartsClicked += __args =>
                {
                    _modalLayer.Window = new GameChartsWindow(GuiServices, _texts, _playersRepository);
                };
                _modalLayer.Window = statsWindow;
            };
            _modalLayer.Window = window;
        }