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

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 | DrawRoomSelectorInternal (RoomSelectionIntent single_click_intent, bool show_room_id_input) |
| void | DrawEntranceSelectorInternal (bool show_properties) |
| 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_ |
| DungeonRoomStore * | 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_ = kViewGrouped |
| 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 31 of file dungeon_room_selector.h.
|
private |
| Enumerator | |
|---|---|
| kViewList | |
| kViewGrouped | |
Definition at line 126 of file dungeon_room_selector.h.
|
private |
| Enumerator | |
|---|---|
| kFilterAll | |
| kFilterHasSprites | |
| kFilterHasItems | |
| kFilterHasObjects | |
Definition at line 134 of file dungeon_room_selector.h.
|
inlineexplicit |
Definition at line 33 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 33 of file dungeon_room_selector.cc.
References DrawRoomSelectorInternal().
Referenced by Draw(), and yaze::editor::RoomBrowserContent::Draw().

| void yaze::editor::DungeonRoomSelector::DrawRoomBrowser | ( | RoomSelectionIntent | single_click_intent = RoomSelectionIntent::kFocusInWorkbench | ) |
Definition at line 38 of file dungeon_room_selector.cc.
References DrawRoomSelectorInternal().
Referenced by yaze::editor::DungeonWorkbenchContent::DrawSidebarContent().

| void yaze::editor::DungeonRoomSelector::DrawEntranceSelector | ( | ) |
Definition at line 312 of file dungeon_room_selector.cc.
References DrawEntranceSelectorInternal().
Referenced by yaze::editor::DungeonEntranceListPanel::Draw().

| void yaze::editor::DungeonRoomSelector::DrawEntranceBrowser | ( | ) |
Definition at line 316 of file dungeon_room_selector.cc.
References DrawEntranceSelectorInternal().
Referenced by yaze::editor::DungeonWorkbenchContent::DrawSidebarContent().

|
inline |
Definition at line 44 of file dungeon_room_selector.h.
References yaze::editor::EditorContext::game_data, game_data_, yaze::editor::EditorContext::rom, and rom_.
|
inline |
Definition at line 48 of file dungeon_room_selector.h.
References game_data_, and rom_.
|
inline |
Definition at line 51 of file dungeon_room_selector.h.
Referenced by yaze::editor::DungeonEditorV2::SetRom().

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

|
inline |
Definition at line 54 of file dungeon_room_selector.h.
References game_data_.
Referenced by SetGameData().
|
inline |
Definition at line 57 of file dungeon_room_selector.h.
References current_room_id_.
Referenced by yaze::editor::DungeonEditorV2::OnRoomSelected().
|
inline |
Definition at line 58 of file dungeon_room_selector.h.
References current_room_id_.
Referenced by yaze::editor::DungeonEditorV2::current_room_id().
|
inline |
Definition at line 60 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 61 of file dungeon_room_selector.h.
References active_rooms_.
Referenced by yaze::editor::DungeonEditorV2::active_rooms().
|
inline |
Definition at line 62 of file dungeon_room_selector.h.
References active_rooms_.
|
inline |
Definition at line 65 of file dungeon_room_selector.h.
References current_entrance_id_.
|
inline |
Definition at line 68 of file dungeon_room_selector.h.
References current_entrance_id_.
|
inline |
Definition at line 71 of file dungeon_room_selector.h.
References rooms_.
Referenced by yaze::editor::DungeonEditorV2::Load().
|
inline |
Definition at line 72 of file dungeon_room_selector.h.
References entrances_.
Referenced by yaze::editor::DungeonEditorV2::Load().
|
inline |
Definition at line 77 of file dungeon_room_selector.h.
References room_selected_callback_.
Referenced by yaze::editor::DungeonEditorV2::Load(), yaze::editor::RoomBrowserContent::RoomBrowserContent(), set_room_selected_callback(), and yaze::editor::RoomBrowserContent::SetRoomSelectedCallback().
|
inline |
Definition at line 81 of file dungeon_room_selector.h.
References SetRoomSelectedCallback().

|
inline |
Definition at line 86 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 92 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 96 of file dungeon_room_selector.h.
References SetEntranceSelectedCallback().

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

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

|
private |
Definition at line 56 of file dungeon_room_selector.cc.
References entity_type_filter_, yaze::editor::DungeonRoomStore::GetIfLoaded(), yaze::zelda3::Room::GetSprites(), kFilterAll, kFilterHasItems, kFilterHasObjects, kFilterHasSprites, rooms_, and yaze::editor::DungeonRoomStore::size().
Referenced by RebuildRoomFilterCache().

|
private |
Definition at line 78 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::editor::DungeonRoomStore::GetIfLoaded(), 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 DrawRoomBrowser(), and DrawRoomSelector().
|
private |
Definition at line 320 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 DrawEntranceBrowser(), and DrawEntranceSelector().
|
private |
Definition at line 536 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::editor::DungeonRoomStore::GetIfLoaded(), yaze::zelda3::GetRoomLabel(), yaze::editor::kOpenStandalone, room_intent_callback_, room_selected_callback_, rooms_, and yaze::editor::DungeonRoomStore::size().
Referenced by DrawRoomSelectorInternal().
|
private |
Definition at line 104 of file dungeon_room_selector.h.
Referenced by context(), DrawEntranceSelectorInternal(), DrawRoomSelectorInternal(), rom(), SetContext(), and SetRom().
|
private |
Definition at line 105 of file dungeon_room_selector.h.
Referenced by context(), game_data(), SetContext(), and SetGameData().
|
private |
Definition at line 106 of file dungeon_room_selector.h.
Referenced by current_room_id(), DrawGroupedRoomList(), DrawRoomSelectorInternal(), and set_current_room_id().
|
private |
Definition at line 107 of file dungeon_room_selector.h.
Referenced by current_entrance_id(), DrawEntranceSelectorInternal(), and set_current_entrance_id().
|
private |
Definition at line 108 of file dungeon_room_selector.h.
Referenced by active_rooms(), mutable_active_rooms(), and set_active_rooms().
|
private |
Definition at line 110 of file dungeon_room_selector.h.
Referenced by DrawGroupedRoomList(), DrawRoomSelectorInternal(), PassesEntityTypeFilter(), and set_rooms().
|
private |
Definition at line 111 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelectorInternal(), RebuildEntranceFilterCache(), and set_entrances().
|
private |
Definition at line 114 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelectorInternal(), DrawGroupedRoomList(), DrawRoomSelectorInternal(), and SetRoomSelectedCallback().
|
private |
Definition at line 117 of file dungeon_room_selector.h.
Referenced by DrawGroupedRoomList(), DrawRoomSelectorInternal(), and SetRoomSelectedWithIntentCallback().
|
private |
Definition at line 120 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelectorInternal(), and SetEntranceSelectedCallback().
|
private |
Definition at line 122 of file dungeon_room_selector.h.
Referenced by DrawRoomSelectorInternal(), and RebuildRoomFilterCache().
|
private |
Definition at line 123 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelectorInternal(), and RebuildEntranceFilterCache().
|
private |
Definition at line 130 of file dungeon_room_selector.h.
Referenced by DrawRoomSelectorInternal().
|
private |
Definition at line 140 of file dungeon_room_selector.h.
Referenced by DrawRoomSelectorInternal(), and PassesEntityTypeFilter().
|
private |
Definition at line 143 of file dungeon_room_selector.h.
Referenced by DrawGroupedRoomList(), DrawRoomSelectorInternal(), and RebuildRoomFilterCache().
|
private |
Definition at line 144 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelectorInternal(), and RebuildEntranceFilterCache().
|
private |
Definition at line 145 of file dungeon_room_selector.h.
Referenced by DrawRoomSelectorInternal().
|
private |
Definition at line 146 of file dungeon_room_selector.h.
Referenced by DrawEntranceSelectorInternal().