yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::DungeonRoomSelector Class Reference

Handles room and entrance selection UI. More...

#include <dungeon_room_selector.h>

Collaboration diagram for yaze::editor::DungeonRoomSelector:

Public Member Functions

 DungeonRoomSelector (Rom *rom=nullptr)
 
void Draw ()
 
void DrawRoomSelector (RoomSelectionIntent single_click_intent=RoomSelectionIntent::kFocusInWorkbench)
 
void DrawRoomBrowser (RoomSelectionIntent single_click_intent=RoomSelectionIntent::kFocusInWorkbench)
 
void DrawEntranceSelector ()
 
void DrawEntranceBrowser ()
 
void SetContext (EditorContext ctx)
 
EditorContext context () const
 
void SetRom (Rom *rom)
 
Romrom () const
 
void SetGameData (zelda3::GameData *game_data)
 
zelda3::GameDatagame_data () const
 
void SetProject (const project::YazeProject *project)
 
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 (DungeonRoomStore *rooms)
 
void set_entrances (std::array< zelda3::RoomEntrance, zelda3::kNumDungeonEntranceSlots > *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 DrawRoomSelectorInternal (RoomSelectionIntent single_click_intent, bool show_room_id_input)
 
void DrawEntranceSelectorInternal (bool show_properties)
 
void DrawGroupedRoomList (RoomSelectionIntent single_click_intent)
 

Private Attributes

Romrom_ = nullptr
 
zelda3::GameDatagame_data_ = nullptr
 
const project::YazeProjectproject_ = nullptr
 
uint16_t current_room_id_ = 0
 
int pending_scroll_room_id_ = -1
 
int current_entrance_id_ = 0
 
ImVector< int > active_rooms_
 
DungeonRoomStorerooms_ = nullptr
 
std::array< zelda3::RoomEntrance, zelda3::kNumDungeonEntranceSlots > * 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_
 

Detailed Description

Handles room and entrance selection UI.

Definition at line 37 of file dungeon_room_selector.h.

Member Enumeration Documentation

◆ ViewMode

Enumerator
kViewList 
kViewGrouped 

Definition at line 142 of file dungeon_room_selector.h.

◆ EntityTypeFilter

Enumerator
kFilterAll 
kFilterHasSprites 
kFilterHasItems 
kFilterHasObjects 

Definition at line 150 of file dungeon_room_selector.h.

Constructor & Destructor Documentation

◆ DungeonRoomSelector()

yaze::editor::DungeonRoomSelector::DungeonRoomSelector ( Rom * rom = nullptr)
inlineexplicit

Definition at line 39 of file dungeon_room_selector.h.

Member Function Documentation

◆ Draw()

void yaze::editor::DungeonRoomSelector::Draw ( )

Definition at line 30 of file dungeon_room_selector.cc.

References DrawRoomSelector().

Here is the call graph for this function:

◆ DrawRoomSelector()

void yaze::editor::DungeonRoomSelector::DrawRoomSelector ( RoomSelectionIntent single_click_intent = RoomSelectionIntent::kFocusInWorkbench)

Definition at line 36 of file dungeon_room_selector.cc.

References DrawRoomSelectorInternal().

Referenced by Draw(), and yaze::editor::RoomBrowserContent::Draw().

Here is the call graph for this function:

◆ DrawRoomBrowser()

void yaze::editor::DungeonRoomSelector::DrawRoomBrowser ( RoomSelectionIntent single_click_intent = RoomSelectionIntent::kFocusInWorkbench)

Definition at line 41 of file dungeon_room_selector.cc.

References DrawRoomSelectorInternal().

Referenced by yaze::editor::DungeonWorkbenchContent::DrawSidebarContent().

Here is the call graph for this function:

◆ DrawEntranceSelector()

void yaze::editor::DungeonRoomSelector::DrawEntranceSelector ( )

Definition at line 318 of file dungeon_room_selector.cc.

References DrawEntranceSelectorInternal().

Referenced by yaze::editor::DungeonEntranceListPanel::Draw().

Here is the call graph for this function:

◆ DrawEntranceBrowser()

void yaze::editor::DungeonRoomSelector::DrawEntranceBrowser ( )

Definition at line 322 of file dungeon_room_selector.cc.

References DrawEntranceSelectorInternal().

Referenced by yaze::editor::DungeonWorkbenchContent::DrawSidebarContent().

Here is the call graph for this function:

◆ SetContext()

void yaze::editor::DungeonRoomSelector::SetContext ( EditorContext ctx)
inline

◆ context()

EditorContext yaze::editor::DungeonRoomSelector::context ( ) const
inline

Definition at line 54 of file dungeon_room_selector.h.

References game_data_, and rom_.

◆ SetRom()

void yaze::editor::DungeonRoomSelector::SetRom ( Rom * rom)
inline

Definition at line 57 of file dungeon_room_selector.h.

References rom(), and rom_.

Referenced by yaze::editor::DungeonEditorV2::RefreshRomBackedState(), and yaze::editor::DungeonEditorV2::SetRom().

Here is the call graph for this function:

◆ rom()

Rom * yaze::editor::DungeonRoomSelector::rom ( ) const
inline

Definition at line 58 of file dungeon_room_selector.h.

References rom_.

Referenced by SetRom().

◆ SetGameData()

void yaze::editor::DungeonRoomSelector::SetGameData ( zelda3::GameData * game_data)
inline

Definition at line 59 of file dungeon_room_selector.h.

References game_data(), and game_data_.

Here is the call graph for this function:

◆ game_data()

zelda3::GameData * yaze::editor::DungeonRoomSelector::game_data ( ) const
inline

Definition at line 60 of file dungeon_room_selector.h.

References game_data_.

Referenced by SetGameData().

◆ SetProject()

void yaze::editor::DungeonRoomSelector::SetProject ( const project::YazeProject * project)
inline

Definition at line 61 of file dungeon_room_selector.h.

References project_.

Referenced by yaze::editor::DungeonEditorV2::Initialize().

◆ set_current_room_id()

void yaze::editor::DungeonRoomSelector::set_current_room_id ( uint16_t room_id)
inline

◆ current_room_id()

int yaze::editor::DungeonRoomSelector::current_room_id ( ) const
inline

Definition at line 70 of file dungeon_room_selector.h.

References current_room_id_.

Referenced by yaze::editor::DungeonEditorV2::current_room_id().

◆ set_active_rooms()

void yaze::editor::DungeonRoomSelector::set_active_rooms ( const ImVector< int > & rooms)
inline

◆ active_rooms()

const ImVector< int > & yaze::editor::DungeonRoomSelector::active_rooms ( ) const
inline

Definition at line 73 of file dungeon_room_selector.h.

References active_rooms_.

Referenced by yaze::editor::DungeonEditorV2::active_rooms().

◆ mutable_active_rooms()

ImVector< int > & yaze::editor::DungeonRoomSelector::mutable_active_rooms ( )
inline

◆ set_current_entrance_id()

void yaze::editor::DungeonRoomSelector::set_current_entrance_id ( int entrance_id)
inline

◆ current_entrance_id()

int yaze::editor::DungeonRoomSelector::current_entrance_id ( ) const
inline

Definition at line 80 of file dungeon_room_selector.h.

References current_entrance_id_.

◆ set_rooms()

void yaze::editor::DungeonRoomSelector::set_rooms ( DungeonRoomStore * rooms)
inline

◆ set_entrances()

void yaze::editor::DungeonRoomSelector::set_entrances ( std::array< zelda3::RoomEntrance, zelda3::kNumDungeonEntranceSlots > * entrances)
inline

◆ SetRoomSelectedCallback()

void yaze::editor::DungeonRoomSelector::SetRoomSelectedCallback ( std::function< void(int)> callback)
inline

◆ set_room_selected_callback()

void yaze::editor::DungeonRoomSelector::set_room_selected_callback ( std::function< void(int)> callback)
inline

Definition at line 94 of file dungeon_room_selector.h.

References SetRoomSelectedCallback().

Here is the call graph for this function:

◆ SetRoomSelectedWithIntentCallback()

void yaze::editor::DungeonRoomSelector::SetRoomSelectedWithIntentCallback ( std::function< void(int, RoomSelectionIntent)> callback)
inline

◆ SetEntranceSelectedCallback()

void yaze::editor::DungeonRoomSelector::SetEntranceSelectedCallback ( std::function< void(int)> callback)
inline

◆ set_entrance_selected_callback()

void yaze::editor::DungeonRoomSelector::set_entrance_selected_callback ( std::function< void(int)> callback)
inline

Definition at line 109 of file dungeon_room_selector.h.

References SetEntranceSelectedCallback().

Here is the call graph for this function:

◆ GetBlocksetGroupName()

const char * yaze::editor::DungeonRoomSelector::GetBlocksetGroupName ( uint8_t blockset)
static

◆ RebuildRoomFilterCache()

void yaze::editor::DungeonRoomSelector::RebuildRoomFilterCache ( )
private

◆ RebuildEntranceFilterCache()

void yaze::editor::DungeonRoomSelector::RebuildEntranceFilterCache ( )
private

◆ PassesEntityTypeFilter()

bool yaze::editor::DungeonRoomSelector::PassesEntityTypeFilter ( int room_id) const
private

◆ DrawRoomSelectorInternal()

◆ DrawEntranceSelectorInternal()

◆ DrawGroupedRoomList()

Member Data Documentation

◆ rom_

Rom* yaze::editor::DungeonRoomSelector::rom_ = nullptr
private

◆ game_data_

zelda3::GameData* yaze::editor::DungeonRoomSelector::game_data_ = nullptr
private

Definition at line 118 of file dungeon_room_selector.h.

Referenced by context(), game_data(), SetContext(), and SetGameData().

◆ project_

const project::YazeProject* yaze::editor::DungeonRoomSelector::project_ = nullptr
private

◆ current_room_id_

uint16_t yaze::editor::DungeonRoomSelector::current_room_id_ = 0
private

◆ pending_scroll_room_id_

int yaze::editor::DungeonRoomSelector::pending_scroll_room_id_ = -1
private

Definition at line 121 of file dungeon_room_selector.h.

Referenced by DrawGroupedRoomList(), and set_current_room_id().

◆ current_entrance_id_

int yaze::editor::DungeonRoomSelector::current_entrance_id_ = 0
private

◆ active_rooms_

ImVector<int> yaze::editor::DungeonRoomSelector::active_rooms_
private

Definition at line 123 of file dungeon_room_selector.h.

Referenced by active_rooms(), mutable_active_rooms(), and set_active_rooms().

◆ rooms_

DungeonRoomStore* yaze::editor::DungeonRoomSelector::rooms_ = nullptr
private

◆ entrances_

std::array<zelda3::RoomEntrance, zelda3::kNumDungeonEntranceSlots>* yaze::editor::DungeonRoomSelector::entrances_ = nullptr
private

◆ room_selected_callback_

std::function<void(int)> yaze::editor::DungeonRoomSelector::room_selected_callback_
private

◆ room_intent_callback_

std::function<void(int, RoomSelectionIntent)> yaze::editor::DungeonRoomSelector::room_intent_callback_
private

◆ entrance_selected_callback_

std::function<void(int)> yaze::editor::DungeonRoomSelector::entrance_selected_callback_
private

◆ room_filter_

ImGuiTextFilter yaze::editor::DungeonRoomSelector::room_filter_
private

Definition at line 138 of file dungeon_room_selector.h.

Referenced by DrawRoomSelectorInternal(), and RebuildRoomFilterCache().

◆ entrance_filter_

ImGuiTextFilter yaze::editor::DungeonRoomSelector::entrance_filter_
private

◆ view_mode_

ViewMode yaze::editor::DungeonRoomSelector::view_mode_ = kViewGrouped
private

Definition at line 146 of file dungeon_room_selector.h.

Referenced by DrawRoomSelectorInternal().

◆ entity_type_filter_

EntityTypeFilter yaze::editor::DungeonRoomSelector::entity_type_filter_ = kFilterAll
private

Definition at line 156 of file dungeon_room_selector.h.

Referenced by DrawRoomSelectorInternal(), and PassesEntityTypeFilter().

◆ filtered_room_indices_

std::vector<int> yaze::editor::DungeonRoomSelector::filtered_room_indices_
private

◆ filtered_entrance_indices_

std::vector<int> yaze::editor::DungeonRoomSelector::filtered_entrance_indices_
private

◆ last_room_filter_

std::string yaze::editor::DungeonRoomSelector::last_room_filter_
private

Definition at line 161 of file dungeon_room_selector.h.

Referenced by DrawRoomSelectorInternal().

◆ last_entrance_filter_

std::string yaze::editor::DungeonRoomSelector::last_entrance_filter_
private

Definition at line 162 of file dungeon_room_selector.h.

Referenced by DrawEntranceSelectorInternal().


The documentation for this class was generated from the following files: