Handles room and entrance selection UI. More...
#include <dungeon_room_selector.h>

Public Member Functions | |
| DungeonRoomSelector (Rom *rom=nullptr) | |
| void | Draw () |
| void | DrawRoomSelector (RoomSelectionIntent single_click_intent=RoomSelectionIntent::kFocusInWorkbench) |
| void | DrawEntranceSelector () |
| void | SetContext (EditorContext ctx) |
| EditorContext | context () const |
| void | SetRom (Rom *rom) |
| Rom * | rom () const |
| void | SetGameData (zelda3::GameData *game_data) |
| zelda3::GameData * | game_data () const |
| void | set_current_room_id (uint16_t room_id) |
| int | current_room_id () const |
| void | set_active_rooms (const ImVector< int > &rooms) |
| const ImVector< int > & | active_rooms () const |
| ImVector< int > & | mutable_active_rooms () |
| void | set_current_entrance_id (int entrance_id) |
| int | current_entrance_id () const |
| void | set_rooms (std::array< zelda3::Room, 0x128 > *rooms) |
| void | set_entrances (std::array< zelda3::RoomEntrance, 0x8C > *entrances) |
| void | SetRoomSelectedCallback (std::function< void(int)> callback) |
| void | set_room_selected_callback (std::function< void(int)> callback) |
| void | SetRoomSelectedWithIntentCallback (std::function< void(int, RoomSelectionIntent)> callback) |
| void | SetEntranceSelectedCallback (std::function< void(int)> callback) |
| void | set_entrance_selected_callback (std::function< void(int)> callback) |
Static Public Member Functions | |
| static const char * | GetBlocksetGroupName (uint8_t blockset) |
Private Types | |
| enum | ViewMode : uint8_t { kViewList = 0 , kViewGrouped = 1 } |
| enum | EntityTypeFilter : uint8_t { kFilterAll = 0 , kFilterHasSprites = 1 , kFilterHasItems = 2 , kFilterHasObjects = 3 } |
Private Member Functions | |
| void | RebuildRoomFilterCache () |
| void | RebuildEntranceFilterCache () |
| bool | PassesEntityTypeFilter (int room_id) const |
| void | DrawGroupedRoomList (RoomSelectionIntent single_click_intent) |
Private Attributes | |
| Rom * | rom_ = nullptr |
| zelda3::GameData * | game_data_ = nullptr |
| uint16_t | current_room_id_ = 0 |
| int | current_entrance_id_ = 0 |
| ImVector< int > | active_rooms_ |
| std::array< zelda3::Room, 0x128 > * | rooms_ = nullptr |
| std::array< zelda3::RoomEntrance, 0x8C > * | entrances_ = nullptr |
| std::function< void(int)> | room_selected_callback_ |
| std::function< void(int, RoomSelectionIntent)> | room_intent_callback_ |
| std::function< void(int)> | entrance_selected_callback_ |
| ImGuiTextFilter | room_filter_ |
| ImGuiTextFilter | entrance_filter_ |
| ViewMode | view_mode_ = kViewList |
| EntityTypeFilter | entity_type_filter_ = kFilterAll |
| std::vector< int > | filtered_room_indices_ |
| std::vector< int > | filtered_entrance_indices_ |
| std::string | last_room_filter_ |
| std::string | last_entrance_filter_ |
Handles room and entrance selection UI.
Definition at line 30 of file dungeon_room_selector.h.
|
private |
| Enumerator | |
|---|---|
| kViewList | |
| kViewGrouped | |
Definition at line 122 of file dungeon_room_selector.h.
|
private |
| Enumerator | |
|---|---|
| kFilterAll | |
| kFilterHasSprites | |
| kFilterHasItems | |
| kFilterHasObjects | |
Definition at line 130 of file dungeon_room_selector.h.
|
inlineexplicit |
Definition at line 32 of file dungeon_room_selector.h.
| void yaze::editor::DungeonRoomSelector::Draw | ( | ) |
Definition at line 27 of file dungeon_room_selector.cc.
References DrawRoomSelector().

| void yaze::editor::DungeonRoomSelector::DrawRoomSelector | ( | RoomSelectionIntent | single_click_intent = RoomSelectionIntent::kFocusInWorkbench | ) |
Definition at line 65 of file dungeon_room_selector.cc.
References yaze::zelda3::RoomLayerManager::ApplyLayerMerging(), yaze::editor::SelectionChangedEvent::CreateSingle(), current_room_id_, DrawGroupedRoomList(), entity_type_filter_, yaze::editor::ContentRegistry::Context::event_bus(), filtered_room_indices_, yaze::gui::LayoutHelpers::GetMinTouchTarget(), yaze::zelda3::GetRoomLabel(), ICON_MD_FOLDER, ICON_MD_LIST, yaze::gui::InputHexWord(), yaze::Rom::is_loaded(), yaze::gui::LayoutHelpers::IsTouchDevice(), kFilterAll, kFilterHasItems, kFilterHasObjects, kFilterHasSprites, yaze::editor::kFocusInWorkbench, yaze::zelda3::kNumberOfRooms, yaze::editor::kOpenStandalone, kViewGrouped, kViewList, last_room_filter_, RebuildRoomFilterCache(), rom_, room_filter_, room_intent_callback_, room_selected_callback_, rooms_, and view_mode_.
Referenced by Draw(), yaze::editor::DungeonRoomSelectorPanel::Draw(), and yaze::editor::DungeonWorkbenchPanel::Draw().
| void yaze::editor::DungeonRoomSelector::DrawEntranceSelector | ( | ) |
Definition at line 294 of file dungeon_room_selector.cc.
References yaze::editor::SelectionChangedEvent::CreateSingle(), current_entrance_id_, entrance_filter_, entrance_selected_callback_, entrances_, yaze::editor::ContentRegistry::Context::event_bus(), filtered_entrance_indices_, yaze::zelda3::GetEntranceLabel(), yaze::gui::InputHexByte(), yaze::gui::InputHexWord(), yaze::Rom::is_loaded(), last_entrance_filter_, RebuildEntranceFilterCache(), rom_, and room_selected_callback_.
Referenced by yaze::editor::DungeonEntranceListPanel::Draw().
|
inline |
Definition at line 40 of file dungeon_room_selector.h.
References yaze::editor::EditorContext::game_data, game_data_, yaze::editor::EditorContext::rom, and rom_.
|
inline |
Definition at line 44 of file dungeon_room_selector.h.
References game_data_, and rom_.
|
inline |
Definition at line 47 of file dungeon_room_selector.h.
Referenced by yaze::editor::DungeonEditorV2::SetRom().

|
inline |
|
inline |
Definition at line 49 of file dungeon_room_selector.h.
References game_data(), and game_data_.

|
inline |
Definition at line 50 of file dungeon_room_selector.h.
References game_data_.
Referenced by SetGameData().
|
inline |
Definition at line 53 of file dungeon_room_selector.h.
References current_room_id_.
Referenced by yaze::editor::DungeonEditorV2::OnRoomSelected().
|
inline |
Definition at line 54 of file dungeon_room_selector.h.
References current_room_id_.
Referenced by yaze::editor::DungeonEditorV2::current_room_id().
|
inline |
Definition at line 56 of file dungeon_room_selector.h.
References active_rooms_.
Referenced by yaze::editor::DungeonEditorV2::Load(), yaze::editor::DungeonEditorV2::OnRoomSelected(), and yaze::editor::DungeonEditorV2::ProcessPendingSwap().
|
inline |
Definition at line 57 of file dungeon_room_selector.h.
References active_rooms_.
Referenced by yaze::editor::DungeonEditorV2::active_rooms().
|
inline |
Definition at line 58 of file dungeon_room_selector.h.
References active_rooms_.
|
inline |
Definition at line 61 of file dungeon_room_selector.h.
References current_entrance_id_.
|
inline |
Definition at line 64 of file dungeon_room_selector.h.
References current_entrance_id_.
|
inline |
Definition at line 67 of file dungeon_room_selector.h.
References rooms_.
Referenced by yaze::editor::DungeonEditorV2::Load().
|
inline |
Definition at line 68 of file dungeon_room_selector.h.
References entrances_.
Referenced by yaze::editor::DungeonEditorV2::Load().
|
inline |
Definition at line 73 of file dungeon_room_selector.h.
References room_selected_callback_.
Referenced by yaze::editor::DungeonRoomSelectorPanel::DungeonRoomSelectorPanel(), yaze::editor::DungeonEditorV2::Load(), set_room_selected_callback(), and yaze::editor::DungeonRoomSelectorPanel::SetRoomSelectedCallback().
|
inline |
Definition at line 77 of file dungeon_room_selector.h.
References SetRoomSelectedCallback().

|
inline |
Definition at line 82 of file dungeon_room_selector.h.
References room_intent_callback_.
Referenced by yaze::editor::DungeonEditorV2::Initialize(), and yaze::editor::DungeonEditorV2::Load().
|
inline |
Definition at line 88 of file dungeon_room_selector.h.
References entrance_selected_callback_.
Referenced by yaze::editor::DungeonEntranceListPanel::DungeonEntranceListPanel(), set_entrance_selected_callback(), and yaze::editor::DungeonEntranceListPanel::SetEntranceSelectedCallback().
|
inline |
Definition at line 92 of file dungeon_room_selector.h.
References SetEntranceSelectedCallback().

|
static |
Definition at line 450 of file dungeon_room_selector.cc.
Referenced by DrawGroupedRoomList().
|
private |
Definition at line 33 of file dungeon_room_selector.cc.
References filtered_room_indices_, yaze::zelda3::GetRoomLabel(), yaze::zelda3::kNumberOfRooms, PassesEntityTypeFilter(), and room_filter_.
Referenced by DrawRoomSelector().

|
private |
Definition at line 258 of file dungeon_room_selector.cc.
References entrance_filter_, entrances_, filtered_entrance_indices_, and yaze::zelda3::GetEntranceLabel().
Referenced by DrawEntranceSelector().

|
private |
Definition at line 46 of file dungeon_room_selector.cc.
References entity_type_filter_, kFilterAll, kFilterHasItems, kFilterHasObjects, kFilterHasSprites, and rooms_.
Referenced by RebuildRoomFilterCache().
|
private |
Definition at line 508 of file dungeon_room_selector.cc.
References yaze::zelda3::RoomLayerManager::ApplyLayerMerging(), yaze::editor::SelectionChangedEvent::CreateSingle(), current_room_id_, yaze::editor::ContentRegistry::Context::event_bus(), filtered_room_indices_, GetBlocksetGroupName(), yaze::zelda3::GetRoomLabel(), yaze::editor::kOpenStandalone, room_intent_callback_, room_selected_callback_, and rooms_.
Referenced by DrawRoomSelector().
|
private |
Definition at line 100 of file dungeon_room_selector.h.
Referenced by context(), DrawEntranceSelector(), DrawRoomSelector(), rom(), SetContext(), and SetRom().
|
private |
Definition at line 101 of file dungeon_room_selector.h.
Referenced by context(), game_data(), SetContext(), and SetGameData().
|
private |
Definition at line 102 of file dungeon_room_selector.h.
Referenced by current_room_id(), DrawGroupedRoomList(), DrawRoomSelector(), and set_current_room_id().
|
private |
Definition at line 103 of file dungeon_room_selector.h.
Referenced by current_entrance_id(), DrawEntranceSelector(), and set_current_entrance_id().
|
private |
Definition at line 104 of file dungeon_room_selector.h.
Referenced by active_rooms(), mutable_active_rooms(), and set_active_rooms().
|
private |
Definition at line 106 of file dungeon_room_selector.h.
Referenced by DrawGroupedRoomList(), DrawRoomSelector(), PassesEntityTypeFilter(), and set_rooms().
|
private |
Definition at line 107 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelector(), RebuildEntranceFilterCache(), and set_entrances().
|
private |
Definition at line 110 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelector(), DrawGroupedRoomList(), DrawRoomSelector(), and SetRoomSelectedCallback().
|
private |
Definition at line 113 of file dungeon_room_selector.h.
Referenced by DrawGroupedRoomList(), DrawRoomSelector(), and SetRoomSelectedWithIntentCallback().
|
private |
Definition at line 116 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelector(), and SetEntranceSelectedCallback().
|
private |
Definition at line 118 of file dungeon_room_selector.h.
Referenced by DrawRoomSelector(), and RebuildRoomFilterCache().
|
private |
Definition at line 119 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelector(), and RebuildEntranceFilterCache().
Definition at line 126 of file dungeon_room_selector.h.
Referenced by DrawRoomSelector().
|
private |
Definition at line 136 of file dungeon_room_selector.h.
Referenced by DrawRoomSelector(), and PassesEntityTypeFilter().
|
private |
Definition at line 139 of file dungeon_room_selector.h.
Referenced by DrawGroupedRoomList(), DrawRoomSelector(), and RebuildRoomFilterCache().
|
private |
Definition at line 140 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelector(), and RebuildEntranceFilterCache().
|
private |
Definition at line 141 of file dungeon_room_selector.h.
Referenced by DrawRoomSelector().
|
private |
Definition at line 142 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelector().