yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::EditorRegistry Class Reference

Manages editor types, categories, and lifecycle. More...

#include <editor_registry.h>

Public Member Functions

 EditorRegistry ()=default
 
 ~EditorRegistry ()=default
 
void JumpToDungeonRoom (int room_id)
 
void JumpToOverworldMap (int map_id)
 
void SwitchToEditor (EditorType editor_type)
 
void SetJumpToDungeonRoomCallback (std::function< void(int)> callback)
 
void SetJumpToOverworldMapCallback (std::function< void(int)> callback)
 
void HideCurrentEditorPanels ()
 
void ShowEditorPanels (EditorType editor_type)
 
void ToggleEditorPanels (EditorType editor_type)
 
std::vector< EditorTypeGetEditorsInCategory (const std::string &category) const
 
std::vector< std::string > GetAvailableCategories () const
 
std::string GetEditorDisplayName (EditorType type) const
 
void RegisterEditor (EditorType type, Editor *editor)
 
void UnregisterEditor (EditorType type)
 
EditorGetEditor (EditorType type) const
 
bool IsEditorActive (EditorType type) const
 
bool IsEditorVisible (EditorType type) const
 
void SetEditorActive (EditorType type, bool active)
 

Static Public Member Functions

static bool IsPanelBasedEditor (EditorType type)
 
static std::string GetEditorCategory (EditorType type)
 
static EditorType GetEditorTypeFromCategory (const std::string &category)
 
static std::vector< std::string > GetAllEditorCategories ()
 Get all editor categories in display order for sidebar.
 

Private Member Functions

bool IsValidEditorType (EditorType type) const
 
void ValidateEditorType (EditorType type) const
 

Private Attributes

std::unordered_map< EditorType, Editor * > registered_editors_
 
std::function< void(int)> jump_to_room_callback_
 
std::function< void(int)> jump_to_map_callback_
 

Static Private Attributes

static const std::unordered_map< EditorType, std::string > kEditorCategories
 
static const std::unordered_map< EditorType, std::string > kEditorNames
 
static const std::unordered_map< EditorType, bool > kPanelBasedEditors
 

Detailed Description

Manages editor types, categories, and lifecycle.

Extracted from EditorManager to provide focused editor management:

  • Editor type classification and categorization
  • Editor activation and switching
  • Editor-specific navigation (jump to room/map)
  • Editor card management

Definition at line 23 of file editor_registry.h.

Constructor & Destructor Documentation

◆ EditorRegistry()

yaze::editor::EditorRegistry::EditorRegistry ( )
default

◆ ~EditorRegistry()

yaze::editor::EditorRegistry::~EditorRegistry ( )
default

Member Function Documentation

◆ IsPanelBasedEditor()

◆ GetEditorCategory()

◆ GetEditorTypeFromCategory()

EditorType yaze::editor::EditorRegistry::GetEditorTypeFromCategory ( const std::string & category)
static

◆ GetAllEditorCategories()

std::vector< std::string > yaze::editor::EditorRegistry::GetAllEditorCategories ( )
static

Get all editor categories in display order for sidebar.

Returns
Vector of category names in preferred display order

Definition at line 82 of file editor_registry.cc.

Referenced by yaze::editor::EditorManager::Update().

◆ JumpToDungeonRoom()

void yaze::editor::EditorRegistry::JumpToDungeonRoom ( int room_id)

◆ JumpToOverworldMap()

void yaze::editor::EditorRegistry::JumpToOverworldMap ( int map_id)

◆ SwitchToEditor()

void yaze::editor::EditorRegistry::SwitchToEditor ( EditorType editor_type)

Definition at line 125 of file editor_registry.cc.

References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ SetJumpToDungeonRoomCallback()

void yaze::editor::EditorRegistry::SetJumpToDungeonRoomCallback ( std::function< void(int)> callback)
inline

Definition at line 45 of file editor_registry.h.

References jump_to_room_callback_.

◆ SetJumpToOverworldMapCallback()

void yaze::editor::EditorRegistry::SetJumpToOverworldMapCallback ( std::function< void(int)> callback)
inline

Definition at line 48 of file editor_registry.h.

References jump_to_map_callback_.

◆ HideCurrentEditorPanels()

void yaze::editor::EditorRegistry::HideCurrentEditorPanels ( )
Todo
Hide cards for this editor

Definition at line 144 of file editor_registry.cc.

References GetEditorDisplayName(), IsPanelBasedEditor(), and registered_editors_.

Here is the call graph for this function:

◆ ShowEditorPanels()

void yaze::editor::EditorRegistry::ShowEditorPanels ( EditorType editor_type)
Todo
Show cards for this editor

Definition at line 154 of file editor_registry.cc.

References GetEditorDisplayName(), IsPanelBasedEditor(), and ValidateEditorType().

Here is the call graph for this function:

◆ ToggleEditorPanels()

void yaze::editor::EditorRegistry::ToggleEditorPanels ( EditorType editor_type)
Todo
Toggle cards for this editor

Definition at line 164 of file editor_registry.cc.

References GetEditorDisplayName(), IsPanelBasedEditor(), and ValidateEditorType().

Here is the call graph for this function:

◆ GetEditorsInCategory()

std::vector< EditorType > yaze::editor::EditorRegistry::GetEditorsInCategory ( const std::string & category) const

Definition at line 174 of file editor_registry.cc.

References kEditorCategories.

◆ GetAvailableCategories()

std::vector< std::string > yaze::editor::EditorRegistry::GetAvailableCategories ( ) const

Definition at line 187 of file editor_registry.cc.

References kEditorCategories.

◆ GetEditorDisplayName()

std::string yaze::editor::EditorRegistry::GetEditorDisplayName ( EditorType type) const

◆ RegisterEditor()

void yaze::editor::EditorRegistry::RegisterEditor ( EditorType type,
Editor * editor )

Definition at line 209 of file editor_registry.cc.

References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ UnregisterEditor()

void yaze::editor::EditorRegistry::UnregisterEditor ( EditorType type)

Definition at line 221 of file editor_registry.cc.

References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ GetEditor()

Editor * yaze::editor::EditorRegistry::GetEditor ( EditorType type) const

Definition at line 232 of file editor_registry.cc.

References registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ IsEditorActive()

bool yaze::editor::EditorRegistry::IsEditorActive ( EditorType type) const

Definition at line 242 of file editor_registry.cc.

References registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ IsEditorVisible()

bool yaze::editor::EditorRegistry::IsEditorVisible ( EditorType type) const

Definition at line 252 of file editor_registry.cc.

References registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ SetEditorActive()

void yaze::editor::EditorRegistry::SetEditorActive ( EditorType type,
bool active )

Definition at line 262 of file editor_registry.cc.

References registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ IsValidEditorType()

bool yaze::editor::EditorRegistry::IsValidEditorType ( EditorType type) const
private

Definition at line 271 of file editor_registry.cc.

References kEditorCategories.

Referenced by ValidateEditorType().

◆ ValidateEditorType()

void yaze::editor::EditorRegistry::ValidateEditorType ( EditorType type) const
private

Member Data Documentation

◆ kEditorCategories

◆ kEditorNames

const std::unordered_map< EditorType, std::string > yaze::editor::EditorRegistry::kEditorNames
staticprivate
Initial value:
=
{{EditorType::kDungeon, "Dungeon Editor"},
{EditorType::kOverworld, "Overworld Editor"},
{EditorType::kGraphics, "Graphics Editor"},
{EditorType::kPalette, "Palette Editor"},
{EditorType::kSprite, "Sprite Editor"},
{EditorType::kScreen, "Screen Editor"},
{EditorType::kMessage, "Message Editor"},
{EditorType::kMusic, "Music Editor"},
{EditorType::kAssembly, "Assembly Editor"},
{EditorType::kEmulator, "Emulator Editor"},
{EditorType::kHex, "Hex Editor"},
{EditorType::kAgent, "Agent Editor"},
{EditorType::kSettings, "Settings Editor"}}

Definition at line 76 of file editor_registry.h.

Referenced by GetEditorDisplayName().

◆ kPanelBasedEditors

const std::unordered_map< EditorType, bool > yaze::editor::EditorRegistry::kPanelBasedEditors
staticprivate
Initial value:

Definition at line 77 of file editor_registry.h.

Referenced by IsPanelBasedEditor().

◆ registered_editors_

std::unordered_map<EditorType, Editor*> yaze::editor::EditorRegistry::registered_editors_
private

◆ jump_to_room_callback_

std::function<void(int)> yaze::editor::EditorRegistry::jump_to_room_callback_
private

Definition at line 83 of file editor_registry.h.

Referenced by JumpToDungeonRoom(), and SetJumpToDungeonRoomCallback().

◆ jump_to_map_callback_

std::function<void(int)> yaze::editor::EditorRegistry::jump_to_map_callback_
private

Definition at line 84 of file editor_registry.h.

Referenced by JumpToOverworldMap(), and SetJumpToOverworldMapCallback().


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