yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
editor_activator.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SYSTEM_EDITOR_ACTIVATOR_H_
2#define YAZE_APP_EDITOR_SYSTEM_EDITOR_ACTIVATOR_H_
3
4#include <functional>
5#include <string>
6
7#include "absl/status/status.h"
9#include "app/editor/editor.h"
10
11namespace yaze {
12namespace editor {
13
14// Forward declarations
15class EditorSet;
16class PanelManager;
17class LayoutManager;
18class UICoordinator;
19class RightPanelManager;
20class ToastManager;
21
33 public:
34 struct Dependencies {
40 EventBus* event_bus = nullptr; // For navigation event subscriptions
41 std::function<absl::Status(EditorType)> ensure_editor_assets_loaded;
43 std::function<size_t()> get_current_session_id;
44 std::function<void(std::function<void()>)> queue_deferred_action;
45 };
46
47 EditorActivator() = default;
48 ~EditorActivator() = default;
49
50 void Initialize(const Dependencies& deps);
51
58 void SwitchToEditor(EditorType type, bool force_visible = false,
59 bool from_dialog = false);
60
66
71 void JumpToDungeonRoom(int room_id);
72
77 void JumpToOverworldMap(int map_id);
78
83 void JumpToMessage(int message_id);
84
89 void JumpToAssemblySymbol(const std::string& symbol);
90
91 private:
92 void ActivatePanelBasedEditor(EditorType type, Editor* editor);
94 EditorSet* editor_set);
95 void HandleNonEditorClassSwitch(EditorType type, bool force_visible);
96
98 bool initialized_ = false;
99};
100
101} // namespace editor
102} // namespace yaze
103
104#endif // YAZE_APP_EDITOR_SYSTEM_EDITOR_ACTIVATOR_H_
Handles editor switching, layout initialization, and jump-to navigation.
void HandleNonEditorClassSwitch(EditorType type, bool force_visible)
void ActivatePanelBasedEditor(EditorType type, Editor *editor)
void JumpToAssemblySymbol(const std::string &symbol)
Jump to an assembly symbol definition in the Assembly editor.
void SwitchToEditor(EditorType type, bool force_visible=false, bool from_dialog=false)
Switch to an editor, optionally forcing visibility.
void Initialize(const Dependencies &deps)
void JumpToMessage(int message_id)
Jump to a specific message ID in the Message editor.
void InitializeEditorLayout(EditorType type)
Initialize the DockBuilder layout for an editor.
void JumpToDungeonRoom(int room_id)
Jump to a specific dungeon room.
void JumpToOverworldMap(int map_id)
Jump to a specific overworld map.
void DeactivatePanelBasedEditor(EditorType type, Editor *editor, EditorSet *editor_set)
Contains a complete set of editors for a single ROM instance.
Interface for editor classes.
Definition editor.h:236
Manages ImGui DockBuilder layouts for each editor type.
Central registry for all editor cards with session awareness and dependency injection.
Manages right-side sliding panels for agent chat, proposals, settings.
Handles all UI drawing operations and state management.
std::function< EditorSet *()> get_current_editor_set
std::function< void(std::function< void()>)> queue_deferred_action
std::function< absl::Status(EditorType)> ensure_editor_assets_loaded