Refactor LoadAssets method in EditorManager to streamline asset loading

This commit is contained in:
scawful
2025-05-05 11:42:37 -04:00
parent c08386801e
commit cb2473e656
2 changed files with 9 additions and 7 deletions

View File

@@ -548,13 +548,16 @@ absl::Status EditorManager::LoadAssets() {
} }
current_editor_set_->overworld_editor_.Initialize(); current_editor_set_->overworld_editor_.Initialize();
current_editor_set_->message_editor_.Initialize(); current_editor_set_->message_editor_.Initialize();
ASSIGN_OR_RETURN(*gfx::Arena::Get().mutable_gfx_sheets(),
auto &sheet_manager = gfx::Arena::Get();
ASSIGN_OR_RETURN(*sheet_manager.mutable_gfx_sheets(),
LoadAllGraphicsData(*current_rom_)); LoadAllGraphicsData(*current_rom_));
for (auto &editor : current_editor_set_->active_editors_) { RETURN_IF_ERROR(current_editor_set_->overworld_editor_.Load());
RETURN_IF_ERROR(editor->Load()); RETURN_IF_ERROR(current_editor_set_->dungeon_editor_.Load());
} RETURN_IF_ERROR(current_editor_set_->screen_editor_.Load());
RETURN_IF_ERROR(current_editor_set_->settings_editor_.Load());
RETURN_IF_ERROR(current_editor_set_->sprite_editor_.Load());
RETURN_IF_ERROR(current_editor_set_->message_editor_.Load());
RETURN_IF_ERROR(current_editor_set_->music_editor_.Load());
RETURN_IF_ERROR(current_editor_set_->palette_editor_.Load());
return absl::OkStatus(); return absl::OkStatus();
} }

View File

@@ -20,7 +20,6 @@
#include "app/editor/system/popup_manager.h" #include "app/editor/system/popup_manager.h"
#include "app/editor/system/settings_editor.h" #include "app/editor/system/settings_editor.h"
#include "app/emu/emulator.h" #include "app/emu/emulator.h"
#include "app/gui/input.h"
#include "app/rom.h" #include "app/rom.h"
#include "yaze_config.h" #include "yaze_config.h"