yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
screen_editor_panels.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_GRAPHICS_PANELS_SCREEN_EDITOR_PANELS_H_
2#define YAZE_APP_EDITOR_GRAPHICS_PANELS_SCREEN_EDITOR_PANELS_H_
3
4#include <functional>
5#include <string>
6
9
10namespace yaze {
11namespace editor {
12
13// =============================================================================
14// EditorPanel wrappers for ScreenEditor panels
15// =============================================================================
16
21 public:
22 using DrawCallback = std::function<void()>;
23
24 explicit DungeonMapsPanel(DrawCallback draw_callback)
25 : draw_callback_(std::move(draw_callback)) {}
26
27 std::string GetId() const override { return "screen.dungeon_maps"; }
28 std::string GetDisplayName() const override { return "Dungeon Maps"; }
29 std::string GetIcon() const override { return ICON_MD_MAP; }
30 std::string GetEditorCategory() const override { return "Screen"; }
34 int GetPriority() const override { return 10; }
35
36 void Draw(bool* p_open) override {
37 if (draw_callback_) {
39 }
40 }
41
42 private:
44};
45
50 public:
51 using DrawCallback = std::function<void()>;
52
53 explicit InventoryMenuPanel(DrawCallback draw_callback)
54 : draw_callback_(std::move(draw_callback)) {}
55
56 std::string GetId() const override { return "screen.inventory_menu"; }
57 std::string GetDisplayName() const override { return "Inventory Menu"; }
58 std::string GetIcon() const override { return ICON_MD_INVENTORY; }
59 std::string GetEditorCategory() const override { return "Screen"; }
63 int GetPriority() const override { return 20; }
64
65 void Draw(bool* p_open) override {
66 if (draw_callback_) {
68 }
69 }
70
71 private:
73};
74
79 public:
80 using DrawCallback = std::function<void()>;
81 using EnabledCallback = std::function<bool()>;
82
83 MenuTilemapPanel(DrawCallback draw_callback, EnabledCallback enabled_callback)
84 : draw_callback_(std::move(draw_callback)),
85 enabled_callback_(std::move(enabled_callback)) {}
86
87 std::string GetId() const override { return "screen.menu_tilemap"; }
88 std::string GetDisplayName() const override { return "Menu Tilemap (2bpp)"; }
89 std::string GetIcon() const override { return ICON_MD_GRID_ON; }
90 std::string GetEditorCategory() const override { return "Screen"; }
91 int GetPriority() const override { return 60; }
92
93 // Post-#262 admission policy: this is a Screen-editor-hosted embedded
94 // tool, not a default global workspace window. It stays reachable via
95 // its keyboard shortcut (kPanel-scope toggle, see GetShortcutHint()) and
96 // the command palette/workflow surfaces (GetWorkflowGroup/Label/
97 // Description below), without adding a row to the cross-editor window
98 // browser.
102
103 // Named workflow + reason (the "why does this panel exist" the #262
104 // admission rule requires): editing Oracle of Secrets' 2bpp BG3 menu
105 // tilemap files (Menu/tilemaps/*.tilemap|*.bin, Menu/rings/*.tilemap),
106 // first-class use case being the "Masks & Rings" page 3 prototype
107 // (ring_box.tilemap, Menu/menu_page3.asm).
108 std::string GetWorkflowGroup() const override { return "Editors"; }
109 std::string GetWorkflowLabel() const override {
110 return "Edit Menu Tilemap (2bpp)";
111 }
112 std::string GetWorkflowDescription() const override {
113 return "Edit an Oracle of Secrets 2bpp BG3 menu tilemap file (e.g. "
114 "ring_box.tilemap for the \"Masks & Rings\" page 3 prototype) "
115 "with a live preview rendered from real CHR + palette sources.";
116 }
117
118 std::string GetShortcutHint() const override { return "Alt+6"; }
119
120 // Responsive-size contract: a canvas + tool-rail layout, not a fixed
121 // content grid, so this is a first-open hint (LayoutManager may resize
122 // it), not an exact width like a tile picker's HasExactPreferredWidth().
123 float GetPreferredWidth() const override { return 620.0f; }
124 float GetPreferredHeight() const override { return 520.0f; }
125
126 bool IsEnabled() const override {
127 return enabled_callback_ ? enabled_callback_() : true;
128 }
129 std::string GetDisabledTooltip() const override { return "Load a ROM first"; }
130
131 void Draw(bool* p_open) override {
132 if (draw_callback_) {
134 }
135 }
136
137 private:
140};
141
146 public:
147 using DrawCallback = std::function<void()>;
148
149 explicit OverworldMapScreenPanel(DrawCallback draw_callback)
150 : draw_callback_(std::move(draw_callback)) {}
151
152 std::string GetId() const override { return "screen.overworld_map"; }
153 std::string GetDisplayName() const override { return "Overworld Map"; }
154 std::string GetIcon() const override { return ICON_MD_PUBLIC; }
155 std::string GetEditorCategory() const override { return "Screen"; }
159 int GetPriority() const override { return 30; }
160
161 void Draw(bool* p_open) override {
162 if (draw_callback_) {
164 }
165 }
166
167 private:
169};
170
175 public:
176 using DrawCallback = std::function<void()>;
177
178 explicit TitleScreenPanel(DrawCallback draw_callback)
179 : draw_callback_(std::move(draw_callback)) {}
180
181 std::string GetId() const override { return "screen.title_screen"; }
182 std::string GetDisplayName() const override { return "Title Screen"; }
183 std::string GetIcon() const override { return ICON_MD_TITLE; }
184 std::string GetEditorCategory() const override { return "Screen"; }
188 int GetPriority() const override { return 40; }
189
190 void Draw(bool* p_open) override {
191 if (draw_callback_) {
193 }
194 }
195
196 private:
198};
199
204 public:
205 using DrawCallback = std::function<void()>;
206
207 explicit NamingScreenPanel(DrawCallback draw_callback)
208 : draw_callback_(std::move(draw_callback)) {}
209
210 std::string GetId() const override { return "screen.naming_screen"; }
211 std::string GetDisplayName() const override { return "Naming Screen"; }
212 std::string GetIcon() const override { return ICON_MD_EDIT; }
213 std::string GetEditorCategory() const override { return "Screen"; }
216 "Command palette (stub: the editor draws nothing yet)");
217 }
218 int GetPriority() const override { return 50; }
219
220 void Draw(bool* p_open) override {
221 if (draw_callback_) {
223 }
224 }
225
226 private:
228};
229
230} // namespace editor
231} // namespace yaze
232
233#endif // YAZE_APP_EDITOR_GRAPHICS_PANELS_SCREEN_EDITOR_PANELS_H_
EditorPanel for Dungeon Maps Editor.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
std::function< void()> DrawCallback
DungeonMapsPanel(DrawCallback draw_callback)
std::string GetId() const override
Unique identifier for this panel.
void Draw(bool *p_open) override
Draw the panel content.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetIcon() const override
Material Design icon for this panel.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
EditorPanel for Inventory Menu Editor.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetIcon() const override
Material Design icon for this panel.
InventoryMenuPanel(DrawCallback draw_callback)
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
std::string GetId() const override
Unique identifier for this panel.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
void Draw(bool *p_open) override
Draw the panel content.
EditorPanel for the Menu Tilemap (2bpp) Editor.
void Draw(bool *p_open) override
Draw the panel content.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
std::string GetShortcutHint() const override
Get keyboard shortcut hint for display.
std::function< void()> DrawCallback
int GetPriority() const override
Get display priority for menu ordering.
MenuTilemapPanel(DrawCallback draw_callback, EnabledCallback enabled_callback)
float GetPreferredHeight() const override
Get preferred height for this panel (optional)
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
std::function< bool()> EnabledCallback
std::string GetWorkflowLabel() const override
Optional workflow label for menus/command palette.
std::string GetId() const override
Unique identifier for this panel.
std::string GetWorkflowGroup() const override
Optional workflow group for hack-centric actions.
std::string GetWorkflowDescription() const override
Optional workflow description for menus/command palette.
std::string GetIcon() const override
Material Design icon for this panel.
std::string GetDisabledTooltip() const override
Get tooltip text when panel is disabled.
float GetPreferredWidth() const override
Get preferred width for this panel (optional)
bool IsEnabled() const override
Check if this panel is currently enabled.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
EditorPanel for Naming Screen Editor.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
NamingScreenPanel(DrawCallback draw_callback)
std::string GetId() const override
Unique identifier for this panel.
std::string GetIcon() const override
Material Design icon for this panel.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
void Draw(bool *p_open) override
Draw the panel content.
EditorPanel for Overworld Map Screen Editor.
std::string GetId() const override
Unique identifier for this panel.
OverworldMapScreenPanel(DrawCallback draw_callback)
std::string GetEditorCategory() const override
Editor category this panel belongs to.
void Draw(bool *p_open) override
Draw the panel content.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetIcon() const override
Material Design icon for this panel.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
EditorPanel for Title Screen Editor.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
int GetPriority() const override
Get display priority for menu ordering.
TitleScreenPanel(DrawCallback draw_callback)
std::string GetIcon() const override
Material Design icon for this panel.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
void Draw(bool *p_open) override
Draw the panel content.
std::string GetId() const override
Unique identifier for this panel.
Base interface for all logical window content components.
#define ICON_MD_TITLE
Definition icons.h:1990
#define ICON_MD_MAP
Definition icons.h:1173
#define ICON_MD_EDIT
Definition icons.h:645
#define ICON_MD_PUBLIC
Definition icons.h:1524
#define ICON_MD_GRID_ON
Definition icons.h:896
#define ICON_MD_INVENTORY
Definition icons.h:1011
static WindowPresentationPolicy Diagnostic()
static WindowPresentationPolicy EmbeddedTool(std::string capability=std::string())
WindowPresentationPolicy WithHost(std::string host_name) const
Returns a copy that names the hosting surface.
static WindowPresentationPolicy OptionalPopOut()