feat: Added basic network interface support

This commit is contained in:
WerWolv
2023-05-15 11:30:24 +02:00
parent e685d65be8
commit c006062540
12 changed files with 194 additions and 2 deletions

View 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 { };
});
}
}