yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::EditorManager Class Reference

The EditorManager controls the main editor window and manages the various editor classes. More...

#include <editor_manager.h>

Classes

class  SessionScope
 

Public Member Functions

 EditorManager ()
 
 ~EditorManager ()
 
void Initialize (gfx::IRenderer *renderer, const std::string &filename="")
 
void OpenEditorAndCardsFromFlags (const std::string &editor_name, const std::string &cards_str)
 
absl::Status Update ()
 Main update loop for the editor application.
 
void DrawMenuBar ()
 Draw the main menu bar.
 
auto emulator () -> emu::Emulator &
 
auto quit () const
 
auto version () const
 
MenuBuildermenu_builder ()
 
WorkspaceManagerworkspace_manager ()
 
absl::Status SetCurrentRom (Rom *rom)
 
auto GetCurrentRom () const -> Rom *
 
auto GetCurrentEditorSet () const -> EditorSet *
 
auto GetCurrentEditor () const -> Editor *
 
size_t GetCurrentSessionId () const
 
UICoordinatorui_coordinator ()
 
auto overworld () const -> yaze::zelda3::Overworld *
 
size_t GetCurrentSessionIndex () const
 
core::FeatureFlags::FlagsGetCurrentFeatureFlags ()
 
void SetFontGlobalScale (float scale)
 
void RefreshWorkspacePresets ()
 
void SaveWorkspacePreset (const std::string &name)
 
void LoadWorkspacePreset (const std::string &name)
 
void JumpToDungeonRoom (int room_id)
 
void JumpToOverworldMap (int map_id)
 
void SwitchToEditor (EditorType editor_type)
 
bool IsSidebarVisible () const
 
void SetSidebarVisible (bool visible)
 
void HideCurrentEditorCards ()
 
void CreateNewSession ()
 
void DuplicateCurrentSession ()
 
void CloseCurrentSession ()
 
void RemoveSession (size_t index)
 
void SwitchToSession (size_t index)
 
size_t GetActiveSessionCount () const
 
void SaveWorkspaceLayout ()
 
void LoadWorkspaceLayout ()
 
void ResetWorkspaceLayout ()
 
void ShowAllWindows ()
 
void HideAllWindows ()
 
void LoadDeveloperLayout ()
 
void LoadDesignerLayout ()
 
void LoadModderLayout ()
 
std::string GenerateUniqueEditorTitle (EditorType type, size_t session_index) const
 
bool HasDuplicateSession (const std::string &filepath)
 
void RenameSession (size_t index, const std::string &new_name)
 
void Quit ()
 
void ShowGlobalSearch ()
 
void ShowCommandPalette ()
 
void ShowPerformanceDashboard ()
 
void ShowImGuiDemo ()
 
void ShowImGuiMetrics ()
 
void ShowHexEditor ()
 
void ShowEmulator ()
 
void ShowMemoryEditor ()
 
void ShowResourceLabelManager ()
 
void ShowCardBrowser ()
 
void ShowWelcomeScreen ()
 
absl::Status LoadRom ()
 Load a ROM file into a new or existing session.
 
absl::Status SaveRom ()
 Save the current ROM file.
 
absl::Status SaveRomAs (const std::string &filename)
 
absl::Status OpenRomOrProject (const std::string &filename)
 
absl::Status CreateNewProject (const std::string &template_name="Basic ROM Hack")
 
absl::Status OpenProject ()
 
absl::Status SaveProject ()
 
absl::Status SaveProjectAs ()
 
absl::Status ImportProject (const std::string &project_path)
 
absl::Status RepairCurrentProject ()
 

Static Public Member Functions

static bool IsCardBasedEditor (EditorType type)
 

Private Member Functions

absl::Status DrawRomSelector ()=delete
 
void DrawContextSensitiveCardControl ()
 
absl::Status LoadAssets ()
 
void InitializeTestSuites ()
 
void ConfigureEditorDependencies (EditorSet *editor_set, Rom *rom, size_t session_id)
 Injects dependencies into all editors within an EditorSet.
 

Private Attributes

bool quit_ = false
 
bool show_workspace_layout = false
 
size_t session_to_rename_ = 0
 
char session_rename_buffer_ [256] = {}
 
ProposalDrawer proposal_drawer_
 
bool show_proposal_drawer_ = false
 
AgentChatHistoryPopup agent_chat_history_popup_
 
bool show_chat_history_popup_ = false
 
ProjectFileEditor project_file_editor_
 
EditorSelectionDialog editor_selection_dialog_
 
WelcomeScreen welcome_screen_
 
std::string version_ = ""
 
absl::Status status_
 
emu::Emulator emulator_
 
std::deque< RomSessionsessions_
 
Editorcurrent_editor_ = nullptr
 
EditorSet blank_editor_set_ {}
 
gfx::IRendererrenderer_ = nullptr
 
project::YazeProject current_project_
 
EditorDependencies::SharedClipboard shared_clipboard_
 
std::unique_ptr< PopupManagerpopup_manager_
 
ToastManager toast_manager_
 
MenuBuilder menu_builder_
 
ShortcutManager shortcut_manager_
 
UserSettings user_settings_
 
EditorCardRegistry card_registry_
 
EditorRegistry editor_registry_
 
std::unique_ptr< MenuOrchestratormenu_orchestrator_
 
ProjectManager project_manager_
 
RomFileManager rom_file_manager_
 
std::unique_ptr< UICoordinatorui_coordinator_
 
WindowDelegate window_delegate_
 
std::unique_ptr< SessionCoordinatorsession_coordinator_
 
std::unique_ptr< LayoutManagerlayout_manager_
 
WorkspaceManager workspace_manager_ {&toast_manager_}
 
float autosave_timer_ = 0.0f
 

Detailed Description

The EditorManager controls the main editor window and manages the various editor classes.

The EditorManager class contains instances of various editor classes such as AssemblyEditor, DungeonEditor, GraphicsEditor, MusicEditor, OverworldEditor, PaletteEditor, ScreenEditor, and SpriteEditor. The current_editor_ member variable points to the currently active editor in the tab view.

Definition at line 66 of file editor_manager.h.

Constructor & Destructor Documentation

◆ EditorManager()

◆ ~EditorManager()

yaze::editor::EditorManager::~EditorManager ( )
default

Member Function Documentation

◆ Initialize()

void yaze::editor::EditorManager::Initialize ( gfx::IRenderer renderer,
const std::string &  filename = "" 
)

Definition at line 240 of file editor_manager.cc.

References yaze::editor::AgentChatWidget::Z3EDCommandCallbacks::accept_proposal, agent_chat_history_popup_, yaze::cli::GeminiConfig::api_key, yaze::editor::AgentChatWidget::MultimodalCallbacks::capture_snapshot, card_registry_, yaze::editor::ConfigureEditorShortcuts(), yaze::editor::ConfigureMenuShortcuts(), CreateNewProject(), yaze::editor::AgentChatWidget::Z3EDCommandCallbacks::diff_proposal, yaze::editor::ShortcutDependencies::editor_manager, yaze::editor::ShortcutDependencies::editor_registry, editor_registry_, editor_selection_dialog_, emulator_, yaze::editor::AgentChatWidget::AutomationCallbacks::focus_proposal, yaze::editor::ProposalDrawer::FocusProposal(), yaze::editor::UserSettings::Preferences::font_global_scale, yaze::cli::GeminiAIService::GenerateMultimodalResponse(), yaze::test::TestManager::Get(), GetCurrentRom(), ICON_MD_AUDIO_FILE, ICON_MD_AUDIOTRACK, ICON_MD_BUG_REPORT, ICON_MD_KEYBOARD, ICON_MD_MEMORY, ICON_MD_PREVIEW, ICON_MD_SAVE, ICON_MD_SMART_TOY, ICON_MD_SPEED, ICON_MD_STOP, ICON_MD_VIDEOGAME_ASSET, InitializeTestSuites(), yaze::cli::agent::ChatMessage::kAgent, yaze::editor::kInfo, yaze::editor::AgentChatWidget::Z3EDCommandCallbacks::list_proposals, yaze::editor::UserSettings::Load(), LoadRom(), LOG_WARN, yaze::editor::EditorSelectionDialog::MarkRecentlyUsed(), yaze::editor::ShortcutDependencies::menu_orchestrator, menu_orchestrator_, yaze::cli::agent::ChatMessage::message, yaze::cli::GeminiConfig::model, yaze::editor::AgentChatWidget::AutomationCallbacks::open_harness_dashboard, OpenRomOrProject(), yaze::editor::ShortcutDependencies::popup_manager, popup_manager_, yaze::editor::UserSettings::prefs(), PRINT_IF_ERROR, project_file_editor_, yaze::editor::ShortcutDependencies::project_manager, project_manager_, proposal_drawer_, yaze::editor::EditorCardRegistry::RegisterCard(), yaze::editor::AgentChatWidget::Z3EDCommandCallbacks::reject_proposal, renderer_, yaze::editor::AgentChatWidget::AutomationCallbacks::replay_last_plan, yaze::test::TestManager::ReplayLastPlan(), yaze::editor::ShortcutDependencies::rom_file_manager, rom_file_manager_, yaze::editor::AgentChatWidget::MultimodalCallbacks::send_to_gemini, yaze::cli::agent::ChatMessage::sender, yaze::editor::ShortcutDependencies::session_coordinator, session_coordinator_, yaze::emu::Emulator::set_card_registry(), yaze::editor::WorkspaceManager::set_card_registry(), yaze::editor::WelcomeScreen::SetNewProjectCallback(), yaze::editor::WelcomeScreen::SetOpenProjectCallback(), yaze::editor::WelcomeScreen::SetOpenRomCallback(), yaze::editor::EditorSelectionDialog::SetSelectionCallback(), yaze::editor::AgentChatHistoryPopup::SetToastManager(), yaze::editor::ProjectFileEditor::SetToastManager(), shortcut_manager_, yaze::editor::ProposalDrawer::Show(), yaze::editor::ToastManager::Show(), yaze::editor::AgentChatWidget::AutomationCallbacks::show_active_tests, yaze::editor::UserSettings::Preferences::show_welcome_on_startup, yaze::editor::EditorCardRegistry::ShowCard(), yaze::test::TestManager::ShowHarnessActiveTests(), yaze::test::TestManager::ShowHarnessDashboard(), status_, SwitchToEditor(), yaze::cli::agent::ChatMessage::timestamp, yaze::editor::ShortcutDependencies::toast_manager, toast_manager_, yaze::editor::ShortcutDependencies::ui_coordinator, ui_coordinator_, user_settings_, yaze::cli::GeminiConfig::verbose, welcome_screen_, yaze::editor::ShortcutDependencies::workspace_manager, and workspace_manager_.

Referenced by yaze::Controller::OnEntry().

◆ OpenEditorAndCardsFromFlags()

void yaze::editor::EditorManager::OpenEditorAndCardsFromFlags ( const std::string &  editor_name,
const std::string &  cards_str 
)

Definition at line 560 of file editor_manager.cc.

References GetCurrentEditorSet(), yaze::editor::kDungeon, yaze::editor::kSettings, yaze::editor::kUnknown, LOG_DEBUG, LOG_INFO, and LOG_WARN.

Referenced by yaze::Controller::SetStartupEditor().

Here is the call graph for this function:

◆ Update()

absl::Status yaze::editor::EditorManager::Update ( )

Main update loop for the editor application.

DELEGATION FLOW:

  1. Update timing manager for accurate delta time
  2. Draw popups (PopupManager) - modal dialogs across all sessions
  3. Execute shortcuts (ShortcutManager) - keyboard input handling
  4. Draw toasts (ToastManager) - user notifications
  5. Iterate all sessions and update active editors
  6. Draw session UI (SessionCoordinator) - session switcher, manager
  7. Draw sidebar (EditorCardRegistry) - card-based editor UI

Note: EditorManager retains the main loop to coordinate multi-session updates, but delegates specific drawing/state operations to specialized components.

Definition at line 649 of file editor_manager.cc.

References yaze::editor::UserSettings::Preferences::autosave_enabled, yaze::editor::UserSettings::Preferences::autosave_interval, autosave_timer_, yaze::Rom::SaveSettings::backup, card_registry_, current_editor_, yaze::editor::ProposalDrawer::Draw(), yaze::editor::ToastManager::Draw(), yaze::editor::EditorCardRegistry::DrawCardBrowser(), yaze::editor::EditorCardRegistry::DrawSidebar(), editor_selection_dialog_, yaze::editor::ExecuteShortcuts(), GenerateUniqueEditorTitle(), yaze::gfx::PerformanceDashboard::Get(), yaze::gui::BackgroundRenderer::Get(), yaze::gui::ThemeManager::Get(), yaze::TimingManager::Get(), yaze::test::TestManager::Get(), yaze::editor::EditorCardRegistry::GetActiveCategory(), GetCurrentEditorSet(), GetCurrentRom(), yaze::editor::EditorRegistry::GetEditorCategory(), yaze::editor::EditorRegistry::GetEditorTypeFromCategory(), IsCardBasedEditor(), yaze::editor::OverworldEditor::jump_to_tab_, yaze::editor::kError, yaze::editor::kOverworld, yaze::editor::kSuccess, yaze::editor::kUnknown, LOG_DEBUG, popup_manager_, yaze::editor::UserSettings::prefs(), proposal_drawer_, yaze::gfx::PerformanceDashboard::Render(), yaze::Rom::SaveSettings::save_new, session_coordinator_, sessions_, yaze::editor::EditorCardRegistry::SetActiveCategory(), yaze::test::TestManager::SetCurrentRom(), shortcut_manager_, yaze::editor::EditorSelectionDialog::Show(), yaze::editor::ToastManager::Show(), status_, SwitchToEditor(), toast_manager_, ui_coordinator_, yaze::TimingManager::Update(), yaze::editor::Editor::Update(), and user_settings_.

Referenced by yaze::Controller::OnLoad().

◆ DrawMenuBar()

◆ emulator()

auto yaze::editor::EditorManager::emulator ( ) -> emu::Emulator&
inline

Definition at line 80 of file editor_manager.h.

References emulator_.

Referenced by yaze::Controller::OnEntry().

◆ quit()

auto yaze::editor::EditorManager::quit ( ) const
inline

Definition at line 81 of file editor_manager.h.

References quit_.

Referenced by yaze::Controller::OnLoad().

◆ version()

auto yaze::editor::EditorManager::version ( ) const
inline

◆ menu_builder()

MenuBuilder & yaze::editor::EditorManager::menu_builder ( )
inline

Definition at line 84 of file editor_manager.h.

References menu_builder_.

◆ workspace_manager()

WorkspaceManager * yaze::editor::EditorManager::workspace_manager ( )
inline

◆ SetCurrentRom()

absl::Status yaze::editor::EditorManager::SetCurrentRom ( Rom rom)

Definition at line 1505 of file editor_manager.cc.

References yaze::test::TestManager::Get(), GetCurrentRom(), session_coordinator_, sessions_, and yaze::test::TestManager::SetCurrentRom().

Here is the call graph for this function:

◆ GetCurrentRom()

◆ GetCurrentEditorSet()

auto yaze::editor::EditorManager::GetCurrentEditorSet ( ) const -> EditorSet*
inline

◆ GetCurrentEditor()

◆ GetCurrentSessionId()

size_t yaze::editor::EditorManager::GetCurrentSessionId ( ) const
inline

◆ ui_coordinator()

UICoordinator * yaze::editor::EditorManager::ui_coordinator ( )
inline

◆ overworld()

auto yaze::editor::EditorManager::overworld ( ) const -> yaze::zelda3::Overworld*
inline

Definition at line 93 of file editor_manager.h.

References GetCurrentEditorSet().

Referenced by yaze::Controller::overworld().

Here is the call graph for this function:

◆ GetCurrentSessionIndex()

size_t yaze::editor::EditorManager::GetCurrentSessionIndex ( ) const

Definition at line 1606 of file editor_manager.cc.

References GetCurrentRom(), session_coordinator_, and sessions_.

Referenced by GetCurrentFeatureFlags(), SaveProject(), and SaveRomAs().

Here is the call graph for this function:

◆ GetCurrentFeatureFlags()

core::FeatureFlags::Flags * yaze::editor::EditorManager::GetCurrentFeatureFlags ( )
inline

Definition at line 104 of file editor_manager.h.

References yaze::core::FeatureFlags::get(), GetCurrentSessionIndex(), and sessions_.

Here is the call graph for this function:

◆ SetFontGlobalScale()

void yaze::editor::EditorManager::SetFontGlobalScale ( float  scale)
inline

◆ RefreshWorkspacePresets()

void yaze::editor::EditorManager::RefreshWorkspacePresets ( )
inline

Definition at line 123 of file editor_manager.h.

References yaze::editor::WorkspaceManager::RefreshPresets(), and workspace_manager_.

Referenced by yaze::editor::UICoordinator::DrawWorkspacePresetDialogs().

Here is the call graph for this function:

◆ SaveWorkspacePreset()

void yaze::editor::EditorManager::SaveWorkspacePreset ( const std::string &  name)
inline

Definition at line 124 of file editor_manager.h.

References yaze::editor::WorkspaceManager::SaveWorkspacePreset(), and workspace_manager_.

Referenced by yaze::editor::UICoordinator::DrawWorkspacePresetDialogs().

Here is the call graph for this function:

◆ LoadWorkspacePreset()

void yaze::editor::EditorManager::LoadWorkspacePreset ( const std::string &  name)
inline

Definition at line 127 of file editor_manager.h.

References yaze::editor::WorkspaceManager::LoadWorkspacePreset(), and workspace_manager_.

Referenced by yaze::editor::UICoordinator::DrawWorkspacePresetDialogs().

Here is the call graph for this function:

◆ JumpToDungeonRoom()

void yaze::editor::EditorManager::JumpToDungeonRoom ( int  room_id)

Definition at line 1654 of file editor_manager.cc.

References GetCurrentEditorSet(), yaze::editor::kDungeon, and SwitchToEditor().

Here is the call graph for this function:

◆ JumpToOverworldMap()

void yaze::editor::EditorManager::JumpToOverworldMap ( int  map_id)

Definition at line 1665 of file editor_manager.cc.

References GetCurrentEditorSet(), yaze::editor::kOverworld, and SwitchToEditor().

Here is the call graph for this function:

◆ SwitchToEditor()

◆ IsCardBasedEditor()

bool yaze::editor::EditorManager::IsCardBasedEditor ( EditorType  type)
static

Definition at line 97 of file editor_manager.cc.

References yaze::editor::EditorRegistry::IsCardBasedEditor().

Referenced by SwitchToEditor(), and Update().

Here is the call graph for this function:

◆ IsSidebarVisible()

bool yaze::editor::EditorManager::IsSidebarVisible ( ) const
inline

Definition at line 138 of file editor_manager.h.

References ui_coordinator_.

◆ SetSidebarVisible()

void yaze::editor::EditorManager::SetSidebarVisible ( bool  visible)
inline

Definition at line 141 of file editor_manager.h.

References ui_coordinator_.

◆ HideCurrentEditorCards()

void yaze::editor::EditorManager::HideCurrentEditorCards ( )

◆ CreateNewSession()

◆ DuplicateCurrentSession()

◆ CloseCurrentSession()

void yaze::editor::EditorManager::CloseCurrentSession ( )

Definition at line 1572 of file editor_manager.cc.

References session_coordinator_.

◆ RemoveSession()

void yaze::editor::EditorManager::RemoveSession ( size_t  index)

Definition at line 1580 of file editor_manager.cc.

References session_coordinator_.

◆ SwitchToSession()

void yaze::editor::EditorManager::SwitchToSession ( size_t  index)

◆ GetActiveSessionCount()

size_t yaze::editor::EditorManager::GetActiveSessionCount ( ) const

Definition at line 1621 of file editor_manager.cc.

References session_coordinator_, and sessions_.

◆ SaveWorkspaceLayout()

void yaze::editor::EditorManager::SaveWorkspaceLayout ( )
inline

Definition at line 160 of file editor_manager.h.

References yaze::editor::WindowDelegate::SaveWorkspaceLayout(), and window_delegate_.

Referenced by yaze::editor::MenuOrchestrator::OnSaveWorkspaceLayout().

Here is the call graph for this function:

◆ LoadWorkspaceLayout()

void yaze::editor::EditorManager::LoadWorkspaceLayout ( )
inline

Definition at line 161 of file editor_manager.h.

References yaze::editor::WindowDelegate::LoadWorkspaceLayout(), and window_delegate_.

Referenced by yaze::editor::MenuOrchestrator::OnLoadWorkspaceLayout().

Here is the call graph for this function:

◆ ResetWorkspaceLayout()

void yaze::editor::EditorManager::ResetWorkspaceLayout ( )
inline

Definition at line 162 of file editor_manager.h.

References yaze::editor::WindowDelegate::ResetWorkspaceLayout(), and window_delegate_.

Referenced by yaze::editor::MenuOrchestrator::OnResetWorkspaceLayout().

Here is the call graph for this function:

◆ ShowAllWindows()

void yaze::editor::EditorManager::ShowAllWindows ( )
inline

Definition at line 163 of file editor_manager.h.

References ui_coordinator_.

Referenced by yaze::editor::MenuOrchestrator::OnShowAllWindows().

◆ HideAllWindows()

void yaze::editor::EditorManager::HideAllWindows ( )
inline

Definition at line 167 of file editor_manager.h.

References ui_coordinator_.

Referenced by yaze::editor::MenuOrchestrator::OnHideAllWindows().

◆ LoadDeveloperLayout()

void yaze::editor::EditorManager::LoadDeveloperLayout ( )
inline

Definition at line 173 of file editor_manager.h.

References yaze::editor::WindowDelegate::LoadDeveloperLayout(), and window_delegate_.

Referenced by yaze::editor::MenuOrchestrator::OnLoadDeveloperLayout().

Here is the call graph for this function:

◆ LoadDesignerLayout()

void yaze::editor::EditorManager::LoadDesignerLayout ( )
inline

Definition at line 174 of file editor_manager.h.

References yaze::editor::WindowDelegate::LoadDesignerLayout(), and window_delegate_.

Referenced by yaze::editor::MenuOrchestrator::OnLoadDesignerLayout().

Here is the call graph for this function:

◆ LoadModderLayout()

void yaze::editor::EditorManager::LoadModderLayout ( )
inline

Definition at line 175 of file editor_manager.h.

References yaze::editor::WindowDelegate::LoadModderLayout(), and window_delegate_.

Referenced by yaze::editor::MenuOrchestrator::OnLoadModderLayout().

Here is the call graph for this function:

◆ GenerateUniqueEditorTitle()

std::string yaze::editor::EditorManager::GenerateUniqueEditorTitle ( EditorType  type,
size_t  session_index 
) const

Definition at line 1636 of file editor_manager.cc.

References yaze::editor::kEditorNames, and session_coordinator_.

Referenced by Update().

◆ HasDuplicateSession()

bool yaze::editor::EditorManager::HasDuplicateSession ( const std::string &  filepath)

Definition at line 1745 of file editor_manager.cc.

References sessions_.

◆ RenameSession()

void yaze::editor::EditorManager::RenameSession ( size_t  index,
const std::string &  new_name 
)

◆ Quit()

void yaze::editor::EditorManager::Quit ( )
inline

Definition at line 182 of file editor_manager.h.

References quit_.

Referenced by yaze::editor::MenuOrchestrator::OnQuit().

◆ ShowGlobalSearch()

void yaze::editor::EditorManager::ShowGlobalSearch ( )
inline

Definition at line 186 of file editor_manager.h.

References ui_coordinator_.

Referenced by yaze::editor::MenuOrchestrator::OnShowGlobalSearch().

◆ ShowCommandPalette()

void yaze::editor::EditorManager::ShowCommandPalette ( )
inline

Definition at line 190 of file editor_manager.h.

References ui_coordinator_.

Referenced by yaze::editor::MenuOrchestrator::OnShowCommandPalette().

◆ ShowPerformanceDashboard()

void yaze::editor::EditorManager::ShowPerformanceDashboard ( )
inline

◆ ShowImGuiDemo()

void yaze::editor::EditorManager::ShowImGuiDemo ( )
inline

Definition at line 198 of file editor_manager.h.

References ui_coordinator_.

Referenced by yaze::editor::MenuOrchestrator::OnShowImGuiDemo().

◆ ShowImGuiMetrics()

void yaze::editor::EditorManager::ShowImGuiMetrics ( )
inline

Definition at line 202 of file editor_manager.h.

References ui_coordinator_.

Referenced by yaze::editor::MenuOrchestrator::OnShowImGuiMetrics().

◆ ShowHexEditor()

void yaze::editor::EditorManager::ShowHexEditor ( )

Definition at line 112 of file editor_manager.cc.

References card_registry_, and yaze::editor::EditorCardRegistry::ShowCard().

Referenced by yaze::editor::MenuOrchestrator::OnShowHexEditor().

Here is the call graph for this function:

◆ ShowEmulator()

void yaze::editor::EditorManager::ShowEmulator ( )
inline

Definition at line 207 of file editor_manager.h.

References ui_coordinator_.

Referenced by yaze::editor::MenuOrchestrator::OnShowEmulator().

◆ ShowMemoryEditor()

void yaze::editor::EditorManager::ShowMemoryEditor ( )
inline

Definition at line 208 of file editor_manager.h.

References ui_coordinator_.

Referenced by yaze::editor::MenuOrchestrator::OnShowMemoryEditor().

◆ ShowResourceLabelManager()

void yaze::editor::EditorManager::ShowResourceLabelManager ( )
inline

◆ ShowCardBrowser()

void yaze::editor::EditorManager::ShowCardBrowser ( )
inline

Definition at line 210 of file editor_manager.h.

References ui_coordinator_.

Referenced by yaze::editor::MenuOrchestrator::OnShowCardBrowser().

◆ ShowWelcomeScreen()

void yaze::editor::EditorManager::ShowWelcomeScreen ( )
inline

Definition at line 214 of file editor_manager.h.

References ui_coordinator_.

Referenced by yaze::editor::MenuOrchestrator::OnShowWelcomeScreen().

◆ LoadRom()

absl::Status yaze::editor::EditorManager::LoadRom ( )

Load a ROM file into a new or existing session.

DELEGATION:

FLOW:

  1. Show file dialog and get filename
  2. Check for duplicate sessions (prevent opening same ROM twice)
  3. Load ROM via RomFileManager into temp_rom
  4. Find empty session or create new session
  5. Move ROM into session and set current pointers
  6. Configure editor dependencies for the session
  7. Load all editor assets
  8. Update UI state and recent files

Definition at line 1107 of file editor_manager.cc.

References yaze::editor::EditorSelectionDialog::ClearRecentEditors(), ConfigureEditorDependencies(), editor_selection_dialog_, yaze::test::TestManager::Get(), GetCurrentEditorSet(), GetCurrentRom(), GetCurrentSessionId(), yaze::project::RecentFilesManager::GetInstance(), yaze::editor::kWarning, LoadAssets(), yaze::editor::RomFileManager::LoadRom(), RETURN_IF_ERROR, rom_file_manager_, session_coordinator_, yaze::test::TestManager::SetCurrentRom(), yaze::editor::ToastManager::Show(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), toast_manager_, and ui_coordinator_.

Referenced by Initialize(), yaze::editor::MenuOrchestrator::OnOpenRom(), and yaze::editor::UICoordinator::UICoordinator().

◆ SaveRom()

absl::Status yaze::editor::EditorManager::SaveRom ( )

Save the current ROM file.

DELEGATION:

RESPONSIBILITIES STILL IN EDITORMANAGER:

  • Coordinating editor saves (dungeon maps, overworld maps, graphics sheets)
  • Checking feature flags to determine what to save
  • Accessing current session's editors

This stays in EditorManager because it requires knowledge of all editors and the order in which they must be saved to maintain ROM integrity.

Definition at line 1212 of file editor_manager.cc.

References yaze::gfx::Arena::Get(), yaze::core::FeatureFlags::get(), GetCurrentEditorSet(), GetCurrentRom(), RETURN_IF_ERROR, rom_file_manager_, yaze::SaveAllGraphicsData(), yaze::zelda3::SaveDungeonMaps(), and yaze::editor::RomFileManager::SaveRom().

Referenced by yaze::editor::MenuOrchestrator::OnSaveRom().

◆ SaveRomAs()

◆ OpenRomOrProject()

◆ CreateNewProject()

absl::Status yaze::editor::EditorManager::CreateNewProject ( const std::string &  template_name = "Basic ROM Hack")

◆ OpenProject()

absl::Status yaze::editor::EditorManager::OpenProject ( )

Definition at line 1324 of file editor_manager.cc.

References yaze::editor::UserSettings::Preferences::autosave_enabled, yaze::project::WorkspaceSettings::autosave_enabled, yaze::editor::UserSettings::Preferences::autosave_interval, yaze::project::WorkspaceSettings::autosave_interval_secs, yaze::editor::EditorSelectionDialog::ClearRecentEditors(), yaze::project::YazeProject::code_folder, ConfigureEditorDependencies(), current_project_, editor_selection_dialog_, yaze::editor::RomSession::feature_flags, yaze::project::YazeProject::feature_flags, yaze::project::YazeProject::filepath, yaze::editor::UserSettings::Preferences::font_global_scale, yaze::project::WorkspaceSettings::font_global_scale, yaze::test::TestManager::Get(), GetCurrentEditorSet(), GetCurrentRom(), GetCurrentSessionId(), yaze::project::YazeProject::GetDisplayName(), yaze::project::RecentFilesManager::GetInstance(), yaze::editor::kSuccess, yaze::editor::kWarning, LoadAssets(), yaze::editor::RomFileManager::LoadRom(), LOG_DEBUG, yaze::project::YazeProject::Open(), popup_manager_, yaze::editor::UserSettings::prefs(), RETURN_IF_ERROR, rom_file_manager_, yaze::project::YazeProject::rom_filename, session_coordinator_, yaze::test::TestManager::SetCurrentRom(), yaze::editor::ToastManager::Show(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), toast_manager_, ui_coordinator_, user_settings_, yaze::project::YazeProject::Validate(), and yaze::project::YazeProject::workspace_settings.

Referenced by yaze::editor::MenuOrchestrator::OnOpenProject(), and OpenRomOrProject().

◆ SaveProject()

◆ SaveProjectAs()

◆ ImportProject()

absl::Status yaze::editor::EditorManager::ImportProject ( const std::string &  project_path)

◆ RepairCurrentProject()

absl::Status yaze::editor::EditorManager::RepairCurrentProject ( )

◆ DrawRomSelector()

absl::Status yaze::editor::EditorManager::DrawRomSelector ( )
privatedelete

◆ DrawContextSensitiveCardControl()

void yaze::editor::EditorManager::DrawContextSensitiveCardControl ( )
private

Definition at line 924 of file editor_manager.cc.

References ui_coordinator_.

◆ LoadAssets()

◆ InitializeTestSuites()

void yaze::editor::EditorManager::InitializeTestSuites ( )
private

Definition at line 197 of file editor_manager.cc.

References yaze::test::TestManager::Get(), and yaze::test::RegisterZ3edTestSuites().

Referenced by Initialize().

Here is the call graph for this function:

◆ ConfigureEditorDependencies()

void yaze::editor::EditorManager::ConfigureEditorDependencies ( EditorSet editor_set,
Rom rom,
size_t  session_id 
)
private

Injects dependencies into all editors within an EditorSet.

This function is called whenever a new session is created or a ROM is loaded into an existing session. It configures the EditorDependencies struct with pointers to all the managers and services that editors need, then applies them to the editor set.

Parameters
editor_setThe set of editors to configure
romThe ROM instance for this session
session_idThe unique ID for this session

Dependencies injected:

  • rom: The ROM data for this session
  • session_id: For creating session-aware card IDs
  • card_registry: For registering and managing editor cards
  • toast_manager: For showing user notifications
  • popup_manager: For displaying modal dialogs
  • shortcut_manager: For editor-specific shortcuts (future)
  • shared_clipboard: For cross-editor data sharing (e.g. tile copying)
  • user_settings: For accessing user preferences
  • renderer: For graphics operations (dungeon/overworld editors)

Definition at line 1777 of file editor_manager.cc.

References yaze::editor::EditorSet::ApplyDependencies(), yaze::editor::EditorDependencies::card_registry, card_registry_, yaze::editor::EditorDependencies::popup_manager, popup_manager_, yaze::editor::EditorDependencies::renderer, renderer_, yaze::editor::EditorDependencies::rom, yaze::editor::EditorDependencies::session_id, yaze::editor::EditorDependencies::shared_clipboard, shared_clipboard_, yaze::editor::EditorDependencies::shortcut_manager, shortcut_manager_, yaze::editor::EditorDependencies::toast_manager, toast_manager_, yaze::editor::EditorDependencies::user_settings, and user_settings_.

Referenced by CreateNewSession(), DuplicateCurrentSession(), LoadRom(), OpenProject(), and OpenRomOrProject().

Here is the call graph for this function:

Member Data Documentation

◆ quit_

bool yaze::editor::EditorManager::quit_ = false
private

Definition at line 251 of file editor_manager.h.

Referenced by Quit(), and quit().

◆ show_workspace_layout

bool yaze::editor::EditorManager::show_workspace_layout = false
private

Definition at line 257 of file editor_manager.h.

◆ session_to_rename_

size_t yaze::editor::EditorManager::session_to_rename_ = 0
private

Definition at line 258 of file editor_manager.h.

◆ session_rename_buffer_

char yaze::editor::EditorManager::session_rename_buffer_[256] = {}
private

Definition at line 259 of file editor_manager.h.

◆ proposal_drawer_

ProposalDrawer yaze::editor::EditorManager::proposal_drawer_
private

Definition at line 265 of file editor_manager.h.

Referenced by DrawMenuBar(), Initialize(), and Update().

◆ show_proposal_drawer_

bool yaze::editor::EditorManager::show_proposal_drawer_ = false
private

Definition at line 266 of file editor_manager.h.

◆ agent_chat_history_popup_

AgentChatHistoryPopup yaze::editor::EditorManager::agent_chat_history_popup_
private

Definition at line 273 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ show_chat_history_popup_

bool yaze::editor::EditorManager::show_chat_history_popup_ = false
private

Definition at line 274 of file editor_manager.h.

◆ project_file_editor_

ProjectFileEditor yaze::editor::EditorManager::project_file_editor_
private

Definition at line 277 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ editor_selection_dialog_

EditorSelectionDialog yaze::editor::EditorManager::editor_selection_dialog_
private

Definition at line 281 of file editor_manager.h.

Referenced by Initialize(), LoadRom(), OpenProject(), OpenRomOrProject(), and Update().

◆ welcome_screen_

WelcomeScreen yaze::editor::EditorManager::welcome_screen_
private

Definition at line 282 of file editor_manager.h.

Referenced by Initialize().

◆ version_

std::string yaze::editor::EditorManager::version_ = ""
private

Definition at line 290 of file editor_manager.h.

Referenced by EditorManager(), and version().

◆ status_

absl::Status yaze::editor::EditorManager::status_
private

Definition at line 291 of file editor_manager.h.

Referenced by DrawMenuBar(), Initialize(), and Update().

◆ emulator_

emu::Emulator yaze::editor::EditorManager::emulator_
private

Definition at line 292 of file editor_manager.h.

Referenced by DrawMenuBar(), emulator(), Initialize(), and LoadAssets().

◆ sessions_

◆ current_editor_

Editor* yaze::editor::EditorManager::current_editor_ = nullptr
private

Definition at line 298 of file editor_manager.h.

Referenced by GetCurrentEditor(), HideCurrentEditorCards(), and Update().

◆ blank_editor_set_

EditorSet yaze::editor::EditorManager::blank_editor_set_ {}
private

Definition at line 299 of file editor_manager.h.

◆ renderer_

gfx::IRenderer* yaze::editor::EditorManager::renderer_ = nullptr
private

Definition at line 303 of file editor_manager.h.

Referenced by ConfigureEditorDependencies(), Initialize(), and LoadAssets().

◆ current_project_

project::YazeProject yaze::editor::EditorManager::current_project_
private

◆ shared_clipboard_

EditorDependencies::SharedClipboard yaze::editor::EditorManager::shared_clipboard_
private

Definition at line 306 of file editor_manager.h.

Referenced by ConfigureEditorDependencies().

◆ popup_manager_

std::unique_ptr<PopupManager> yaze::editor::EditorManager::popup_manager_
private

◆ toast_manager_

◆ menu_builder_

MenuBuilder yaze::editor::EditorManager::menu_builder_
private

Definition at line 309 of file editor_manager.h.

Referenced by EditorManager(), and menu_builder().

◆ shortcut_manager_

ShortcutManager yaze::editor::EditorManager::shortcut_manager_
private

Definition at line 310 of file editor_manager.h.

Referenced by ConfigureEditorDependencies(), EditorManager(), Initialize(), and Update().

◆ user_settings_

UserSettings yaze::editor::EditorManager::user_settings_
private

◆ card_registry_

EditorCardRegistry yaze::editor::EditorManager::card_registry_
private

◆ editor_registry_

EditorRegistry yaze::editor::EditorManager::editor_registry_
private

Definition at line 315 of file editor_manager.h.

Referenced by EditorManager(), HideCurrentEditorCards(), and Initialize().

◆ menu_orchestrator_

std::unique_ptr<MenuOrchestrator> yaze::editor::EditorManager::menu_orchestrator_
private

Definition at line 316 of file editor_manager.h.

Referenced by DrawMenuBar(), EditorManager(), and Initialize().

◆ project_manager_

ProjectManager yaze::editor::EditorManager::project_manager_
private

Definition at line 317 of file editor_manager.h.

Referenced by CreateNewProject(), EditorManager(), and Initialize().

◆ rom_file_manager_

RomFileManager yaze::editor::EditorManager::rom_file_manager_
private

◆ ui_coordinator_

◆ window_delegate_

WindowDelegate yaze::editor::EditorManager::window_delegate_
private

◆ session_coordinator_

◆ layout_manager_

std::unique_ptr<LayoutManager> yaze::editor::EditorManager::layout_manager_
private

Definition at line 322 of file editor_manager.h.

Referenced by EditorManager(), and SwitchToEditor().

◆ workspace_manager_

WorkspaceManager yaze::editor::EditorManager::workspace_manager_ {&toast_manager_}
private

◆ autosave_timer_

float yaze::editor::EditorManager::autosave_timer_ = 0.0f
private

Definition at line 325 of file editor_manager.h.

Referenced by Update().


The documentation for this class was generated from the following files: