mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 05:05:19 -05:00
feat: Added basic network interface support
This commit is contained in:
17
plugins/builtin/source/content/communication_interface.cpp
Normal file
17
plugins/builtin/source/content/communication_interface.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
void registerNetworkEndpoints() {
|
||||
ContentRegistry::CommunicationInterface::registerNetworkEndpoint("pattern_editor/set_code", [](const nlohmann::json &data) -> nlohmann::json {
|
||||
auto code = data["code"].get<std::string>();
|
||||
|
||||
EventManager::post<RequestSetPatternLanguageCode>(code);
|
||||
|
||||
return { };
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user