|
|
@ -19,8 +19,7 @@ namespace MWLua
|
|
|
|
auto vfs = MWBase::Environment::get().getResourceSystem()->getVFS();
|
|
|
|
auto vfs = MWBase::Environment::get().getResourceSystem()->getVFS();
|
|
|
|
|
|
|
|
|
|
|
|
api["loadYaml"] = [lua = context.mLua, vfs](std::string_view fileName) {
|
|
|
|
api["loadYaml"] = [lua = context.mLua, vfs](std::string_view fileName) {
|
|
|
|
auto normalizedName = VFS::Path::normalizeFilename(fileName);
|
|
|
|
Files::IStreamPtr file = vfs->get(VFS::Path::Normalized(fileName));
|
|
|
|
auto file = vfs->getNormalized(normalizedName);
|
|
|
|
|
|
|
|
return LuaUtil::YamlLoader::load(*file, lua->sol());
|
|
|
|
return LuaUtil::YamlLoader::load(*file, lua->sol());
|
|
|
|
};
|
|
|
|
};
|
|
|
|
api["decodeYaml"] = [lua = context.mLua](std::string_view inputData) {
|
|
|
|
api["decodeYaml"] = [lua = context.mLua](std::string_view inputData) {
|
|
|
|