feat(editor): enhance card-based editor functionality and streamline initialization
- Updated EditorManager to support new card-based editors, including Emulator, Hex, and Assembly editors. - Added centralized registration of editor cards with EditorCardManager, improving visibility management. - Implemented methods to retrieve editor types from categories and manage card visibility dynamically. - Enhanced initialization processes for various editors to ensure proper card registration and default visibility settings. Benefits: - Improved user experience by organizing editor cards and providing quick access to new editor functionalities. - Streamlined editor management, making it easier to switch between different editing contexts and enhancing overall workflow efficiency.
This commit is contained in:
@@ -37,8 +37,8 @@ constexpr ImGuiTableFlags kSpriteTableFlags =
|
||||
*/
|
||||
class SpriteEditor : public Editor {
|
||||
public:
|
||||
explicit SpriteEditor(Rom* rom = nullptr) : rom_(rom) {
|
||||
type_ = EditorType::kSprite;
|
||||
explicit SpriteEditor(Rom* rom = nullptr) : rom_(rom) {
|
||||
type_ = EditorType::kSprite;
|
||||
}
|
||||
|
||||
void Initialize() override;
|
||||
@@ -51,10 +51,10 @@ class SpriteEditor : public Editor {
|
||||
absl::Status Paste() override { return absl::UnimplementedError("Paste"); }
|
||||
absl::Status Find() override { return absl::UnimplementedError("Find"); }
|
||||
absl::Status Save() override { return absl::UnimplementedError("Save"); }
|
||||
|
||||
|
||||
// Set the ROM pointer
|
||||
void set_rom(Rom* rom) { rom_ = rom; }
|
||||
|
||||
|
||||
// Get the ROM pointer
|
||||
Rom* rom() const { return rom_; }
|
||||
|
||||
@@ -84,11 +84,6 @@ class SpriteEditor : public Editor {
|
||||
void DrawAnimationFrames();
|
||||
void DrawToolset();
|
||||
|
||||
// Card visibility - ALL FALSE by default to prevent crash on ROM load
|
||||
// Cards only shown when user explicitly opens them via View menu or shortcuts
|
||||
bool show_vanilla_editor_ = false;
|
||||
bool show_custom_editor_ = false;
|
||||
|
||||
ImVector<int> active_sprites_; /**< Active sprites. */
|
||||
|
||||
int current_sprite_id_; /**< Current sprite ID. */
|
||||
|
||||
Reference in New Issue
Block a user