feat: custom languages syntax (WIP)

This commit is contained in:
MihailRis
2025-04-13 00:19:38 +03:00
parent 4360cd408b
commit 5253be6c56
18 changed files with 278 additions and 88 deletions
+3
View File
@@ -12,6 +12,7 @@
#include "coders/json.hpp"
#include "coders/toml.hpp"
#include "coders/commons.hpp"
#include "devtools/Editor.hpp"
#include "content/ContentControl.hpp"
#include "core_defs.hpp"
#include "io/io.hpp"
@@ -73,6 +74,7 @@ Engine& Engine::getInstance() {
void Engine::initialize(CoreParameters coreParameters) {
params = std::move(coreParameters);
settingsHandler = std::make_unique<SettingsHandler>(settings);
editor = std::make_unique<devtools::Editor>(*this);
cmd = std::make_unique<cmd::CommandsInterpreter>();
network = network::Network::create(settings.network);
@@ -134,6 +136,7 @@ void Engine::initialize(CoreParameters coreParameters) {
);
}
content = std::make_unique<ContentControl>(paths, *input, [this]() {
editor->loadTools();
langs::setup(langs::get_current(), paths.resPaths.collectRoots());
if (!isHeadless()) {
for (auto& pack : content->getAllContentPacks()) {
+9
View File
@@ -33,6 +33,10 @@ namespace network {
class Network;
}
namespace devtools {
class Editor;
}
class initialize_error : public std::runtime_error {
public:
initialize_error(const std::string& message) : std::runtime_error(message) {}
@@ -63,6 +67,7 @@ class Engine : public util::ObjectsKeeper {
std::unique_ptr<Window> window;
std::unique_ptr<Input> input;
std::unique_ptr<gui::GUI> gui;
std::unique_ptr<devtools::Editor> editor;
PostRunnables postRunnables;
Time time;
OnWorldOpen levelConsumer;
@@ -161,4 +166,8 @@ public:
cmd::CommandsInterpreter& getCmd() {
return *cmd;
}
devtools::Editor& getEditor() {
return *editor;
}
};