fix headless mode
This commit is contained in:
parent
8a74c65812
commit
62518f0658
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "io/io.hpp"
|
#include "io/io.hpp"
|
||||||
#include "io/engine_paths.hpp"
|
#include "io/engine_paths.hpp"
|
||||||
#include "coders/toml.hpp"
|
|
||||||
#include "Content.hpp"
|
#include "Content.hpp"
|
||||||
#include "ContentPack.hpp"
|
#include "ContentPack.hpp"
|
||||||
#include "ContentBuilder.hpp"
|
#include "ContentBuilder.hpp"
|
||||||
@ -10,18 +9,10 @@
|
|||||||
#include "PacksManager.hpp"
|
#include "PacksManager.hpp"
|
||||||
#include "objects/rigging.hpp"
|
#include "objects/rigging.hpp"
|
||||||
#include "logic/scripting/scripting.hpp"
|
#include "logic/scripting/scripting.hpp"
|
||||||
#include "window/input.hpp"
|
|
||||||
#include "core_defs.hpp"
|
#include "core_defs.hpp"
|
||||||
|
|
||||||
static void load_configs(Input& input, const io::path& root) {
|
static void load_configs(Input& input, const io::path& root) {
|
||||||
auto configFolder = root / "config";
|
auto configFolder = root / "config";
|
||||||
auto bindsFile = configFolder / "bindings.toml";
|
|
||||||
if (io::is_regular_file(bindsFile)) {
|
|
||||||
input.getBindings().read(
|
|
||||||
toml::parse(bindsFile.string(), io::read_string(bindsFile)),
|
|
||||||
BindType::BIND
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentControl::ContentControl(
|
ContentControl::ContentControl(
|
||||||
|
|||||||
@ -136,6 +136,18 @@ void Engine::initialize(CoreParameters coreParameters) {
|
|||||||
content = std::make_unique<ContentControl>(paths, *input, [this]() {
|
content = std::make_unique<ContentControl>(paths, *input, [this]() {
|
||||||
langs::setup(langs::get_current(), paths.resPaths.collectRoots());
|
langs::setup(langs::get_current(), paths.resPaths.collectRoots());
|
||||||
if (!isHeadless()) {
|
if (!isHeadless()) {
|
||||||
|
for (auto& pack : content->getAllContentPacks()) {
|
||||||
|
auto configFolder = pack.folder / "config";
|
||||||
|
auto bindsFile = configFolder / "bindings.toml";
|
||||||
|
if (io::is_regular_file(bindsFile)) {
|
||||||
|
input->getBindings().read(
|
||||||
|
toml::parse(
|
||||||
|
bindsFile.string(), io::read_string(bindsFile)
|
||||||
|
),
|
||||||
|
BindType::BIND
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
loadAssets();
|
loadAssets();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user