The EditorManager controls the main editor window and manages the various editor classes. More...
#include <editor_manager.h>
Public Member Functions | |
EditorManager () | |
void | Initialize (const std::string &filename="") |
absl::Status | Update () |
void | DrawMenuBar () |
auto | emulator () -> emu::Emulator & |
auto | quit () const |
auto | version () const |
absl::Status | SetCurrentRom (Rom *rom) |
auto | GetCurrentRom () -> Rom * |
auto | GetCurrentEditorSet () -> EditorSet * |
Private Member Functions | |
void | DrawHomepage () |
absl::Status | DrawRomSelector () |
absl::Status | LoadRom () |
absl::Status | LoadAssets () |
absl::Status | SaveRom () |
absl::Status | OpenRomOrProject (const std::string &filename) |
absl::Status | OpenProject () |
absl::Status | SaveProject () |
Private Attributes | |
bool | quit_ = false |
bool | backup_rom_ = false |
bool | save_new_auto_ = true |
bool | new_project_menu = false |
bool | show_emulator_ = false |
bool | show_memory_editor_ = false |
bool | show_asm_editor_ = false |
bool | show_imgui_metrics_ = false |
bool | show_imgui_demo_ = false |
bool | show_palette_editor_ = false |
bool | show_resource_label_manager = false |
bool | show_workspace_layout = false |
bool | show_homepage_ = true |
std::string | version_ = "" |
absl::Status | status_ |
emu::Emulator | emulator_ |
std::vector< std::shared_ptr< Rom > > | roms_ |
std::unordered_map< Rom *, std::unique_ptr< EditorSet > > | editor_sets_ |
Rom * | current_rom_ = nullptr |
EditorSet * | current_editor_set_ = nullptr |
Editor * | current_editor_ = nullptr |
Project | current_project_ |
EditorContext | context_ |
std::unique_ptr< PopupManager > | popup_manager_ |
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 44 of file editor_manager.h.
|
inline |
Definition at line 46 of file editor_manager.h.
References context_, popup_manager_, and version_.
void yaze::editor::EditorManager::Initialize | ( | const std::string & | filename = "" | ) |
Definition at line 65 of file editor_manager.cc.
References backup_rom_, context_, current_editor_, current_editor_set_, current_project_, current_rom_, editor_sets_, yaze::RecentFilesManager::GetRecentFiles(), ICON_MD_BALLOT, ICON_MD_CLOSE, ICON_MD_CONTENT_COPY, ICON_MD_CONTENT_CUT, ICON_MD_CONTENT_PASTE, ICON_MD_EXIT_TO_APP, ICON_MD_FILE_DOWNLOAD, ICON_MD_FILE_OPEN, ICON_MD_GAMEPAD, ICON_MD_HELP, ICON_MD_HOME, ICON_MD_MEMORY, ICON_MD_MISCELLANEOUS_SERVICES, ICON_MD_REDO, ICON_MD_SAVE_AS, ICON_MD_SEARCH, ICON_MD_SIM_CARD, ICON_MD_SPACE_DASHBOARD, ICON_MD_UNDO, yaze::editor::kAssemblyEditorName, yaze::editor::kDungeonEditorName, yaze::editor::kGraphicsEditorName, yaze::editor::kMessageEditorName, yaze::editor::kMusicEditorName, yaze::editor::kOverworldEditorName, yaze::editor::kPaletteEditorName, yaze::editor::kScreenEditorName, yaze::gui::kSeparator, yaze::editor::kSettingsEditorName, yaze::editor::kSpriteEditorName, yaze::RecentFilesManager::Load(), LoadRom(), OpenProject(), OpenRomOrProject(), popup_manager_, PRINT_IF_ERROR, quit_, save_new_auto_, SaveProject(), SaveRom(), show_asm_editor_, show_emulator_, show_homepage_, show_imgui_demo_, show_imgui_metrics_, show_memory_editor_, show_workspace_layout, and status_.
absl::Status yaze::editor::EditorManager::Update | ( | ) |
Definition at line 283 of file editor_manager.cc.
References context_, current_editor_, current_editor_set_, DrawHomepage(), yaze::editor::ExecuteShortcuts(), yaze::editor::kOverworld, popup_manager_, show_homepage_, and status_.
void yaze::editor::EditorManager::DrawMenuBar | ( | ) |
Definition at line 413 of file editor_manager.cc.
References current_editor_set_, current_project_, current_rom_, yaze::gui::DrawDisplaySettings(), yaze::gui::DrawMenu(), DrawRomSelector(), emulator_, ICON_MD_DISPLAY_SETTINGS, yaze::gui::kDefaultModalSize, new_project_menu, SaveRom(), show_asm_editor_, show_emulator_, show_imgui_demo_, show_imgui_metrics_, show_memory_editor_, show_palette_editor_, show_resource_label_manager, yaze::editor::FileDialogWrapper::ShowOpenFileDialog(), yaze::editor::FileDialogWrapper::ShowOpenFolderDialog(), status_, and version_.
|
inline |
Definition at line 58 of file editor_manager.h.
References emulator_.
|
inline |
Definition at line 59 of file editor_manager.h.
References quit_.
|
inline |
Definition at line 60 of file editor_manager.h.
References version_.
absl::Status yaze::editor::EditorManager::SetCurrentRom | ( | Rom * | rom | ) |
Definition at line 650 of file editor_manager.cc.
References context_, current_editor_set_, current_rom_, editor_sets_, LoadAssets(), RETURN_IF_ERROR, and yaze::SharedRom::set_rom().
Referenced by DrawRomSelector().
|
inline |
Definition at line 63 of file editor_manager.h.
References current_rom_.
|
inline |
Definition at line 64 of file editor_manager.h.
References current_editor_set_.
|
private |
Definition at line 328 of file editor_manager.cc.
References yaze::gui::ClickableText(), current_editor_set_, current_rom_, yaze::core::FeatureFlags::get(), yaze::RecentFilesManager::GetRecentFiles(), yaze::editor::kDungeonEditorName, yaze::editor::kGraphicsEditorName, yaze::editor::kMessageEditorName, yaze::editor::kOverworldEditorName, yaze::editor::kPaletteEditorName, yaze::editor::kScreenEditorName, yaze::editor::kSpriteEditorName, yaze::RecentFilesManager::Load(), LoadRom(), OpenRomOrProject(), yaze::gui::OpenUrl(), and status_.
Referenced by Update().
|
private |
Definition at line 395 of file editor_manager.cc.
References current_rom_, RETURN_IF_ERROR, roms_, and SetCurrentRom().
Referenced by DrawMenuBar().
|
private |
Definition at line 526 of file editor_manager.cc.
References yaze::RecentFilesManager::AddFile(), context_, current_editor_set_, current_rom_, editor_sets_, yaze::RecentFilesManager::Load(), LoadAssets(), RETURN_IF_ERROR, roms_, yaze::RecentFilesManager::Save(), and yaze::editor::FileDialogWrapper::ShowOpenFileDialog().
Referenced by DrawHomepage(), and Initialize().
|
private |
Definition at line 551 of file editor_manager.cc.
References ASSIGN_OR_RETURN, current_editor_set_, current_rom_, yaze::GraphicsSheetManager::GetInstance(), yaze::LoadAllGraphicsData(), and RETURN_IF_ERROR.
Referenced by LoadRom(), OpenProject(), OpenRomOrProject(), and SetCurrentRom().
|
private |
Definition at line 566 of file editor_manager.cc.
References backup_rom_, current_editor_set_, current_rom_, yaze::core::FeatureFlags::get(), yaze::GraphicsSheetManager::GetInstance(), RETURN_IF_ERROR, save_new_auto_, and yaze::SaveAllGraphicsData().
Referenced by DrawMenuBar(), and Initialize().
|
private |
Definition at line 584 of file editor_manager.cc.
References context_, current_editor_set_, current_project_, current_rom_, editor_sets_, LoadAssets(), OpenProject(), RETURN_IF_ERROR, roms_, and yaze::SharedRom::set_rom().
Referenced by DrawHomepage(), and Initialize().
|
private |
Definition at line 607 of file editor_manager.cc.
References yaze::RecentFilesManager::AddFile(), context_, current_editor_set_, current_project_, current_rom_, editor_sets_, yaze::RecentFilesManager::Load(), LoadAssets(), RETURN_IF_ERROR, roms_, and yaze::RecentFilesManager::Save().
Referenced by Initialize(), and OpenRomOrProject().
|
private |
Definition at line 641 of file editor_manager.cc.
References current_project_, new_project_menu, and RETURN_IF_ERROR.
Referenced by Initialize().
|
private |
Definition at line 76 of file editor_manager.h.
Referenced by Initialize(), and quit().
|
private |
Definition at line 77 of file editor_manager.h.
Referenced by Initialize(), and SaveRom().
|
private |
Definition at line 78 of file editor_manager.h.
Referenced by Initialize(), and SaveRom().
|
private |
Definition at line 79 of file editor_manager.h.
Referenced by DrawMenuBar(), and SaveProject().
|
private |
Definition at line 81 of file editor_manager.h.
Referenced by DrawMenuBar(), and Initialize().
|
private |
Definition at line 82 of file editor_manager.h.
Referenced by DrawMenuBar(), and Initialize().
|
private |
Definition at line 83 of file editor_manager.h.
Referenced by DrawMenuBar(), and Initialize().
|
private |
Definition at line 84 of file editor_manager.h.
Referenced by DrawMenuBar(), and Initialize().
|
private |
Definition at line 85 of file editor_manager.h.
Referenced by DrawMenuBar(), and Initialize().
|
private |
Definition at line 86 of file editor_manager.h.
Referenced by DrawMenuBar().
|
private |
Definition at line 87 of file editor_manager.h.
Referenced by DrawMenuBar().
|
private |
Definition at line 88 of file editor_manager.h.
Referenced by Initialize().
|
private |
Definition at line 89 of file editor_manager.h.
Referenced by Initialize(), and Update().
|
private |
Definition at line 91 of file editor_manager.h.
Referenced by DrawMenuBar(), EditorManager(), and version().
|
private |
Definition at line 93 of file editor_manager.h.
Referenced by DrawHomepage(), DrawMenuBar(), Initialize(), and Update().
|
private |
Definition at line 94 of file editor_manager.h.
Referenced by DrawMenuBar(), and emulator().
|
private |
Definition at line 95 of file editor_manager.h.
Referenced by DrawRomSelector(), LoadRom(), OpenProject(), and OpenRomOrProject().
|
private |
Definition at line 96 of file editor_manager.h.
Referenced by Initialize(), LoadRom(), OpenProject(), OpenRomOrProject(), and SetCurrentRom().
|
private |
Definition at line 97 of file editor_manager.h.
Referenced by DrawHomepage(), DrawMenuBar(), DrawRomSelector(), GetCurrentRom(), Initialize(), LoadAssets(), LoadRom(), OpenProject(), OpenRomOrProject(), SaveRom(), and SetCurrentRom().
|
private |
Definition at line 98 of file editor_manager.h.
Referenced by DrawHomepage(), DrawMenuBar(), GetCurrentEditorSet(), Initialize(), LoadAssets(), LoadRom(), OpenProject(), OpenRomOrProject(), SaveRom(), SetCurrentRom(), and Update().
|
private |
Definition at line 99 of file editor_manager.h.
Referenced by Initialize(), and Update().
|
private |
Definition at line 101 of file editor_manager.h.
Referenced by DrawMenuBar(), Initialize(), OpenProject(), OpenRomOrProject(), and SaveProject().
|
private |
Definition at line 102 of file editor_manager.h.
Referenced by EditorManager(), Initialize(), LoadRom(), OpenProject(), OpenRomOrProject(), SetCurrentRom(), and Update().
|
private |
Definition at line 103 of file editor_manager.h.
Referenced by EditorManager(), Initialize(), and Update().