[jasper/world/studio] Fix WorldEditor to pull in resource updates
All checks were successful
Build / build (push) Successful in 3m9s

This commit is contained in:
Gary Talent 2024-05-22 23:24:08 -05:00
parent 542e492830
commit ded73a0b4c
2 changed files with 8 additions and 5 deletions

View File

@ -239,11 +239,14 @@ void WorldEditorImGui::rmObjSet() noexcept {
pushCommand<RmObjectSet>(m_doc, m_palMgr.selectedIdx);
}
ox::Error WorldEditorImGui::handleObjectSetUpdate(ox::StringView path) noexcept {
if (ox::any_of(m_doc.objSets.begin(), m_doc.objSets.end(), [path](ObjectSetEntry const&set) {
return set.path == path;
})) {
ox::Error WorldEditorImGui::handleObjectSetUpdate(ox::StringView, ox::UUID const&uuid) noexcept {
auto const matches = [uuid](ObjectSetEntry const&set) {
auto const [setUuid, err] = keel::uuidUrlToUuid(set.path);
return !err && setUuid == uuid;
};
if (ox::any_of(m_doc.objSets.begin(), m_doc.objSets.end(), matches)) {
oxReturnError(buildObjCache(keelCtx(m_sctx.tctx), m_doc).moveTo(m_objCache));
oxReturnError(loadWorldStatic(m_objCache, m_doc).moveTo(m_worldStatic));
}
return loadObjectSets();
}

View File

@ -72,7 +72,7 @@ class WorldEditorImGui: public studio::Editor {
void rmObjSet() noexcept;
// handles the updating of an object set in case it is one used by this world
ox::Error handleObjectSetUpdate(ox::StringView path) noexcept;
ox::Error handleObjectSetUpdate(ox::StringView path, ox::UUID const&) noexcept;
ox::Error loadObjectSets() noexcept;