Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
AssetBrowserRegistry.hpp
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <vector>
4#include <functional>
5#include <filesystem>
6#include "core/EngineAPI.hpp"
7
8namespace Engine {
9
15 public:
16 using ContextMenuCallback = std::function<void(const std::filesystem::path&)>;
17
18 struct Option {
19 std::string labelPath; // e.g. "Create/Custom Component"
21 };
22
28 static void registerOption(const std::string& labelPath, ContextMenuCallback callback) {
29 getOptions().push_back({ labelPath, callback });
30 }
31
35 static std::vector<Option>& getOptions() {
36 static std::vector<Option> s_options;
37 return s_options;
38 }
39 };
40
41}
#define ENGINE_API
Definition EngineAPI.hpp:10
Registry for adding custom options and submenu items to the Asset Browser's right-click context menu.
Definition AssetBrowserRegistry.hpp:14
static void registerOption(const std::string &labelPath, ContextMenuCallback callback)
Registers a custom context menu item.
Definition AssetBrowserRegistry.hpp:28
std::function< void(const std::filesystem::path &)> ContextMenuCallback
Definition AssetBrowserRegistry.hpp:16
static std::vector< Option > & getOptions()
Retrieves all registered custom menu options.
Definition AssetBrowserRegistry.hpp:35
Definition Application.hpp:16
Definition AssetBrowserRegistry.hpp:18
std::string labelPath
Definition AssetBrowserRegistry.hpp:19
ContextMenuCallback callback
Definition AssetBrowserRegistry.hpp:20