yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_room_selector.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_DUNGEON_DUNGEON_ROOM_SELECTOR_H
2#define YAZE_APP_EDITOR_DUNGEON_DUNGEON_ROOM_SELECTOR_H
3
4#include <functional>
5#include "imgui/imgui.h"
6#include "app/rom.h"
9
10namespace yaze {
11namespace editor {
12
17 public:
18 explicit DungeonRoomSelector(Rom* rom = nullptr) : rom_(rom) {}
19
20 void Draw();
21 void DrawRoomSelector();
23
24 void set_rom(Rom* rom) { rom_ = rom; }
25 Rom* rom() const { return rom_; }
26
27 // Room selection
28 void set_current_room_id(uint16_t room_id) { current_room_id_ = room_id; }
29 int current_room_id() const { return current_room_id_; }
30
31 void set_active_rooms(const ImVector<int>& rooms) { active_rooms_ = rooms; }
32 const ImVector<int>& active_rooms() const { return active_rooms_; }
33 ImVector<int>& mutable_active_rooms() { return active_rooms_; }
34
35 // Entrance selection
36 void set_current_entrance_id(int entrance_id) { current_entrance_id_ = entrance_id; }
38
39 // Room data access
40 void set_rooms(std::array<zelda3::Room, 0x128>* rooms) { rooms_ = rooms; }
41 void set_entrances(std::array<zelda3::RoomEntrance, 0x8C>* entrances) { entrances_ = entrances; }
42
43 // Callback for room selection events
44 void set_room_selected_callback(std::function<void(int)> callback) {
45 room_selected_callback_ = callback;
46 }
47
48 private:
49 Rom* rom_ = nullptr;
50 uint16_t current_room_id_ = 0;
52 ImVector<int> active_rooms_;
53
54 std::array<zelda3::Room, 0x128>* rooms_ = nullptr;
55 std::array<zelda3::RoomEntrance, 0x8C>* entrances_ = nullptr;
56
57 // Callback for room selection events
58 std::function<void(int)> room_selected_callback_;
59};
60
61} // namespace editor
62} // namespace yaze
63
64#endif
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:71
Handles room and entrance selection UI.
void set_entrances(std::array< zelda3::RoomEntrance, 0x8C > *entrances)
const ImVector< int > & active_rooms() const
void set_current_entrance_id(int entrance_id)
void set_room_selected_callback(std::function< void(int)> callback)
std::array< zelda3::RoomEntrance, 0x8C > * entrances_
std::function< void(int)> room_selected_callback_
std::array< zelda3::Room, 0x128 > * rooms_
void set_active_rooms(const ImVector< int > &rooms)
void set_rooms(std::array< zelda3::Room, 0x128 > *rooms)
Main namespace for the application.