-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tesseratos): add Menu Bar plugin
- Loading branch information
Showing
5 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#include "plugin.hpp" | ||
|
||
#include <cubos/engine/defaults/plugin.hpp> | ||
#include <cubos/engine/imgui/plugin.hpp> | ||
|
||
#include "../asset_explorer/plugin.hpp" | ||
#include "../debugger/plugin.hpp" | ||
#include "../importer/plugin.hpp" | ||
#include "../project/plugin.hpp" | ||
#include "../scene_editor/plugin.hpp" | ||
#include "../voxel_palette_editor/plugin.hpp" | ||
|
||
using namespace cubos::engine; | ||
using namespace tesseratos; | ||
|
||
void tesseratos::menuBarPlugin(Cubos& cubos) | ||
{ | ||
cubos.depends(imguiPlugin); | ||
|
||
cubos.depends(debuggerPlugin); | ||
cubos.depends(assetExplorerPlugin); | ||
|
||
cubos.depends(projectPlugin); | ||
|
||
cubos.depends(sceneEditorPlugin); | ||
cubos.depends(voxelPaletteEditorPlugin); | ||
cubos.depends(importerPlugin); | ||
|
||
cubos.system("setup Menu Bar") | ||
.tagged(imguiTag) | ||
.call([](AssetExplorerTool& assetExplorerTool, DebuggerTool& debuggerTool,ProjectTool& projectTool, | ||
ImporterTool& importerTool, SceneEditorTool& sceneEditorTool, VoxelPalleteEditorTool& voxelPalleteEditorTool) { | ||
|
||
ImGui::Begin("Tesseratos"); | ||
|
||
if (ImGui::BeginMenuBar()) | ||
{ | ||
if (ImGui::BeginMenu("Project")) | ||
{ | ||
ImGui::MenuItem("New...", "Ctrl+N"); | ||
ImGui::MenuItem("Open...", "Ctrl+O"); | ||
ImGui::MenuItem("Browse in Bridge...", "Alt+Ctrl+O"); | ||
ImGui::MenuItem("Open As...", "Alt+Shift+Ctrl+O"); | ||
if(ImGui::BeginMenu("Open Recent")) { | ||
ImGui::Text("No recent files..."); | ||
ImGui::EndMenu(); | ||
} | ||
ImGui::Separator(); | ||
|
||
ImGui::MenuItem("Close", "Ctrl+W"); | ||
ImGui::MenuItem("Close All", "Alt+Ctrl+W"); | ||
ImGui::Separator(); | ||
|
||
ImGui::MenuItem("Save", "Ctrl+S"); | ||
ImGui::MenuItem("Save As", "Shift+Ctrl+S"); | ||
ImGui::MenuItem("Revert", "F12"); | ||
ImGui::Separator(); | ||
|
||
ImGui::MenuItem("Export"); | ||
ImGui::MenuItem("Generate"); | ||
ImGui::MenuItem("Share"); | ||
ImGui::Separator(); | ||
|
||
ImGui::MenuItem("Print...", "Ctrl+P"); | ||
ImGui::MenuItem("Print One Copy", "Ctrl+P"); | ||
ImGui::Separator(); | ||
|
||
ImGui::MenuItem("File Info...", "Alt+Shift+Ctrl+1"); | ||
ImGui::MenuItem("Exit", "Ctrl+Q"); | ||
|
||
ImGui::EndMenu(); | ||
} | ||
if (ImGui::BeginMenu("Edit")) | ||
{ | ||
ImGui::MenuItem("Fullscreen"); | ||
ImGui::MenuItem("Padding"); | ||
ImGui::EndMenu(); | ||
} | ||
if (ImGui::BeginMenu("View")) | ||
{ | ||
ImGui::MenuItem("Asset Explorer", "", &assetExplorerTool.isOpen); | ||
ImGui::MenuItem("Debugger", "", &debuggerTool.isOpen); | ||
ImGui::MenuItem("Importer", "", &importerTool.isOpen); | ||
ImGui::MenuItem("Project", "", &projectTool.isOpen); | ||
ImGui::MenuItem("Scene Editor", "", &sceneEditorTool.isOpen); | ||
ImGui::MenuItem("Voxel Pallete Editor", "", &voxelPalleteEditorTool.isOpen); | ||
|
||
ImGui::EndMenu(); | ||
} | ||
|
||
ImGui::EndMenuBar(); | ||
} | ||
|
||
ImGui::End(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/// @dir | ||
/// @brief @ref tesseratos-menu-bar-plugin plugin directory. | ||
|
||
/// @file | ||
/// @brief Plugin entry point. | ||
/// @ingroup tesseratos-menu-bar-plugin | ||
|
||
#pragma once | ||
|
||
#include <cubos/engine/prelude.hpp> | ||
|
||
namespace tesseratos | ||
{ | ||
/// @defgroup tesseratos-menu-bar-plugin Menu bar | ||
/// @ingroup tesseratos | ||
/// @brief Adds a menu bar to tesseratos. | ||
|
||
/// @brief Plugin entry function. | ||
/// @param cubos @b Cubos main class | ||
/// @ingroup tesseratos-menu-bar-plugin | ||
void menuBarPlugin(cubos::engine::Cubos& cubos); | ||
} // namespace tesseratos |