yaze 0.2.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

struct  RomSession
 

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 ()
 
void LoadUserSettings ()
 
void SaveUserSettings ()
 
void RefreshWorkspacePresets ()
 
void SaveWorkspacePreset (const std::string &name)
 
void LoadWorkspacePreset (const std::string &name)
 

Private Attributes

bool quit_ = false
 
bool backup_rom_ = false
 
bool save_new_auto_ = true
 
bool autosave_enabled_ = false
 
float autosave_interval_secs_ = 120.0f
 
float autosave_timer_ = 0.0f
 
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_save_workspace_preset_ = false
 
bool show_load_workspace_preset_ = false
 
bool show_homepage_ = true
 
bool show_command_palette_ = false
 
bool show_global_search_ = false
 
std::string version_ = ""
 
std::string settings_filename_ = "settings.ini"
 
float font_global_scale_ = 1.0f
 
std::vector< std::string > workspace_presets_
 
std::string last_workspace_preset_ = ""
 
std::string status_message_ = ""
 
absl::Status status_
 
emu::Emulator emulator_
 
std::deque< RomSessionsessions_
 
Romcurrent_rom_ = nullptr
 
EditorSetcurrent_editor_set_ = nullptr
 
Editorcurrent_editor_ = nullptr
 
EditorSet blank_editor_set_ {}
 
Project current_project_
 
EditorContext context_
 
std::unique_ptr< PopupManagerpopup_manager_
 
ToastManager toast_manager_
 

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 81 of file editor_manager.h.

Constructor & Destructor Documentation

◆ EditorManager()

yaze::editor::EditorManager::EditorManager ( )
inline

Definition at line 83 of file editor_manager.h.

References context_, popup_manager_, and version_.

Member Function Documentation

◆ Initialize()

void yaze::editor::EditorManager::Initialize ( const std::string & filename = "")

Definition at line 119 of file editor_manager.cc.

References autosave_enabled_, autosave_interval_secs_, backup_rom_, blank_editor_set_, context_, current_editor_, current_editor_set_, current_project_, current_rom_, 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_HISTORY, 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::kInfo, 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::editor::kSuccess, yaze::RecentFilesManager::Load(), LoadRom(), LoadUserSettings(), OpenProject(), OpenRomOrProject(), popup_manager_, PRINT_IF_ERROR, quit_, RefreshWorkspacePresets(), save_new_auto_, SaveProject(), SaveRom(), SaveUserSettings(), show_asm_editor_, show_command_palette_, show_emulator_, show_global_search_, show_homepage_, show_imgui_demo_, show_imgui_metrics_, show_load_workspace_preset_, show_memory_editor_, show_save_workspace_preset_, show_workspace_layout, status_, and toast_manager_.

◆ Update()

◆ DrawMenuBar()

◆ emulator()

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

Definition at line 95 of file editor_manager.h.

References emulator_.

◆ quit()

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

Definition at line 96 of file editor_manager.h.

References quit_.

◆ version()

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

Definition at line 97 of file editor_manager.h.

References version_.

◆ SetCurrentRom()

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

Definition at line 875 of file editor_manager.cc.

References current_editor_set_, current_rom_, and sessions_.

Referenced by DrawRomSelector().

◆ GetCurrentRom()

auto yaze::editor::EditorManager::GetCurrentRom ( ) -> Rom*
inline

Definition at line 100 of file editor_manager.h.

References current_rom_.

◆ GetCurrentEditorSet()

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

Definition at line 101 of file editor_manager.h.

References current_editor_set_.

◆ DrawHomepage()

◆ DrawRomSelector()

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

Definition at line 504 of file editor_manager.cc.

References current_rom_, RETURN_IF_ERROR, sessions_, SetCurrentRom(), and yaze::Rom::short_name().

Referenced by DrawMenuBar().

Here is the call graph for this function:

◆ LoadRom()

◆ LoadAssets()

absl::Status yaze::editor::EditorManager::LoadAssets ( )
private

Definition at line 771 of file editor_manager.cc.

References ASSIGN_OR_RETURN, current_editor_set_, current_rom_, yaze::gfx::Arena::Get(), yaze::LoadAllGraphicsData(), and RETURN_IF_ERROR.

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

Here is the call graph for this function:

◆ SaveRom()

◆ OpenRomOrProject()

absl::Status yaze::editor::EditorManager::OpenRomOrProject ( const std::string & filename)
private

◆ OpenProject()

◆ SaveProject()

absl::Status yaze::editor::EditorManager::SaveProject ( )
private

Definition at line 866 of file editor_manager.cc.

References current_project_, new_project_menu, and RETURN_IF_ERROR.

Referenced by Initialize().

◆ LoadUserSettings()

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

Definition at line 43 of file editor_manager.cc.

References autosave_enabled_, autosave_interval_secs_, font_global_scale_, yaze::core::LoadConfigFile(), and settings_filename_.

Referenced by Initialize().

Here is the call graph for this function:

◆ SaveUserSettings()

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

Definition at line 64 of file editor_manager.cc.

References autosave_enabled_, autosave_interval_secs_, font_global_scale_, yaze::core::SaveFile(), and settings_filename_.

Referenced by DrawMenuBar(), and Initialize().

Here is the call graph for this function:

◆ RefreshWorkspacePresets()

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

Definition at line 72 of file editor_manager.cc.

References yaze::core::LoadConfigFile(), and workspace_presets_.

Referenced by Initialize(), and SaveWorkspacePreset().

Here is the call graph for this function:

◆ SaveWorkspacePreset()

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

Definition at line 86 of file editor_manager.cc.

References last_workspace_preset_, RefreshWorkspacePresets(), yaze::core::SaveFile(), and workspace_presets_.

Referenced by DrawMenuBar().

Here is the call graph for this function:

◆ LoadWorkspacePreset()

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

Definition at line 101 of file editor_manager.cc.

References last_workspace_preset_.

Referenced by DrawMenuBar().

Member Data Documentation

◆ quit_

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

Definition at line 113 of file editor_manager.h.

Referenced by Initialize(), and quit().

◆ backup_rom_

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

Definition at line 114 of file editor_manager.h.

Referenced by Initialize(), and SaveRom().

◆ save_new_auto_

bool yaze::editor::EditorManager::save_new_auto_ = true
private

Definition at line 115 of file editor_manager.h.

Referenced by Initialize(), and SaveRom().

◆ autosave_enabled_

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

Definition at line 116 of file editor_manager.h.

Referenced by Initialize(), LoadUserSettings(), SaveUserSettings(), and Update().

◆ autosave_interval_secs_

float yaze::editor::EditorManager::autosave_interval_secs_ = 120.0f
private

Definition at line 117 of file editor_manager.h.

Referenced by Initialize(), LoadUserSettings(), SaveUserSettings(), and Update().

◆ autosave_timer_

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

Definition at line 118 of file editor_manager.h.

Referenced by Update().

◆ new_project_menu

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

Definition at line 119 of file editor_manager.h.

Referenced by DrawMenuBar(), and SaveProject().

◆ show_emulator_

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

Definition at line 121 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ show_memory_editor_

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

Definition at line 122 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ show_asm_editor_

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

Definition at line 123 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ show_imgui_metrics_

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

Definition at line 124 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ show_imgui_demo_

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

Definition at line 125 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ show_palette_editor_

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

Definition at line 126 of file editor_manager.h.

Referenced by DrawMenuBar().

◆ show_resource_label_manager

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

Definition at line 127 of file editor_manager.h.

Referenced by DrawMenuBar().

◆ show_workspace_layout

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

Definition at line 128 of file editor_manager.h.

Referenced by Initialize().

◆ show_save_workspace_preset_

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

Definition at line 129 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ show_load_workspace_preset_

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

Definition at line 130 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ show_homepage_

bool yaze::editor::EditorManager::show_homepage_ = true
private

Definition at line 131 of file editor_manager.h.

Referenced by Initialize(), and Update().

◆ show_command_palette_

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

Definition at line 132 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ show_global_search_

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

Definition at line 133 of file editor_manager.h.

Referenced by DrawMenuBar(), and Initialize().

◆ version_

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

Definition at line 135 of file editor_manager.h.

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

◆ settings_filename_

std::string yaze::editor::EditorManager::settings_filename_ = "settings.ini"
private

Definition at line 136 of file editor_manager.h.

Referenced by LoadUserSettings(), and SaveUserSettings().

◆ font_global_scale_

float yaze::editor::EditorManager::font_global_scale_ = 1.0f
private

Definition at line 137 of file editor_manager.h.

Referenced by DrawMenuBar(), LoadUserSettings(), and SaveUserSettings().

◆ workspace_presets_

std::vector<std::string> yaze::editor::EditorManager::workspace_presets_
private

Definition at line 138 of file editor_manager.h.

Referenced by DrawMenuBar(), RefreshWorkspacePresets(), and SaveWorkspacePreset().

◆ last_workspace_preset_

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

Definition at line 139 of file editor_manager.h.

Referenced by LoadWorkspacePreset(), and SaveWorkspacePreset().

◆ status_message_

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

Definition at line 140 of file editor_manager.h.

◆ status_

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

Definition at line 142 of file editor_manager.h.

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

◆ emulator_

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

Definition at line 143 of file editor_manager.h.

Referenced by DrawMenuBar(), and emulator().

◆ sessions_

std::deque<RomSession> yaze::editor::EditorManager::sessions_
private

◆ current_rom_

Rom* yaze::editor::EditorManager::current_rom_ = nullptr
private

◆ current_editor_set_

EditorSet* yaze::editor::EditorManager::current_editor_set_ = nullptr
private

◆ current_editor_

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

Definition at line 157 of file editor_manager.h.

Referenced by Initialize(), and Update().

◆ blank_editor_set_

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

Definition at line 158 of file editor_manager.h.

Referenced by Initialize().

◆ current_project_

Project yaze::editor::EditorManager::current_project_
private

Definition at line 160 of file editor_manager.h.

Referenced by DrawMenuBar(), Initialize(), OpenProject(), OpenRomOrProject(), and SaveProject().

◆ context_

EditorContext yaze::editor::EditorManager::context_
private

◆ popup_manager_

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

Definition at line 162 of file editor_manager.h.

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

◆ toast_manager_

ToastManager yaze::editor::EditorManager::toast_manager_
private

Definition at line 163 of file editor_manager.h.

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


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