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:
@@ -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] = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user