Refactor DungeonEditor and related components for improved object management and UI enhancements

- Replaced vertical separators with standard separators in the EditorManager's menu bar for consistency.
- Introduced a new room selection callback mechanism in DungeonRoomSelector to facilitate room selection events.
- Enhanced DungeonEditor with drag-and-select functionality for object placement, improving user interaction.
- Added an object browser in DungeonObjectSelector for better object management and preview capabilities.
- Streamlined object rendering and selection processes, ensuring a more intuitive editing experience.
This commit is contained in:
scawful
2025-09-25 18:56:30 -04:00
parent dd73ea080b
commit 1964d31930
10 changed files with 537 additions and 1485 deletions

View File

@@ -1,9 +1,9 @@
#ifndef YAZE_APP_EDITOR_DUNGEON_DUNGEON_ROOM_SELECTOR_H
#define YAZE_APP_EDITOR_DUNGEON_DUNGEON_ROOM_SELECTOR_H
#include <functional>
#include "imgui/imgui.h"
#include "app/rom.h"
#include "app/gui/input.h"
#include "app/zelda3/dungeon/room_entrance.h"
#include "zelda3/dungeon/room.h"
@@ -40,6 +40,11 @@ class DungeonRoomSelector {
void set_rooms(std::array<zelda3::Room, 0x128>* rooms) { rooms_ = rooms; }
void set_entrances(std::array<zelda3::RoomEntrance, 0x8C>* entrances) { entrances_ = entrances; }
// Callback for room selection events
void set_room_selected_callback(std::function<void(int)> callback) {
room_selected_callback_ = callback;
}
private:
Rom* rom_ = nullptr;
uint16_t current_room_id_ = 0;
@@ -48,6 +53,9 @@ class DungeonRoomSelector {
std::array<zelda3::Room, 0x128>* rooms_ = nullptr;
std::array<zelda3::RoomEntrance, 0x8C>* entrances_ = nullptr;
// Callback for room selection events
std::function<void(int)> room_selected_callback_;
};
} // namespace editor