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 () |
absl::Status | DrawDynamicLayout () |
void | ManageKeyboardShortcuts () |
void | InitializeCommands () |
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 |
bool | dynamic_layout_ = false |
absl::Status | status_ |
emu::Emulator | emulator_ |
std::vector< Editor * > | active_editors_ |
std::vector< EditorLayoutParams > | active_layouts_ |
EditorLayoutParams | root_layout_ |
Project | current_project_ |
EditorContext | 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.
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 38 of file editor_manager.h.
|
inline |
Definition at line 40 of file editor_manager.h.
References active_editors_, current_editor_, dungeon_editor_, graphics_editor_, message_editor_, overworld_editor_, palette_editor_, screen_editor_, and sprite_editor_.
void yaze::app::editor::EditorManager::SetupScreen | ( | std::string | filename = "" | ) |
Definition at line 52 of file editor_manager.cc.
References InitializeCommands(), 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 60 of file editor_manager.cc.
References DrawAboutPopup(), DrawDynamicLayout(), DrawInfoPopup(), DrawStatusPopup(), DrawYazeMenu(), dynamic_layout_, 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 54 of file editor_manager.h.
References emulator_.
Referenced by yaze::app::core::Controller::LoadAudioDevice().
|
inline |
Definition at line 55 of file editor_manager.h.
References quit_.
Referenced by yaze::app::core::Controller::OnLoad().
|
private |
Definition at line 84 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 247 of file editor_manager.cc.
References yaze::app::editor::DrawEditor(), and root_layout_.
Referenced by Update().
|
private |
Definition at line 253 of file editor_manager.cc.
References about_, yaze::app::editor::EditorContext::command_manager, yaze::app::editor::Editor::Copy(), current_editor_, yaze::app::editor::Editor::Cut(), editor_context_, yaze::app::editor::Editor::Find(), yaze::app::RecentFilesManager::GetRecentFiles(), yaze::app::RecentFilesManager::Load(), LoadRom(), OpenRomOrProject(), yaze::app::editor::Editor::Paste(), quit_, yaze::app::editor::Editor::Redo(), SaveRom(), yaze::app::editor::CommandManager::ShowWhichKey(), status_, and yaze::app::editor::Editor::Undo().
Referenced by Update().
|
private |
Definition at line 312 of file editor_manager.cc.
References assembly_editor_, yaze::app::editor::EditorContext::command_manager, dungeon_editor_, yaze::app::editor::EditorLayoutParams::editor, editor_context_, graphics_editor_, yaze::app::editor::EditorLayoutParams::h_split, message_editor_, music_editor_, overworld_editor_, palette_editor_, yaze::app::editor::CommandManager::RegisterPrefix(), yaze::app::editor::CommandManager::RegisterSubcommand(), root_layout_, screen_editor_, settings_editor_, sprite_editor_, and yaze::app::editor::EditorLayoutParams::v_split.
Referenced by SetupScreen().
|
private |
Definition at line 387 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 415 of file editor_manager.cc.
References about_, yaze::app::gui::kDefaultModalSize, and yaze::app::core::kYazeVersion.
Referenced by Update().
|
private |
Definition at line 432 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 448 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 471 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(), dynamic_layout_, emulator_, yaze::app::Project::filepath, yaze::app::editor::Editor::Find(), yaze::app::RecentFilesManager::GetRecentFiles(), yaze::app::gui::kDefaultModalSize, yaze::app::Project::labels_filename_, yaze::app::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 763 of file editor_manager.cc.
References yaze::app::RecentFilesManager::AddFile(), yaze::app::RecentFilesManager::Load(), yaze::app::SharedRom::rom(), yaze::app::RecentFilesManager::Save(), and yaze::app::core::FileDialogWrapper::ShowOpenFileDialog().
Referenced by DrawYazeMenuBar(), and ManageKeyboardShortcuts().
|
private |
Definition at line 774 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 786 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 797 of file editor_manager.cc.
References yaze::app::RecentFilesManager::AddFile(), assembly_editor_, yaze::app::Project::code_folder_, current_project_, yaze::app::Project::filepath, yaze::app::Project::labels_filename_, yaze::app::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::RecentFilesManager::Save().
Referenced by DrawYazeMenuBar(), and OpenRomOrProject().
|
private |
Definition at line 77 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), ManageKeyboardShortcuts(), and quit().
|
private |
Definition at line 78 of file editor_manager.h.
Referenced by DrawAboutPopup(), DrawYazeMenuBar(), and ManageKeyboardShortcuts().
|
private |
Definition at line 79 of file editor_manager.h.
Referenced by DrawInfoPopup(), and DrawYazeMenuBar().
|
private |
Definition at line 80 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), and SaveRom().
|
private |
Definition at line 81 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), and SaveRom().
|
private |
Definition at line 82 of file editor_manager.h.
Referenced by DrawStatusPopup().
|
private |
Definition at line 83 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), and Update().
|
private |
Definition at line 84 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), and Update().
|
private |
Definition at line 86 of file editor_manager.h.
Referenced by DrawStatusPopup(), DrawYazeMenuBar(), ManageActiveEditors(), ManageKeyboardShortcuts(), OpenRomOrProject(), and SaveRom().
|
private |
Definition at line 88 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), and emulator().
|
private |
Definition at line 90 of file editor_manager.h.
Referenced by EditorManager(), and ManageActiveEditors().
|
private |
Definition at line 91 of file editor_manager.h.
|
private |
Definition at line 93 of file editor_manager.h.
Referenced by DrawDynamicLayout(), and InitializeCommands().
|
private |
Definition at line 95 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), OpenProject(), and OpenRomOrProject().
|
private |
Definition at line 96 of file editor_manager.h.
Referenced by InitializeCommands(), and ManageKeyboardShortcuts().
|
private |
Definition at line 98 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), EditorManager(), ManageActiveEditors(), and ManageKeyboardShortcuts().
|
private |
Definition at line 99 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), InitializeCommands(), ManageActiveEditors(), and OpenProject().
|
private |
Definition at line 100 of file editor_manager.h.
Referenced by EditorManager(), InitializeCommands(), and ManageActiveEditors().
|
private |
Definition at line 101 of file editor_manager.h.
Referenced by EditorManager(), InitializeCommands(), and ManageActiveEditors().
|
private |
Definition at line 102 of file editor_manager.h.
Referenced by InitializeCommands(), and ManageActiveEditors().
|
private |
Definition at line 103 of file editor_manager.h.
Referenced by EditorManager(), InitializeCommands(), ManageActiveEditors(), SaveRom(), SetupScreen(), and Update().
|
private |
Definition at line 104 of file editor_manager.h.
Referenced by DrawYazeMenuBar(), EditorManager(), InitializeCommands(), and ManageActiveEditors().
|
private |
Definition at line 105 of file editor_manager.h.
Referenced by EditorManager(), InitializeCommands(), ManageActiveEditors(), and SaveRom().
|
private |
Definition at line 106 of file editor_manager.h.
Referenced by EditorManager(), InitializeCommands(), and ManageActiveEditors().
|
private |
Definition at line 107 of file editor_manager.h.
Referenced by InitializeCommands(), and ManageActiveEditors().
|
private |
Definition at line 108 of file editor_manager.h.
Referenced by EditorManager(), InitializeCommands(), and ManageActiveEditors().
|
private |
Definition at line 109 of file editor_manager.h.
Referenced by DrawYazeMenuBar().