feat: Integrate Unified Object Editor for Enhanced Dungeon Object Management
- Introduced ObjectEditorCard to consolidate object selection, emulator preview, and interaction controls into a single interface. - Updated DungeonCanvasViewer to support object interaction context and handle mouse input for object selection and placement. - Enhanced DungeonEditorV2 with new room graphics card for visualizing room graphics and improved layout for better user experience. - Refactored existing components to accommodate the new unified editor, streamlining the workflow for managing dungeon objects.
This commit is contained in:
@@ -103,6 +103,9 @@ void DungeonCanvasViewer::DrawDungeonCanvas(int room_id) {
|
||||
if (rooms_ && rom_->is_loaded()) {
|
||||
auto& room = (*rooms_)[room_id];
|
||||
|
||||
// Update object interaction context
|
||||
object_interaction_.SetCurrentRoom(rooms_, room_id);
|
||||
|
||||
// Check if THIS ROOM's buffers need rendering (not global arena!)
|
||||
auto& bg1_bitmap = room.bg1_buffer().bitmap();
|
||||
bool needs_render = !bg1_bitmap.is_active() || bg1_bitmap.width() == 0;
|
||||
@@ -139,6 +142,13 @@ void DungeonCanvasViewer::DrawDungeonCanvas(int room_id) {
|
||||
// Render sprites as simple 16x16 squares with labels
|
||||
RenderSprites(room);
|
||||
}
|
||||
|
||||
// Handle object interaction if enabled
|
||||
if (object_interaction_enabled_) {
|
||||
object_interaction_.HandleCanvasMouseInput();
|
||||
object_interaction_.CheckForObjectSelection();
|
||||
object_interaction_.DrawSelectBox();
|
||||
}
|
||||
}
|
||||
|
||||
canvas_.DrawGrid();
|
||||
|
||||
Reference in New Issue
Block a user