Add Rom dependency injection to OverworldEditor

This commit is contained in:
scawful
2024-12-31 11:43:33 -05:00
parent 1ca1e5f17a
commit 33dc1983bc
4 changed files with 38 additions and 56 deletions

View File

@@ -48,12 +48,11 @@ bool IsEditorActive(Editor *editor, std::vector<Editor *> &active_editors) {
} // namespace
void EditorManager::SetupScreen(std::string filename) {
void EditorManager::Initialize(std::string filename) {
if (!filename.empty()) {
PRINT_IF_ERROR(rom()->LoadFromFile(filename));
}
overworld_editor_.InitializeZeml();
InitializeCommands();
overworld_editor_.Initialize();
}
absl::Status EditorManager::Update() {
@@ -298,11 +297,6 @@ void EditorManager::ManageKeyboardShortcuts() {
}
}
void EditorManager::InitializeCommands() {
editor_context_.command_manager.RegisterPrefix("window", 'w',
"window management", "");
}
void EditorManager::DrawStatusPopup() {
static absl::Status prev_status;
if (!status_.ok()) {