The EditorManager controls the main editor window and manages the various editor classes. More...
#include <editor_manager.h>
Public Member Functions | |
EditorManager () | |
void | SetupScreen (std::string filename="") |
absl::Status | Update () |
auto | emulator () -> emu::Emulator & |
auto | quit () |
Public Member Functions inherited from yaze::app::SharedRom | |
SharedRom ()=default | |
virtual | ~SharedRom ()=default |
std::shared_ptr< Rom > | shared_rom () |
auto | rom () |
Public Member Functions inherited from yaze::app::core::ExperimentFlags | |
ExperimentFlags ()=default | |
virtual | ~ExperimentFlags ()=default |
auto | flags () const |
Flags * | mutable_flags () |
std::string | Serialize () const |
Private Member Functions | |
void | ManageActiveEditors () |
void | ManageKeyboardShortcuts () |
void | DrawStatusPopup () |
void | DrawAboutPopup () |
void | DrawInfoPopup () |
void | DrawYazeMenu () |
void | DrawYazeMenuBar () |
void | LoadRom () |
void | SaveRom () |
void | OpenRomOrProject (const std::string &filename) |
absl::Status | OpenProject () |
Private Attributes | |
bool | quit_ = false |
bool | about_ = false |
bool | rom_info_ = false |
bool | backup_rom_ = false |
bool | save_new_auto_ = true |
bool | show_status_ = false |
bool | rom_assets_loaded_ = false |
absl::Status | status_ |
ImVector< int > | active_tabs_ |
std::vector< Editor * > | active_editors_ |
core::MessageDispatcher | dispatcher_ |
emu::Emulator | emulator_ |
Project | current_project_ |
ConstantManager | constant_manager_ |
ExtensionManager | extension_manager_ |
yaze_editor_context | editor_context_ |
Editor * | current_editor_ = nullptr |
AssemblyEditor | assembly_editor_ |
DungeonEditor | dungeon_editor_ |
GraphicsEditor | graphics_editor_ |
MusicEditor | music_editor_ |
OverworldEditor | overworld_editor_ |
PaletteEditor | palette_editor_ |
ScreenEditor | screen_editor_ |
SpriteEditor | sprite_editor_ |
SettingsEditor | settings_editor_ |
MessageEditor | message_editor_ |
MemoryEditorWithDiffChecker | memory_editor_ |
Additional Inherited Members | |
Static Public Attributes inherited from yaze::app::SharedRom | |
static std::shared_ptr< Rom > | shared_rom_ = nullptr |
The EditorManager controls the main editor window and manages the various editor classes.
This class inherits from SharedRom, GfxContext, and ExperimentFlags, and provides functionality for setting up the screen, updating the editor, and shutting down the editor. It also includes methods for drawing various menus and popups, saving the Rom, and managing editor-specific flags.
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 50 of file editor_manager.h.
|
inline |
Definition at line 52 of file editor_manager.h.
References active_editors_, current_editor_, dungeon_editor_, graphics_editor_, message_editor_, overworld_editor_, palette_editor_, and sprite_editor_.
void yaze::app::editor::EditorManager::SetupScreen | ( | std::string | filename = "" | ) |
Definition at line 51 of file editor_manager.cc.
References yaze::app::editor::OverworldEditor::InitializeZeml(), overworld_editor_, PRINT_IF_ERROR, and yaze::app::SharedRom::rom().
Referenced by yaze::app::core::Controller::OnEntry(), and yaze::app::core::Controller::SetupScreen().
absl::Status yaze::app::editor::EditorManager::Update | ( | ) |
Definition at line 58 of file editor_manager.cc.
References DrawAboutPopup(), DrawInfoPopup(), DrawStatusPopup(), DrawYazeMenu(), yaze::app::editor::OverworldEditor::LoadGraphics(), ManageActiveEditors(), ManageKeyboardShortcuts(), overworld_editor_, RETURN_IF_ERROR, yaze::app::SharedRom::rom(), and rom_assets_loaded_.
Referenced by yaze::app::core::Controller::OnLoad().
|
inline |
Definition at line 65 of file editor_manager.h.
References emulator_.
Referenced by yaze::app::core::anonymous_namespace{controller.cc}::HandleKeyDown(), yaze::app::core::anonymous_namespace{controller.cc}::HandleKeyUp(), and yaze::app::core::Controller::LoadAudioDevice().
|
inline |
Definition at line 66 of file editor_manager.h.
References quit_.
Referenced by yaze::app::core::Controller::OnLoad().
|
private |
Definition at line 79 of file editor_manager.cc.
References active_editors_, yaze::app::editor::DungeonEditor::add_room(), assembly_editor_, current_editor_, dungeon_editor_, graphics_editor_, ICON_MD_ADD, yaze::app::editor::OverworldEditor::jump_to_tab(), yaze::app::editor::OverworldEditor::jump_to_tab_, yaze::app::editor::kAssembly, yaze::app::editor::kDungeon, yaze::app::editor::kGraphics, yaze::app::editor::kMessage, yaze::app::editor::kMusic, yaze::app::editor::kOverworld, yaze::app::editor::kPalette, yaze::app::editor::kScreen, yaze::app::editor::kSettings, yaze::app::editor::kSprite, message_editor_, music_editor_, overworld_editor_, palette_editor_, screen_editor_, settings_editor_, sprite_editor_, status_, yaze::app::editor::DungeonEditor::Update(), yaze::app::editor::GraphicsEditor::Update(), yaze::app::editor::MessageEditor::Update(), yaze::app::editor::MusicEditor::Update(), yaze::app::editor::OverworldEditor::Update(), yaze::app::editor::PaletteEditor::Update(), yaze::app::editor::ScreenEditor::Update(), yaze::app::editor::SettingsEditor::Update(), yaze::app::editor::SpriteEditor::Update(), and yaze::app::editor::AssemblyEditor::UpdateCodeView().
Referenced by Update().
|
private |
Definition at line 242 of file editor_manager.cc.
References about_, yaze::app::editor::Editor::Copy(), current_editor_, yaze::app::editor::Editor::Cut(), yaze::app::editor::Editor::Find(), yaze::app::editor::RecentFilesManager::GetRecentFiles(), yaze::app::editor::RecentFilesManager::Load(), LoadRom(), OpenRomOrProject(), yaze::app::editor::Editor::Paste(), quit_, yaze::app::editor::Editor::Redo(), SaveRom(), status_, and yaze::app::editor::Editor::Undo().
Referenced by Update().
|
private |
Definition at line 299 of file editor_manager.cc.
References ICON_MD_CONTENT_COPY, ICON_MD_ERROR, yaze::app::gui::kDefaultModalSize, show_status_, and status_.
Referenced by Update().
|
private |
Definition at line 328 of file editor_manager.cc.
References about_, yaze::app::gui::kDefaultModalSize, and yaze::app::core::kYazeVersion.
Referenced by Update().
|
private |
Definition at line 345 of file editor_manager.cc.
References yaze::app::gui::kDefaultModalSize, yaze::app::SharedRom::rom(), rom_info_, and yaze::app::core::UppercaseHexLongLong().
Referenced by Update().
|
private |
Definition at line 361 of file editor_manager.cc.
References yaze::app::gui::DrawDisplaySettings(), DrawYazeMenuBar(), ICON_MD_DISPLAY_SETTINGS, and yaze::app::core::kYazeVersion.
Referenced by Update().
|
private |
Definition at line 384 of file editor_manager.cc.
References about_, assembly_editor_, backup_rom_, yaze::app::Project::code_folder_, yaze::app::editor::Editor::Copy(), yaze::app::Project::Create(), current_editor_, current_project_, yaze::app::editor::Editor::Cut(), yaze::app::editor::FlagsMenu::Draw(), emulator_, yaze::app::Project::filepath, yaze::app::editor::Editor::Find(), yaze::app::editor::RecentFilesManager::GetRecentFiles(), yaze::app::gui::kDefaultModalSize, yaze::app::Project::labels_filename_, yaze::app::editor::RecentFilesManager::Load(), LoadRom(), memory_editor_, MENU_ITEM, MENU_ITEM2, yaze::app::Project::name, yaze::app::Project::Open(), OpenProject(), OpenRomOrProject(), palette_editor_, yaze::app::editor::Editor::Paste(), yaze::app::Project::project_opened_, quit_, yaze::app::editor::Editor::Redo(), yaze::app::SharedRom::rom(), rom_assets_loaded_, yaze::app::Project::rom_filename_, rom_info_, yaze::app::emu::Emulator::Run(), yaze::app::Project::Save(), save_new_auto_, SaveRom(), yaze::app::core::FileDialogWrapper::ShowOpenFileDialog(), yaze::app::core::FileDialogWrapper::ShowOpenFolderDialog(), status_, yaze::app::editor::Editor::Undo(), yaze::app::editor::AssemblyEditor::Update(), yaze::app::editor::MemoryEditorWithDiffChecker::Update(), and yaze::app::editor::PaletteEditor::Update().
Referenced by DrawYazeMenu().
|
private |
Definition at line 676 of file editor_manager.cc.
References yaze::app::editor::RecentFilesManager::AddFile(), yaze::app::editor::RecentFilesManager::Load(), yaze::app::SharedRom::rom(), yaze::app::editor::RecentFilesManager::Save(), and yaze::app::core::FileDialogWrapper::ShowOpenFileDialog().
Referenced by DrawYazeMenuBar(), and ManageKeyboardShortcuts().
|
private |
Definition at line 687 of file editor_manager.cc.
References backup_rom_, yaze::app::core::ExperimentFlags::flags(), overworld_editor_, RETURN_VOID_IF_ERROR, yaze::app::SharedRom::rom(), yaze::app::editor::OverworldEditor::Save(), save_new_auto_, yaze::app::editor::ScreenEditor::SaveDungeonMaps(), screen_editor_, and status_.
Referenced by DrawYazeMenuBar(), and ManageKeyboardShortcuts().
|
private |
Definition at line 699 of file editor_manager.cc.
References current_project_, yaze::app::Project::Open(), OpenProject(), yaze::app::SharedRom::rom(), and status_.
Referenced by DrawYazeMenuBar(), and ManageKeyboardShortcuts().
|
private |
Definition at line 710 of file editor_manager.cc.
References yaze::app::editor::RecentFilesManager::AddFile(), assembly_editor_, yaze::app::Project::code_folder_, current_project_, yaze::app::Project::filepath, yaze::app::Project::labels_filename_, yaze::app::editor::RecentFilesManager::Load(), yaze::app::Project::name, yaze::app::editor::AssemblyEditor::OpenFolder(), yaze::app::Project::project_opened_, RETURN_IF_ERROR, yaze::app::SharedRom::rom(), yaze::app::Project::rom_filename_, and yaze::app::editor::RecentFilesManager::Save().
Referenced by DrawYazeMenuBar(), and OpenRomOrProject().
|
private |
Definition at line 85 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), ManageKeyboardShortcuts(), and quit().
|
private |
Definition at line 86 of file editor_manager.h.
Referenced by DrawAboutPopup(), DrawYazeMenuBar(), and ManageKeyboardShortcuts().
|
private |
Definition at line 87 of file editor_manager.h.
Referenced by DrawInfoPopup(), and DrawYazeMenuBar().
|
private |
Definition at line 88 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), and SaveRom().
|
private |
Definition at line 89 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), and SaveRom().
|
private |
Definition at line 90 of file editor_manager.h.
Referenced by DrawStatusPopup().
|
private |
Definition at line 91 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), and Update().
|
private |
Definition at line 93 of file editor_manager.h.
Referenced by DrawStatusPopup(), DrawYazeMenuBar(), ManageActiveEditors(), ManageKeyboardShortcuts(), OpenRomOrProject(), and SaveRom().
|
private |
Definition at line 95 of file editor_manager.h.
|
private |
Definition at line 96 of file editor_manager.h.
Referenced by EditorManager(), and ManageActiveEditors().
|
private |
Definition at line 98 of file editor_manager.h.
|
private |
Definition at line 99 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), and emulator().
|
private |
Definition at line 101 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), OpenProject(), and OpenRomOrProject().
|
private |
Definition at line 102 of file editor_manager.h.
|
private |
Definition at line 103 of file editor_manager.h.
|
private |
Definition at line 104 of file editor_manager.h.
|
private |
Definition at line 106 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), EditorManager(), ManageActiveEditors(), and ManageKeyboardShortcuts().
|
private |
Definition at line 107 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), ManageActiveEditors(), and OpenProject().
|
private |
Definition at line 108 of file editor_manager.h.
Referenced by EditorManager(), and ManageActiveEditors().
|
private |
Definition at line 109 of file editor_manager.h.
Referenced by EditorManager(), and ManageActiveEditors().
|
private |
Definition at line 110 of file editor_manager.h.
Referenced by ManageActiveEditors().
|
private |
Definition at line 111 of file editor_manager.h.
Referenced by EditorManager(), ManageActiveEditors(), SaveRom(), SetupScreen(), and Update().
|
private |
Definition at line 112 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), EditorManager(), and ManageActiveEditors().
|
private |
Definition at line 113 of file editor_manager.h.
Referenced by ManageActiveEditors(), and SaveRom().
|
private |
Definition at line 114 of file editor_manager.h.
Referenced by EditorManager(), and ManageActiveEditors().
|
private |
Definition at line 115 of file editor_manager.h.
Referenced by ManageActiveEditors().
|
private |
Definition at line 116 of file editor_manager.h.
Referenced by EditorManager(), and ManageActiveEditors().
|
private |
Definition at line 117 of file editor_manager.h.
Referenced by DrawYazeMenuBar().