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< EditorType > | GetEditorsInCategory (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) |
| Editor * | GetEditor (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 |
Manages editor types, categories, and lifecycle.
Extracted from EditorManager to provide focused editor management:
Definition at line 23 of file editor_registry.h.
|
default |
|
default |
|
static |
Definition at line 59 of file editor_registry.cc.
References kPanelBasedEditors.
Referenced by yaze::editor::EditorActivator::DeactivatePanelBasedEditor(), HideCurrentEditorPanels(), yaze::editor::EditorManager::IsPanelBasedEditor(), ShowEditorPanels(), yaze::editor::EditorActivator::SwitchToEditor(), and ToggleEditorPanels().
|
static |
Definition at line 64 of file editor_registry.cc.
References kEditorCategories.
Referenced by yaze::editor::EditorActivator::ActivatePanelBasedEditor(), yaze::editor::EditorActivator::DeactivatePanelBasedEditor(), yaze::editor::EditorManager::HideCurrentEditorPanels(), yaze::editor::UICoordinator::HideCurrentEditorPanels(), yaze::editor::PanelManager::ResetToDefaults(), and yaze::editor::EditorManager::Update().
|
static |
Definition at line 72 of file editor_registry.cc.
References kEditorCategories, and yaze::editor::kSettings.
Referenced by yaze::editor::EditorManager::Initialize(), and yaze::editor::PanelManager::OnEditorSwitch().
|
static |
Get all editor categories in display order for sidebar.
Definition at line 82 of file editor_registry.cc.
Referenced by yaze::editor::EditorManager::Update().
| void yaze::editor::EditorRegistry::JumpToDungeonRoom | ( | int | room_id | ) |
Definition at line 101 of file editor_registry.cc.
References jump_to_room_callback_, yaze::editor::kDungeon, and registered_editors_.
| void yaze::editor::EditorRegistry::JumpToOverworldMap | ( | int | map_id | ) |
Definition at line 113 of file editor_registry.cc.
References jump_to_map_callback_, yaze::editor::kOverworld, and registered_editors_.
| void yaze::editor::EditorRegistry::SwitchToEditor | ( | EditorType | editor_type | ) |
Definition at line 125 of file editor_registry.cc.
References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

|
inline |
Definition at line 45 of file editor_registry.h.
References jump_to_room_callback_.
|
inline |
Definition at line 48 of file editor_registry.h.
References jump_to_map_callback_.
| void yaze::editor::EditorRegistry::HideCurrentEditorPanels | ( | ) |
Definition at line 144 of file editor_registry.cc.
References GetEditorDisplayName(), IsPanelBasedEditor(), and registered_editors_.

| void yaze::editor::EditorRegistry::ShowEditorPanels | ( | EditorType | editor_type | ) |
Definition at line 154 of file editor_registry.cc.
References GetEditorDisplayName(), IsPanelBasedEditor(), and ValidateEditorType().

| void yaze::editor::EditorRegistry::ToggleEditorPanels | ( | EditorType | editor_type | ) |
Definition at line 164 of file editor_registry.cc.
References GetEditorDisplayName(), IsPanelBasedEditor(), and ValidateEditorType().

| std::vector< EditorType > yaze::editor::EditorRegistry::GetEditorsInCategory | ( | const std::string & | category | ) | const |
Definition at line 174 of file editor_registry.cc.
References kEditorCategories.
| std::vector< std::string > yaze::editor::EditorRegistry::GetAvailableCategories | ( | ) | const |
Definition at line 187 of file editor_registry.cc.
References kEditorCategories.
| std::string yaze::editor::EditorRegistry::GetEditorDisplayName | ( | EditorType | type | ) | const |
Definition at line 201 of file editor_registry.cc.
References kEditorNames.
Referenced by HideCurrentEditorPanels(), RegisterEditor(), ShowEditorPanels(), SwitchToEditor(), ToggleEditorPanels(), and UnregisterEditor().
| void yaze::editor::EditorRegistry::RegisterEditor | ( | EditorType | type, |
| Editor * | editor ) |
Definition at line 209 of file editor_registry.cc.
References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

| void yaze::editor::EditorRegistry::UnregisterEditor | ( | EditorType | type | ) |
Definition at line 221 of file editor_registry.cc.
References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

| Editor * yaze::editor::EditorRegistry::GetEditor | ( | EditorType | type | ) | const |
Definition at line 232 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().

| bool yaze::editor::EditorRegistry::IsEditorActive | ( | EditorType | type | ) | const |
Definition at line 242 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().

| bool yaze::editor::EditorRegistry::IsEditorVisible | ( | EditorType | type | ) | const |
Definition at line 252 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().

| void yaze::editor::EditorRegistry::SetEditorActive | ( | EditorType | type, |
| bool | active ) |
Definition at line 262 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().

|
private |
Definition at line 271 of file editor_registry.cc.
References kEditorCategories.
Referenced by ValidateEditorType().
|
private |
Definition at line 275 of file editor_registry.cc.
References IsValidEditorType().
Referenced by GetEditor(), IsEditorActive(), IsEditorVisible(), RegisterEditor(), SetEditorActive(), ShowEditorPanels(), SwitchToEditor(), ToggleEditorPanels(), and UnregisterEditor().

|
staticprivate |
Definition at line 75 of file editor_registry.h.
Referenced by GetAvailableCategories(), GetEditorCategory(), GetEditorsInCategory(), GetEditorTypeFromCategory(), and IsValidEditorType().
|
staticprivate |
Definition at line 76 of file editor_registry.h.
Referenced by GetEditorDisplayName().
|
staticprivate |
Definition at line 77 of file editor_registry.h.
Referenced by IsPanelBasedEditor().
|
private |
Definition at line 80 of file editor_registry.h.
Referenced by GetEditor(), HideCurrentEditorPanels(), IsEditorActive(), IsEditorVisible(), JumpToDungeonRoom(), JumpToOverworldMap(), RegisterEditor(), SetEditorActive(), SwitchToEditor(), and UnregisterEditor().
|
private |
Definition at line 83 of file editor_registry.h.
Referenced by JumpToDungeonRoom(), and SetJumpToDungeonRoomCallback().
|
private |
Definition at line 84 of file editor_registry.h.
Referenced by JumpToOverworldMap(), and SetJumpToOverworldMapCallback().