/// <inheritdoc/> public IApplicationStructureConfigurationBuilder Include(ApplicationArea area, string format) { if (!format.StartsWith("[")) { format = $"[.]{format}"; } var formatsByArea = new Dictionary <ApplicationArea, IEnumerable <IStringFormat> >(_structureFormats); var parser = new StringFormatParser(); var stringFormat = parser.Parse(format); List <IStringFormat> formats; if (formatsByArea.ContainsKey(area)) { formats = new List <IStringFormat>(formatsByArea[area]); } else { formats = new List <IStringFormat>(); } formats.Add(stringFormat); formatsByArea[area] = formats; var builder = new ApplicationStructureConfigurationBuilder(formatsByArea); return(builder); }
public MainWindow() : base(WINDOW_WIDTH, WINDOW_HEIGHT, GraphicsMode.Default, WINDOW_TITLE, GameWindowFlags.Default, DisplayDevice.Default, GL_MAJOR_VERSION, GL_MINOR_VERSION, GraphicsContextFlags.Default) { ImGuiRenderer.Init(); _guiComponents = new List <ImGuiComponent>(); ApplicationArea applicationArea = new ApplicationArea(this); _guiComponents.Add(new MainMenuBar(applicationArea.JsonTree, this)); _guiComponents.Add(applicationArea); }
// -------------- public MainWindow() : base(WINDOW_WIDTH, WINDOW_HEIGHT, GraphicsMode.Default, WINDOW_TITLE, GameWindowFlags.Default, DisplayDevice.Default, GL_MAJOR_VERSION, GL_MINOR_VERSION, GraphicsContextFlags.Default) { Instance = this; Icon = new Icon(typeof(MainWindow), "appicon.ico"); GL.Enable(EnableCap.DepthTest); GL.Enable(EnableCap.CullFace); _cam = new Camera(); _cam.Transform.Translate(new Vector3(0, 0, -3)); _fbo = new Framebuffer(WINDOW_WIDTH, WINDOW_HEIGHT, FramebufferTarget.Framebuffer); _proj = Matrix4.CreatePerspectiveFieldOfView(MathHelper.DegreesToRadians(60f), (float)_fbo.Width / _fbo.Height, 0.1f, 100f); ImGuiRenderer.Init(); _guiComponents = new List <ImGuiComponent>(); _updateAvailableModal = new Modal("New update available!", "Download at https://github.com/Figglewatts/LSDView/releases/latest"); createControllers(); ApplicationArea area = new ApplicationArea(); TreeView <TreeNode> outlineView = new TreeView <TreeNode>(); _treeController.SetTree(outlineView); area.AddChild(new Columns(2, new List <ImGuiComponent> { outlineView, new FramebufferArea(_fbo) }, new[] { 250f, -1 })); var menuBar = new MainMenuBar(_fileOpenController, _vramController, _configController, _cameraController); _guiComponents.Add(area); _guiComponents.Add(menuBar); _guiComponents.Add(_exportFileDialog); _guiComponents.Add(_updateAvailableModal); }
/// <inheritdoc/> public IApplicationStructureConfigurationBuilder Include(ApplicationArea area, string format) { return(this); }
/// <inheritdoc/> public IEnumerable <IStringFormat> GetStructureFormatsForArea(ApplicationArea area) { return(new IStringFormat[0]); }
// -------------- public GuiApplication(ILifetimeScope scope) : base(WINDOW_WIDTH, WINDOW_HEIGHT, GraphicsMode.Default, WINDOW_TITLE, GameWindowFlags.Default, DisplayDevice.Default, GL_MAJOR_VERSION, GL_MINOR_VERSION, GraphicsContextFlags.Default) { Instance = this; createControllers(scope); Icon = new Icon(typeof(GuiApplication), "appicon.ico"); GL.Enable(EnableCap.DepthTest); GL.Enable(EnableCap.CullFace); _cam = new Camera(); _cameraController.ProvideCamera(_cam); _cam.Transform.Translate(new Vector3(0, 0, -3)); _fbo = new Framebuffer(WINDOW_WIDTH, WINDOW_HEIGHT, FramebufferTarget.Framebuffer); _proj = Matrix4.CreatePerspectiveFieldOfView(MathHelper.DegreesToRadians(60f), (float)_fbo.Width / _fbo.Height, 0.1f, 100f); ImGuiRenderer.Init(); _guiComponents = new List <ImGuiComponent>(); ApplicationArea area = new ApplicationArea(); TreeView <TreeNode> outlineView = new TreeView <TreeNode>(); _treeController.SetTree(outlineView); area.AddChild(new Columns(2, new List <ImGuiComponent> { outlineView, new FramebufferArea(_fbo) }, new[] { 250f, -1 })); var menuBar = new MainMenuBar(_fileOpenController, _vramController, _configController, _cameraController, _exportController); if (string.IsNullOrWhiteSpace(_configController.Config.GameDataPath)) { // show the set game data path dialog if it hasn't yet been set menuBar.OpenSetGameDataPath(); } _updateAvailableModal = new Modal("New update available!", "Download at https://github.com/Figglewatts/LSDView/releases/latest"); _fileExportDialog = new FileDialog(_configController.Config.GameDataPath, FileDialog.DialogType.Save); _configController.Config.OnGameDataPathChange += () => _fileExportDialog.InitialDir = _configController.Config.GameDataPath; _exportController.ProvideFileExportDialog(_fileExportDialog); _guiComponents.Add(area); _guiComponents.Add(menuBar); _guiComponents.Add(_fileExportDialog); _guiComponents.Add(_updateAvailableModal); if (_updateCheckerController.IsUpdateAvailable()) { _updateAvailableModal.ShowModal(); } }