feat(editor): enhance EditorManager with card-based editor functionality

- Introduced methods to determine if an editor is card-based and to retrieve its category.
- Implemented a sidebar toggle shortcut (Ctrl+B) for managing card visibility.
- Added functionality to hide current editor cards when switching editors.
- Updated editor initialization to register global shortcuts for activating specific editors.
- Enhanced the Update method to draw a sidebar for the current category editor.

Benefits:
- Improved user experience by organizing editor cards and providing quick access to editor categories.
- Streamlined editor management, making it easier to switch between different editing contexts.
This commit is contained in:
scawful
2025-10-12 11:57:39 -04:00
parent b7f78008b7
commit 312522d709
20 changed files with 2213 additions and 343 deletions

View File

@@ -168,6 +168,15 @@ class EditorManager {
void JumpToOverworldMap(int map_id);
void SwitchToEditor(EditorType editor_type);
// Card-based editor registry
static bool IsCardBasedEditor(EditorType type);
static std::string GetEditorCategory(EditorType type);
bool IsSidebarVisible() const { return show_card_sidebar_; }
void SetSidebarVisible(bool visible) { show_card_sidebar_ = visible; }
// Clean up cards when switching editors
void HideCurrentEditorCards();
// Session management
void CreateNewSession();
void DuplicateCurrentSession();
@@ -247,6 +256,7 @@ class EditorManager {
bool show_welcome_screen_ = false;
bool welcome_screen_manually_closed_ = false;
bool show_card_browser_ = false;
bool show_card_sidebar_ = true; // VSCode-style sidebar for editor cards (toggle with Ctrl+B)
size_t session_to_rename_ = 0;
char session_rename_buffer_[256] = {};