Implement object selection rectangle functionality in DungeonEditor

- Added methods for object selection rectangle handling, including CheckForObjectSelection, DrawObjectSelectRect, and SelectObjectsInRect.
- Enhanced DungeonEditor to support right-click drag selection for multiple objects, improving user interaction and object management.
- Updated the UI in DungeonObjectSelector to optimize object previews and improve layout for better visibility.
- Refactored various sections of DungeonEditor for code clarity and consistency, including adjustments to object rendering and selection processes.
This commit is contained in:
scawful
2025-09-25 19:30:12 -04:00
parent fd538b8f31
commit 8389989ab3
3 changed files with 384 additions and 206 deletions

View File

@@ -130,6 +130,11 @@ class DungeonEditor : public Editor {
bool IsObjectInSelectBox(const zelda3::RoomObject& object) const;
void PlaceObjectAtPosition(int room_x, int room_y);
// Object selection rectangle (like OverworldEditor)
void CheckForObjectSelection();
void DrawObjectSelectRect();
void SelectObjectsInRect();
// Room graphics management
absl::Status LoadAndRenderRoomGraphics(int room_id);
absl::Status ReloadAllRoomGraphics();
@@ -196,6 +201,12 @@ class DungeonEditor : public Editor {
std::vector<int> selected_objects_;
int current_layer_ = 0; // 0 = BG1, 1 = BG2, 2 = Both
// Object selection rectangle (like OverworldEditor)
bool object_select_active_ = false;
ImVec2 object_select_start_;
ImVec2 object_select_end_;
std::vector<size_t> selected_object_indices_;
// New editor system integration
std::unique_ptr<zelda3::DungeonEditorSystem> dungeon_editor_system_;
std::shared_ptr<zelda3::DungeonObjectEditor> object_editor_;