yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
window_sidebar.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_MENU_WINDOW_SIDEBAR_H_
2#define YAZE_APP_EDITOR_MENU_WINDOW_SIDEBAR_H_
3
4#include <functional>
5#include <string>
6
8
9namespace yaze {
10namespace editor {
11
12class WorkspaceWindowManager;
13class UserSettings;
14struct WindowDescriptor;
15
17 public:
18 explicit WindowSidebar(
19 WorkspaceWindowManager& window_manager,
20 std::function<bool()> is_dungeon_workbench_mode = {},
21 std::function<void(bool)> set_dungeon_workflow_mode = {},
22 std::function<float()> get_bottom_reserved_height = {},
23 std::function<EditorContextSnapshot(const std::string&)>
24 context_provider = {});
25
26 void SetUserSettings(UserSettings* settings) { user_settings_ = settings; }
27
28 static bool MatchesWindowSearch(const std::string& query,
29 const std::string& display_name,
30 const std::string& window_id,
31 const std::string& shortcut_hint);
32 static bool IsDungeonWindowModeTarget(const std::string& window_id);
33
34 // Maps WindowDescriptor::workflow_group to a sidebar section label.
35 // Empty / "Windows" → "Editors". Known groups pass through unchanged.
36 static std::string SidebarSectionFor(const std::string& workflow_group);
37 static std::string SidebarSectionFor(const WindowDescriptor& window);
38
39 // Workbench mode hides Room List / Matrix / per-room windows from the list.
40 static bool ShouldOmitWindowInSidebar(const std::string& window_id,
41 bool dungeon_workbench_mode);
42 static bool HasRenderableContext(const EditorContextSnapshot& snapshot);
43
44 // Render independently of sidebar visibility, using the current session's
45 // snapshot instead of retaining a copy of another session's context.
46 void DrawContextDetailsWindow(size_t session_id);
47
48 void Draw(size_t session_id, const std::string& category,
49 std::function<bool()> has_rom);
50
51 private:
53
54 void DrawEditorContext(size_t session_id, const std::string& category,
55 const EditorContextSnapshot& snapshot);
56 void DrawEditorContextDetails(size_t session_id,
57 const EditorContextSnapshot& snapshot);
58 void DispatchContextAction(size_t session_id,
59 const EditorContextAction& action);
60
62 std::function<bool()> is_dungeon_workbench_mode_;
63 std::function<void(bool)> set_dungeon_workflow_mode_;
64 std::function<float()> get_bottom_reserved_height_;
65 std::function<EditorContextSnapshot(const std::string&)> context_provider_;
67 char sidebar_search_[256] = {};
69};
70
71} // namespace editor
72} // namespace yaze
73
74#endif // YAZE_APP_EDITOR_MENU_WINDOW_SIDEBAR_H_
Manages user preferences and settings persistence.
void Draw(size_t session_id, const std::string &category, std::function< bool()> has_rom)
std::function< void(bool)> set_dungeon_workflow_mode_
void DrawEditorContextDetails(size_t session_id, const EditorContextSnapshot &snapshot)
static bool HasRenderableContext(const EditorContextSnapshot &snapshot)
std::function< bool()> is_dungeon_workbench_mode_
std::function< EditorContextSnapshot(const std::string &) context_provider_)
static bool IsDungeonWindowModeTarget(const std::string &window_id)
void DrawContextDetailsWindow(size_t session_id)
void DispatchContextAction(size_t session_id, const EditorContextAction &action)
WorkspaceWindowManager & window_manager_
void SetUserSettings(UserSettings *settings)
WindowSidebar(WorkspaceWindowManager &window_manager, std::function< bool()> is_dungeon_workbench_mode={}, std::function< void(bool)> set_dungeon_workflow_mode={}, std::function< float()> get_bottom_reserved_height={}, std::function< EditorContextSnapshot(const std::string &)> context_provider={})
void DrawEditorContext(size_t session_id, const std::string &category, const EditorContextSnapshot &snapshot)
std::function< float()> get_bottom_reserved_height_
static std::string SidebarSectionFor(const std::string &workflow_group)
static bool ShouldOmitWindowInSidebar(const std::string &window_id, bool dungeon_workbench_mode)
static bool MatchesWindowSearch(const std::string &query, const std::string &display_name, const std::string &window_id, const std::string &shortcut_hint)
Central registry for all editor cards with session awareness and dependency injection.
Metadata for a dockable editor window (formerly PanelInfo)