Refactor EditorManager and OverworldEditor for enhanced functionality and error handling

- Updated EditorManager to improve welcome screen logic, ensuring it only displays in truly empty states and not when a ROM is loaded but current_rom_ is null.
- Enhanced error handling in EditorManager by routing editor errors to the toast manager for better user feedback.
- Improved OverworldEditor with enhanced tile interaction detection and added scratch space functionality for better layout management.
- Introduced a new ScratchSpaceSlot structure in OverworldEditor to manage scratch space for tile16 layouts, allowing for more flexible editing and selection.
- Added utility functions in canvas_utils for grid alignment and effective scaling, improving overall canvas interaction.
- Implemented an enhanced palette editor with ROM integration, providing users with tools for color analysis and palette management.
This commit is contained in:
scawful
2025-09-27 15:24:58 -04:00
parent 261032b1bd
commit a9ead0a45c
17 changed files with 4434 additions and 821 deletions

View File

@@ -282,7 +282,27 @@ void BeginNoPadding() {
void EndNoPadding() { ImGui::PopStyleVar(2); }
void BeginChildWithScrollbar(const char *str_id) {
ImGui::BeginChild(str_id, ImGui::GetContentRegionAvail(), true,
// Get available region but ensure minimum size for proper scrolling
ImVec2 available = ImGui::GetContentRegionAvail();
if (available.x < 64.0f) available.x = 64.0f;
if (available.y < 64.0f) available.y = 64.0f;
ImGui::BeginChild(str_id, available, true,
ImGuiWindowFlags_AlwaysVerticalScrollbar);
}
void BeginChildWithScrollbar(const char *str_id, ImVec2 content_size) {
// Set content size before beginning child to enable proper scrolling
if (content_size.x > 0 && content_size.y > 0) {
ImGui::SetNextWindowContentSize(content_size);
}
// Get available region but ensure minimum size for proper scrolling
ImVec2 available = ImGui::GetContentRegionAvail();
if (available.x < 64.0f) available.x = 64.0f;
if (available.y < 64.0f) available.y = 64.0f;
ImGui::BeginChild(str_id, available, true,
ImGuiWindowFlags_AlwaysVerticalScrollbar);
}