res/bindings.toml moved to res/config

This commit is contained in:
MihailRis 2024-06-02 21:42:51 +03:00
parent 3a6fa57630
commit d3e34741e0
2 changed files with 14 additions and 8 deletions

View File

@ -252,6 +252,16 @@ void Engine::loadAssets() {
assets.reset(new_assets.release());
}
static void load_configs(const fs::path& root) {
auto configFolder = root/fs::path("config");
auto bindsFile = configFolder/fs::path("bindings.toml");
if (fs::is_regular_file(bindsFile)) {
Events::loadBindingsToml(
bindsFile.u8string(), files::read_string(bindsFile)
);
}
}
void Engine::loadContent() {
auto resdir = paths->getResources();
ContentBuilder contentBuilder;
@ -274,14 +284,10 @@ void Engine::loadContent() {
ContentLoader loader(&pack);
loader.load(contentBuilder);
auto configFolder = pack.folder/fs::path("config");
auto bindsFile = configFolder/fs::path("bindings.toml");
if (fs::is_regular_file(bindsFile)) {
Events::loadBindingsToml(
bindsFile.u8string(), files::read_string(bindsFile)
);
}
}
load_configs(pack.folder);
}
load_configs(paths->getResources());
content = contentBuilder.build();
resPaths = std::make_unique<ResPaths>(resdir, resRoots);