feat: Added all menu items to command palette

This commit is contained in:
WerWolv
2023-03-20 14:11:43 +01:00
parent 39e8d557e8
commit 6e23560e80
4 changed files with 81 additions and 0 deletions

View File

@@ -220,12 +220,24 @@ namespace hex {
getEntries().push_back(ContentRegistry::CommandPaletteCommands::Entry { type, command, unlocalizedDescription, displayCallback, executeCallback });
}
void addHandler(Type type, const std::string &command, const QueryCallback &queryCallback, const DisplayCallback &displayCallback) {
log::debug("Registered new command palette command handler: {}", command);
getHandlers().push_back(ContentRegistry::CommandPaletteCommands::Handler { type, command, queryCallback, displayCallback });
}
std::vector<Entry> &getEntries() {
static std::vector<Entry> commands;
return commands;
}
std::vector<Handler> &getHandlers() {
static std::vector<Handler> commands;
return commands;
}
}