Example #1
0
        public EmitterSettingsController(ImGuiManager imGuiManager,
                                         SettingsCommandHandler commandHandler,
                                         ApplicationState applicationState,
                                         AppOperationQueue appOperationQueue,
                                         ITextureFileLoader textureFileLoader,
                                         MonoGameImGuiRenderer monoGameImGuiRenderer)
        {
            _commandHandler        = commandHandler;
            _applicationState      = applicationState;
            _appOperationQueue     = appOperationQueue;
            _textureFileLoader     = textureFileLoader;
            _monoGameImGuiRenderer = monoGameImGuiRenderer;

            _workbench = new Workbench(commandHandler)
            {
                IsVisible = false
            };
            imGuiManager.AddElement(_workbench);

            _activeEditorWindow = new ActiveEditorWindow()
            {
                IsVisible = false
            };
            imGuiManager.AddElement(_activeEditorWindow);

            _workbench.PropertyChanged          += WorkbenchOnPropertyChanged;
            _workbench.ModifierRemovalRequested += WorkbenchOnModifierRemovalRequested;
        }
Example #2
0
        private void CreateSettingsWindow()
        {
            var settingsWindow = new SettingsWindow(_appSettings)
            {
                IsVisible = true
            };

            _imGuiManager.AddElement(settingsWindow);

            settingsWindow.SaveChangesRequested += (sender, args) =>
            {
                _appSettings.ScriptFolderPath     = settingsWindow.ScriptFolderPath;
                _appSettings.TextEditorExecutable = settingsWindow.TextEditorExecutable;
                SettingsIo.Save(_appSettings);

                _imGuiManager.RemoveElement(settingsWindow);
            };

            settingsWindow.PropertyChanged += (sender, args) =>
            {
                switch (args.PropertyName)
                {
                case nameof(SettingsWindow.CloseRequested):
                    _imGuiManager.RemoveElement(settingsWindow);
                    break;
                }
            };
        }
Example #3
0
        protected override void Initialize()
        {
            var imGuiRenderer = new MonoGameImGuiRenderer(this);

            imGuiRenderer.Initialize();

            _imGuiManager = new ImGuiManager(imGuiRenderer);
            _imGuiManager.AddElement(_demoWindowElement);
            _imGuiManager.AddElement(_entityDataWindow);

            _entityDataWindow.IsVisible = true;

            base.Initialize();
        }
Example #4
0
        public EditorUiController(ImGuiManager imGuiManager,
                                  SettingsCommandHandler commandHandler,
                                  AppOperationQueue appOperationQueue,
                                  ApplicationState applicationState,
                                  ITextureFileLoader textureFileLoader,
                                  MonoGameImGuiRenderer monoGameImGuiRenderer)
        {
            _imGuiManager      = imGuiManager;
            _appOperationQueue = appOperationQueue;
            _applicationState  = applicationState;

            _imguiDemoWindow = new DemoWindow {
                IsVisible = false
            };
            _imGuiManager.AddElement(_imguiDemoWindow);

            var appToolbar = new AppToolbar(_appOperationQueue, _applicationState);

            _imGuiManager.AddElement(appToolbar);

            _newFileDialog = new NewFileDialog();
            _newFileDialog.CreateButtonClicked += NewFileDialogOnCreateButtonClicked;
            _newFileDialog.ModalClosed         += NewFileDialogOnModalClosed;
            _imGuiManager.AddElement(_newFileDialog);

            _messagePopup              = new MessagePopup();
            _messagePopup.ModalClosed += MessagePopupOnModalClosed;
            _imGuiManager.AddElement(_messagePopup);

            _emitterSettingsController = new EmitterSettingsController(imGuiManager,
                                                                       commandHandler,
                                                                       applicationState,
                                                                       appOperationQueue,
                                                                       textureFileLoader,
                                                                       monoGameImGuiRenderer);

            appToolbar.NewMenuItemClicked  += AppToolbarOnNewMenuItemClicked;
            appToolbar.OpenMenuItemClicked += AppToolbarOnOpenMenuItemClicked;
            appToolbar.SaveMenuItemClicked += AppToolbarOnSaveMenuItemClicked;
        }
Example #5
0
        public PlotterUi(Game game, AppSettings appSettings, ScriptManager scriptManager, OnScreenLogger onScreenLogger)
        {
            _appSettings    = appSettings;
            _scriptManager  = scriptManager;
            _onScreenLogger = onScreenLogger;

            var renderer = new MonoGameImGuiRenderer(game);

            renderer.Initialize();

            _imGuiManager = new ImGuiManager(renderer);

            _imGuiDemoWindow = new ImGuiDemoWindow();
            _imGuiManager.AddElement(_imGuiDemoWindow);

            var messageOverlay = new MessageOverlay(onScreenLogger)
            {
                IsVisible = true
            };

            messageOverlay.DismissMostRecentMessageClicked +=
                (sender, args) => _onScreenLogger.RemoveMostRecentMessage();

            _imGuiManager.AddElement(messageOverlay);

            AppToolbar = new AppToolbar(_scriptManager, _appSettings)
            {
                IsVisible = true
            };
            _imGuiManager.AddElement(AppToolbar);

            _imGuiManager.AddElement(new ImGuiSettings {
                IsVisible = true
            });

            AppToolbar.SettingsClicked += (sender, args) => CreateSettingsWindow();
            AppToolbar.NewClicked      += (sender, args) => CreateNewFileDialog();
            AppToolbar.OpenClicked     += (sender, args) => OpenScriptFile(args);
        }