mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
build: Refactor ContentRegistry into multiple separate files
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
#include <hex/plugin.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/content_registry/user_interface.hpp>
|
||||
#include <hex/api/task_manager.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
|
||||
@@ -86,7 +86,7 @@ std::vector<const Script*> loadAllScripts() {
|
||||
void addScriptsMenu() {
|
||||
static std::vector<const Script*> scripts;
|
||||
static TaskHolder runnerTask, updaterTask;
|
||||
hex::ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.extras" }, 5000, [] {
|
||||
hex::ContentRegistry::UserInterface::addMenuItemSubMenu({ "hex.builtin.menu.extras" }, 5000, [] {
|
||||
static bool menuJustOpened = true;
|
||||
|
||||
if (menu::beginMenuEx("hex.script_loader.menu.run_script"_lang, ICON_VS_LIBRARY)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <script_api.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/content_registry/provider.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <script_api.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/content_registry/views.hpp>
|
||||
#include <hex/api/content_registry/user_interface.hpp>
|
||||
|
||||
#include <hex/api/imhex_api/system.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
@@ -182,5 +183,5 @@ SCRIPT_API(void registerView, const char *icon, const char *name, void *drawFunc
|
||||
|
||||
SCRIPT_API(void addMenuItem, const char *icon, const char *menuName, const char *itemName, void *function) {
|
||||
using MenuFunction = void(*)();
|
||||
ContentRegistry::Interface::addMenuItem({ menuName, itemName }, icon, 9999, Shortcut::None, reinterpret_cast<MenuFunction>(function));
|
||||
ContentRegistry::UserInterface::addMenuItem({ menuName, itemName }, icon, 9999, Shortcut::None, reinterpret_cast<MenuFunction>(function));
|
||||
}
|
||||
Reference in New Issue
Block a user