feat: Enhance editor card management and shortcut functionality

- Introduced new shortcut categories for graphics, screen, and sprite editors, improving accessibility and organization.
- Updated DungeonEditorV2 and other editor classes to register cards with the EditorCardManager, allowing for better control and visibility management.
- Refactored shortcut registration for dungeon, graphics, screen, and sprite editors, ensuring consistent user experience across the application.
- Improved initialization processes to handle dynamic card visibility and shortcuts effectively.
This commit is contained in:
scawful
2025-10-09 09:46:29 -04:00
parent 9465195956
commit 219406901d
15 changed files with 315 additions and 86 deletions

View File

@@ -24,7 +24,32 @@ using ImGui::TableNextRow;
using ImGui::TableSetupColumn;
using ImGui::Text;
void SpriteEditor::Initialize() {}
void SpriteEditor::Initialize() {
// Register cards with EditorCardManager during initialization (once)
auto& card_manager = gui::EditorCardManager::Get();
card_manager.RegisterCard({
.card_id = "sprite.vanilla_editor",
.display_name = "Vanilla Sprites",
.icon = ICON_MD_SMART_TOY,
.category = "Sprite",
.shortcut_hint = "Alt+Shift+1",
.visibility_flag = &show_vanilla_editor_,
.priority = 10
});
card_manager.RegisterCard({
.card_id = "sprite.custom_editor",
.display_name = "Custom Sprites",
.icon = ICON_MD_ADD_CIRCLE,
.category = "Sprite",
.shortcut_hint = "Alt+Shift+2",
.visibility_flag = &show_custom_editor_,
.priority = 20
});
printf("[SpriteEditor] Registered 2 cards with EditorCardManager\n");
}
absl::Status SpriteEditor::Load() {
gfx::ScopedTimer timer("SpriteEditor::Load");