12#include "imgui/imgui.h"
33 {
"overworld.canvas",
"Overworld Canvas",
nullptr,
ICON_MD_MAP,
"Overworld",
34 "Ctrl+Shift+O",
nullptr, 5,
true},
35 {
"overworld.area_graphics",
"Area Graphics",
nullptr,
ICON_MD_IMAGE,
36 "Overworld",
nullptr,
nullptr, 50,
false},
37 {
"overworld.tile16_selector",
"Tile16 Selector",
nullptr,
ICON_MD_GRID_ON,
38 "Overworld",
nullptr,
nullptr, 50,
true},
39 {
"overworld.tile16_editor",
"Tile16 Editor",
nullptr,
ICON_MD_EDIT,
40 "Overworld",
nullptr,
nullptr, 15,
false},
42 "Overworld",
nullptr,
nullptr, 50,
false},
43 {
"overworld.properties",
"Map Properties",
nullptr,
ICON_MD_TUNE,
44 "Overworld",
nullptr,
nullptr, 50,
false},
45 {
"overworld.scratch",
"Scratch Workspace",
nullptr,
ICON_MD_DRAW,
46 "Overworld",
nullptr,
nullptr, 50,
false},
48 "Overworld",
nullptr,
nullptr, 50,
false},
50 "Overworld",
nullptr,
nullptr, 50,
false},
52 "Overworld",
nullptr,
nullptr, 50,
false},
54 "Overworld",
nullptr,
nullptr, 50,
false},
57 {
"dungeon.control_panel",
"Dungeon Controls",
" Dungeon Controls",
59 "Load a ROM to access dungeon controls", 10,
false},
60 {
"dungeon.room_selector",
"Room List",
" Room List",
ICON_MD_LIST,
61 "Dungeon",
"Ctrl+Shift+R",
"Load a ROM to browse dungeon rooms", 20,
63 {
"dungeon.entrance_list",
"Entrance List",
" Entrance List",
65 "Load a ROM to browse dungeon entrances", 25,
false},
66 {
"dungeon.entrance_properties",
"Entrance Properties",
67 " Entrance Properties",
ICON_MD_TUNE,
"Dungeon",
nullptr,
68 "Load a ROM to edit entrance properties", 26,
false},
70 "Dungeon",
"Ctrl+Shift+M",
"Load a ROM to view the room matrix", 30,
72 {
"dungeon.room_graphics",
"Room Graphics",
" Room Graphics",
ICON_MD_IMAGE,
73 "Dungeon",
"Ctrl+Shift+G",
"Load a ROM to view room graphics", 50,
false},
75 "Dungeon",
nullptr,
nullptr, 60,
false},
76 {
"dungeon.sprite_editor",
"Sprite Editor",
nullptr,
ICON_MD_PERSON,
77 "Dungeon",
nullptr,
nullptr, 65,
false},
79 "Dungeon",
nullptr,
nullptr, 66,
false},
80 {
"dungeon.palette_editor",
"Palette Editor",
" Palette Editor",
82 "Load a ROM to edit dungeon palettes", 70,
false},
86 "Graphics",
nullptr,
nullptr, 10,
true},
87 {
"graphics.pixel_editor",
"Pixel Editor",
nullptr,
ICON_MD_DRAW,
88 "Graphics",
nullptr,
nullptr, 20,
true},
89 {
"graphics.palette_controls",
"Palette Controls",
nullptr,
ICON_MD_PALETTE,
90 "Graphics",
nullptr,
nullptr, 30,
false},
91 {
"graphics.link_sprite_editor",
"Link Sprite Editor",
nullptr,
94 "Graphics",
nullptr,
nullptr, 38,
false},
95 {
"graphics.gfx_group_editor",
"Graphics Groups",
nullptr,
97 {
"graphics.paletteset_editor",
"Palettesets",
nullptr,
99 {
"graphics.prototype_viewer",
"Prototype Viewer",
nullptr,
103 {
"palette.control_panel",
"Palette Controls",
" Group Manager",
104 ICON_MD_PALETTE,
"Palette",
"Ctrl+Shift+P",
"Load a ROM first", 10,
false},
106 "Palette",
"Ctrl+Alt+1",
"Load a ROM first", 20,
false},
107 {
"palette.ow_animated",
"Overworld Animated",
" Overworld Animated",
108 ICON_MD_WATER,
"Palette",
"Ctrl+Alt+2",
"Load a ROM first", 30,
false},
109 {
"palette.dungeon_main",
"Dungeon Main",
" Dungeon Main",
ICON_MD_CASTLE,
110 "Palette",
"Ctrl+Alt+3",
"Load a ROM first", 40,
false},
111 {
"palette.sprites",
"Global Sprite Palettes",
" SNES Palette",
112 ICON_MD_PETS,
"Palette",
"Ctrl+Alt+4",
"Load a ROM first", 50,
false},
113 {
"palette.sprites_aux1",
"Sprites Aux 1",
" Sprites Aux 1",
115 {
"palette.sprites_aux2",
"Sprites Aux 2",
" Sprites Aux 2",
117 {
"palette.sprites_aux3",
"Sprites Aux 3",
" Sprites Aux 3",
119 {
"palette.equipment",
"Equipment Palettes",
" Equipment Palettes",
120 ICON_MD_SHIELD,
"Palette",
"Ctrl+Alt+5",
"Load a ROM first", 60,
false},
121 {
"palette.quick_access",
"Quick Access",
" Color Harmony",
123 {
"palette.custom",
"Custom Palette",
" Palette Editor",
ICON_MD_BRUSH,
124 "Palette",
"Ctrl+Alt+C",
"Load a ROM first", 80,
false},
128 "Sprite",
nullptr,
nullptr, 10,
true},
130 "Sprite",
nullptr,
nullptr, 20,
false},
133 {
"screen.dungeon_maps",
"Dungeon Maps",
" Dungeon Map Editor",
ICON_MD_MAP,
134 "Screen",
"Alt+1",
"Load a ROM first", 10,
false},
135 {
"screen.inventory_menu",
"Inventory Menu",
" Inventory Menu",
137 {
"screen.overworld_map",
"Overworld Map",
" Overworld Map",
ICON_MD_PUBLIC,
138 "Screen",
"Alt+3",
"Load a ROM first", 30,
false},
139 {
"screen.title_screen",
"Title Screen",
" Title Screen",
ICON_MD_TITLE,
140 "Screen",
"Alt+4",
"Load a ROM first", 40,
false},
141 {
"screen.naming_screen",
"Naming Screen",
" Naming Screen",
ICON_MD_EDIT,
142 "Screen",
"Alt+5",
"Load a ROM first", 50,
false},
145 {
"music.song_browser",
"Song Browser",
" Song Browser",
147 {
"music.tracker",
"Playback Control",
" Playback Control",
149 {
"music.piano_roll",
"Piano Roll",
" Piano Roll",
ICON_MD_PIANO,
"Music",
150 "Ctrl+Shift+P",
nullptr, 15,
false},
151 {
"music.instrument_editor",
"Instrument Editor",
" Instrument Editor",
153 {
"music.sample_editor",
"Sample Editor",
" Sample Editor",
ICON_MD_WAVES,
154 "Music",
"Ctrl+Shift+S",
nullptr, 25,
false},
155 {
"music.assembly",
"Assembly View",
" Music Assembly",
ICON_MD_CODE,
156 "Music",
"Ctrl+Shift+A",
nullptr, 30,
false},
158 "Music",
nullptr,
nullptr, 95,
false},
159 {
"music.help",
"Help",
" Music Editor Help",
ICON_MD_HELP,
"Music",
nullptr,
163 {
"message.message_list",
"Message List",
nullptr,
ICON_MD_LIST,
"Message",
164 nullptr,
nullptr, 10,
false},
165 {
"message.message_editor",
"Message Editor",
nullptr,
ICON_MD_EDIT,
166 "Message",
nullptr,
nullptr, 20,
false},
168 "Message",
nullptr,
nullptr, 30,
false},
169 {
"message.dictionary",
"Dictionary",
nullptr,
ICON_MD_BOOK,
"Message",
170 nullptr,
nullptr, 40,
false},
174 nullptr,
nullptr, 5,
true},
175 {
"assembly.code_editor",
"Code Editor",
nullptr,
ICON_MD_CODE,
"Assembly",
176 nullptr,
nullptr, 10,
true},
178 "Assembly",
nullptr,
nullptr, 20,
true},
180 nullptr,
nullptr, 30,
false},
182 "Assembly",
nullptr,
nullptr, 40,
false},
185 {
"emulator.cpu_debugger",
"CPU Debugger",
" CPU Debugger",
187 {
"emulator.ppu_viewer",
"PPU Viewer",
" PPU Viewer",
189 {
"emulator.memory_viewer",
"Memory Viewer",
" Memory Viewer",
191 {
"emulator.breakpoints",
"Breakpoints",
" Breakpoints",
ICON_MD_STOP,
192 "Emulator",
nullptr,
nullptr, 40,
false},
193 {
"emulator.performance",
"Performance",
" Performance",
ICON_MD_SPEED,
194 "Emulator",
nullptr,
nullptr, 50,
false},
196 "Emulator",
nullptr,
nullptr, 60,
false},
197 {
"emulator.save_states",
"Save States",
" Save States",
ICON_MD_SAVE,
198 "Emulator",
nullptr,
nullptr, 70,
false},
199 {
"emulator.keyboard_config",
"Keyboard Config",
" Keyboard Config",
201 {
"emulator.virtual_controller",
"Virtual Controller",
204 {
"emulator.apu_debugger",
"APU Debugger",
" APU Debugger",
207 "Emulator",
nullptr,
nullptr, 100,
false},
208 {
"memory.hex_editor",
"Hex Editor",
nullptr,
ICON_MD_MEMORY,
"Memory",
209 nullptr,
nullptr, 10,
false},
220 descriptor.
window_title = panel.window_title ? panel.window_title :
"";
221 descriptor.
icon = panel.icon ? panel.icon :
"";
222 descriptor.
category = panel.category ? panel.category :
"";
223 descriptor.
shortcut_hint = panel.shortcut ? panel.shortcut :
"";
225 panel.disabled_tooltip ? panel.disabled_tooltip :
"";
227 descriptor.
priority = panel.priority;
230 if (panel.visible_by_default) {
237 const ImGuiViewport* viewport = ImGui::GetMainViewport();
238 ImGui::SetNextWindowPos(viewport->WorkPos);
239 ImGui::SetNextWindowSize(viewport->WorkSize);
240 ImGui::SetNextWindowViewport(viewport->ID);
242 ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDocking |
243 ImGuiWindowFlags_NoTitleBar |
244 ImGuiWindowFlags_NoCollapse |
245 ImGuiWindowFlags_NoResize |
246 ImGuiWindowFlags_NoMove |
247 ImGuiWindowFlags_NoBringToFrontOnFocus |
248 ImGuiWindowFlags_NoNavFocus |
249 ImGuiWindowFlags_NoBackground;
251 ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
252 ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
253 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
254 ImGui::Begin(
"LabDockspace",
nullptr, window_flags);
255 ImGui::PopStyleVar(3);
257 ImGuiID dockspace_id = ImGui::GetID(
"MainDockSpace");
258 ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f),
259 ImGuiDockNodeFlags_PassthruCentralNode);
265 for (
const auto& [panel_id, descriptor] : descriptors) {
266 if (descriptor.visibility_flag && !*descriptor.visibility_flag) {
271 bool* open_ptr = descriptor.visibility_flag ? descriptor.visibility_flag : &open;
272 const std::string title = descriptor.GetWindowTitle();
274 if (ImGui::Begin(title.c_str(), open_ptr)) {
275 ImGui::Text(
"Lab panel: %s", descriptor.display_name.c_str());
276 ImGui::Text(
"Panel ID: %s", panel_id.c_str());
284int main(
int argc,
char** argv) {
293 if (!window_backend) {
298 config.
title =
"Yaze Lab";
304 if (!window_backend->Initialize(config).ok()) {
309 if (!renderer || !window_backend->InitializeRenderer(renderer.get())) {
310 window_backend->Shutdown();
314 if (!window_backend->InitializeImGui(renderer.get()).ok()) {
315 renderer->Shutdown();
316 window_backend->Shutdown();
327 layout_designer.
Initialize(&panel_manager, &layout_manager,
nullptr);
328 layout_designer.
Open();
333 while (running && window_backend->IsActive()) {
334 while (window_backend->PollEvent(event)) {
341 window_backend->NewImGuiFrame();
345 layout_designer.
Draw();
350 window_backend->RenderImGui(renderer.get());
354 window_backend->ShutdownImGui();
355 renderer->Shutdown();
356 window_backend->Shutdown();
int main(int argc, char **argv)
Manages ImGui DockBuilder layouts for each editor type.
void SetPanelManager(PanelManager *manager)
Set the panel manager for window title lookups.
Central registry for all editor cards with session awareness and dependency injection.
void RegisterSession(size_t session_id)
void SetActiveSession(size_t session_id)
bool ShowPanel(size_t session_id, const std::string &base_card_id)
void RegisterPanel(size_t session_id, const PanelDescriptor &base_info)
const std::unordered_map< std::string, PanelDescriptor > & GetAllPanelDescriptors() const
Get all panel descriptors (for layout designer, panel browser, etc.)
Main window for the WYSIWYG layout designer.
void Draw()
Draw the designer window (call every frame)
void Open()
Open the designer window.
void Initialize(PanelManager *panel_manager, yaze::editor::LayoutManager *layout_manager=nullptr, yaze::editor::EditorManager *editor_manager=nullptr)
Initialize the designer with manager references.
static std::unique_ptr< IRenderer > Create(RendererBackendType type=RendererBackendType::kDefault)
Create a renderer instance with the specified backend type.
static LogManager & instance()
void configure(LogLevel level, const std::string &file_path, const std::set< std::string > &categories)
Configures the logging system.
#define ICON_MD_GRID_VIEW
#define ICON_MD_FOLDER_OPEN
#define ICON_MD_LIBRARY_MUSIC
#define ICON_MD_LANDSCAPE
#define ICON_MD_VIEW_MODULE
#define ICON_MD_VIEW_LIST
#define ICON_MD_CONSTRUCTION
#define ICON_MD_COLLECTIONS
#define ICON_MD_VIDEOGAME_ASSET
#define ICON_MD_FONT_DOWNLOAD
#define ICON_MD_BUG_REPORT
#define ICON_MD_AUDIOTRACK
#define ICON_MD_VIEW_IN_AR
#define ICON_MD_INVENTORY
#define ICON_MD_DOOR_FRONT
#define ICON_MD_PLAY_CIRCLE
#define ICON_MD_SPORTS_ESPORTS
#define ICON_MD_AUDIO_FILE
#define ICON_MD_COLOR_LENS
#define ICON_MD_ANALYTICS
#define ICON_MD_ADD_CIRCLE
#define ICON_MD_SMART_TOY
constexpr size_t kLabSessionId
constexpr LabPanelSeed kLabPanels[]
void DrawLabPanels(const yaze::editor::PanelManager &panel_manager)
void RegisterLabPanels(yaze::editor::PanelManager *panel_manager)
SDL2/SDL3 compatibility layer.
const char * display_name
const char * disabled_tooltip
const char * window_title
Metadata for an editor panel (formerly PanelInfo)
std::string disabled_tooltip
std::string shortcut_hint