[studio] Add File -> Reload Project menu item

This commit is contained in:
2025-07-30 00:37:23 -05:00
parent 07e5bf9054
commit 2f36a3f6f0
2 changed files with 14 additions and 5 deletions

View File

@@ -185,10 +185,15 @@ ox::Error Project::writeObj(ox::StringViewCR path, T const &obj) noexcept {
template<typename T>
ox::Result<T> Project::loadObj(ox::StringViewCR path) const noexcept {
OX_REQUIRE(buff, loadBuff(path));
OX_REQUIRE_M(buff, loadBuff(path));
if constexpr(ox::is_same_v<T, ox::ModelObject>) {
return keel::readAsset(m_typeStore, buff);
} else {
OX_REQUIRE(typeId, keel::readAssetTypeId(buff));
if (typeId != ox::ModelTypeId_v<T>) {
OX_REQUIRE(ah, keel::readAssetHeader(buff));
OX_RETURN_ERROR(keel::convertBuffToBuff<T>(m_kctx, buff, ah.clawHdr.fmt).moveTo(buff));
}
return keel::readAsset<T>(buff);
}
}