Refactor asset loading in EditorManager to iterate over active editors; streamline loading process for better scalability and maintainability.

This commit is contained in:
scawful
2025-04-29 13:38:47 -04:00
parent ad60cd3fd3
commit dcd7a81432
2 changed files with 3 additions and 10 deletions

View File

@@ -551,8 +551,9 @@ absl::Status EditorManager::LoadAssets() {
auto &sheet_manager = GraphicsSheetManager::GetInstance();
ASSIGN_OR_RETURN(*sheet_manager.mutable_gfx_sheets(),
LoadAllGraphicsData(*current_rom_));
RETURN_IF_ERROR(current_editor_set_->overworld_editor_.Load());
RETURN_IF_ERROR(current_editor_set_->dungeon_editor_.Load());
for (auto &editor : current_editor_set_->active_editors_) {
RETURN_IF_ERROR(editor->Load());
}
return absl::OkStatus();
}