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>

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_
 
Romcurrent_rom_ = nullptr
 
EditorSetcurrent_editor_set_ = nullptr
 
Editorcurrent_editor_ = nullptr
 
Project current_project_
 
EditorContext context_
 
std::unique_ptr< PopupManagerpopup_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 44 of file editor_manager.h.

Constructor & Destructor Documentation

◆ EditorManager()

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

Definition at line 46 of file editor_manager.h.

References context_, popup_manager_, and version_.

Member Function Documentation

◆ Initialize()

◆ Update()

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

◆ DrawMenuBar()

◆ emulator()

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

Definition at line 58 of file editor_manager.h.

References emulator_.

◆ quit()

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

Definition at line 59 of file editor_manager.h.

References quit_.

◆ version()

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

Definition at line 60 of file editor_manager.h.

References version_.

◆ SetCurrentRom()

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().

Here is the call graph for this function:

◆ GetCurrentRom()

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

Definition at line 63 of file editor_manager.h.

References current_rom_.

◆ GetCurrentEditorSet()

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

Definition at line 64 of file editor_manager.h.

References current_editor_set_.

◆ DrawHomepage()

◆ DrawRomSelector()

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

Definition at line 395 of file editor_manager.cc.

References current_rom_, RETURN_IF_ERROR, roms_, and SetCurrentRom().

Referenced by DrawMenuBar().

Here is the call graph for this function:

◆ LoadRom()

◆ LoadAssets()

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

◆ SaveRom()

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

◆ OpenRomOrProject()

absl::Status yaze::editor::EditorManager::OpenRomOrProject ( const std::string & filename)
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().

Here is the call graph for this function:

◆ OpenProject()

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

◆ SaveProject()

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

Definition at line 641 of file editor_manager.cc.

References current_project_, new_project_menu, and RETURN_IF_ERROR.

Referenced by Initialize().

Member Data Documentation

◆ quit_

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

Definition at line 76 of file editor_manager.h.

Referenced by Initialize(), and quit().

◆ backup_rom_

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

Definition at line 77 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 78 of file editor_manager.h.

Referenced by Initialize(), and SaveRom().

◆ new_project_menu

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

Definition at line 79 of file editor_manager.h.

Referenced by DrawMenuBar(), and SaveProject().

◆ show_emulator_

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

Definition at line 81 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 82 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 83 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 84 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 85 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 86 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 87 of file editor_manager.h.

Referenced by DrawMenuBar().

◆ show_workspace_layout

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

Definition at line 88 of file editor_manager.h.

Referenced by Initialize().

◆ show_homepage_

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

Definition at line 89 of file editor_manager.h.

Referenced by Initialize(), and Update().

◆ version_

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

Definition at line 91 of file editor_manager.h.

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

◆ status_

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

Definition at line 93 of file editor_manager.h.

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

◆ emulator_

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

Definition at line 94 of file editor_manager.h.

Referenced by DrawMenuBar(), and emulator().

◆ roms_

std::vector<std::shared_ptr<Rom> > yaze::editor::EditorManager::roms_
private

Definition at line 95 of file editor_manager.h.

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

◆ editor_sets_

std::unordered_map<Rom*, std::unique_ptr<EditorSet> > yaze::editor::EditorManager::editor_sets_
private

Definition at line 96 of file editor_manager.h.

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

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

Referenced by Initialize(), and Update().

◆ current_project_

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

Definition at line 101 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 103 of file editor_manager.h.

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


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