public MainScreen(Game game, SpriteBatch spriteBatch) : base(game) { _spriteBatch = spriteBatch; var serviceScope = ((LivGame)Game).ServiceProvider; _uiState = serviceScope.GetRequiredService <ISectorUiState>(); _player = serviceScope.GetRequiredService <IPlayer>(); _transitionPool = serviceScope.GetRequiredService <ITransitionPool>(); _animationBlockerService = serviceScope.GetRequiredService <IAnimationBlockerService>(); var uiContentStorage = serviceScope.GetRequiredService <IUiContentStorage>(); _camera = new Camera(); _personEffectsPanel = new PersonConditionsPanel(_uiState, screenX: 8, screenY: 8, uiContentStorage: uiContentStorage); _personEquipmentModal = new PersonPropsModalDialog( uiContentStorage, game.GraphicsDevice, _uiState, ((LivGame)game).ServiceProvider); _personStatsModal = new PersonStatsModalDialog( uiContentStorage, game.GraphicsDevice, _uiState); _containerModal = new ContainerModalDialog( _uiState, uiContentStorage, Game.GraphicsDevice, serviceScope); var humanActorTaskSource = serviceScope.GetRequiredService <IHumanActorTaskSource <ISectorTaskSourceContext> >(); var mainPerson = _player.MainPerson; if (mainPerson is null) { throw new InvalidOperationException("Main person is not initalized. Generate globe first."); } _bottomMenu = new BottomMenuPanel( humanActorTaskSource, mainPerson.GetModule <ICombatActModule>(), uiContentStorage, mainPerson.GetModule <IEquipmentModule>(), _uiState); _bottomMenu.PropButtonClicked += BottomMenu_PropButtonClicked; _bottomMenu.StatButtonClicked += BottomMenu_StatButtonClicked; }