public void Run(EditorUpdate runParam) { var groupedEditors = Editors.GroupBy(e => e.Category); if (ImGui.BeginMainMenuBar()) { foreach (var group in groupedEditors) { if (ImGui.BeginMenu(group.Key)) { foreach (var editor in group) { bool active = editor.Active; ImGui.MenuItem(editor.Name, "", ref active, true); editor.Active = active; } ImGui.EndMenu(); } } ImGui.EndMainMenuBar(); } foreach (var editor in Editors.Where(e => e.Active)) { editor.Run(runParam); } }
private void DrawMainMenu() { if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("File")) { if (ImGui.MenuItem("Settings", null, this.showSettingsWindow)) { this.showSettingsWindow = !this.showSettingsWindow; } if (ImGui.MenuItem("ImGui Metrics", null, this.showMetricsWindow)) { this.showMetricsWindow = !this.showMetricsWindow; } ImGui.Separator(); if (ImGui.MenuItem("Quit")) { this.Window.Close(); } ImGui.EndMenu(); } ImGui.EndMainMenuBar(); } }
public void Draw() { if (!_showDebugBar || !ImGui.BeginMainMenuBar()) { return; } if (ImGui.BeginMenu(MenuLabel)) { if (ImGui.MenuItem(MenuItemToggle, SlashCommand, _base._menu.Visible)) { _base.FlipVisibility(); } if (ImGui.MenuItem(MenuItemRediscover)) { _base.ReloadMods(); } #if DEBUG if (ImGui.MenuItem(MenuItemHide)) { _showDebugBar = false; } #endif ImGui.EndMenu(); } ImGui.EndMainMenuBar(); }
public void Draw(IViewState viewState) { if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("Tools")) { ImGui.Checkbox("Toggle Console", ref _consoleVisible); ImGui.Checkbox("Toggle Material Control", ref _materialControlVisible); ImGui.Checkbox("Toggle Object Editor", ref _objectEditorVisible); ImGui.EndMenu(); } ImGui.Text(_fta.CurrentAverageFramesPerSecond.ToString("000.0 fps / ") + _fta.CurrentAverageFrameTimeMilliseconds.ToString("#00.00 ms")); ImGui.TextUnformatted($"Camera Position: {viewState.Origin} Camera Angles: Pitch {viewState.Angles.X} Yaw {viewState.Angles.Y}"); ImGui.EndMainMenuBar(); } DrawConsole(); DrawMaterialControl(); DrawObjectEditor(); }
protected override void CustomRender() { if (ImGui.BeginMainMenuBar()) { CreateFileMenu(); CreateViewMenu(); if (!string.IsNullOrWhiteSpace(_applicationState.ActiveFileName)) { ImGui.SameLine(); ImGui.Text($" - {_applicationState.ActiveFileName}"); if (_applicationState.HasUnsavedChanges) { ImGui.SameLine(); ImGui.Text("*"); } } var versionString = $"v{_applicationState.Version}"; var versionWidth = ImGui.CalcTextSize(versionString); var versionStartPoint = ImGui.GetWindowWidth() - versionWidth.X - 25; ImGui.SameLine(versionStartPoint); ImGui.Text(versionString); var zoomString = $"{(int)(_applicationState.Zoom * 100)}%%"; var zoomWidth = ImGui.CalcTextSize(zoomString); var zoomStartPoint = versionStartPoint - zoomWidth.X - 25; ImGui.SameLine(zoomStartPoint); ImGui.Text(zoomString); ImGui.EndMainMenuBar(); } }
public void Render(out float menuHeight) { if (this.DarkMode) { ImGui.StyleColorsDark(); } else { ImGui.StyleColorsLight(); } menuHeight = 0.0f; if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("Theme")) { if (ImGui.MenuItem("Light", "", !this.DarkMode, this.DarkMode)) { this.DarkMode = false; } if (ImGui.MenuItem("Dark", "", this.DarkMode, !this.DarkMode)) { this.DarkMode = true; } //if (ImGui.MenuItem("Demo", "", DemoMode)) //{ // DemoMode = !DemoMode; //} ImGui.EndMenu(); } menuHeight = ImGui.GetWindowHeight(); ImGui.EndMainMenuBar(); } }
public void Draw() { if (!_showDebugBar || !ImGui.BeginMainMenuBar()) { return; } using var raii = ImGuiRaii.DeferredEnd(ImGui.EndMainMenuBar); if (!ImGui.BeginMenu(MenuLabel)) { return; } raii.Push(ImGui.EndMenu); if (ImGui.MenuItem(MenuItemToggle, SlashCommand, _base._menu.Visible)) { _base.FlipVisibility(); } if (ImGui.MenuItem(MenuItemRediscover)) { _base.ReloadMods(); } #if DEBUG if (ImGui.MenuItem(MenuItemHide)) { _showDebugBar = false; } #endif }
public override bool Draw() { ImGui.DockSpaceOverViewport(); ImGui.BeginMainMenuBar(); if (ImGui.BeginMenu("File")) { if (ImGui.BeginMenu("Project")) { if (ImGui.MenuItem("New") && Platform.OpenFolderBroswer(out string path)) { EditorProject.CreateProject(path, "Template Project"); } if (ImGui.MenuItem("Open") && Platform.OpenFolderBroswer(out path)) { EditorProject.OpenProject(path); } ImGui.EndMenu(); } ImGui.EndMenu(); } //if (ImGui.BeginMenu("Windows")) //{ // if (ImGui.MenuItem("Style Editor")) // showstyle = !showstyle; // ImGui.EndMenu(); //} ImGui.EndMainMenuBar(); return(true); }
private static unsafe void SubmitMainMenu() { if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("Scene")) { if (ImGui.MenuItem("Save Scene", "Ctrl+S")) { HostHelper.SaveScene(); } if (ImGui.MenuItem("Save Frame Snapshots")) { FrameOutput.DebugSaveFrame = true; } ImGui.EndMenu(); } if (ImGui.BeginMenu("Selection")) { if (ImGui.MenuItem("Duplicate", "Ctrl+D")) { HostHelper.Duplicate(); } ImGui.EndMenu(); } ImGui.EndMainMenuBar(); } }
private void RenderMainMenu() { if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("Windows")) { for (var i = 0; i < this.Windows.Count; i++) { var window = this.Windows[i]; if (ImGui.MenuItem(window.Name, "", this.OpenWindows[window.Name])) { this.OpenWindows[window.Name] = !this.OpenWindows[window.Name]; } } if (ImGui.MenuItem("DemoWindow", "", this.showDemoWindow)) { this.showDemoWindow = !this.showDemoWindow; } ImGui.EndMenu(); } this.SceneManager.RenderMainMenuItems(); ImGui.EndMainMenuBar(); } }
public void Update(float deltaSeconds) { if (IsPlaying) { UpdateScheduler.Update(deltaSeconds, EUpdatePriority.ResourceLoading, EUpdatePriority.PrePhysics); PhysicsWorld.Update(deltaSeconds); UpdateScheduler.Update(deltaSeconds, EUpdatePriority.PostPhysics, EUpdatePriority.Latest); } else { UpdateScheduler.Update(deltaSeconds, EUpdatePriority.Editor, EUpdatePriority.ResourceLoading); } GameConsole.Draw(ViewManager.ScreenWidth, ViewManager.ScreenHeight); ViewManager.GetViewInfo(out SSceneViewInfo viewInfo); #region MenuBar m_performanceCounter.UpdateFrametime(deltaSeconds); ImGui.BeginMainMenuBar(); ImGui.Text("FPS: " + (1 / m_performanceCounter.SmoothedFrametime).ToString("n2")); ImGui.Text(string.Format("CameraPosition X: {0:0.00} Y: {1:0.00} Z: {2:0.00}", viewInfo.ViewLocation.X, viewInfo.ViewLocation.Y, viewInfo.ViewLocation.Z)); ImGui.EndMainMenuBar(); #endregion CRenderer.Instance.ActiveScene.UpdateViewInfo(in viewInfo); for (int i = 0; i < m_pendingDestroyEntities.Count; i++) { InternalDestroyEntity(m_pendingDestroyEntities[i]); } m_pendingDestroyEntities.Clear(); }
public void Draw() { if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("Tools")) { _console.AddMenuItem(); _materialControl.AddMenuItem(); _objectEditor.AddMenuItem(); ImGui.EndMenu(); } ImGui.Text(_fta.CurrentAverageFramesPerSecond.ToString("000.0 fps / ") + _fta.CurrentAverageFrameTimeMilliseconds.ToString("#00.00 ms")); //TODO: probably should get the scene from somewhere else var viewState = _client.UserInterface.Renderer.Scene; ImGui.TextUnformatted($"Camera Position: {viewState.Origin} Camera Angles: Pitch {viewState.Angles.X} Yaw {viewState.Angles.Y}"); ImGui.EndMainMenuBar(); } _console.Draw(); _materialControl.Draw(); _objectEditor.Draw(); }
public override void BuildUI(ImGuiRenderer renderer) { if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("File")) { if (ImGui.MenuItem("Close", "c")) { GuiState.ShutdownRequested = true; } ImGui.EndMenu(); } if (ImGui.BeginMenu("Options")) { if (ImGui.MenuItem("Show SadConsole game", "s", ref GuiState.ShowSadConsoleRendering, true)) { GuiState.RaiseShowSadConsoleRenderingChanged(); } ImGui.MenuItem("Show surface preview", "p", ref GuiState.ShowSurfacePreview, true); ImGui.EndMenu(); } ImGui.EndMainMenuBar(); } }
private void RenderUI(IScene currentScene, PerspectiveCamera camera, GameTime gameTime) { if (this.State.EditorState.ShowGui) { if (this.KeyboardInput.Hold(Keys.LeftShift)) { this.Editors.DragSpeed = FastDragSpeed; } else { this.Editors.DragSpeed = SlowDragSpeed; } this.Gui.BeginLayout(gameTime); { if (ImGui.BeginMainMenuBar()) { for (var i = 0; i < this.Menus.Count; i++) { this.Menus[i].Render(camera); } if (ImGui.Button("Reset Scene")) { this.SceneSelector.ResetScene(); } var speed = this.CameraController.TranslateSpeed.Value; ImGui.SliderFloat("Movement Speed", ref speed, CameraController.MinTranslateSpeed, CameraController.MaxTranslateSpeed); this.CameraController.TranslateSpeed = speed; this.State.EditorState.CameraSpeed = speed; ImGui.EndMainMenuBar(); } currentScene.RenderUI(); if (this.State.EntityState.ShowEntityWindow && this.State.EntityState.SelectedEntity.Id > 0) { this.EntityWindow.Render(); } else { this.State.EntityState.ShowEntityWindow = false; } if (this.State.NetState.ShowNetWindow) { this.NetWindow.Render(); } if (this.State.DebugState.ShowDemo) { ImGui.ShowDemoWindow(); } } this.Gui.EndLayout(); } }
public override void Render(CommandList cl) { if (ImGui.BeginMainMenuBar()) { RenderChildren(cl); ImGui.EndMainMenuBar(); } }
internal static void GlaivesMainMenuBar() { if (!_menuBarInitialized) { _console = new ImGuiConsole(); _textureEditor = new ImGuiTextureEditor(); foreach (Type type in Assembly.GetEntryAssembly().GetTypes()) { if (type.IsSubclassOf(typeof(Level))) { _levels.Add(type.Name, type); } } _menuBarInitialized = true; } ImGui.BeginMainMenuBar(); if (ImGui.BeginMenu("Windows")) { if (ImGui.MenuItem("Texture Editor", "CTRL+T")) { _textureEditor.IsOpen = true; } if (ImGui.MenuItem("Console", "~")) { _console.IsOpen = true; } ImGui.EndMenu(); } _textureEditor.Draw(Engine.Get.ContentFolder); _console.Draw(); if (ImGui.BeginMenu("Game")) { if (ImGui.BeginMenu("Load Level")) { foreach (KeyValuePair <string, Type> levelKvp in _levels) { if (ImGui.MenuItem(levelKvp.Key)) { Engine.Get.LoadLevel(levelKvp.Value); } } ImGui.EndMenu(); } ImGui.EndMenu(); } ImGui.EndMainMenuBar(); }
private static void MenuBar() { ImGui.BeginMainMenuBar(); { if (ImGui.BeginMenu("Project")) { if (ImGui.MenuItem("Save Project")) { ProjectInfo.SaveCurrentProject(); } if (ImGui.MenuItem("Build")) { CompilationSystem.Builder.Build(CurrentProject.BuildPath, "build"); } ImGui.EndMenu(); } if (ImGui.BeginMenu("Windows")) { if (ImGui.BeginMenu("New Window")) { foreach (var type in EditorWindowTypes) { if (ImGui.Button($"New {type.Name}")) { var window = (EditorWindow)Activator.CreateInstance(type); window.WindowTitle += EditorWindows.Count; // TODO: use something else for Unique Id generation! (perhaps use the RenderEngine2D system?) EditorWindows.Add(window); } } ImGui.EndMenu(); } if (ImGui.BeginMenu("Open Windows")) { foreach (var window in EditorWindows) { bool enabled = window.Enabled; ImGui.Checkbox($"{window.WindowTitle} ({window.GetType().Name})", ref enabled); window.Enabled = enabled; } ImGui.EndMenu(); } ImGui.EndMenu(); } } ImGui.EndMainMenuBar(); }
/// <summary> /// Draw the main menu. /// </summary> public void DrawMainMenu() { //Begin menu bar. if (ImGui.BeginMainMenuBar()) { //Tools. if (ImGui.MenuItem("Fursona Maker")) { new FursonaMakerWindow(); } if (ImGui.MenuItem("Coloring Book")) { } if (ImGui.MenuItem("Part Editor")) { } if (Helper.DebugMode && ImGui.MenuItem("YuPaint")) { new YuPaintDEMO(); } if (ImGui.MenuItem("Settings")) { new SettingsWindow(); } if (ImGui.MenuItem("About")) { new AboutWindow(); } //Fullscreen. if (ImGui.Button("Fullscreen")) { ToggleFullscreen(); } //Wallpaper stuff. if (Helper.Settings.EnableWallpapers && ImGui.Button("Next Wallpaper")) { Wallpapers.FetchNextWallpaper(); } if (Helper.Settings.EnableWallpapers && ImGui.Button("Save Wallpaper")) { Wallpapers.SaveWallpaper(); } string wallpaperPauseText = Wallpapers.Paused ? "Unpause Wallpapers" : "Pause Wallpapers"; if (Helper.Settings.EnableWallpapers && ImGui.Button(wallpaperPauseText)) { Wallpapers.Paused = !Wallpapers.Paused; } //End menu bar. ImGui.EndMenuBar(); } }
/// <summary> /// draws the main menu bar /// </summary> void drawMainMenuBar() { if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("File")) { if (ImGui.MenuItem("Quit ImGui")) { setEnabled(false); } ImGui.EndMenu(); } if (_sceneSubclasses.Count > 0 && ImGui.BeginMenu("Scenes")) { foreach (var sceneType in _sceneSubclasses) { if (ImGui.MenuItem(sceneType.Name)) { var scene = (Scene)sceneType.GetConstructor(Type.EmptyTypes).Invoke(new object[] { }); Core.startSceneTransition(new CrossFadeTransition(() => scene)); } } ImGui.EndMenu(); } if (_themes.Length > 0 && ImGui.BeginMenu("Themes")) { foreach (var theme in _themes) { if (ImGui.MenuItem(theme.Name)) { theme.Invoke(null, new object[] {}); } } ImGui.EndMenu(); } if (ImGui.BeginMenu("Window")) { ImGui.MenuItem("Demo Window", null, ref showDemoWindow); ImGui.MenuItem("Style Editor", null, ref showStyleEditor); ImGui.Separator(); ImGui.MenuItem("Core Window", null, ref showCoreWindow); ImGui.MenuItem("Scene Graph Window", null, ref showSceneGraphWindow); ImGui.MenuItem("Separate Game Window", null, ref showSeperateGameWindow); ImGui.EndMenu(); } ImGui.EndMainMenuBar(); } }
protected virtual void ImGuiLayout() { ImGui.BeginMainMenuBar(); ImGui.EndMainMenuBar(); { ImGui.Begin("Base Editor"); ImGui.Button("Level Editor"); ImGui.Button("AutoTile Editor"); ImGui.Button("Event Editor"); ImGui.Separator(); ImGui.End(); } //// 1. Show a simple window //// Tip: if we don't call ImGui.Begin()/ImGui.End() the widgets appears in a window automatically called "Debug" //{ // ImGui.Text("Hello, world!"); // ImGui.SliderFloat("float", ref f, 0.0f, 1.0f, string.Empty, 1f); // ImGui.ColorEdit3("clear color", ref clear_color); // if (ImGui.Button("Test Window")) show_test_window = !show_test_window; // if (ImGui.Button("Another Window")) show_another_window = !show_another_window; // ImGui.Text(string.Format("Application average {0:F3} ms/frame ({1:F1} FPS)", 1000f / ImGui.GetIO().Framerate, ImGui.GetIO().Framerate)); // ImGui.InputText("Text input", _textBuffer, 100); // ImGui.Text("Texture sample"); // ImGui.Image(_imGuiTexture, new Num.Vector2(300, 150), Num.Vector2.Zero, Num.Vector2.One, Num.Vector4.One, Num.Vector4.One); // Here, the previously loaded texture is used //} //// 2. Show another simple window, this time using an explicit Begin/End pair //if (show_another_window) //{ // ImGui.SetNextWindowSize(new Num.Vector2(200, 100), ImGuiCond.FirstUseEver); // ImGui.Begin("Another Window", ref show_another_window); // ImGui.Text("Hello, world!"); // ImGui.SliderFloat("float", ref f, 0.0f, 1.0f, string.Empty, 1f); // ImGui.Text("Hello"); // ImGui.End(); //} //// 3. Show the ImGui test window. Most of the sample code is in ImGui.ShowTestWindow() //if (show_test_window) //{ // ImGui.SetNextWindowPos(new Num.Vector2(650, 20), ImGuiCond.FirstUseEver); // ImGui.ShowDemoWindow(ref show_test_window); //} }
override protected unsafe void SubmitImGUILayout(float secondsPerFrame) { _secondsPerFrameSamples[_sampleCounter] = secondsPerFrame; if (_sampleCounter < MAX_SAMPLES - 1) { _sampleCounter++; } else { _sampleCounter = 0; } string performance = $"Seconds per Frame: {secondsPerFrame.ToString("N5")}"; var acc = 0.0f; for (int i = 0; i < MAX_SAMPLES; i++) { acc += _secondsPerFrameSamples[i]; } acc /= MAX_SAMPLES; var avg_fps = 1.0f / acc; string avg_performance = $"Average Seconds per Frame: {acc.ToString("N5")}"; string performance_fps = $"Average Frames per Second: {avg_fps.ToString("N2")}"; if (ImGui.BeginMainMenuBar()) { ImGui.Text(performance); ImGui.Text("||"); ImGui.Text(performance_fps); ImGui.Text("||"); ImGui.Text(avg_performance); ImGui.Text("||"); if (ImGui.BeginMenu("Backend")) { if (ImGui.MenuItem("OpenGL", GraphicsDevice.IsBackendSupported(GraphicsBackend.OpenGL))) { backendCallback = true; newGraphicsBackend = GraphicsBackend.OpenGL; } if (ImGui.MenuItem("Metal", GraphicsDevice.IsBackendSupported(GraphicsBackend.Metal))) { backendCallback = true; newGraphicsBackend = GraphicsBackend.Metal; } ImGui.EndMenu(); } ImGui.EndMainMenuBar(); } }
protected virtual void ImGuiLayout() { ImguiExample(); if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("File")) { if (ImGui.MenuItem("New")) { _menuAction = "New"; } if (ImGui.MenuItem("Open")) { _menuAction = "Open"; } ImGui.Separator(); if (ImGui.MenuItem("Save")) { _menuAction = "Save"; } if (ImGui.MenuItem("Save As")) { _menuAction = "SaveAs"; } ImGui.Separator(); if (ImGui.MenuItem("Quit")) { this.Exit(); } ImGui.EndMenu(); } ImGui.EndMainMenuBar(); } if (_menuAction == "Open") { bool result = false; bool _fopen = true; ImGui.SetNextWindowSize(DefaultFilePickerSize, ImGuiCond.FirstUseEver); ImGui.OpenPopup(FilePickerID); } if (ImGui.BeginPopupModal(FilePickerID)) { var result = DrawFolder(ref selected, true); ImGui.EndPopup(); } }
private void RenderMenu() { if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("File")) { if (ImGui.BeginMenu("Open...")) { if (ImGui.MenuItem("nanosuit.obj")) { } ImGui.EndMenu(); } if (ImGui.MenuItem("Save as...")) { } ImGui.EndMenu(); } if (ImGui.BeginMenu("Edit")) { ImGui.EndMenu(); } if (ImGui.BeginMenu("View")) { ImGui.EndMenu(); } if (ImGui.BeginMenu("Extra")) { if (ImGui.MenuItem("BenchmarkIK")) { Benchmark.RunInverseKinematics(); } if (ImGui.MenuItem("BenchmarkPP")) { Benchmark.RunPathPlanning(); } ImGui.EndMenu(); } ImGui.EndMainMenuBar(); } }
public static void Build(float elapsedTime, float offsetX, float offsetY) { ImGui.GetIO().FontGlobalScale = Main.DPIY; ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 7.0f); ImGui.PushStyleVar(ImGuiStyleVar.WindowBorderSize, 1.0f); ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new System.Numerics.Vector2(14.0f, 8.0f)); DialogManager.UpdateDialogs(); if (ImGui.BeginMainMenuBar()) { MenuBar.BuildMenuBar(); ImGui.EndMainMenuBar(); } ImGui.PushStyleColor(ImGuiCol.WindowBg, new System.Numerics.Vector4(0.15f, 0.15f, 0.15f, Focused ? 1 : 0.65f)); TooltipManager.PreUpdate(elapsedTime, offsetX, offsetY); WindowDebug.Update(); WindowEditPlayerEquip.Update(); WindowHelp.Update(); WindowSceneManager.Update(); WindowToolbox.Update(); WindowEntitySettings.Update(); SpWindowEventInspector.Update(); ImGui.PopStyleColor(); ImGui.PopStyleVar(3); TooltipManager.PostUpdate(); IsInit = false; RequestExpandAllTreeNodes = false; RequestCollapse = false; Focused = ImGui.IsAnyItemFocused() || ImGui.IsWindowFocused(ImGuiFocusedFlags.AnyWindow) || DialogManager.AnyDialogsShowing; Hovered = ImGui.IsWindowHovered(ImGuiHoveredFlags.AnyWindow) || ImGui.IsAnyItemHovered(); if (Focused || Hovered) { Main.Input.CursorType = MouseCursorType.Arrow; } }
public unsafe override void Loop(EngineLoopInfo loopInfo) { var style = ImGui.GetStyle(); ImGui.StyleColorsClassic(style); if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("Options")) { int min = 0; int max = 1000000; if (ImGui.SliderInt("Doges", ref doges, min, max, doges.ToString())) { Console.WriteLine($"You chose {doges} doges"); var toAdd = Math.Max(0, doges - sprites.Count); Console.WriteLine($"Adding {toAdd}"); var texture = ResourceManager.GetTexture("Bunny"); var random = new Random(); for (int i = 0; i < toAdd; i++) { // Sprites var next = random.NextDouble(); var sprite = new SpritePrimitive(texture) { Position = new Vector2((float)random.NextDouble() * 600, (float)random.NextDouble() * 600), Origin = Vector2.One / 2 }; //sprite.ZIndex = sprite.Position.X / 10000f; sprites.Add(sprite); Add(sprite); } } ImGui.EndMenu(); } ImGui.Separator(); ImGui.Text($"{loopInfo.FramesPerSecond} fps / {loopInfo.MillisecondsPerFrame} ms"); ImGui.EndMainMenuBar(); } foreach (var spritePrimitive in sprites) { spritePrimitive.Rotation += 3.0f * loopInfo.SecondsPerFrame; } }
public override void Render() { if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("File")) { renderFileMenu(); ImGui.EndMenu(); } if (ImGui.BeginMenu("Edit")) { renderEditMenu(); ImGui.EndMenu(); } if (ImGui.BeginMenu("Help")) { renderHelpMenu(); ImGui.EndMenu(); } } ImGui.EndMainMenuBar(); if (_openFileOpenDialog) { _openDialog.Show(fileName => _jsonTree.LoadJson(fileName), "*.json"); _openFileOpenDialog = false; } if (_openFileSaveDialog) { _saveDialog.Show(fileName => _jsonTree.SaveJson(fileName), "*", ".json"); _openFileSaveDialog = false; } if (_openSchemaOpenDialog) { _openSchemaDialog.Show(fileName => _jsonTree.LoadSchema(fileName), "*.json"); _openSchemaOpenDialog = false; } _openDialog.Render(); _openSchemaDialog.Render(); _saveDialog.Render(); renderModals(); }
public void Draw(Style style) { style.BeginMainMenu(this); ImGui.BeginMainMenuBar(); if (ImGui.BeginMenu("File")) { if (ImGui.MenuItem("Save", "CTRL+S")) { } if (ImGui.MenuItem("Open", "CTRL+O")) { } if (ImGui.MenuItem("New", "CTRL+N")) { } ImGui.EndMenu(); } if (ImGui.BeginMenu("Edit")) { if (ImGui.MenuItem("Undo", "CTRL+Z")) { } if (ImGui.MenuItem("Redo", "CTRL+Y", false, false)) { } // Disabled item ImGui.Separator(); if (ImGui.MenuItem("Cut", "CTRL+X")) { } if (ImGui.MenuItem("Copy", "CTRL+C")) { } if (ImGui.MenuItem("Paste", "CTRL+V")) { } ImGui.EndMenu(); } if (ImGui.BeginMenu("View")) { WindowMenuItem("Node Hierarchy", HierarchyWindow); WindowMenuItem("History", HistoryWindow); ImGui.EndMenu(); } ImGui.EndMainMenuBar(); style.EndMainMenu(this); }
private void DrawMainMenu() { if (ImGui.BeginMainMenuBar()) { if (ImGui.BeginMenu("File")) { if (ImGui.MenuItem("Open debug window")) { isOpen = true; } if (ImGui.MenuItem("Toggle demo window")) { showDemoWindow = true; } ImGui.EndMenu(); } if (ImGui.BeginMenu("Edit")) { if (ImGui.MenuItem("Undo", "CTRL+Z")) { } if (ImGui.MenuItem("Redo", "CTRL+Y", false, false)) { } // Disabled item ImGui.Separator(); if (ImGui.MenuItem("Cut", "CTRL+X")) { } if (ImGui.MenuItem("Copy", "CTRL+C")) { } if (ImGui.MenuItem("Paste", "CTRL+V")) { } ImGui.EndMenu(); } ImGui.EndMainMenuBar(); } }
public float MainMenu() { float wsize = 0; if (ImGui.BeginMainMenuBar()) { wsize = ImGui.GetWindowHeight(); if (ImGui.BeginMenu("File")) { filemanager = ImGui.MenuItem("Open"); ImGui.EndMenu(); } if (ImGui.BeginMenu("Reset")) { resetemu = true; c.emustate = State.Reset; ImGui.EndMenu(); } if (c.emustate == State.Running) { if (ImGui.BeginMenu("Debug")) { if (ImGui.MenuItem("Debugger")) { c.emustate = State.Debug; } if (ImGui.MenuItem("Memory")) { showram = true; } ImGui.EndMenu(); } if (ImGui.BeginMenu("Tracer") && c.emustate == State.Running) { if (ImGui.MenuItem("Trace") && c.cpu != null) { c.cpu.trace = !c.cpu.trace; } ImGui.EndMenu(); } } ImGui.EndMainMenuBar(); } return(wsize); }
public override void OnGUI() { ImGui.BeginMainMenuBar(); if (ImGui.BeginMenu("File")) { if (ImGui.MenuItem("Open Luminal project", "ctrl+o")) { Editor.DoLoadFlow(); } ImGui.EndMenu(); } ImGui.EndMainMenuBar(); }