[nostalgia/studio] Update for new model type store system
This commit is contained in:
parent
885f4a8713
commit
717bbd2e0f
@ -103,15 +103,22 @@ ox::Error Project::writeObj(const ox::String &path, auto *obj) const noexcept {
|
||||
// write to FS
|
||||
oxReturnError(writeBuff(path, buff));
|
||||
// write type descriptor
|
||||
oxRequire(type, ox::buildTypeDef(obj));
|
||||
oxRequireM(typeOut, ox::writeClaw(type.get(), ox::ClawFormat::Organic));
|
||||
ox::TypeStore typeStore;
|
||||
oxReturnError(ox::buildTypeDef(&typeStore, obj));
|
||||
// write out type store
|
||||
static constexpr auto descPath = "/.nostalgia/type_descriptors";
|
||||
oxReturnError(mkdir(descPath));
|
||||
for (const auto t : typeStore.typeList()) {
|
||||
if (t->typeName.beginsWith("B:")) {
|
||||
continue;
|
||||
}
|
||||
oxRequireM(typeOut, ox::writeClaw(t, ox::ClawFormat::Organic));
|
||||
// replace garbage last character with new line
|
||||
typeOut.back().value = '\n';
|
||||
// write to FS
|
||||
static constexpr auto descPath = "/.nostalgia/type_descriptors";
|
||||
const auto typePath = ox::sfmt("{}/{}", descPath, type->typeName);
|
||||
oxReturnError(mkdir(descPath));
|
||||
const auto typePath = ox::sfmt("{}/{}", descPath, t->typeName);
|
||||
oxReturnError(writeBuff(typePath, typeOut));
|
||||
}
|
||||
fileUpdated.emit(path);
|
||||
return OxError(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user