Implement workspace and session management features in EditorManager

- Added functionality for creating, duplicating, and closing sessions, enhancing user experience with multiple ROMs.
- Integrated session management UI elements, including a session switcher and session manager, for better navigation.
- Introduced workspace layout management features, allowing users to save and load layouts, and reset to defaults.
- Updated popup manager to include workspace help and session limit warnings, improving user guidance.
- Enhanced UI drawing functions to support new session and layout management features, ensuring a cohesive user interface.
This commit is contained in:
scawful
2025-09-25 15:18:11 -04:00
parent c943577aff
commit 83dbee155b
4 changed files with 695 additions and 13 deletions

View File

@@ -32,6 +32,11 @@ void PopupManager::Initialize() {
popups_["Troubleshooting"] = {"Troubleshooting", false, [this]() { DrawTroubleshootingPopup(); }};
popups_["Contributing"] = {"Contributing", false, [this]() { DrawContributingPopup(); }};
popups_["Whats New v03"] = {"What's New in v0.3", false, [this]() { DrawWhatsNewPopup(); }};
// Workspace-related popups
popups_["Workspace Help"] = {"Workspace Help", false, [this]() { DrawWorkspaceHelpPopup(); }};
popups_["Session Limit Warning"] = {"Session Limit Warning", false, [this]() { DrawSessionLimitWarningPopup(); }};
popups_["Layout Reset Confirm"] = {"Reset Layout Confirmation", false, [this]() { DrawLayoutResetConfirmPopup(); }};
}
void PopupManager::DrawPopups() {
@@ -355,5 +360,68 @@ void PopupManager::DrawWhatsNewPopup() {
}
}
void PopupManager::DrawWorkspaceHelpPopup() {
TextWrapped("Workspace Management");
TextWrapped("YAZE supports multiple ROM sessions and flexible workspace layouts.");
Spacing();
TextWrapped("Session Management:");
BulletText("Ctrl+Shift+N: Create new session");
BulletText("Ctrl+Shift+W: Close current session");
BulletText("Ctrl+Tab: Quick session switcher");
BulletText("Each session maintains its own ROM and editor state");
Spacing();
TextWrapped("Layout Management:");
BulletText("Drag window tabs to dock/undock");
BulletText("Ctrl+Shift+S: Save current layout");
BulletText("Ctrl+Shift+O: Load saved layout");
BulletText("F11: Maximize current window");
Spacing();
TextWrapped("Preset Layouts:");
BulletText("Developer: Code, memory, testing tools");
BulletText("Designer: Graphics, palettes, sprites");
BulletText("Modder: All gameplay editing tools");
if (Button("Close", gui::kDefaultModalSize)) {
Hide("Workspace Help");
}
}
void PopupManager::DrawSessionLimitWarningPopup() {
TextColored(ImVec4(1.0f, 0.5f, 0.0f, 1.0f), "%s Warning", ICON_MD_WARNING);
TextWrapped("You have reached the recommended session limit.");
TextWrapped("Having too many sessions open may impact performance.");
Spacing();
TextWrapped("Consider closing unused sessions or saving your work.");
if (Button("Understood", gui::kDefaultModalSize)) {
Hide("Session Limit Warning");
}
SameLine();
if (Button("Open Session Manager", gui::kDefaultModalSize)) {
Hide("Session Limit Warning");
// This would trigger the session manager to open
}
}
void PopupManager::DrawLayoutResetConfirmPopup() {
TextColored(ImVec4(1.0f, 0.5f, 0.0f, 1.0f), "%s Confirm Reset", ICON_MD_WARNING);
TextWrapped("This will reset your current workspace layout to default.");
TextWrapped("Any custom window arrangements will be lost.");
Spacing();
TextWrapped("Do you want to continue?");
if (Button("Reset Layout", gui::kDefaultModalSize)) {
Hide("Layout Reset Confirm");
// This would trigger the actual reset
}
SameLine();
if (Button("Cancel", gui::kDefaultModalSize)) {
Hide("Layout Reset Confirm");
}
}
} // namespace editor
} // namespace yaze

View File

@@ -81,6 +81,11 @@ class PopupManager {
void DrawTroubleshootingPopup();
void DrawContributingPopup();
void DrawWhatsNewPopup();
// Workspace-related popups
void DrawWorkspaceHelpPopup();
void DrawSessionLimitWarningPopup();
void DrawLayoutResetConfirmPopup();
EditorManager* editor_manager_;
std::unordered_map<std::string, PopupParams> popups_;